/t-stack:tstack-typescriptfrom t-stack
Use when you write, change or review TypeScript (.ts or .tsx): model states as discriminated unions, brand ids so they can't be swapped, make bad values impossible to build, treat outside data as unknown and parse it once with the project's schema library, avoid as-casts, narrow in a fixed order, check switches for exhaustiveness, and prefer satisfies, derived types and object arguments. Skip for other languages, and for the module's overall shape (use tstack-architect).
Ships in t-stack. 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.
The type checker is the cheapest reviewer you have: it runs on every save and never gets tired. These rules move mistakes from runtime, where a person finds them, to compile time, where the build finds them. They follow from two ideas: make wrong states impossible to write down, and check outside data once, at the edge.
kind, type), its brand shape. Follow them; don't add a second way.{ kind: "loading" } | { kind: "ready"; card: Card } | { kind: "error"; message: string } can't be both loading and failed.CardId, ProjectId), so one can't be passed for the other. Create them only in a parser.[T, ...T[]], a range as a start and a length. Strengthen a type only where the loose one forces a !, a cast or a "can't happen" throw.unknown: request bodies, JSON.parse, environment variables, file contents, query results. Parse it once at the edge with the schema library the project already uses, and derive the type from the schema.in, then typeof or instanceof, then a type guard that really checks, and only then as, after validation.never check in the default branch, so a new variant breaks the build where it must be handled.satisfies to as for checked literals, derive types (Pick, Omit, ReturnType, Awaited, typeof) before you declare new ones, and pass an object when a function takes several arguments of the same type.any. No as on unvalidated data. A type guard that doesn't check what it claims is worse than a cast, because its name says it's safe.T[] while every use of it is total.console.log in shipped code. Use the project's logger, with an id to debug from.@ts-expect-error) needs a reason that is about a tool, not about our code (see tstack-no-comments).The types you added or changed, the casts and anys removed, where outside data is now parsed, and the type check result.
Detail: references/patterns.md.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wavyrai/sfora-skills --plugin t-stack28 skills in this plugin
/tstack-architectUse when a change is big enough that writing code first would fix the wrong shape: a new module, a new data model, a change to who owns some state, or a card whose design the owner must see. Sketch the caller's usage, the types and the signatures first, compare at least two shapes, put the chosen sketch on the card or a doc, then build against it and scrap it when it keeps fighting you. Skip for a one-file fix with an obvious shape (just build it, with tstack-tdd), and for comparing finished candidates (use tstack-arena)./tstack-arenaUse when one attempt at a non-trivial piece of work would fix the wrong shape: a contested design, an API, a tricky algorithm, a page of copy. Run two to four independent candidates on the same brief, have a separate judge score them against a written rubric, pick one as the base, graft the best parts of the others into it by hand, and verify the result. Covers the brief, the rubric, the judge and the synthesis note on the card. Skip for work with one obvious answer, and for splitting work into slices (use tstack-swarm)./tstack-benchmark-checklistUse before you report or act on a performance number you measured: a speedup or regression in a PR, a CI step's time, a job's duration, a choice between two libraries or settings. Seven questions to answer with evidence from runs: what limits it, was each side tuned, does it break physical limits, did it error, does it repeat, does it matter end to end, and did the work happen at all. Covers how to state the number on a card. Skip for numbers you didn't measure, and for finding the slow code in the first place (use tstack-how, then measure).