audit-type-safety
Skill4 starsChanged 2 months agoMITView on GitHub
Audit TypeScript codebases for type-safety bypasses and weak typing. Use when reviewing TS or TSX files for any, untyped function signatures, unchecked external data, ts-ignore or ts-expect-error comments without justification, generated code that bypasses the type system, or launch readiness.
In this repository25 other files it gives its agents.
- audit-asset-pipelineSkill
- audit-auth-and-access-controlSkill
- audit-corsSkill
- audit-database-performanceSkill
- audit-input-validationSkill
- audit-rate-limitingSkill
- audit-resilience-and-observabilitySkill
- audit-secrets-and-configSkill
- ios-prelaunch-checklistSkill
- security-reviewSkill
- code-review-loopSkill
- error-logging-reviewSkill
- hive-parallel-review-loopSkill
- hive-review-loopSkill
- input-contract-hardeningSkill
- microskills-review-generatorSkill
- microskills-review-runnerSkill
- parallel-code-review-loopSkill
- perf-optimizationSkill
- parallel-plan-implementationSkill
- phase-commit-reviewerSkill
- product-implementation-plannerSkill
- product-plan-compilerSkill
- test-quality-reviewSkill
- verified-commit-splitSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Read tsconfig files and package scripts.
- Very specific: line 14
Check strictness settings such as strict, noImplicitAny, strictNullChecks, noUncheckedIndexedAccess, and exactOptionalPropertyTypes.
- Distinctive: line 15
Run the repository's typecheck command if available and practical.
- Very specific: line 18
Treat @ts-expect-error without a clear nearby explanation as a finding.
- Distinctive: line 21
Prefer runtime parsing/validation at boundaries and typed internal values after parsing.
- Distinctive: line 23
Look for generated directories, comments, broad casts, untyped helpers, or large code additions that disabled checks.
- Distinctive: line 30
Use fast searches such as:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Audit Type Safety
Find TypeScript code paths where the type system was bypassed or weakened enough to hide real defects.
Workflow
- Establish the compiler baseline:
- Read
tsconfigfiles and package scripts. - Check strictness settings such as
strict,noImplicitAny,strictNullChecks,noUncheckedIndexedAccess, andexactOptionalPropertyTypes. - Run the repository's typecheck command if available and practical.
- Read
- Search for bypasses:
- Explicit
any, implicit any from untyped parameters, unsafe casts, double casts throughunknown,as any, non-null assertions, disabled lint rules, and@ts-ignoreor@ts-expect-error. - Treat
@ts-expect-errorwithout a clear nearby explanation as a finding.
- Explicit
- Review external data boundaries:
- API responses, server request bodies, JSON parsing, storage reads, environment variables, feature flags, URL params, and third-party SDK data.
- Prefer runtime parsing/validation at boundaries and typed internal values after parsing.
- Review AI-generated or copied code paths:
- Look for generated directories, comments, broad casts, untyped helpers, or large code additions that disabled checks.
- Flag places where generated code accepts unvalidated data or erases types.
- Prioritize by blast radius:
- Shared utilities, API clients, auth/payment code, data models, and user-input paths rank above isolated UI glue.
Useful Searches
Use fast searches such as:
rg -n "\bany\b|as any|@ts-ignore|@ts-expect-error|eslint-disable|// @ts-|unknown as|!\." --glob '*.{ts,tsx}'
rg -n "function [^(]+\([^)]*\)|=>|JSON\.parse|fetch\(" --glob '*.{ts,tsx}'Tune searches to the repository to avoid noise.
Output
Group findings by category:
- Compiler configuration gaps.
- Explicit type bypasses.
- Untyped public/shared function signatures.
- Unchecked external data.
- Generated or copied code bypasses.
Each finding must include file and line, why the type checker cannot protect the code, a concrete safer type or parser pattern, and whether an automated typecheck/lint rule can prevent recurrence.
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.

