Provides TypeScript patterns for type-first development, making illegal states unrepresentable, exhaustive handling, and runtime validation. Must use when reading or writing TypeScript/JavaScript files.
75
62%
Does it follow best practices?
Impact
96%
1.11xAverage score across 3 eval scenarios
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./data/skills-md/0xbigboss/claude-code/typescript-best-practices/SKILL.mdDiscriminated unions and exhaustive handling
Discriminated union states
100%
100%
State-specific fields
100%
100%
Branded order ID type
100%
100%
Branded customer ID type
100%
100%
Const assertion literal union
100%
100%
Exhaustive switch with never
0%
66%
Error messages include context
100%
100%
No parameter mutation
100%
100%
Array methods over for loops
0%
100%
Pure business logic
87%
100%
Const over let
100%
100%
Test edge cases
100%
100%
Zod runtime validation and schema composition
Zod schema as source of truth
100%
100%
safeParse for user input
100%
100%
parse at trust boundary
100%
100%
Schema composition - not duplication
70%
100%
Transform for normalization
100%
100%
Custom refine with descriptive error
100%
100%
Return result to caller
100%
100%
Descriptive field error messages
100%
100%
Partial update schema
100%
100%
Date transform
100%
100%
Test covers both parse paths
100%
100%
Typed config from environment variables
Zod schema for config
100%
100%
Config type from schema
20%
50%
Parsed at module load
83%
100%
Invalid config crashes
60%
100%
Defaults for non-secrets
100%
100%
No defaults for secrets
100%
100%
No process.env in other code
75%
100%
Coerced numeric port
87%
100%
Enum for log level
100%
100%
Boolean feature flag
85%
85%
Test: missing required field throws
100%
100%
f772de4
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.