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.
84
Quality
77%
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%
Without context: $0.6062 · 2m 25s · 27 turns · 33 in / 9,812 out tokens
With context: $0.6252 · 2m 4s · 30 turns · 34 in / 8,072 out tokens
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%
Without context: $0.5565 · 2m 28s · 27 turns · 33 in / 9,015 out tokens
With context: $0.6551 · 2m 35s · 29 turns · 316 in / 9,134 out tokens
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%
Without context: $0.4877 · 1m 55s · 24 turns · 29 in / 7,499 out tokens
With context: $0.7054 · 2m 29s · 33 turns · 37 in / 9,090 out tokens
5342bca
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.