last update
Apr 25, 2026
license
Apache-2.0v1.0.0
format
SKILL.md
- Install
// Downloads SKILL.md into ~/.claude/skills/typescript-strict-coder/
$ curl -fsSL --create-dirs -o ~/.claude/skills/typescript-strict-coder/SKILL.md https://claudeskil.com/skills/typescript-strict-coder/SKILL.md - Invoke
// Inside Claude Code, type the skill name as a slash command
> /typescript-strict-coder give my landing page a hero treatment - Or copy this from the README
// extracted ts block
$ // Before: silently unsafe function getValue(obj, key) { return obj[key]; } // After: inference-preserving generic function getValue<T, K extends keyof T>(obj: T, key: K): T[K] { return obj[key];
- name:
- TypeScript Strict Mode Expert
- slug:
- typescript-strict-coder
- version:
- v1.0.0
- license:
- Apache-2.0
- author:
- @chiragthummar16
- categories:
- tags:
- #typescript#strict-mode#generics#type-safety#javascript
- description:
Enforce strict TypeScript: generics, utility types, discriminated unions, and type guards.
README.md
TypeScript Strict Mode Expert
A focused assistant for getting a codebase to compile cleanly under "strict": true — and stay there. It migrates JavaScript to typed TypeScript, hunts down any, and writes the generics, conditional types, and discriminated unions that the compiler needs to actually catch your bugs. Aimed at teams flipping the strict flag on an existing project, library authors shipping .d.ts files, and anyone tired of as any escape hatches.
When to use it
- You set
"strict": trueandtscnow reports hundreds of errors you need triaged and fixed. - A function takes
anyand you want a real generic signature with proper inference. - You're modeling state (loading / success / error) and want a discriminated union plus exhaustive
switchchecks. - Migrating
.js/.jsxto.ts/.tsxincrementally withallowJsandcheckJs. - Third-party types are wrong or missing and you need a module augmentation or ambient declaration.
What it does
It works against your real tsconfig.json, enabling the flags that make up strict: strictNullChecks, noImplicitAny, strictFunctionTypes, strictPropertyInitialization, and friends, plus useful add-ons like noUncheckedIndexedAccess and exactOptionalPropertyTypes. Fixes are driven by tsc --noEmit diagnostics, so changes are verified against the compiler rather than guessed.
On the type side it reaches for utility types (Partial, Pick, Omit, Record, ReturnType, Awaited), infer in conditional types, mapped types with key remapping, satisfies for config objects, and user-defined type guards (x is Foo) plus assert signatures. For React it types props, hooks, refs, and event handlers; for Node it handles @types/node gaps and async return types.
Example
curl -fsSL --create-dirs -o ~/.claude/skills/typescript-strict-coder/SKILL.md https://claudeskil.com/skills/typescript-strict-coder/SKILL.md
// Before: silently unsafe
function getValue(obj, key) { return obj[key]; }
// After: inference-preserving generic
function getValue<T, K extends keyof T>(obj: T, key: K): T[K] {
return obj[key];
}
// Exhaustive discriminated union
type Result<T> =
| { status: "ok"; data: T }
| { status: "err"; error: Error };
function unwrap<T>(r: Result<T>): T {
switch (r.status) {
case "ok": return r.data;
case "err": throw r.error;
default: { const _x: never = r; return _x; } // compile error if a case is added
}
}
Tips & gotchas
- Turn on strictness flags one at a time (
strictNullChecksfirst) — flipping the wholestrictumbrella at once buries you in noise. noUncheckedIndexedAccessis not part ofstrict; enable it separately to catcharr[i]returningundefined.- Prefer
satisfiesoverasfor config objects — it validates without widening or erasing the literal type. strictPropertyInitializationneeds either an initializer, a constructor assignment, or the!definite-assignment marker.
FAQ
Will it just sprinkle any to silence errors? No — the goal is the opposite. It narrows with type guards, generics, or unions, and flags places where a genuine unknown is the honest type.
Can it handle a gradual migration? Yes. It works file-by-file using allowJs/checkJs and // @ts-expect-error markers so you can ship while migrating.
Does it cover wrong third-party types? It writes declaration merging, module augmentation, and ambient .d.ts overrides for libraries with missing or incorrect typings.
authored by
@chiragthummar16Android Jetpack Pro
Ship Jetpack Compose screens, ViewModels, and Gradle config with idiomatic best practices baked in.
0iOS SwiftUI Architect
Design SwiftUI apps with clean architecture: MV pattern, @Observable, and Swift Concurrency.
0PPT Deck Designer
Turn a rough outline into a visually polished pitch deck with on-brand layouts and speaker notes.
0Video Cut Assistant
Produce edit decision lists, trim plans, and subtitle cues from raw footage transcripts.
0
$ cat reviews/