agentleFS
hawkyrehawkyre/hawk-skills/skills/remove-code/SKILL.md

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.

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
  1. Distinctive:

    Trace dependencies: before deleting anything:

    line 12
  2. Distinctive:

    All references to the functionality across the codebase

    line 14
  3. Distinctive:

    Update imports, exports, index files

    line 25
  4. Distinctive:

    Remove or update related tests

    line 26
  5. Distinctive:

    Run the project's check command

    line 29
  6. Distinctive:

    Always verify with a full check run after deletion

    line 35
  7. Distinctive:

    Do deletion in its own PR, separate from any new feature work

    line 36
  8. Very specific:

    Check .agents/common-mistakes/ for any removal-specific patterns before executing

    line 37

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Remove Code

Process

  1. Understand the capability to remove (not just files): What user-facing or internal capability is being removed?
  2. 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
  3. Present the trace: List everything to delete and everything to modify, grouped by file. Wait for user review.
  4. Execute deletion:

    • Fully dead files: delete
    • Partially dead files: remove only dead parts
    • Update imports, exports, index files
    • Remove or update related tests
  5. 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, then rg -n '<pattern>' /tmp/hawk-remove-code-<step>.log | head -50 extracts what you need. Read only the required lines from the file. See README → Big-output discipline.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.