agentleFS
jscott3201jscott3201/yet-more-skills/skills/simplify-existing-code/SKILL.md

simplify-existing-code

Skill4 starsChanged 2 months agoApache-2.0View on GitHub

Simplify a requested code path by deleting unnecessary work, reusing existing behavior, or reducing caller complexity. Use explicitly for cleanup; not permission to weaken contracts, checks, or requested features.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    Keep input validation, authentication, authorization, data-loss prevention, resource bounds, accessibility, and required error handling.

    line 19
  2. Distinctive:

    Avoid incidental API redesign, broad formatting churn, clever compression, and permanent “simplification modes.” For a diagnosis-only …

    line 21
  3. Distinctive:

    Use the existing test framework and meaningful behavioral checks.

    line 25

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

Simplify Existing Code

Make the requested behavior easier to own without making it less correct. Simplicity is reduced coordination and maintenance cost—not the shortest line, smallest test count, or fewest files at any price.

Understand before removing

Read the actual path, callers, tests, and user goal. Identify what each layer or dependency does today, including failures and cleanup. Separate dead or speculative behavior from requirements that look inconvenient. A one-implementation abstraction may still enforce a useful boundary; judge its purpose, not its count.

First ask whether redundant work can disappear. Then consider an existing helper, language/runtime facility, native platform behavior, or installed dependency that meets the same contract. Adding a small correct local implementation can be simpler than forcing an ill-fitting package; using a mature existing dependency can be simpler than maintaining a risky reinvention. Explain only consequential tradeoffs.

Preserve the important costs and guarantees

Keep input validation, authentication, authorization, data-loss prevention, resource bounds, accessibility, and required error handling. Do not replace a cancellable or bounded operation with an unbounded convenience call. In protocols, storage, and bindings, preserve timing, durability, ownership, and error semantics.

Avoid incidental API redesign, broad formatting churn, clever compression, and permanent “simplification modes.” For a diagnosis-only request, propose the change without applying it. For authorized cleanup, make the smallest coherent change that removes a real source of complexity.

Prove the same behavior still works

Use the existing test framework and meaningful behavioral checks. Do not impose a one-test ceiling, delete fixtures for aesthetic reasons, or replace a suite with a self-check. Add a targeted regression for an uncovered contract when needed.

Compare public results and failure paths before and after. Measure performance only when it is part of the goal; fewer lines do not prove lower latency or less memory. Report removed responsibility, preserved behavior, actual checks, and any remaining tradeoff.

This is an explicit task, not an always-on hook or authority to challenge settled user requirements repeatedly.

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.