Agent skill

Tsed Models

by tsedio in tsedio/tsed

Define Ts.ED v8 models and control validation and serialization with @tsed/schema decorators or the functional s builder, @tsed/ajv and @tsed/json-mapper.

MITAuto-check passedBackend & APIs

Install Tsed Models

skills CLI
$ npx skills add tsedio/tsed --skill tsed-models -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tsedio/tsed tsed-models --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tsedio/tsed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/tsed/skills/tsed-models .claude/skills/tsed-models && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tsed-models
GitHub stars
3.1k
Token cost
~2.3k tokens
SKILL.md length
805 words
Files
2
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

Define Ts.ED v8 models and control validation and serialization with @tsed/schema decorators or the functional s builder, @tsed/ajv and @tsed/json-mapper.

  • Works in 5 steps: Describe the model → Vary the model with groups → Enable validation → …
  • Properties disappear from a request body
  • SKILL.md covers 1. Describe the model, 2. Vary the model with groups, 3. Enable validation and 4. Map outside of controllers, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Tsed Models is an agent skill from tsedio/tsed. Define Ts.ED v8 models and control validation and serialization with @tsed/schema decorators or the functional s builder, @tsed/ajv and @tsed/json-mapper. Use when creating a DTO or entity class, when properties disappear from a request body or response, when invalid payloads are not rejected, when a 400 AJVVALIDATIONERROR or "Bad request on parameter" appears, or when working with @Property, @Required, @CollectionOf, @Groups, @Nullable, @OneOf, @DiscriminatorKey, @Generics, getJsonSchema, serialize/deserialize…

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Backend & APIs. The repository describes itself as: :triangularruler: Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline… The licence is MIT.

When your agent uses it

  • Properties disappear from a request body
  • Invalid payloads are not rejected
  • A 400 AJVVALIDATIONERROR
  • Bad request on parameter appears

Example prompts

  • “Bad request on parameter”
  • “/tsed-models”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Describe the model
  2. Vary the model with groups
  3. Enable validation
  4. Map outside of controllers
  5. Use the functional builder when a class is not wanted

What it can do on your machine

Read from SKILL.md and the folder at commit cebcc11. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • tsed.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tsed Models loads about 2.3k tokens when it runs. Until then it costs about 152 tokens; SKILL.md has 805 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~152
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from tsedio/tsed at commit cebcc11, republished under its MIT licence (© tsedio). 805 words, ~2,307 tokens.

Download SKILL.mdSave it as .claude/skills/tsed-models/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
tsed-models
description
Define Ts.ED v8 models and control validation and serialization with @tsed/schema decorators or the functional `s` builder, @tsed/ajv and @tsed/json-mapper. Use when creating a DTO or entity class, when properties disappear from a request body or response, when invalid payloads are not rejected, when a 400 AJV_VALIDATION_ERROR or "Bad request on parameter" appears, or when working with @Property, @Required, @CollectionOf, @Groups, @Nullable, @OneOf, @DiscriminatorKey, @Generics, getJsonSchema, serialize/deserialize, strictGroups, custom AJV formats or keywords, or a custom ValidationPipe.

Ts.ED Models, Validation and Serialization

One class describes the JSON Schema, the validation rules, the mapping and the OpenAPI model. The schema is the source of truth: what is not described does not exist.

Package map (never import from @tsed/common):

ConcernPackage
Schema decorators, s, getJsonSchema@tsed/schema
serialize, deserialize, OnSerialize, OnDeserialize, BeforeDeserialize, AfterDeserialize@tsed/json-mapper
Formats, Keyword, AjvService@tsed/ajv (plus ajv)
ValidationPipe, ValidationError@tsed/platform-params

1. Describe the model

typescript
import {CollectionOf, Default, Email, Enum, Groups, MinLength, Nullable, Property, Required} from "@tsed/schema";
import {Role} from "./Role.js";

export class User {
  @Groups("!creation")
  id: string;

  @Required()
  @MinLength(3)
  name: string;

  @Required()
  @Email()
  email: string;

  @Enum("admin", "member")
  @Default("member")
  kind: string = "member";

