/tsed:tsed-controllersfrom Ts.ED
Writes Ts.ED v8 HTTP controllers and routes using decorators. Covers @Controller paths, verb/parameter/response decorators, typed inputs, and mounting configuration.
Ships in Ts.ED. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Declare endpoints with decorators and let Ts.ED map, validate and serialize. Keep controllers thin: inputs in, service call, value out.
Package map (never import from @tsed/common):
| Symbol | Package |
|---|---|
Controller, Configuration, Inject | @tsed/di |
Get, Post, Put, Patch, Delete, Head, Options, All, Returns, Status, Redirect, Location, ContentType, Header, View, Hidden | @tsed/schema |
PathParams, QueryParams, BodyParams, HeaderParams, Cookies, Session, Locals, Context, RawBodyParams, RawPathParams, RawQueryParams, UsePipe | @tsed/platform-params |
Req, Res, Next, PlatformRequest, PlatformResponse, PlatformContext | @tsed/platform-http |
useDecorators, StoreSet | @tsed/core |
import {Controller, Inject} from "@tsed/di";
import {NotFound} from "@tsed/exceptions";
import {BodyParams, PathParams, QueryParams} from "@tsed/platform-params";
import {Get, Post, Returns} from "@tsed/schema";
import {Calendar} from "../models/Calendar.js";
import {CalendarsService} from "../services/CalendarsService.js";
@Controller("/calendars")
export class CalendarsController {
@Inject()
protected service: CalendarsService;
@Get("/")
@(Returns(200, Array).Of(Calendar))
list(@QueryParams("limit") limit: number = 20) {
return this.service.list(limit);
}
@Get("/:id")
@Returns(200, Calendar)
@Returns(404, NotFound)
async get(@PathParams("id") id: string) {
const calendar = await this.service.get(id);
if (!calendar) throw new NotFound("Calendar not found");
return calendar;
}
@Post("/")
@Returns(201, Calendar)
create(@BodyParams() payload: Calendar) {
return this.service.create(payload);
}
}
import {Configuration} from "@tsed/di";
import {CalendarsController} from "./controllers/CalendarsController.js";
@Configuration({mount: {"/rest": [CalendarsController]}})
export class Server {}
Object.values() of a barrel). Do not pass glob strings to mount./rest/v1, /rest/v2.@Controller({path: "/rest", children: [CalendarsController, EventsController]}); mount only the parent. A child can be reused under several parents.@Controller on the subclass only.@PathParams("id"), @QueryParams("q"), @BodyParams(), @BodyParams("field"), @HeaderParams("x-token"), @Cookies("sid"), @Session("user"), @Locals("key"), @Context() $ctx.any is emitted as Object: no mapping, no property validation. Use @Any() from @tsed/schema when any type must be accepted.@BodyParams(Product) products: Product[], @QueryParams("ids", String) ids: string[].@QueryParams() query: SearchQuery.@PathParams("id") @Pattern(/^[0-9a-f]{24}$/) id: string.@BodyParams, @PathParams and @QueryParams run the json-mapper and validation by default. @HeaderParams, @Cookies, @Session, @Locals do not; opt in with the options form @HeaderParams({expression: "x-id", useValidation: true, useMapper: true}).Raw* variants to bypass mapping and validation (for example before @UsePipe, see tsed-middlewares).@Context() $ctx: PlatformContext ($ctx.request, $ctx.response, $ctx.logger, $ctx.endpoint) over @Req()/@Res(). Do not type @Req()/@Res() as Express objects in portable code; use PlatformRequest/PlatformResponse.Model, validation and group rules belong to tsed-models.
Observable, Buffer and readable streams are resolved and sent by the platform. Do not call res.send()/res.json() and also return a value.@Returns(status, Model). It drives OpenAPI and the serialization options of that status: .Of(Item), .Nested(Sub), .Groups("read"), .ContentType("text/xml"), .Header("x-total", ...), .Description("..."), .Binary().@(Returns(200, Pagination).Of(Product)).@Status(201, Model), @Header("x-version", "1"), @ContentType("text/csv"). Use $ctx.response.status(...), .setHeaders(...), .attachment(...) for dynamic values.@Redirect("/new") or @Redirect(301, "/new"); add a Location header with @Location("/items/1").@View("calendar.ejs") and return the view data (engine setup: https://tsed.dev/docs/templating.md).@Hidden(). Documentation details belong to tsed-openapi./search) above parametric ones (/:id).@Get("/:id") @Get("/alias/:id")./:id, optional /:id? or Express 5 /{:id}, named wildcard /:path* read with @PathParams("path"). Adapters convert these for Express 4/5, Koa and Fastify./:id(\\d+)); Express 5 rejects them and Ts.ED does not convert them. Validate with @Pattern instead.Compose existing decorators with useDecorators; store options with StoreSet and read them through $ctx.endpoint.get(Key).
import {StoreSet, useDecorators} from "@tsed/core";
import {UseBefore} from "@tsed/platform-middlewares";
import {Returns} from "@tsed/schema";
import {QuotaMiddleware} from "../middlewares/QuotaMiddleware.js";
export function Quota(limit: number) {
return useDecorators(StoreSet(QuotaMiddleware, {limit}), UseBefore(QuotaMiddleware), Returns(429));
}
Middlewares, auth decorators, interceptors and pipes: tsed-middlewares. Thrown errors and error payloads: tsed-exceptions.
mount, or the mount prefix was forgotten in the URL./calendars/search hits get(":id"): reorder the methods.@Returns does not convert the returned value to another class; it selects serialization options (groups, generics) and documents the response..js extension fail at runtime in ESM projects.PlatformRouter are not part of the OpenAPI document.children.@Returns.@tsed/common import; relative imports end with .js.Depth: https://tsed.dev/docs/controllers.md, https://tsed.dev/docs/routing.md, https://tsed.dev/docs/custom-endpoint-decorators.md, https://tsed.dev/docs/request-context.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
13 skills in this plugin
/tsed-cliScaffolds 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 (tsed init, generate, template, add, run, update, dev, build). Use when creating a Ts.ED project, adding a controller, service, middleware, model, interceptor, pipe, decorator or custom template, when package.json has a "tsed" key or @tsed/cli, when a .templates/ directory exists, or on errors E_CWD_NOT_SET, E_PROJECT_NOT_INITIALIZED, E_TEMPLATE_UNKNOWN, E_ARGS_INVALID./tsed-configurationConfigure and bootstrap a Ts.ED v8 server - the @Configuration decorator or configuration() on the Server class, PlatformExpress/PlatformKoa/PlatformFastify.bootstrap, server options (mount, middlewares, httpPort, httpsPort, acceptMimes, logger, statics, views, responseFilters, imports), per-platform express/koa/fastify options, and @tsed/config sources (envs, dotenv, json, yaml). Use when editing Server.ts, index.ts or src/config, adding @tsed/config or the extends option, or reading settings with constant(), refValue(), @Constant, @Value or configuration().get()./tsed-diDeclare, inject and scope Ts.ED v8 providers and wire lifecycle hooks - @Injectable, @Module, @Controller, @Inject, the functional API (inject, injectMany, lazyInject, constant, refValue, injectable().factory/asyncFactory/class/value, injector, context, logger), ProviderScope, custom tokens, @tsed/hooks ($on, $emit, $asyncEmit, $alter) and request context. Use when writing services or modules with @tsed/di, fixing InjectionError, "Given token is undefined" or undefined injected properties, choosing a scope, adding $onInit/$onDestroy/$onReady, or replacing registerProvider and other deprecated DI APIs.npx claudepluginhub tsedio/tsed --plugin tsedOther plugins' skills for the same job