/typescript:typescriptfrom typescript
Guides TypeScript code generation with schema-first design, strict type safety, and immutable patterns. Activates when writing or reviewing TypeScript, defining types/schemas, or building type-safe apps.
Ships in typescript. 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.
Schema-first design, strict type safety, and immutable patterns.
principle-parse-at-the-boundary).principle-type-system-discipline).any; strict mode enabled.A trust boundary still needs a runtime check. When the dependency set is frozen, add no dependency and do not skip the check. Write a decoder that accepts unknown. Narrow each field with typeof, Array.isArray, or a type predicate. Report an invalid value through the failure path the function already contracts, such as a Result variant or a null return (principle-parse-at-the-boundary).
Create the accumulator inside the function, append with push or assign by key, and return it under a readonly type. Do not build a growing collection with [...accumulator, item] or { ...accumulator, [key]: value } inside a loop: each step copies the growing accumulator, so the loop becomes quadratic.
When a request says "update it in place", or a helper that you must reuse writes into its argument, return a new value and leave the caller's value unchanged. Give a mutating helper only a value that you created, and keep the helper's behaviour unchanged for its other callers. When you return a new value against the request's wording, say so in your answer, and state that neither a documented mutable API nor a measured hot path requires mutation.
When the caller's contract does require mutation through a documented mutable API or a measured hot path, both mutating and returning a new value break a rule. Write neither as the final patch. Name the conflict between that contract and Core Principle 3, and ask the contract's owner to choose (principle-rank-sources-by-authority).
Validate every field the source documents. Type each undocumented part as unknown; do not guess its field names. State in your answer what the validator does not check, and why, so a reader sees how far validation reaches without reading the code.
Never use as to state a fact you have not checked, including a shape that a document, contract, or upstream promise describes. Narrow a value you have just checked with a user-defined type predicate, or with one assertion placed immediately after the check. Name the checked condition in the predicate name or in a comment on the assertion (principle-type-system-discipline, principle-observe-dont-infer).
| Guide | Read for |
|---|---|
| schemas.md | Schema-first patterns; when a schema is required vs optional; trust boundary identification; test data factories with schema validation; schema examples (API responses, business validation) |
| types-interfaces.md | Type vs interface; any vs unknown; type assertions; strict mode and tsconfig.json settings |
| immutability.md | Immutability patterns (spread operators); readonly; forbidden array methods; options objects vs positional parameters; boolean parameter anti-patterns; Result types; early returns |
| utilities.md | Branded types for domain concepts; built-in utility types (Pick, Omit, Partial, etc.); custom utility types; code smell tables |
| patterns.md | Worked examples: schema-first at trust boundaries; internal types without schemas; schema with test factory; Result type; branded types; immutable array operations; options object |
Does data come from outside the application?
├── Yes → Schema required
└── No → Does it have validation rules (format, range, enum)?
├── Yes → Schema required
└── No → Is it shared between systems?
├── Yes → Schema required
└── No → Type is fine
type or interface?Am I defining a behavior contract for dependency injection?
├── Yes → interface
└── No → type
any or unknown?Never use any.
Always use unknown for truly unknown types.
How many parameters?
├── 1-2 → Positional is fine
└── 3+ → Use options object
Before committing TypeScript code, verify:
any types (use unknown instead)z.infer) rather than declared a second timetype for data, interface only for behaviour contractsreadonly where appropriatenull return, or a documented throw)principle-type-system-discipline)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
typescript, type-safety, schema-first, immutability, code-generation
npx claudepluginhub mintuz/skills --plugin typescriptOther plugins' skills for the same job