agentleFS
davidscotttuftsdavidscotttufts/hyvemind/skills/cleanup/SKILL.md

cleanup

Skill0 starsChanged 17 days agoApache-2.0View on GitHub

Remove dead code only when it is proved dead: zero references AND no dynamic path to it (string-built imports, registries, reflection, config/manifests, plugin loaders, exports other packages use). Protects public API, migrations, security, compliance, generated code and anything cited as evidence. Reports what looked dead but was kept, and why. Small commits, each citing its proof. Use for dead-code sweeps, orphan removal after a change, or 'is this still used?'.

71 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

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 61 edited versions we read keep these.

  • 3

    Distinctive

    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. Very specific:

    Zero static references: Search the whole repo, every workspace package, by name *and* by path (foo, ./foo, foo.js, the kebab and camel …

    line 17
  2. Distinctive:

    No dynamic path: Search for the ways code is reached without naming it:

    line 20
  3. Distinctive:

    Remove what the deletion orphans: helpers, fixtures, config keys, docs, the dependency in the manifest.

    line 46
  4. Distinctive:

    Run the full gate after each commit.

    line 48

“Common” is measured: kept by at least 6 in 10 of the 61 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

Cleanup

Deleting live code is a silent outage: the reference you missed was built from a string, read from a manifest, or lives in another package. "No grep hits" is the start of the proof, not the proof.

1. Prove it dead

A unit (file, export, function, route, flag, config key) is dead only when both hold, and you can show the commands:

  1. Zero static references. Search the whole repo, every workspace package, by name and by path (foo, ./foo, foo.js, the kebab and camel spellings). Exclude only its own definition and its own tests.
  2. No dynamic path. Search for the ways code is reached without naming it:
    • string-built imports (import(\./handlers/${x}`), require(name)`);
    • registries and maps keyed by string, decorators, reflection, DI containers;
    • config, manifests, routes files, CI/workflow files, scripts in package.json;
    • plugin or pack loaders that scan a directory;
    • exports of a published package (other repos import them; you can't grep them).

An empty search is suspect until it can fail: point the same search at a unit you know is live and see it hit ({{skill:evidence-rules}}).

2. Protected: never delete here

Public API and published exports · migrations (even applied ones) · security, auth and tenancy code · compliance and retention logic · generated code (fix the generator, or leave it) · anything cited as upgrade or verification evidence (a doc, checker or decision record names it). Raise these with the user instead.

3. Tests are not judged here

A test whose subject you delete goes with it. Whether any other test is still needed is {{skill:test-necessity}}'s call, made with probes, not here.

4. Remove

  • One unit (or one tight cluster) per commit. The message cites the proof: the static search, the dynamic searches, and "not protected because …".
  • Remove what the deletion orphans: helpers, fixtures, config keys, docs, the dependency in the manifest.
  • Run the full gate after each commit. A red gate means the proof was wrong: revert that commit, and record what you missed.

5. Report

  • Removed: unit, proof, commit.
  • Kept: each unit that looked dead but was saved, with the reason (dynamic path found at file:line, protected category, cited as evidence).
  • The denominator: "examined N candidates: removed R, kept K".

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.