agentleFS
ekirtonekirton/Poule/.claude/skills/cleanup/SKILL.md

cleanup

Skill0 starsChanged 8 months agoApache-2.0View on GitHub

Find and remove dead code, orphaned tests, and unused modules left behind after spec changes, feature removals, or pivots. Walks the SDD layers top-down to identify code that no longer has upstream justification. Use after a pivot, feature removal, or when you suspect dead code exists.

75 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chips, react-query-best-practices and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • udecodeSkill

    chips

    Run the project's suggested-task ledger, the chips. /chips alone brings this session's open tasks up to date: it applies what the ledger helper says, settles stale and split tasks, cards what can start and reports the board, and /chips all also takes the ship-list tasks and the ones no live session owns, and merges duplicate tasks across the board. Use for /chips, /chips offer, start or drop, \"what chips are open\", \"suggest a task for X\", \"update the chips\", \"clean up the chips\", \"which chips are stale\", \"is this chip still worth doing\", \"merge duplicate chips\", at the last hand-back of a run that offered a task, and whenever pstack would file a tracked issue, a follow-up, a reflect Backlog item or an out-of-band PR.

    Also in 3 projects that use this

  • bibektimilsina00Skill

    react-query-best-practices

    Audit and fix React Query usage in apps/web — enforce query key factories, signal forwarding, staleTime, and proper mutation patterns. Use when reviewing or fixing server-state code.

    Also in 3 projects that use this

  • bibektimilsina00Skill

    you-might-not-need-a-callback

    Analyze and fix useCallback anti-patterns in your code

    Also in 3 projects that use this

  • Scylla23Skill

    redo

    Re-run the last routed task one model tier up (haiku → sonnet → opus → fable). User-invoked escalation when the previous result missed. Pass --dry-run to preview without running.

    Also in 3 projects that use this

  • Aetheria-Labs1Skill

    plan-page

    Plan one storefront page from strategy through final copy, section order, proof, offers, template direction, responsive layout, and production asset requirements. Stops at an approved execution-ready specification.

    Also in 3 projects that use this

  • SocialKit-APISkill

    video-transcripts

    Extract transcripts from social videos through SocialKit across YouTube, TikTok, Instagram, Facebook, X/Twitter, LinkedIn, and direct video file URLs. Use when the user asks to transcribe, get captions or subtitles, pull the spoken text, or read what a video says, including one video or many at once. Returns full text plus timestamped segments. Not for posting, private accounts, or unrelated website scraping.

    Also in 3 projects that use this

  • +3 more from bibektimilsina00

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 9 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 63 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the agent returns, compile the candidate list.

    line 17
  2. Distinctive:

    Not everything without a spec reference is dead — utilities, shared helpers, and infrastructure code may be used transitively.

    line 23
  3. Distinctive:

    If a candidate has live callers outside the dead-code set, remove it from the list.

    line 27
  4. Distinctive:

    If a candidate's only callers are themselves candidates, keep both on the list (the whole cluster is dead).

    line 28
  5. Distinctive:

    Ask the user to confirm which removals to proceed with.

    line 43
  6. Distinctive:

    Delete dead modules and test files entirely.

    line 49
  7. Distinctive:

    Remove orphaned imports, registrations, and references from live files.

    line 50
  8. Distinctive:

    Remove dead functions/classes from files that contain both live and dead code.

    line 51
  9. Very specific:

    Remove entries from __init__.py exports, CLI command registrations, and script references.

    line 52
  10. Very specific:

    Run python -m pytest test/ -x -q after each removal set.

    line 53
  11. Distinctive:

    Do not make a PR — the user decides when the branch is ready.

    line 74

“Common” is measured: kept by at least 6 in 10 of the 63 edited versions of this file we could read. “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

Dead Code Cleanup

Find and remove code that has lost its upstream justification: $ARGUMENTS

Phase 1: Identify removed or narrowed specifications

  1. Launch an Explore agent to scan for orphaned code:
    • "Search for functions, classes, modules, and test files in src/ and test/ that are no longer referenced by any current specification in specification/ or architecture document in doc/architecture/. Also check for: (a) imports of deleted modules, (b) CLI commands or entry points that reference removed features, (c) scripts in scripts/ that serve removed features. The user's scope hint is: $ARGUMENTS. Return a structured list grouped by category: dead modules, dead functions, dead tests, dead scripts, orphaned imports."
  2. When the agent returns, compile the candidate list. For each candidate, record:
    • File path and function/class name
    • Why it appears orphaned (which spec was removed or narrowed)

Phase 2: Verify candidates

Not everything without a spec reference is dead — utilities, shared helpers, and infrastructure code may be used transitively.

  1. For each candidate module or function, check for live callers:
    • Grep for imports and call sites across src/, test/, scripts/, and commands/.
    • If a candidate has live callers outside the dead-code set, remove it from the list.
    • If a candidate's only callers are themselves candidates, keep both on the list (the whole cluster is dead).
  2. Group the verified candidates into removal sets — clusters of files that can be removed together without breaking anything.

Phase 3: Present findings

  1. Present the removal plan to the user as a table:
#CategoryFileSymbolReason
1dead modulesrc/Poule/neural/channel.py—spec neural-retrieval.md removed
2dead testtest/unit/test_neural_retrieval.py—tests removed module
3orphaned importsrc/Poule/cli/commands.pyimport channelimports dead module
...
  1. Ask the user to confirm which removals to proceed with. Wait for approval before editing. Do not remove anything the user excludes.

Phase 4: Remove dead code

  1. Run: echo "implementation" > $CLAUDE_PROJECT_DIR/sdd-layer
  2. For each approved removal set:
    • Delete dead modules and test files entirely.
    • Remove orphaned imports, registrations, and references from live files.
    • Remove dead functions/classes from files that contain both live and dead code.
    • Remove entries from __init__.py exports, CLI command registrations, and script references.
  3. Run python -m pytest test/ -x -q after each removal set. If a test fails:
    • The candidate was not actually dead. Revert the removal and remove it from the list.
    • Report the false positive to the user.

Phase 5: Completion

  1. Run: echo "free" > $CLAUDE_PROJECT_DIR/sdd-layer
  2. Present a summary:

Removed:

#FileAction
1src/Poule/neural/channel.pydeleted
2src/Poule/cli/commands.pyremoved import of channel
...

Kept (false positives):

#FileReason kept
...
  1. Do not make a PR — the user decides when the branch is ready.

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.