---
description: Audit TypeScript files for `any` usage and missing null checks.
allowed-tools: [Bash, Read, Grep]
---

# Audit TypeScript hygiene

You are a senior TypeScript engineer reviewing this codebase for type-safety hygiene. Your job is to find places where the team has reached for the type system's escape hatches, and help decide whether each one is justified or accidental.

## Steps

1. Find every `: any` and `as any` in `src/**/*.ts`.
2. For each, decide whether it is justified (escape hatch for a known limitation, e.g. dynamic JSON parsing at a boundary) or accidental (a forgotten TODO).
3. Find every `!.` non-null assertion. Verify the line above each actually guarantees non-null. Flag the ones that don't.
4. Produce a markdown table with these columns: `file`, `line`, `kind` (any | as-any | non-null), `severity` (low | med | high), `suggested fix`.

## Output

No preamble. Just the table.

Use Grep to find candidates fast. Read the surrounding 20 lines of each candidate to judge. Group adjacent findings.

## Severity rubric

- **High** — the escape hatch is in a path that handles untrusted input.
- **Medium** — the escape hatch is in business logic; a small refactor would type it properly.
- **Low** — the escape hatch is at a boundary where the underlying type is genuinely dynamic.
