typescript-guardian
Skill26 starsChanged 4 months agoMITView on GitHub
Focuses 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.
In this repository119 other files it gives its agents.
- adr-writerSkill
- architecture-reviewerSkill
- cache-strategy-plannerSkill
- cost-optimization-auditorSkill
- cqrs-event-sourcing-designerSkill
- disaster-recovery-plannerSkill
- event-driven-architectSkill
- feature-flag-lifecycle-managerSkill
- migration-plannerSkill
- multi-tenant-data-partitionerSkill
- project-plannerSkill
- rate-limiting-architectSkill
- tech-debt-assessorSkill
- zero-downtime-migration-plannerSkill
- api-designerSkill
- bug-hunterSkill
- code-reviewerSkill
- concurrency-race-detectorSkill
- database-architectSkill
- dependency-auditorSkill
- error-handling-architectSkill
- graphql-schema-designerSkill
- legacy-code-refactorerSkill
- memory-leak-detectorSkill
- microservices-boundary-definerSkill
- performance-auditorSkill
- pr-reviewerSkill
- refactor-expertSkill
- resilience-circuit-breaker-designerSkill
- security-auditorSkill
- sql-query-optimizerSkill
- state-machine-designerSkill
- websocket-protocol-designerSkill
- adr-generatorSkill
- changelog-generatorSkill
- codebase-glossary-builderSkill
- commit-message-expertSkill
- contributor-guide-writerSkill
- documentation-writerSkill
- executive-summary-writerSkill
- readme-builderSkill
- release-notes-writerSkill
- rfc-proposal-writerSkill
- runbook-generatorSkill
- sdk-getting-started-writerSkill
- status-update-writerSkill
- ci-cd-pipeline-optimizerSkill
- context-window-optimizerSkill
- git-conflict-resolverSkill
- interview-question-generatorSkill
- meeting-notes-distillerSkill
- monorepo-workflow-architectSkill
- onboarding-guide-generatorSkill
- on-call-handover-writerSkill
- prompt-enhancerSkill
- retro-facilitatorSkill
- task-breakdown-assistantSkill
- tech-debt-burndown-plannerSkill
- cognitive-bias-detectorSkill
- decision-makerSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Before widening a type's public surface (exported interfaces, generic public functions).
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

