Agent skill
typescript-taste
Apply rigorous TypeScript type design with strong inference, minimal constraints, and sound fallbacks.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/design/typescript-taste-iplaylf2-khora
Metadata
Additional technical details for this skill
- short description
- TypeScript type design taste
SKILL.md
TypeScript Type Taste
Use this skill for strict TypeScript type design and tradeoff-driven generic design.
Examples
Read only when a concrete example is needed.
- Inference alignment: align generics to the primary type — references/INFERENCE_ALIGNMENT.md
- Unreachable branches: encode impossible paths with never — references/UNREACHABLE_BRANCH.md
- Union call sites: avoid impossible intersections — references/UNION_CALL_SITES.md
- Constraint minimalism: keep constraints minimal — references/CONSTRAINT_MINIMALISM.md
Workflow
- Identify the primary input surface such as function params, config object, or constructor.
- Align generics to that surface so inference follows the call site.
- Constrain only what is necessary and avoid structure that blocks valid inputs.
- Encode unreachable branches with never and use unknown only when reachability is uncertain.
- Derive result types from inputs with infer or indexed access.
- Validate mixed call paths so unions stay usable and do not collapse into intersections.
Heuristics
- Prefer whole-type constraints over inner type parameters when no inner type is clearly primary.
- Keep generic names short and consistent, and only make them descriptive when it reduces confusion.
- Avoid parallel generics that can be derived from inputs.
- Use minimal constraints that preserve inference and soundness.
Checks
- Inference: callers get the right type without explicit generics.
- Compatibility: unions remain unions and do not collapse into intersections.
- Strictness: works under strict, exactOptionalPropertyTypes, and noUncheckedIndexedAccess.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?