  @Nullable(String)
  bio: string | null;

  @CollectionOf(Role)
  roles: Role[];

  @Property()
  createdAt: Date;
}
  1. Use classes. Interfaces and type aliases carry no runtime metadata.
  2. Put at least one schema decorator on every property; @Property() is the minimum. Undecorated properties are dropped from the schema, from deserialized inputs and from serialized outputs.
  3. Declare the item type of every Array, Map and Set with @CollectionOf(Item) (aliases @ArrayOf, @MapOf). Use @RecordOf for records.
  4. Presence and nullability are separate: @Required() / @Optional() versus @Nullable(Type). @Required() treats undefined, null and "" as missing; whitelist a value with @Allow("") or @Allow(null).
  5. Constraints: @MinLength/@MaxLength, @Minimum/@Maximum (aliases @Min/@Max), @Pattern, @Format("date"), @Email, @Uri, @Url, @DateTime, @Enum, @Const, @Integer, @MinItems/@MaxItems/@UniqueItems.
  6. Rename on the wire with @Name("first_name"). Mark direction with @ReadOnly() / @WriteOnly(). Document with @Description, @Example, @Title.
  7. Allow unknown keys per model with @AdditionalProperties(true) (or a schema). Do not enable jsonMapper.additionalProperties globally to work around a missing decorator.
  8. Polymorphism: @OneOf(A, B) / @AnyOf / @AllOf. Add @DiscriminatorKey() on the base property and @DiscriminatorValue("a") on each subclass so deserialize instantiates the right class.
  9. Generics: @Generics("T") on the class, @CollectionOf("T") or @Property("T") on the member, then bind at the endpoint with @(Returns(200, Pagination).Of(Product)).
  10. Do not use @Ignore() in new code (deprecated); use @Groups.

2. Vary the model with groups

  1. @Groups("creation") exposes a property only for that group; @Groups("!creation") hides it for that group; patterns such as group.* match several.
  2. Select groups on input with @BodyParams() @Groups("creation") user: User and on output with @(Returns(200, User).Groups("read")).
  3. @BodyParams() @Partial() payload: User makes all properties optional for PATCH.
  4. Set jsonMapper.strictGroups: true in new applications. Without it, an endpoint that declares no group exposes every grouped property, and the generated documentation does not match the runtime.

3. Enable validation

typescript
import "@tsed/ajv";
import {Configuration} from "@tsed/di";

@Configuration({
  ajv: {returnsCoercedValues: true},
  jsonMapper: {strictGroups: true}
})
export class Server {}
  1. Install ajv and @tsed/ajv, and import @tsed/ajv in the server. Without a registered validator the built-in ValidationPipe only checks required parameters; every other constraint is silently skipped.
  2. The ajv configuration key takes AJV constructor options directly, plus errorFormatter and returnsCoercedValues.
  3. Failures throw AjvValidationError (a BadRequest, name AJV_VALIDATION_ERROR, with errors[]), returned as 400. Payload shape and customization: tsed-exceptions.
  4. Custom messages: .Error("...") on a constraint decorator, or @ErrorMsg, @TypeError, @DefaultMsg.
  5. Custom format: @Formats("slug", {type: "string"}) on a class implementing FormatsMethods<string> (validate(value): boolean); apply with @Format("slug").
  6. Custom keyword: @Keyword({keyword: "range", type: "number", schemaType: "array"}) on a class implementing KeywordMethods (compile or validate); apply with @CustomKey("range", [1, 10]).
  7. Import format and keyword classes from the server entry point, otherwise they are never registered.
  8. Replace the validator only as a last resort: extend ValidationPipe and decorate with @OverrideProvider(ValidationPipe) from @tsed/di, throwing ValidationError. OpenAPI and mapping keep using the JSON Schema.
Show full SKILL.md (308 more words)Show less

4. Map outside of controllers

typescript
import {deserialize, serialize} from "@tsed/json-mapper";
import {s} from "@tsed/schema";
import {User} from "./models/User.js";

