Agent skill

Tsed Di

by tsedio in 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…

MITAuto-check passed

Install Tsed Di

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

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

GitHub CLI
$ gh skill install tsedio/tsed tsed-di --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-di .claude/skills/tsed-di && 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-di
GitHub stars
3.1k
Token cost
~2.1k tokens
SKILL.md length
692 words
Files
3 (incl. references)
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 7 steps: Pick one style per file → Choose the provider kind → Declare custom providers and tokens → …
  • Writing services
  • SKILL.md covers 1. Pick one style per file, 2. Choose the provider kind, 3. Declare custom providers… and 4. Set the scope, plus 5 more sections
  • Reaches tsed.dev

What it does

Tsed Di is an agent skill from 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, 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…

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `agents/openai.yaml` and `references/di-api.md`).

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

  • Writing services
  • Modules with @tsed/di
  • Fixing InjectionError
  • Given token is undefined

Example prompts

  • “Given token is undefined”
  • “/tsed-di”

Workflow steps

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

  1. Pick one style per file
  2. Choose the provider kind
  3. Declare custom providers and tokens
  4. Set the scope
  5. Lazy-load heavy providers
  6. Use lifecycle hooks
  7. Read the request context

What it can do on your machine

Read from SKILL.md and the folder at commit cf95a4e. 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

    Hosts in commands or code, which the agent is likely to contact:

    • 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 Di loads about 2.1k tokens when it runs, and up to ~5.1k if it reads all its reference files. Until then it costs about 154 tokens; SKILL.md has 692 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~154
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.1k

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 cf95a4e, republished under its MIT licence (© tsedio). 692 words, ~2,099 tokens.

Download SKILL.mdSave it as .claude/skills/tsed-di/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
tsed-di
description
Declare, 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.

Ts.ED Dependency Injection and Lifecycle

Register every class the framework must build, resolve dependencies through the injector, and never construct DI-managed classes with new.

Read the DI API reference for signatures, the hook order and the deprecated-API table. Depth: https://tsed.dev/docs/providers.md, https://tsed.dev/docs/custom-providers.md, https://tsed.dev/docs/hooks.md.

1. Pick one style per file

All symbols below come from @tsed/di. Decorators and the functional API are interchangeable; follow the style already used in the project.

typescript
import {Injectable, Inject, inject, injectable} from "@tsed/di";
import {UsersRepository} from "./UsersRepository.js";

@Injectable()
export class UsersService {
  @Inject()
  protected repository: UsersRepository; // decorator style

  // or: private readonly repository = inject(UsersRepository); // functional style
}

// Functional registration, without the class decorator:
// export class UsersService { ... }
// injectable(UsersService);
  • inject() works in class field initializers, constructors, factories and hooks of registered providers.
  • Do not call inject() at module top level: it builds the provider before configuration, imports overrides and test mocks are loaded.
  • Do not mix @Injectable() and injectable(Class) on the same class.
  • Controllers: @Controller("/path"), or controller(Class).path("/path"). Routing belongs to tsed-controllers.

2. Choose the provider kind

  1. Plain service: @Injectable().
  2. Module (groups providers, carries configuration, built before the Server): @Module({imports: [...]}).
  3. Value, factory, async factory, or implementation chosen at runtime: a custom token (step 3).
  4. Middleware and interceptor classes: see tsed-middlewares. @Interceptor() and @Intercept() are exported by @tsed/di.

3. Declare custom providers and tokens

typescript
import {constant, injectable} from "@tsed/di";

export const DbConnection = injectable(Symbol.for("DbConnection"))
  .asyncFactory(async () => {
    const options = constant<DbOptions>("database");
    return connect(options);
  })
  .hooks({$onDestroy: (connection) => connection.close()})
  .token();
export type DbConnection = typeof DbConnection;
  • Builders: .value(v), .factory(fn), .asyncFactory(fn), .class(Klass); chain .scope(), .deps(), .imports(), .hooks(), .type(), .alias(), and end with .token().
  • Inject it with inject(DbConnection) or @Inject(DbConnection) db: DbConnection.
  • Symbol and string tokens always need the explicit token: @Inject(TOKEN). A bare @Inject() only works when the TypeScript type is a class.
  • Interface abstraction: export const RetryPolicy = Symbol("RetryPolicy") plus export interface RetryPolicy {...}, then injectable(RetryPolicy).class(TokenBucket).
  • Group implementations: injectable(Foo).type(Bar) or @Injectable({type: Bar}), then injectMany<Bar>(Bar) or @Inject(Bar) bars: Bar[].
  • Swap an existing provider: @OverrideProvider(Original) on the replacement class, or imports: [{token, useClass}] in configuration.

