agentleFS
metacircu1armetacircu1ar/hive_skills/skills/audit/audit-type-safety/SKILL.md

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.

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
  1. Very specific:

    Read tsconfig files and package scripts.

    line 13
  2. Very specific:

    Check strictness settings such as strict, noImplicitAny, strictNullChecks, noUncheckedIndexedAccess, and exactOptionalPropertyTypes.

    line 14
  3. Distinctive:

    Run the repository's typecheck command if available and practical.

    line 15
  4. Very specific:

    Treat @ts-expect-error without a clear nearby explanation as a finding.

    line 18
  5. Distinctive:

    Prefer runtime parsing/validation at boundaries and typed internal values after parsing.

    line 21
  6. Distinctive:

    Look for generated directories, comments, broad casts, untyped helpers, or large code additions that disabled checks.

    line 23
  7. Distinctive:

    Use fast searches such as:

    line 30

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Audit Type Safety

Find TypeScript code paths where the type system was bypassed or weakened enough to hide real defects.

Workflow

  1. Establish the compiler baseline:
    • Read tsconfig files and package scripts.
    • Check strictness settings such as strict, noImplicitAny, strictNullChecks, noUncheckedIndexedAccess, and exactOptionalPropertyTypes.
    • Run the repository's typecheck command if available and practical.
  2. Search for bypasses:
    • Explicit any, implicit any from untyped parameters, unsafe casts, double casts through unknown, as any, non-null assertions, disabled lint rules, and @ts-ignore or @ts-expect-error.
    • Treat @ts-expect-error without a clear nearby explanation as a finding.
  3. 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.
  4. 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.
  5. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.