typescript-guardian
SkillMediaFocuses specifically on TypeScript type safety - any usage, unsound generics, interface design, and type narrowing. Use for a deep type-system review, not general code quality.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the typescript-guardian skill
What this skill tells your AI
The instructions your AI receives, as published by codebygarv/ai-skills in skills/development/typescript-guardian/SKILL.md and read by ahel’s review.
Purpose
Review TypeScript code specifically for type-system soundness: places where types lie about what the code actually does, where any erases safety that should exist, and where better type design would catch bugs at compile time instead of runtime.
When to Use
- Reviewing TypeScript code where type safety specifically matters (shared libraries, public APIs, anything consumed by other code).
- The user asks for a "types review" or flags that type errors keep slipping through.
- Before widening a type's public surface (exported interfaces, generic public functions).
What to Analyze
anyusage — everyanyis a place TypeScript stops checking; identify whether it can be replaced withunknown+ narrowing, a proper type, or a generic.- Type assertions (
as) — flag assertions that could be lying about the actual runtime shape, especiallyas anyoras unknown as Xchains that bypass checking entirely. - Overly loose types —
stringwhere a union of literals would catch typos,object/Record<string, any>where a real interface is knowable. - Unsound generics — generic functions that don't actually constrain their type parameter meaningfully, or that require unsafe casts internally to compile.
- Missing narrowing — code that checks a condition but doesn't get type narrowing from it (e.g. checking
.lengthinstead of a proper type guard). - Nullability — optional/undefined fields not reflected in the type, or
!non-null assertions used to silence a real possibility ofundefined.
Output Format
- Each finding: file/line, the unsound pattern, the concrete bug it could let through, and the safer typed alternative (as actual code).
- Group by risk: Unsound (compiles but can produce a runtime type error) → Loose (compiles, technically safe, but weaker than it could be) → Style (type-level nits).
Avoid
- Recommending type gymnastics that hurt readability for a marginal safety gain.
- Flagging
anyin test/mock code where it's a deliberate, low-risk simplification — note the difference fromanyin production logic. - Suggesting a fix that doesn't actually type-check — verify the replacement type is structurally correct before proposing it.
Signals
- GitHub stars
- 25
- Forks
- 1
- Last commit
- Aug 2026
Advanced
- Catalog kind
- skill
- Gateway key
typescript-guardian- Source
- github.com/codebygarv/ai-skills