4. Set the scope

typescript
import {Injectable, ProviderScope, Scope} from "@tsed/di";

@Injectable()
@Scope(ProviderScope.REQUEST)
export class RequestCart {}
// functional: injectable(RequestCart).scope(ProviderScope.REQUEST);
  • SINGLETON (default): one instance, built at startup.
  • REQUEST: one instance per request. The controller and every provider on the injection chain must also be REQUEST; a singleton parent keeps the first instance forever.
  • INSTANCE: a new instance on every injection. inject(Token, {rebuild: true}) forces a fresh one ad hoc.
  • Prefer the request context (step 7) over REQUEST scope when you only need per-request data.

5. Lazy-load heavy providers

typescript
import {lazyInject} from "@tsed/di";

const service = await lazyInject(() => import("./ReportService.js")); // module must `export default` the class

Decorator form: @LazyInject("ReportService", () => import("./ReportService.js")) reports: Promise<ReportService>. Only $onInit runs for lazy providers. Do not lazy-load controllers, middlewares, or providers that rely on other hooks.

6. Use lifecycle hooks

typescript
import {Injectable, OnDestroy, OnInit} from "@tsed/di";
import {$asyncEmit, $on} from "@tsed/hooks";

@Injectable()
export class QueueService implements OnInit, OnDestroy {
  async $onInit() {}
  async $onDestroy() {}
  $onReady() {}
}

$on("$onReady", () => {}); // subscribe without a class
await $asyncEmit("$orderCreated", [order]); // emit a custom hook; listeners are `$orderCreated(order)` methods
  • Any method starting with $ on a provider is registered as a hook listener.
  • Order: $beforeInit → $onInit → $afterInit → $beforeRoutesInit → $onRoutesInit → $afterRoutesInit → $beforeListen → $afterListen → $onReady; per request $onRequest / $onResponse; shutdown $onDestroy.
  • OnInit and OnDestroy types come from @tsed/di; BeforeInit, AfterInit, BeforeRoutesInit, OnRoutesInit, AfterRoutesInit, BeforeListen, AfterListen, OnReady come from @tsed/platform-http.
  • Use $alter("$name", value, [args]) / $asyncAlter for hooks that transform a value. $emit is synchronous and does not await listeners.
Show full SKILL.md (265 more words)Show less

7. Read the request context

typescript
import {context} from "@tsed/di";
import type {PlatformContext} from "@tsed/platform-http";

const $ctx = context<PlatformContext>();
$ctx.logger.info({event: "LOOKUP", id: $ctx.request.params.id});
  • In handlers and middlewares use @Context() $ctx: PlatformContext from @tsed/platform-params.
  • In services use context() or @InjectContext() $ctx?: PlatformContext from @tsed/di. Do not store $ctx on a singleton.
  • Store per-request data with $ctx.set(key, value) / $ctx.get(key). Outside a request, context() returns a detached DIContext, not the request.

Pitfalls

  • InjectionError or "Given token is undefined. Could mean a circular dependency problem": two files import each other. Extract the shared logic into a third provider, or resolve late with inject(Token) inside the method; never fix it with new.
  • Property injected with @Inject() typed as an interface resolves to Object and throws InvalidPropertyTokenError. Pass the token.
  • Injected property is undefined in the constructor under some compilers: set useDefineForClassFields: false and enable experimentalDecorators + emitDecoratorMetadata.
  • An async factory resolves before $onInit; consumers receive the resolved value, not a promise. Do not await inject(TOKEN) in singletons.
  • Request-scoped providers only get $onDestroy; other $ hooks are not called on them.
  • A provider file that is never imported is never registered. Import it from a module, controller, or imports.
  • Do not import from @tsed/common; use @tsed/di, @tsed/hooks, @tsed/platform-http, @tsed/platform-params.

Checklist

  • Every DI-managed class is registered exactly once (@Injectable/@Module/@Controller or injectable()/controller()).
  • Non-class tokens are injected with an explicit token and exported together with a matching type.
  • Scopes are consistent along the whole injection chain; no request data lives on a singleton.
  • Resources opened in $onInit or a factory are closed in $onDestroy.
  • No registerProvider, injector.emit/alter/alterAsync, or @tsed/common import remains (see the reference table; use tsed-migration for v7 code).
  • Settings are read with constant() / refValue() (tsed-configuration) and providers are tested through PlatformTest (tsed-testing).