const user = deserialize<User>(input, {type: User, groups: ["creation"]});
const users = deserialize<User[]>(list, {type: User, collectionType: Array});
const json = serialize(user, {type: User, groups: ["read"]});
const schema = s.compile(User, {groups: ["creation"]}); // getJsonSchema() is the deprecated alias
  1. Controllers call these automatically for @BodyParams, @QueryParams, @PathParams and for returned values. Call them yourself for queues, sockets, caches and tests.
  2. deserialize does not validate. Validate first with AjvService.validate(value, {type: User}).
  3. Transform one property with @OnSerialize((value) => ...) / @OnDeserialize((value) => ...); hook the whole class with @BeforeDeserialize / @AfterDeserialize. All four come from @tsed/json-mapper.
  4. The constructor does not receive the payload unless jsonMapper.disableUnsecureConstructor is false. Do not rely on Object.assign(this, data) constructors.

5. Use the functional builder when a class is not wanted

typescript
import {s} from "@tsed/schema";

export const ProductSchema = s.object({
  title: s.string().required().minLength(3),
  price: s.number().minimum(0),
  tags: s.array(s.string())
});
export type Product = s.infer<typeof ProductSchema>;

s is the only builder export to use (s.string, s.number, s.integer, s.boolean, s.date, s.datetime, s.email, s.enums, s.array, s.map, s.set, s.record, s.oneOf, s.anyOf, s.allOf). s.from(Model) returns a local copy to compose; s.get(Model) returns the shared class schema, so changes to it are global; s.generic(Pagination).of(Product) binds generics.

Pitfalls

  • Field missing from the response or undefined in the handler: no decorator on the property.
  • Array items arrive as plain objects: @CollectionOf is missing, or the parameter decorator did not receive the item class (see tsed-controllers).
  • Nothing is validated: @tsed/ajv is not imported, or the parameter is typed with an interface or any.
  • null rejected or coerced: add @Nullable(Type); it is mandatory when ajv.returnsCoercedValues is enabled.
  • Password leaks in a response: groups are declared but the endpoint sets none and strictGroups is off.
  • @DiscriminatorKey() property typed with the enum: keep it string; values come from @DiscriminatorValue.
  • OnSerialize imported from @tsed/schema (as some doc pages show) does not compile; import it from @tsed/json-mapper.

Checklist

  • Classes only; every property decorated; every collection has @CollectionOf.
  • @tsed/ajv imported in the server; jsonMapper.strictGroups decided explicitly.
  • Groups set on both the input parameter and @Returns where the shape differs.
  • Custom formats and keywords imported at startup.
  • Schema checked with s.compile(Model) in a unit test (see tsed-testing).
  • No @tsed/common import; relative imports end with .js.

Depth: https://tsed.dev/docs/model.md, https://tsed.dev/docs/validation.md, https://tsed.dev/docs/json-mapper.md. OpenAPI output: tsed-openapi.

© tsedio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in plugins/tsed/skills/tsed-models of tsedio/tsed.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit cebcc11

Compare with similar skills

Tsed Models next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tsed Models compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tsed Models this skilltsedio/tsed3.1k—~2.3kAutomated safety check: PassMIT
Configuring Horizoncoollabsio/coolify63k4 repos~898Automated safety check: PassMIT
Nestjs Best Practicesrolling-scopes/rsschool-app10k6 repos~1.2kAutomated safety check: PassMIT
Sub2API AdminWei-Shaw/sub2api43k1 repos~717Automated safety check: PassLGPL-3.0
Firecrawl Build Onboardingfirecrawl/firecrawl190k1 repos~1.4kAutomated safety check: NotesISC
Obsidian BasesAtmosphere/atmosphere3.8k22 repos~3.2kAutomated safety check: PassApache-2.0

