← ClaudeAtlas

typescript-narrowslisted

Provides a single, well-reasoned TypeScript opinion for every common decision point. Eliminates the "multiple ways to do it" problem when writing, refactoring, or reviewing TypeScript code. Use when generating TypeScript, performing TypeScript code review, or deciding between multiple valid TypeScript patterns.
sethlivingston/the-typescript-narrows · ★ 0 · Code & Development · score 70
Install: claude install-skill sethlivingston/the-typescript-narrows
# The TypeScript Narrows One opinion per decision point. When TypeScript gives you five valid ways, this skill picks one and tells you why. ## How to use this skill Apply these opinions when writing new TypeScript code, refactoring existing code, or reviewing pull requests. Each opinion has a stance (what to do), a rationale (why), and do/don't examples in the reference files. **Severity tiers** indicate impact level: | Tag | Tier | Meaning | | --- | -------------- | ------------------------------------------------------------------- | | [B] | Bug prevention | Can cause runtime errors, data corruption, or silent wrong behavior | | [M] | Maintenance | Makes code harder to understand, refactor, or extend over time | | [S] | Style | Consistency and readability with no functional impact | **Exception clause:** All opinions allow exceptions when there is no other viable alternative. If you must deviate, document why in a code comment. Convenience alone is not a valid exception. ## Type Safety - Never use explicit `any`; use `unknown` and narrow before use. [B] - Use `unknown` for values of uncertain type to force callers to narrow. [B] - Restrict type assertions to proven-safe patterns only. [B] - Do not use the `!` non-null assertion operator; use proper null checks. [B] - Require explicit boolean comparisons; no truthy/falsy shortcuts. [B] - Type catch clause variables as