Codebase Litter Audit
Codex Compatibility
When running this skill in Codex, translate Claude Code-only primitives before acting: AskUserQuestion -> chat/request_user_input, TodoWrite -> update_plan, Task/TaskCreate/TeamCreate/SendMessage -> spawn_agent/send_input/wait_agent when available and allowed, and EnterPlanMode/ExitPlanMode -> a concise chat plan plus explicit approval.
Resolve Read/Write/Edit/Bash/WebSearch/WebFetch to Codex file/shell/web tools, and map ~/.claude/... paths to ~/.agents/... or ~/.codex/... unless the task explicitly targets Claude Code.
Cursor Compatibility
When running this skill in Cursor Agent, translate Claude Code-only primitives before acting: AskUserQuestion -> AskQuestion; TodoWrite -> Cursor TodoWrite or an equivalent checklist; Task/TaskCreate/TeamCreate/SendMessage/multi-agent flows -> Cursor Task (subagents), parallel Tasks, or run_in_background when allowed (TeamCreate/SendMessage may have no exact match); EnterPlanMode/ExitPlanMode -> Plan mode (SwitchMode / CreatePlan) plus explicit approval.
Resolve Read/Write/Edit/StrReplace/Bash/web/search/MCP via Cursor Composer or Agent equivalents. MCP names written as mcp__server__tool typically map to call_mcp_tool with configured server identifiers. Map ~/.claude/... to ~/.cursor/skills/, .cursor/skills/, and .cursor/rules/ unless the task explicitly targets Claude Code.
Overview
Find incomplete or misleading work that is still reachable, visible, or confusing even when dead-code scanners report nothing. Treat the scanner as a lead generator, then verify each finding by reading neighboring code, tests, docs, and issue tracker context.
Workflow
Establish scope.
- Run
git status --short and note whether the worktree is dirty.
- Identify the repo root and primary tracker (
gh issue list when GitHub is configured).
- Do not edit files unless the user explicitly asks for cleanup.
Collect candidate signals.
- Prefer the bundled scanner:
python3 ~/.codex/skills/codebase-litter-audit/scripts/scan_litter.py . --markdown
- If the repo is huge, pass focused paths after the repo root:
--include src --include e2e.
- Supplement with
rg for domain words the scanner cannot infer, such as feature names, issue IDs, or product terminology.
Verify candidates manually.
- Read the candidate line and nearby code.
- Trace one call site, UI surface, test, or doc reference before calling it real.
- Search for later migrations, docs, PRs, or issues that may supersede an old TODO.
- Classify stale comments separately from active defects.
Report with evidence.
- Lead with high-confidence, user-visible, or security-relevant litter.
- Anchor every claim to a clickable file path and line.
- Include severity as
High, Medium, or Low.
- State the smallest cleanup path: remove UI, implement behavior, unskip/replace test, update docs, or close as stale.
- Mention likely duplicate/open issues if found.
What Counts
Use references/signal-catalog.md when deciding whether a candidate is worth reporting.
Strong signals:
- Visible commands, routes, buttons, menus, settings, or CLI options wired to stubs or no-op handlers.
TODO, FIXME, not implemented, stub, temporary, or WIP attached to reachable product code.
- Tests skipped for real product behavior, especially persistence, auth, security, data loss, or critical flows.
- Comments or docs that contradict later code, migrations, or configuration.
- Placeholder assets or copy that can ship to users.
- Suppressions such as
eslint-disable, ts-ignore, @ts-expect-error, or broad ignores with no issue link or expiry.
Weak signals:
- Example text in stories/tests.
- Placeholder attributes in normal forms.
- Historical migration comments already superseded by a later migration.
- Generated files, lockfiles, vendored code, or
.git hook samples.
Output Template
## Codebase Litter Audit
### Findings
- **Medium: <short title>**
Evidence: [file.ts](/abs/path/file.ts:12)
Why it matters: <reachable/visible/confusing behavior>
Smallest cleanup: <implement/remove/document/issue>
### Probably Benign
- <candidate that looked suspicious but was superseded or test-only>
### Suggested Issues
- <one issue per actionable cleanup, with labels if the tracker supports them>
Bundled Resources
scripts/scan_litter.py: candidate scanner that emits Markdown or JSON.
references/signal-catalog.md: classification guide for deciding what is real litter versus normal code.
1---2name: codebase-litter-audit3description: Find unfinished code litter4---56# Codebase Litter Audit78## Codex Compatibility9When running this skill in Codex, translate Claude Code-only primitives before acting: `AskUserQuestion` -> chat/request_user_input, `TodoWrite` -> `update_plan`, `Task`/`TaskCreate`/`TeamCreate`/`SendMessage` -> `spawn_agent`/`send_input`/`wait_agent` when available and allowed, and `EnterPlanMode`/`ExitPlanMode` -> a concise chat plan plus explicit approval.10Resolve `Read`/`Write`/`Edit`/`Bash`/`WebSearch`/`WebFetch` to Codex file/shell/web tools, and map `~/.claude/...` paths to `~/.agents/...` or `~/.codex/...` unless the task explicitly targets Claude Code.1112## Cursor Compatibility13When running this skill in Cursor Agent, translate Claude Code-only primitives before acting: `AskUserQuestion` -> `AskQuestion`; `TodoWrite` -> Cursor `TodoWrite` or an equivalent checklist; `Task`/`TaskCreate`/`TeamCreate`/`SendMessage`/multi-agent flows -> Cursor `Task` (subagents), parallel Tasks, or `run_in_background` when allowed (`TeamCreate`/`SendMessage` may have no exact match); `EnterPlanMode`/`ExitPlanMode` -> Plan mode (`SwitchMode` / `CreatePlan`) plus explicit approval.14Resolve `Read`/`Write`/`Edit`/`StrReplace`/`Bash`/web/search/MCP via Cursor Composer or Agent equivalents. MCP names written as `mcp__server__tool` typically map to `call_mcp_tool` with configured server identifiers. Map `~/.claude/...` to `~/.cursor/skills/`, `.cursor/skills/`, and `.cursor/rules/` unless the task explicitly targets Claude Code.1516## Overview1718Find incomplete or misleading work that is still reachable, visible, or confusing even when dead-code scanners report nothing. Treat the scanner as a lead generator, then verify each finding by reading neighboring code, tests, docs, and issue tracker context.1920## Workflow21221. Establish scope.23 - Run `git status --short` and note whether the worktree is dirty.24 - Identify the repo root and primary tracker (`gh issue list` when GitHub is configured).25 - Do not edit files unless the user explicitly asks for cleanup.26272. Collect candidate signals.28 - Prefer the bundled scanner:2930```bash31python3 ~/.codex/skills/codebase-litter-audit/scripts/scan_litter.py . --markdown32```3334 - If the repo is huge, pass focused paths after the repo root: `--include src --include e2e`.35 - Supplement with `rg` for domain words the scanner cannot infer, such as feature names, issue IDs, or product terminology.36373. Verify candidates manually.38 - Read the candidate line and nearby code.39 - Trace one call site, UI surface, test, or doc reference before calling it real.40 - Search for later migrations, docs, PRs, or issues that may supersede an old TODO.41 - Classify stale comments separately from active defects.42434. Report with evidence.44 - Lead with high-confidence, user-visible, or security-relevant litter.45 - Anchor every claim to a clickable file path and line.46 - Include severity as `High`, `Medium`, or `Low`.47 - State the smallest cleanup path: remove UI, implement behavior, unskip/replace test, update docs, or close as stale.48 - Mention likely duplicate/open issues if found.4950## What Counts5152Use `references/signal-catalog.md` when deciding whether a candidate is worth reporting.5354Strong signals:55- Visible commands, routes, buttons, menus, settings, or CLI options wired to stubs or no-op handlers.56- `TODO`, `FIXME`, `not implemented`, `stub`, `temporary`, or `WIP` attached to reachable product code.57- Tests skipped for real product behavior, especially persistence, auth, security, data loss, or critical flows.58- Comments or docs that contradict later code, migrations, or configuration.59- Placeholder assets or copy that can ship to users.60- Suppressions such as `eslint-disable`, `ts-ignore`, `@ts-expect-error`, or broad ignores with no issue link or expiry.6162Weak signals:63- Example text in stories/tests.64- Placeholder attributes in normal forms.65- Historical migration comments already superseded by a later migration.66- Generated files, lockfiles, vendored code, or `.git` hook samples.6768## Output Template6970```markdown71## Codebase Litter Audit7273### Findings7475- **Medium: <short title>**76 Evidence: [file.ts](/abs/path/file.ts:12)77 Why it matters: <reachable/visible/confusing behavior>78 Smallest cleanup: <implement/remove/document/issue>7980### Probably Benign8182- <candidate that looked suspicious but was superseded or test-only>8384### Suggested Issues8586- <one issue per actionable cleanup, with labels if the tracker supports them>87```8889## Bundled Resources9091- `scripts/scan_litter.py`: candidate scanner that emits Markdown or JSON.92- `references/signal-catalog.md`: classification guide for deciding what is real litter versus normal code.