agentleFS
yuhua99yuhua99/skills/reclaim-code-entropy/SKILL.md

reclaim-code-entropy

Skill2 starsChanged 29 days agoMITView on GitHub

Reclaim code entropy — find, rank, and safely remove accidental complexity. Use when asked to simplify or clean up code, remove dead or over-engineered surface, or collapse duplicate state or APIs.

2 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 2

    1. Yevanchen/reclaim-code-entropy★ 19988% same
    2. caikiji/skills-lab★ 488% same

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 16 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    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:

    Treat code entropy as maintenance surface with no current load-bearing reason: extra representations, states, APIs, branches, packages, …

    line 8
  2. Distinctive:

    Treat removal of a reachable user capability, supported public API, persisted format, or compatibility path as a product decision.

    line 16
  3. Very specific:

    Read repository instructions and the nearest scoped equivalents: AGENTS.md, CONTRIBUTING, architecture docs, ADRs/RFCs/decision notes, …

    line 20
  4. Distinctive:

    Start with large or central production surfaces, not only obvious unused symbols.

    line 29
  5. Distinctive:

    Look for these candidate classes:

    line 31
  6. Distinctive:

    Search its symbol, file path, package name, config key, event/wire string, and alternate call syntax across the whole repository.

    line 49
  7. Distinctive:

    Read history and decision records.

    line 55
  8. Distinctive:

    Keep or downgrade a candidate when any of these holds:

    line 61
  9. Distinctive:

    Use this compact evidence record in audit output:

    line 70
  10. Distinctive:

    Delete the obsolete contract end to end: declaration, implementations, branches, tests that exist only for the removed behavior, exports, …

    line 83
  11. Distinctive:

    Prefer deletion, then standard library/native features, then already-installed dependencies.

    line 86
  12. Distinctive:

    Add compatibility shims only for a real compatibility obligation.

    line 87
  13. Distinctive:

    After each non-trivial batch:

    line 93
  14. Distinctive:

    Search again for deleted symbols, strings, paths, and stale documentation.

    line 95
  15. Distinctive:

    Run the narrowest decisive test first, then the repository's broad relevant type, lint, test, build, codegen, or smoke gates.

    line 96
  16. Distinctive:

    Run git diff --check when Git is available and inspect the complete diff for accidental scope expansion.

    line 98
  17. Distinctive:

    If verification fails, identify whether the candidate was load-bearing, the implementation was incomplete, or the baseline was already red.

    line 101

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Reclaim Code Entropy

Treat code entropy as maintenance surface with no current load-bearing reason: extra representations, states, APIs, branches, packages, policies, or tests that the product must keep coherent.

Core rule: a scanner produces candidates; only consumer, ownership, history, and verification evidence justify deletion. Prefer a few proved cuts over a long speculative list. Finding nothing safe to remove is a valid result.

Choose The Mode

  • For "audit", "find", "review", or "report", inspect only and return ranked candidates. Do not edit.
  • For "apply", "remove", "clean up", "simplify", or "refactor", implement the safest requested cuts and verify them.
  • Treat removal of a reachable user capability, supported public API, persisted format, or compatibility path as a product decision. Surface the visible tradeoff before changing it unless the user already made that decision explicitly.

Establish The Contract

  1. Read repository instructions and the nearest scoped equivalents: AGENTS.md, CONTRIBUTING, architecture docs, ADRs/RFCs/decision notes, package manifests, and test guidance.
  2. Inspect git status; preserve unrelated work. Identify generated, vendored, migration, fixture, and public-package paths before classifying code.
  3. Trace the real runtime flow through entrypoints, configuration, registries, dependency injection, events, queues, persistence, processes/workers, and wire protocols.
  4. In apply mode, discover the repository's actual narrow and broad verification commands and run a proportional baseline when feasible. A red baseline limits what later checks can prove; record it instead of claiming a regression.

Preserve validation at trust boundaries, authorization, security controls, accessibility basics, data-loss prevention, durable-data compatibility, and cleanup that establishes resource quiescence.

Survey For Entropy

Start with large or central production surfaces, not only obvious unused symbols. Run installed dead-code or dependency tools when useful, but treat every result as a lead.

Look for these candidate classes:

  1. Unconsumed surface: public methods, exports, events, config keys, hooks, packages, registry notifications, or protocol fields with no production consumer.
  2. Mirrored fact: two events, caches, summaries, state stores, snapshots, or adapters record the same truth and must be synchronized.
  3. Speculative generality: unset knobs, fixed feature flags, unused fallbacks, one-implementation interfaces, abandoned stubs, or extension points with no owner.
  4. Extra route or layer: multiple front doors to one behavior, forwarding-only wrappers, pass-through packages, or helpers that obscure a single caller.
  5. Lifecycle duplication: several flags, sentinels, promises, queues, or controllers represent one transition such as ready, stopped, settled, flushed, or disposed.
  6. Misplaced defense: copies, freezes, validators, rollback paths, or hostile-object tests protect a same-process typed handoff rather than an actual trust or ownership boundary.
  7. Hand-rolled infrastructure: local parsers, retry loops, globbing, framing, diffing, or data structures already covered by the standard library, native platform, or an installed dependency.
  8. Support-only residue: tests or docs are the only consumers; duplicate expected outputs; obsolete inventories; demo/test packages that impose runtime or publishing cost.
  9. Added-then-abandoned residue: implementation disappeared but flags, schemas, docs, tests, compatibility branches, or decision notes still describe it.