Similar skills

  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Backend & APIsAuto-check passed
  • Nestjs Best Practices

    rolling-scopes/rsschool-app

    NestJS best practices and architecture patterns for building production-ready applications.

    10k GitHub starsUsed in 6 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • Sub2API Admin

    Wei-Shaw/sub2api

    Manages a Sub2API deployment from the command line: accounts, redeem and invitation codes, groups, proxies, imports, exports and raw admin API calls.

    43k GitHub starsUsed in 1 repo~717 tokens
    Backend & APIsAuto-check passed
  • Firecrawl Build Onboarding

    firecrawl/firecrawl

    Gets Firecrawl working in a project: signs you in through the browser, saves FIRECRAWL_API_KEY to .env and picks the first SDK or REST path.

    190k GitHub starsUsed in 1 repo~1.4k tokens
    Backend & APIsAuto-check: notes
  • Obsidian Bases

    Atmosphere/atmosphere

    Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries.

    3.8k GitHub starsUsed in 22 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Backend & APIsAuto-check passed

More from tsedio/tsed

All 19 skills in this repo
  • Create a production-ready Ts.ED platform adapter for a new HTTP framework or runtime, such as Hono, Elysia, Bun.serve, or a Node framework.

    3.1k GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • Tsed CLI

    tsedio/tsed

    Scaffolds Ts.ED v8 projects and generates files with the Ts.ED CLI v7, through its MCP server (tools set-workspace, init-project, list-templates, get-template, generate-file) or the tsed binary…

    3.1k GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • Configure and bootstrap a Ts.ED v8 server - the @Configuration decorator or configuration() on the Server class, PlatformExpress/PlatformKoa/PlatformFastify.bootstrap, server options (mount…

    3.1k GitHub stars~2.1k tokensUpdated yesterday
    Auto-check: notes
  • Tsed Di

    tsedio/tsed

    Declare, inject and scope Ts.ED v8 providers and wire lifecycle hooks - @Injectable, @Module, @Controller, @Inject, the functional API (inject, injectMany, lazyInject, constant, refValue…

    3.1k GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Tsed Docs

    tsedio/tsed

    Locates authoritative Ts.ED v8 documentation and API reference instead of guessing framework APIs.

    3.1k GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed
  • Tsed Logger

    tsedio/tsed

    Configure and use logging in a Ts.ED v8 application with @tsed/logger v8.

    3.1k GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Tsed Models

What does Tsed Models do?

Define Ts.ED v8 models and control validation and serialization with @tsed/schema decorators or the functional s builder, @tsed/ajv and @tsed/json-mapper. Tsed Models is an agent skill from tsedio/tsed.ED v8 models and control validation and serialization with @tsed/schema decorators or the functional s builder, @tsed/ajv and @tsed/json-mapper.

When should I use Tsed Models?

Tsed Models fits situations like: properties disappear from a request body; invalid payloads are not rejected; A 400 AJVVALIDATIONERROR; bad request on parameter appears.

How do I install Tsed Models in Claude Code?

Run `npx skills add tsedio/tsed --skill tsed-models -a claude-code`. Or copy the skill folder (plugins/tsed/skills/tsed-models in tsedio/tsed) into .claude/skills/tsed-models in your project. Claude Code loads it when a task matches its description.

How do I install Tsed Models in Codex?

Run `npx skills add tsedio/tsed --skill tsed-models -a codex`. Or copy the skill folder (plugins/tsed/skills/tsed-models in tsedio/tsed) into .agents/skills/tsed-models in your project. Codex loads it when a task matches its description.

Can I use Tsed Models in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tsedio/tsed --skill tsed-models -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tsed-models, .gemini/skills/tsed-models, .github/skills/tsed-models and .opencode/skills/tsed-models in your project.

What does Tsed Models need to run?

SKILL.md names no scripts, command-line tools or credentials: Tsed Models is instructions for the agent only.

Does Tsed Models access the network?

SKILL.md names 1 domain. As links in the text: tsed.dev. This is read from the text; nothing was executed.

Is Tsed Models safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tsed Models use?

Tsed Models is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tsed Models use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Tsed Models?

Skills that share tags, products or a category with Tsed Models: Configuring Horizon (coollabsio/coolify, 63k stars), Nestjs Best Practices (rolling-scopes/rsschool-app, 10k stars), Sub2API Admin (Wei-Shaw/sub2api, 43k stars) and Firecrawl Build Onboarding (firecrawl/firecrawl, 190k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tsed Models?

tsedio (a GitHub organization) maintains it in tsedio/tsed, which has 3,088 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 7, 2026.

Source: tsedio/tsed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.