© 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 2 other files (references) in plugins/tsed/skills/tsed-di of tsedio/tsed.

  • SKILL.md
  • agents/openai.yaml
  • references/di-api.md

Open the folder on GitHubat commit cf95a4e

Compare with similar skills

Tsed Di 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 Di compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tsed Di this skilltsedio/tsed3.1k—~2.1kAutomated safety check: PassMIT
Add Model Provideropenclaw/openclaw392k—~1.1kAutomated safety check: PassMIT
Prompt Injection Defensesickn33/agentic-awesome-skills47k2 repos~4.2kAutomated safety check: WarnMIT
OmniRoute Provider Managementdiegosouzapw/OmniRoute74k—~2.4kAutomated safety check: PassMIT
OmniRoute Providers CLIdiegosouzapw/OmniRoute74k—~2.2kAutomated safety check: PassMIT
Detecting AI Model Prompt Injection Attacksmukul975/Anthropic-Cybersecurity-Skills34k—~1.9kAutomated safety check: WarnApache-2.0

Similar skills

  • Add Model Provider

    openclaw/openclaw

    Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

    392k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Prompt Injection Defense

    sickn33/agentic-awesome-skills

    Defend AI systems against prompt injection and indirect prompt attacks using input controls, tool permissions, output validation, and isolation boundaries.

    47k GitHub starsUsed in 2 repos~4.2k tokens
    SecurityAuto-check: warnings
  • OmniRoute Provider Management

    diegosouzapw/OmniRoute

    Manages AI provider connections, API keys, OAuth flows and connection tests through OmniRoute's REST API across its 327-provider catalog.

    74k GitHub stars~2.4k tokensUpdated today
    Backend & APIsAuto-check passed
  • OmniRoute Providers CLI

    diegosouzapw/OmniRoute

    Command reference for managing provider connections in the omniroute gateway: browse the catalog, test and validate connections, rotate API keys and read per-provider metrics.

    74k GitHub stars~2.2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Detecting AI Model Prompt Injection Attacks

    mukul975/Anthropic-Cybersecurity-Skills

    Detects prompt injection using regex signature matching, heuristic scoring for structural anomalies, and DeBERTa-based transformer classification, flagging direct injections (system-prompt…

    34k GitHub stars~1.9k tokensUpdated 1 mo ago
    SecurityAuto-check: warnings
  • Detecting Indirect Prompt Injection

    mukul975/Anthropic-Cybersecurity-Skills

    Detect and defend against indirect prompt injection hidden in web pages, documents, and images consumed by an agent, via content extraction (HTML/PDF/OCR), normalization, and scanning with LLM…

    34k GitHub stars~2.8k tokensUpdated 1 mo ago
    SecurityAuto-check: warnings

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 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
  • Tsed MCP Server

    tsedio/tsed

    Expose Model Context Protocol (MCP) tools, resources and prompts from a Ts.ED v8 application with @tsed/platform-mcp, over the application's HTTP endpoint or as a standalone stdio / Streamable HTTP…

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

Questions about Tsed Di

What does Tsed Di do?

Declare, inject and scope Ts.ED v8 providers and wire lifecycle hooks - @Injectable, @Module, @Controller, @Inject, the functional API (inject, injectMany, lazyInject, constant, refValue…. Tsed Di is an agent skill from tsedio/tsed.factory/asyncFactory/class/value, injector, context, logger), ProviderScope, custom tokens, @tsed/hooks ($on, $emit, $asyncEmit, $alter) and request context.

When should I use Tsed Di?

Tsed Di fits situations like: writing services; modules with @tsed/di; fixing InjectionError; given token is undefined.

How do I install Tsed Di in Claude Code?

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

How do I install Tsed Di in Codex?

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

Can I use Tsed Di 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-di -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-di, .gemini/skills/tsed-di, .github/skills/tsed-di and .opencode/skills/tsed-di in your project.

What does Tsed Di need to run?

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

Does Tsed Di access the network?

SKILL.md names 1 domain. In commands or code: tsed.dev; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Tsed Di 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 Di use?

Tsed Di 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 Di use?

About 2.1k tokens (SKILL.md is roughly 8.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3k tokens, read only when the agent opens those files.

What are the alternatives to Tsed Di?

Skills that share tags, products or a category with Tsed Di: Add Model Provider (openclaw/openclaw, 392k stars), Prompt Injection Defense (sickn33/agentic-awesome-skills, 47k stars), OmniRoute Provider Management (diegosouzapw/OmniRoute, 74k stars) and OmniRoute Providers CLI (diegosouzapw/OmniRoute, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tsed Di?

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 8, 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.