Distinguish duplication from necessary independence: separate backends, adapters, representations, or lifecycle mechanisms may intentionally test a contract or protect distinct owners.

Prove Or Reject A Candidate

For each exact symbol, behavior, or artifact:

  1. Search its symbol, file path, package name, config key, event/wire string, and alternate call syntax across the whole repository.
  2. Classify every hit:
    • Production: runtime source, shipped configuration, real entrypoints, migrations, operational scripts.
    • Non-production: tests, docs, comments, snapshots, generated expected output.
    • Ambiguous: examples, fixtures, plugins, reflection, registries, lazy imports, code generation, externally consumed exports. Inspect before classifying.
  3. Inspect callers and callees, not only search counts. Check dynamic loading, stringly typed dispatch, routes, plugin manifests, DI containers, serialization, environment-keyed lookup, and external package contracts.
  4. Read history and decision records. Ask what problem created the surface, whether that problem still exists, and what evidence now beats the original rationale.
  5. Draw ownership for asynchronous or stateful code. Map each state flag, disposer, cancellation path, readiness promise, and terminal outcome to a distinct owner or transition.
  6. State what capability or behavior the deletion gives up, even if the answer is "none observable".
  7. Estimate net reduction: code, tests dedicated only to that code, docs, config, generated artifacts, dependencies, and concepts removed minus replacement glue and migrations added.
  8. Name the smallest check that would fail if the simplification were wrong.

Keep or downgrade a candidate when any of these holds:

  • A real production or external consumer exists.
  • Dynamic reachability or compatibility cannot be ruled out.
  • A current decision record justifies the surface and new evidence does not beat it.
  • The change is a product decision, not cleanup.
  • Churn moves complexity elsewhere without shrinking the contract or number of truths.
  • The candidate is tiny, uncertain, or unrelated to the requested scope.

Use this compact evidence record in audit output:

[confidence / risk] candidate
evidence: production consumers; dynamic/public/compatibility checks; owning rationale
cut: exact code, artifacts, dependency, and concept removed
tradeoff: observable capability or behavior lost
verify: smallest decisive check; estimated net reduction

Implement A Proven Cut

  1. Work in one ownership boundary at a time. Fix the shared source of entropy rather than patching every caller.
  2. Delete the obsolete contract end to end: declaration, implementations, branches, tests that exist only for the removed behavior, exports, config, docs, examples, snapshots, generated inventories, and dependency entries.
  3. Preserve tests of the surviving observable contract. Tests are evidence, not an untouchable specification and not disposable merely to improve the line count.
  4. Collapse mirrored state onto the load-bearing representation. Do not replace two truths with a synchronization wrapper.
  5. Prefer deletion, then standard library/native features, then already-installed dependencies. Add a dependency only when it removes more implementation and dedicated testing burden than its glue and supply-chain cost add.
  6. Add compatibility shims only for a real compatibility obligation; when one exists, keep the path or design an explicit migration instead of silently deleting it.

Net-negative lines are evidence of a cut, not the goal. A safe simplification may add a small test or migration; a large deletion can still be wrong.

Validate The Result

After each non-trivial batch:

  1. Search again for deleted symbols, strings, paths, and stale documentation.
  2. Run the narrowest decisive test first, then the repository's broad relevant type, lint, test, build, codegen, or smoke gates.
  3. Re-run any static analyzer that produced the candidate.
  4. Run git diff --check when Git is available and inspect the complete diff for accidental scope expansion.
  5. Compare behavior at public, persisted, wire, and user-visible boundaries. Measure performance only if a performance claim is made.

If verification fails, identify whether the candidate was load-bearing, the implementation was incomplete, or the baseline was already red. Revert only the current batch or repair the proof; do not weaken a meaningful check to force the deletion through.

Report The Outcome

For an audit, rank the strongest candidates by confidence, risk, and net maintenance reduction. Include rejected or uncertain high-value candidates only when the missing evidence is actionable.

For applied changes, report:

  • what contract or duplicate truth was removed;
  • files, lines, dependencies, and concepts removed where measurable;
  • any user-visible capability or compatibility behavior changed;
  • exact validation run and result;
  • high-value candidates intentionally kept and why.

Ground value claims in net maintenance reduction, not green tests or deletion volume alone.

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.