No slash command · from trove-dev
Enforces TypeScript type-system discipline: make illegal states unrepresentable, validate at boundaries, avoid as/any. Use when reading or editing .ts/.tsx files not covered by a framework-specific skill.
Ships in trove-dev. 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.
This skill ships Trove conventions. Prefer existing project patterns over generic best practices when they conflict.
If a sibling skill in this plugin matches the request more directly, defer to it. See AGENTS.md (or docs/routing.md in the marketplace) for the per-plugin routing index.
The type checker is a proof assistant. Model the domain so wrong states don't compile. On .tsx, defer to trove-react / trove-react-best-practices for component patterns; this skill owns the plain type discipline underneath them.
| Rule | Do | Not |
|---|---|---|
| Illegal states | Discriminated union with a kind/status tag | boolean + optional field pairs |
| Identity | Branded primitives (string & { readonly __brand: 'UserId' }) | bare string for ids |
| External data | unknown + parse at the boundary | any |
| Casts | satisfies to check shape while keeping literals | as SomeType |
| Exhaustiveness | const _exhaustive: never = x in the default branch | unhandled union members |
| Type guards | Guards that actually narrow and are verified | x as Foo inside the guard |
| Derive | Types derived from a schema (Zod/valibot infer) | hand-kept parallel types |
// BAD — admits the meaningless { completed: true, completedAt: undefined }
type Task = { completed: boolean; completedAt?: Date };
// GOOD — the bad state cannot be constructed
type Task =
| { status: 'open' }
| { status: 'done'; completedAt: Date };
Validate once, at the edge (network, config, user input). Past the boundary, trust your domain types and keep logic pure. "Parse, don't validate": a parser returns a more precise type or fails; it doesn't just check and discard what it learned.
function parseUser(raw: unknown): User {
return UserSchema.parse(raw); // unknown -> User, or throws at the boundary
}
See references/patterns.md for the full pattern set with worked examples.
as to silence an error hides the bug you'll debug next week. Reach for narrowing or satisfies first.any on external data erases the boundary. Use unknown and parse.switch over a union compiles today and breaks when a variant is added. Add the never guard.What SKILL.md sets; muted values are Claude Code's defaults
typescript best practices; type this correctly; make illegal states unrepresentable
Three short reads, in order
npx claudepluginhub bravew/trove --plugin trove-dev17 skills in this plugin
/trove-architectDesign the shape before the code: sketch types, signatures, and module structure with not-implemented bodies, agree, then fill in. Scrap the sketch when implementation proves it wrong. Use for non-trivial work where jumping straight to code would lock in the wrong shape./trove-commitGit commit workflow and message conventions. Use when creating, drafting, or reviewing atomic commits with conventional messages./trove-docs-sync-auditRead-only documentation drift audit comparing what the docs claim against what the code does. Covers READMEs, setup guides, API and env docs, changelogs, examples, and generated docs. Use when asked whether docs are stale, missing, or inconsistent after a code change. This is not a code review./trove-explainExplain code, architecture, or data flow at the appropriate level for the audience. Use when someone needs to understand unfamiliar code, a module, or system design./trove-lambdaAWS Lambda handler patterns with CDK infrastructure conventions. Auto-activates when working with Lambda handler or CDK files. Covers handler structure, SQS/SNS parsing, IPC patterns, Powertools logging, and CDK best practices./trove-perfDiagnose and fix a measured performance problem against a baseline: measure first, fix, re-measure, and cite the delta with an artifact path. Use for slow endpoints, slow queries, or any "make this faster" backed by a measurement.Other plugins' skills for the same job