fallow-audit
Skill4 starsChanged 5 days agoMITView on GitHub
Dead-code / unused-export / unused-dependency cleanup via static analysis (fallow, knip, ts-prune, depcheck). Verifies tool output before deleting; handles cascades; zero orphans. Use: 'run fallow', 'remove unused files/deps/types'. NOT correctness review (→ ponytail review mode) or bug fixing (→ systematic-debugging).
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- archifySkill
- authSkill
- brainstormingSkill
- browser-toolsSkill
- code-reviewerSkill
- documentation-writerSkill
- frontend-designSkill
- github-actionsSkill
- grill-meSkill
- harness-engineerSkill
- impeccableSkill
- linkedinSkill
- map-integrationSkill
- pidocSkill
- playwright-testerSkill
- ponytailSkill
- refactoring-uiSkill
- rust-skillsSkill
- sdk-developmentSkill
- self-learnSkill
- session-auditSkill
- skill-managerSkill
- systematic-debuggingSkill
- web-searchSkill
The file
Files
Audit (dead-code cleanup)
Static analyzers miss non-import refs, over-flag. Report = lead list, not delete list.
fallow command map (prefer over grep when present)
npx fallow dead-code— unused files/exports/types/enum+class members/deps + circular depsnpx fallow dead-code --trace src/file.ts:symbol— prove symbol unused before deletingnpx fallow fix --dry-run— preview auto-fixes; don't apply blindly (fixbroader than task)npx fallow audit— changed-file gate; legacy findings excluded by designnpx fallow recommend— starter config (generated code false positives →ignorePatterns)- Exit codes: 0 + 1 = success (1 = findings); 2 = real error. Never
|| true. - First-run findings usually = missing entry point / framework convention / generated files, not dead code.
Workflow
- Run tool, sanity-check BEFORE deleting. Spot-check flagged deps vs config usage (next.config, tailwind, postcss, PM2/compose) — zero imports does not mean unused: grep the package name through the whole build config, webpack
rules/loaderstrings included, not just top-level keys. Inverse too: imported-but-missing packages get added. - Delete in tiers: unreachable files → unused deps (incl. newly-orphaned Radix peers) → duplicate exports (consolidate only verbatim-identical) → unused type/value exports. Derived exports (RTK Query hooks, generated selectors, barrel re-exports) are wrappers: the flagged export is not the dead code — delete the source definition (endpoint, generator entry) too, after proving no test dispatches it directly.
- Non-import ref check (tool can't):
rg -F '<deleted filename>'repo-wide. Check dynamicimport(), icon barrels, docker/compose/PM2 configs. Deleting a file or endpoint → sweep__tests__ortestsfor tests targeting it (component tests, endpoint-dispatch tests); unresolved-import findings catch some, not all. Complete output only:rg -c/wc -l, never| head— truncation fakes a clean sweep. Comment/doc hits = acceptable, note. Never delete deploy/CI config. - Cascades: delete → re-run tool → handle newly-orphaned consumers (types-only-used-by-deleted-types, barrel entries, single-export files) → repeat until clean. Two blind spots both gates miss:
ts-nocheckor lint-ignored files hide orphaned imports — after removing definitions, rg the touched file's own imports; and config-object keys (endpoint/URL constants) lose consumers silently (analyzers flag exports, not object keys) — sweep config files, verify each key's remaining users before removing it. - Scripted bulk edits dangerous: after EVERY script run
tsc --noEmit+ lint (no tsc JSX/TS project →esbuild --loader:.jsx=jsx file --outfile=/dev/nullper touched file), review full diff — scripts eat adjacent declarations, leave orphaned union bodies, JSXstr.replacenests/duplicates tags. Never declare success from regex count; parse or render. Restore wrong removals from git. - Orphan sweep (zero-orphan guarantee): scan touched files for JSDoc
/** */+ section comments describing deleted declarations; cross-check survivors. Read before removing — file-header docs followed by blanks = false positives. - Gate:
tsc --noEmitclean- lint 0 new issues
- production build succeeds
- deleted-name string scan clean
- modified-file diffs = deletions/re-sourcing only, no semantic change
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.

