remove-code
Skill30 starsChanged 2 months agoMITView on GitHub
Remove a feature, delete dead code, drop a dependency, or simplify an abstraction. Use when the user wants to delete or clean up code.
In this repository20 other files it gives its agents.
- capSkill
- code-audit-hardcoreSkill
- code-auditSkill
- coding-processSkill
- design-hierarchySkill
- design-masterSkill
- design-windowSkill
- evaluate-skillSkill
- fix-bugSkill
- human-proseSkill
- implement-plan-auditedSkill
- implement-planSkill
- init-phoenixSkill
- learn-systemSkill
- plan-largeSkill
- plan-smallSkill
- refactorSkill
- review-large-prSkill
- review-planSkill
- write-agentSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Trace dependencies: before deleting anything:
- Distinctive: line 14
All references to the functionality across the codebase
- Distinctive: line 25
Update imports, exports, index files
- Distinctive: line 26
Remove or update related tests
- Distinctive: line 29
Run the project's check command
- Distinctive: line 35
Always verify with a full check run after deletion
- Distinctive: line 36
Do deletion in its own PR, separate from any new feature work
- Very specific: line 37
Check .agents/common-mistakes/ for any removal-specific patterns before executing
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Remove Code
Process
- Understand the capability to remove (not just files): What user-facing or internal capability is being removed?
Trace dependencies before deleting anything:
- All references to the functionality across the codebase
- Code that ONLY exists to support this feature (can be fully deleted)
- Code that is SHARED with other features (must be preserved)
- Database migrations, config entries, env vars, feature flags, documentation that reference it
- Present the trace: List everything to delete and everything to modify, grouped by file. Wait for user review.
Execute deletion:
- Fully dead files: delete
- Partially dead files: remove only dead parts
- Update imports, exports, index files
- Remove or update related tests
- Verify:
- Run the project's check command
- Grep for remaining references to removed code (function names, class names, route paths, config keys) — there are always stragglers
Rules
- Describe the CAPABILITY being removed, not files — this finds things you forgot about
- Always verify with a full check run after deletion
- Do deletion in its own PR, separate from any new feature work
- Check
.agents/common-mistakes/for any removal-specific patterns before executing - Big-output discipline. Heavy command output (project check, full
git diff, repo-wide search, long log, large fetch) goes to/tmp/hawk-remove-code-<step>.log, thenrg -n '<pattern>' /tmp/hawk-remove-code-<step>.log | head -50extracts what you need. Read only the required lines from the file. See README → Big-output discipline.
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.

