CommunityRédaction et éditiongithub.com

usetheokit/theokit-skills

Claude Code plugin that teaches the assistant the real @theokit/sdk API surface — Agent.create, Tool.create with Zod, streaming SDKMessage events, MCP servers, subagents, cron and the error hierarchy — so it writes correct SDK code instead of plausible code. npx @theokit/skill. Apache-2.0.

Qu'est-ce que theokit-skills ?

theokit-skills is a Claude Code agent skill that claude Code plugin that teaches the assistant the real @theokit/sdk API surface — Agent.create, Tool.create with Zod, streaming SDKMessage events, MCP servers, subagents, cron and the error hierarchy — so it writes correct SDK code instead of plausible code. npx @theokit/skill. Apache-2.0.

Compatible avecClaude Code~Codex CLI~Cursor
npx skills add usetheokit/theokit-skills

Installed? Explore more Rédaction et édition skills: steipete/notion, affaan-m/seo, affaan-m/brand-voice · View all 6 →

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

TheoKit DI -- Dependency Injection

Quick reference for @theokit/di -- a TypeScript DI container with decorator metadata.

Installation

pnpm add @theokit/di reflect-metadata

Requires reflect-metadata polyfill imported once at app entry and experimentalDecorators + emitDecoratorMetadata in tsconfig.json.

Core decorators

@Injectable

import { Injectable, Scope } from "@theokit/di";

@Injectable()
class UserRepository {
  findById(id: string) { /* ... */ }
}

// With options:
@Injectable({ scope: Scope.REQUEST })
class RequestScopedService { /* ... */ }

InjectableOptions:

OptionTypeDefaultDescription
scopeScopeScope.SINGLETONLifecycle scope.

@Inject

import { Inject } from "@theokit/di";

@Injectable()
class OrderService {
  constructor(
    @Inject("DATABASE_URL") private readonly dbUrl: string,
    private readonly repo: UserRepository, // auto-resolved by type
  ) {}
}

Use @Inject(token) for string/symbol tokens. Constructor parameter types are auto-resolved via reflect-metadata when the parameter is a class.

@Optional

import { Optional } from "@theokit/di";

@Injectable()
class NotificationService {
  constructor(
    @Optional() private readonly sms?: SmsGateway,
  ) {}
}

Resolves to undefined instead of throwing TokenNotFoundError when the dependency is not registered.

@Qualifier

import { Qualifier } from "@theokit/di";

@Injectable()
class PaymentService {
  constructor(
    @Qualifier("stripe") private readonly gateway: PaymentGateway,
  ) {}
}

Disambiguates between multiple providers registered under the same interface token.

@Primary

import { Primary, Injectable } from "@theokit/di";

@Injectable()
@Primary()
class StripeGateway implements PaymentGateway { /* ... */ }

Marks a provider as the default when multiple are registered for the same token. Wins over non-primary providers unless @Qualifier is used.

@PostConstruct / @PreDestroy

import { PostConstruct, PreDestroy, Injectable } from "@theokit/di";

@Injectable()
class DatabasePool {
  @PostConstruct()
  async init() { /* called after construction */ }

  @PreDestroy()
  async shutdown() { /* called on container.dispose() */ }
}

Container

import { Container } from "@theokit/di";

const container = new Container();

// Register classes
container.register(UserRepository);
container.register(OrderService);

// Register value providers
container.register("DATABASE_URL", { useValue: "postgres://..." });

// Register factory providers
container.register("Logger", {
  useFactory: (ctx) => new Logger(ctx.resolve("DATABASE_URL")),
});

// Register existing (alias)
container.register("PrimaryRepo", { useExisting: UserRepository });

// Resolve
const service = container.resolve(OrderService);
const asyncService = await container.resolveAsync(OrderService);

// Dispose (calls @PreDestroy hooks)
await container.dispose();

ContainerOptions

interface ContainerOptions {
  parent?: Container;    // hierarchical containers
  autoRegister?: boolean; // default false
}

Provider types

type Provider =
  | ClassProvider      // { useClass: Constructor, scope? }
  | ValueProvider      // { useValue: any }
  | FactoryProvider    // { useFactory: (ctx) => any, scope? }
  | ExistingProvider;  // { useExisting: Token }

Scopes

import { Scope } from "@theokit/di";
ScopeBehavior
Scope.SINGLETONOne instance per container (default).
Scope.TRANSIENTNew instance on every resolve.
Scope.REQUESTOne instance per request scope (via container.createScope()).

Request scope example:

const requestContainer = container.createScope();
const handler = requestContainer.resolve(RequestHandler);
// All REQUEST-scoped deps share the same instance within this scope

@Module

import { Module } from "@theokit/di";

@Module({
  providers: [UserRepository, OrderService],
  imports: [DatabaseModule],
  exports: [UserRepository],
})
class UserModule {}

// Load module into container
container.loadModule(UserModule);

ModuleMetadata:

FieldTypeDescription
providersProvider[]Classes/providers registered in this module.
importsModule[]Other modules whose exports become available.
exportsToken[]Tokens visible to importing modules.

Errors

ErrorCause
TokenNotFoundErrorToken not registered and not @Optional.
CyclicDependencyErrorCircular dependency detected in resolution graph.
MissingInjectableErrorClass used as dependency without @Injectable.
ScopeViolationErrorSingleton depends on transient/request-scoped dep.
ContainerDisposedErrorResolve called after container.dispose().
ContainerFrozenErrorRegister called after container is frozen.
AsyncProviderInSyncResolveErrorAsync factory used with resolve() instead of resolveAsync().
ReflectMetadataMissingErrorreflect-metadata polyfill not imported.
CyclicModuleImportErrorCircular module imports detected.
InvalidModuleErrorModule class missing @Module decorator.
InvalidExportErrorModule exports a token not in its providers.

Graph analysis

const graph: DependencyGraph = container.analyzeGraph();
// Useful for debugging dependency chains and detecting issues

Skills associés

steipete/notion

Notion CLI/API for pages, Markdown content, data sources, files, comments, search, Workers, and raw API calls.

community

affaan-m/seo

Audit, plan, and implement SEO improvements across technical SEO, on-page optimization, structured data, Core Web Vitals, and content strategy. Use when the user wants better search visibility, SEO remediation, schema markup, sitemap/robots work, or keyword mapping.

community

affaan-m/brand-voice

Build a source-derived writing style profile from real posts, essays, launch notes, docs, or site copy, then reuse that profile across content, outreach, and social workflows. Use when the user wants voice consistency without generic AI writing tropes.

community

affaan-m/crosspost

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

community

affaan-m/x-api

X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.

community

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

community