Audit dimension - find code that is no longer used, via a reference census over every top-level symbol, one package per invocation. Invoked by dr-audit-orchestrator when dead.md is missing or has pending package rows.
Scanned 9/19/2026
Install to Claude Code
npx -y skills add AHepi/DeepReason --skill dr-audit-dead --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Dr Audit Dead?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/ahepi-dr-audit-dead)More formats (shields.io, HTML) on the badges page.
---
name: dr-audit-dead
description: Audit dimension - find code that is no longer used, via a reference census over every top-level symbol, one package per invocation. Invoked by dr-audit-orchestrator when dead.md is missing or has pending package rows.
---
# Audit: dead code
Entry: `LEDGER.md` exists; `dead.md` missing or contains a package
row marked `pending`. Exit for one invocation: ONE package's census
complete, its row flipped to `done`. The router re-invokes until no
`pending` rows remain (S1: the loop lives in the router).
On first invocation, write the package list into `dead.md`:
`ls -d src/deepreason/*/ src/deepreason/*.py`, one row each, all
`pending`.
## Operations (for the next pending package P)
1. Symbol census:
`rg -n '^(def|class) [A-Za-z_]' <P> --type py > proof/dead-<P>-symbols.txt`
2. For each symbol NAME, count referencing files outside its defining
file:
`rg -l -w 'NAME' src/ tests/ scripts/ tools/ | grep -v <defining-file>`
Hits ≥ 1 → verdict `referenced` (no LEDGER row; tally only).
Hits = 0 → step 2b.
2b. Intra-file use check (a symbol called only from its own file is
wired, not dead):
`rg -c -w 'NAME' <defining-file>`
Count ≥ 2 (the definition line plus at least one use) → verdict
`referenced`, note `intra-file` (tally only). Count = 1 → step 3.
3. String-reference scan (dynamic dispatch, registries, config
strings):
`rg -l "['\"]NAME['\"]" src/ tests/ scripts/ tools/`
Hits ≥ 1 → verdict `dynamic-ref`, row it with the hit file (these
are load-bearing but invisible to imports — worth a row, not a
prompt). Hits = 0 → step 4.
4. Entry-point scan: `rg -l 'NAME' pyproject.toml`. Hit → verdict
`entry-point`. No hit → verdict `candidate-dead`, row it,
disposition `parked`, both scan outputs saved to
`proof/dead-<id>.txt`.
5. Append the package's tally line to `dead.md`
(`P: S symbols, R referenced, D dynamic-ref, C candidate-dead`)
and flip its row to `done`.
## GATE
Pass for the invocation: the package row is `done`, its tally line
exists, and every `candidate-dead` row cites a proof file containing
BOTH empty scans (G2 — "dead" is only sayable with the two searches
pasted). Verdict labels: `referenced` | `dynamic-ref` |
`entry-point` | `candidate-dead`.
`candidate-dead` is the strongest claim this worker may make (X3).
Deletion needs a dr-change-orchestrator tranche; the PARKED prompt
says so and names the symbol, file, and proof.
## Activation plant (first run)
Row a symbol that step 2 provably finds referenced (pick any imported
name) as if it were a candidate; the GATE's proof-file check must
refuse the row (no empty-scan proof exists). Remove the planted row,
paste the refusal and the removal.
## Outlets
| Situation | Outlet |
|---|---|
| Impulse to delete now | PARK — removal prompt, route dr-change-orchestrator |
| Symbol used only by tests | verdict `referenced`, note `tests-only` in the row — parked prompt optional |
| Census too large for one window | flip the package back to `pending` with a `resume-at: NAME` note; the LEDGER carries the position |
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!