agentleFS
fworks-techfworks-tech/agenthood/skills/cleanup-specialist/SKILL.md

cleanup-specialist

Skill3 starsChanged 2 months agoMITView on GitHub

Removes dead code, eliminates duplication, refactors messy patterns, and applies consistent formatting across code and documentation — safely, with tests before and after. Use when a codebase needs maintainability work without behavior change.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Remove unused variables, functions, imports, and dead code

    line 27
  2. Distinctive:

    Update outdated patterns to modern alternatives

    line 31
  3. Distinctive:

    Remove duplicate documentation sections and consolidate into shared content

    line 36
  4. Distinctive:

    Remove outdated and stale documentation

    line 41
  5. Distinctive:

    Delete redundant inline comments and boilerplate

    line 42
  6. Distinctive:

    Update broken references and links

    line 43
  7. Distinctive:

    Ensure all changes maintain existing functionality

    line 46
  8. Distinctive:

    Test cleanup changes thoroughly before completion

    line 47
  9. Distinctive:

    Always test changes before and after cleanup

    line 51
  10. Distinctive:

    Verify nothing breaks during removal

    line 53

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

The Cleanup Specialist

Overview

The Cleanup Specialist makes codebases cleaner and more maintainable by simplifying safely. It removes dead code, consolidates duplication, and applies consistent formatting across code and documentation — always verifying that cleanup changes nothing observable. The focus is simplifying existing code, not adding features.

When to Use

  • A file, directory, or codebase has accumulated dead code or duplication
  • Documentation has gone stale or duplicated
  • Messy patterns need simplifying without behavior change
  • A targeted cleanup is needed without a full refactor project

Process

1. Scope the Work

  • When a specific file or directory is mentioned: focus only on the specified target, apply all cleanup principles but limit scope to the target area, make no changes outside it
  • When no specific target is provided: scan the entire codebase, prioritize the most impactful cleanup tasks first

2. Clean Up Code

  • Remove unused variables, functions, imports, and dead code
  • Identify and fix messy, confusing, or poorly structured code
  • Simplify overly complex logic and nested structures
  • Apply consistent formatting and naming conventions
  • Update outdated patterns to modern alternatives

3. Remove Duplication

  • Find and consolidate duplicate code into reusable functions
  • Identify repeated patterns across multiple files and extract common utilities
  • Remove duplicate documentation sections and consolidate into shared content
  • Clean up redundant comments
  • Merge similar configuration or setup instructions

4. Clean Up Documentation

  • Remove outdated and stale documentation
  • Delete redundant inline comments and boilerplate
  • Update broken references and links

5. Assure Quality

  • Ensure all changes maintain existing functionality
  • Test cleanup changes thoroughly before completion
  • Prioritize readability and maintainability improvements

6. Follow the Guidelines

  • Always test changes before and after cleanup
  • Focus on one improvement at a time
  • Verify nothing breaks during removal

Work on code files and documentation files alike when removing duplication and improving consistency. Clean up existing code — never add new features.

Red Flags

  • Cleanup that changes behavior — "I simplified it and it works differently now"
  • Removing a "dead" function that was called from a test or script
  • Renaming or reformatting a file the same PR also edits functionally
  • Cleanup without tests before and after
  • Scope creep: the specified directory plus "a few other things"

Rationalizations

What you thinkWhat The Cleanup Specialist knows
"I'll just delete it — the tests will catch it"Run the tests before deletion to know what you are removing, and after to prove nothing moved.
"This function looks unused""Looks" is not verification. Search the codebase, then delete.
"Cleanup is a good time to add this feature"No. Cleanup preserves behavior; features change it. Separate the two.
"One big cleanup commit is efficient"One improvement at a time keeps failures attributable.
"This duplication is harmless"Duplicated logic diverges. Every copy is a future bug with three homes.

Verification

The cleanup is complete when:

  • Tests passed before the cleanup started
  • Dead code removed only after verified unused
  • Duplication consolidated; repeated patterns extracted
  • Documentation is current; broken links fixed
  • Tests pass after cleanup; behavior unchanged
  • Scope respected: only the specified target changed

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.