dead
Skill2 starsChanged 35 days agoApache-2.0View on GitHub
Detect and remove unused code across Go and web. USE WHEN diff is substantive (>30 LoC), after implementing a feature, when /go-strict requests dead-code audit, when Stop hook flags Cleanup-opportunities, or when user asks 'is anything unused' or 'clean up dead code'. Runs `mise run dead` (Go reachability) + `pnpm exec knip` (web unused exports/files/deps) + reports a unified punch list. NOT FOR active development , only after a feature lands.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 12-principles-of-animationSkill
- aip-namingSkill
- architectSkill
- babysit-abortSkill
- babysit-prSkill
- babysit-tickSkill
- baseline-uiSkill
- commit-pushSkill
- complex-refactorSkill
- critiqueSkill
- devstackSkill
- go-backendSkill
- goSkill
- go-strictSkill
- greptileSkill
- impl-checkSkill
- inspect-dbSkill
- inspect-deploySkill
- inspect-runtimeSkill
- interaction-designSkill
- issue-planSkill
- lessonsSkill
- mergeSkill
- new-resourceSkill
- plan-featureSkill
- preflightSkill
- pr-reviewSkill
- review-fixSkill
- reviewSkill
- shipSkill
- simplifySkill
- task-execution-protocolSkill
- teamSkill
- tui-component-browserSkill
- tui-design-labSkill
- tui-designSkill
- verifySkill
- wrap-upSkill
- write-docsSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
After a feature lands (>30 LoC) and before opening a PR
- Very specific: line 14
When /go-strict reports Cleanup-opportunities
- Very specific: line 15
When Stop hook's last-check.md shows unreachable-code warnings
- Very specific: line 16
When the user types /dead or asks "anything unused?"
- Very specific: line 57
Only after explicit "apply X, Y, Z" from the user.
- Distinctive: line 64
Remove "almost dead" code that has one caller in a test file (often legitimate)
- Distinctive: line 65
Remove proto-generated unused types (regenerate the proto instead)
- Very specific: line 79
Stop hook , writes unreachable-code findings to .claude/last-check.md Cleanup-opportunities
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
/dead , Unified dead-code detection
Detect and report unused code in one pass across both backends. Apply surgical cuts only after user confirmation.
When to invoke
- After a feature lands (>30 LoC) and before opening a PR
- When
/go-strictreports Cleanup-opportunities - When Stop hook's
last-check.mdshows unreachable-code warnings - When the user types
/deador asks "anything unused?"
How it runs
Step 1 , Scope detection
git diff --name-only HEADBucket files:
- Go changes → run
mise run dead(deadcode reachability scan) - Web changes under
web/→ runpnpm exec knip(unused exports + files + deps)
Skip if neither surface changed.
Step 2 , Run scans in parallel
| Tool | Command | What it finds |
| deadcode | mise run dead (from repo root) | Unreachable Go functions/methods |
| knip | cd web && pnpm exec knip | Unused exports, files, dependencies, types in TS/TSX |
Both are read-only , they only report, never modify.
Step 3 , Report
Unified table:
File | Symbol / Export | Type | Recommendation
internal/kernel/navigate/walk.go:142 | listOrphanedEdges | function | delete , no callers
web/src/lib/format-priority.ts:1 | (entire file) | file | delete , no imports
web/src/components/legacy/old-card.tsx| OldCard | export | delete , superseded by Card
go.mod / package.json | unused dep: lodash | dep | run pnpm rm lodashSum the LoC saved estimate. Ask user which cuts to apply.
Step 4 , Apply selected cuts surgically
Only after explicit "apply X, Y, Z" from the user. Each cut is a separate Edit. Verify with go build ./... (for Go) or # (no frontend) (for web) after each batch.
What this skill deliberately does NOT do
- Apply cuts without user approval
- Touch generated code (
gen/,web/src/gen/) - Modify audit log code (append-only, compliance-protected)
- Remove "almost dead" code that has one caller in a test file (often legitimate)
- Remove proto-generated unused types (regenerate the proto instead)
Gotchas
- knip false-positives on Next.js dynamic routes: pages under
app/[param]/page.tsxlook unused but are entry points. Theweb/knip.jsonconfig lists these asentry:. If knip flags one, check the config first. - deadcode misses RPC handlers: methods registered via reflection (MCP tool registration) aren't always reachable from
main. Cross-check withgrep -r "MethodName" internal/api/before deleting. init()functions can hide live code: deadcode treats init as a root. If you delete a file with only init-side-effect code, the side effect disappears silently.- Tests don't anchor production code: a function only called by
_test.gois still considered dead by deadcode. Decide case-by-case , sometimes it's a helper meant for both. - knip's
--include-entry-exportsmatters: by default knip won't flag exports from entry files. If a re-export inindex.tsis unused, knip needs--include-entry-exportsto see it.
Pairs well with
/simplify, dead code is one of simplify's 4 audit dimensions/go-strict, invokes/deadinside its auto-iteration loop- Stop hook , writes unreachable-code findings to
.claude/last-check.mdCleanup-opportunities
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.

