agentleFS
wty-yywty-yy/skills/code-simplifier/SKILL.md

code-simplifier

Skill2 starsChanged 58 days agoMITView on GitHub

Simplify and refine recently modified code for clarity, consistency, and maintainability while preserving exact behavior. Use when the user asks to simplify, clean up, refactor for readability, polish recently changed code, or review touched code for unnecessary complexity.

42 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use comment-analyzer, performance 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.
  • lin30Skill

    comment-analyzer

    微博评论抓取与深度分析,生成可视化HTML报告。Use when user asks to analyze weibo comments, analyze social media comments, or requests sentiment analysis from weibo posts

    Also in 3 projects that use this

  • pluginagentmarketplaceSkill

    performance

    Optimize application performance through caching strategies, load balancing, database scaling, and monitoring. Build systems handling thousands of concurrent users.

    Also in 3 projects that use this

  • AWSSkill

    setup-matt-pocock-skills

    Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.

    Also in 3 projects that use this

  • OpenAISkill

    verification-before-completion

    Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

    Also in 4 projects that use this

  • AWSSkill

    to-spec

    Turn the current conversation into a spec and publish it to the project issue tracker: no interview, just synthesis of what you've already discussed.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 9 projects that use this

  • +2 more from aws

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. 0 are common, 18 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 40 edited versions we read keep these.

  • 18

    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. Distinctive:

    Use this skill to refine recently modified code unless the user explicitly asks for a broader scope.

    line 12
  2. Distinctive:

    Do not change what the code does.

    line 17
  3. Distinctive:

    Keep all original features, outputs, and behavior intact.

    line 18
  4. Distinctive:

    Treat behavior changes as bugs unless the user requested them.

    line 19
  5. Distinctive:

    Read and follow local guidance such as AGENTS.md, CLAUDE.md, README files, contribution docs, formatter configs, lint rules, and nearby …

    line 22
  6. Distinctive:

    Prefer the repository's established style over generic preferences.

    line 23
  7. Distinctive:

    Keep import order, naming, file layout, typing style, error handling, and component patterns consistent with the project.

    line 24
  8. Distinctive:

    Remove redundant code and weak abstractions.

    line 28
  9. Distinctive:

    Remove comments that only restate obvious code.

    line 31
  10. Very specific:

    Avoid nested ternary operators.

    line 32
  11. Distinctive:

    Do not create clever one-liners that are harder to debug.

    line 36
  12. Distinctive:

    Do not combine unrelated concerns into a single function, module, or component.

    line 37
  13. Distinctive:

    Do not remove helpful abstractions that improve organization.

    line 38
  14. Distinctive:

    Do not prioritize fewer lines over maintainability.

    line 39
  15. Distinctive:

    Do not perform broad refactors unless the user asks for them.

    line 43
  16. Distinctive:

    Avoid unrelated formatting churn.

    line 44
  17. Distinctive:

    Look for unnecessary branching, duplication, awkward names, redundant abstractions, and unclear control flow.

    line 50
  18. Distinctive:

    Run focused tests, type checks, lint checks, or syntax validation when feasible.

    line 52
  19. Distinctive:

    Call out any tests or checks that could not be run.

    line 62

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

Code Simplifier

Purpose

Improve code clarity, consistency, and maintainability without changing behavior.

Use this skill to refine recently modified code unless the user explicitly asks for a broader scope. Preserve all existing features, outputs, APIs, side effects, and observable behavior.

Core Rules

  1. Preserve functionality.
    • Do not change what the code does.
    • Keep all original features, outputs, and behavior intact.
    • Treat behavior changes as bugs unless the user requested them.
  2. Follow project standards.
    • Read and follow local guidance such as AGENTS.md, CLAUDE.md, README files, contribution docs, formatter configs, lint rules, and nearby code patterns.
    • Prefer the repository's established style over generic preferences.
    • Keep import order, naming, file layout, typing style, error handling, and component patterns consistent with the project.
  3. Enhance clarity.
    • Reduce unnecessary complexity and nesting.
    • Remove redundant code and weak abstractions.
    • Improve variable, function, and component names when they make intent clearer.
    • Consolidate related logic when it improves readability.
    • Remove comments that only restate obvious code.
    • Avoid nested ternary operators; prefer switch statements or if/else chains for multiple conditions.
    • Choose explicit readable code over dense or overly compact code.
  4. Avoid over-simplification.
    • Do not create clever one-liners that are harder to debug.
    • Do not combine unrelated concerns into a single function, module, or component.
    • Do not remove helpful abstractions that improve organization.
    • Do not prioritize fewer lines over maintainability.
  5. Keep scope tight.
    • Focus on code touched in the current session or recently modified code.
    • Do not perform broad refactors unless the user asks for them.
    • Avoid unrelated formatting churn.

Workflow

  1. Identify the recently modified or user-specified code.
  2. Inspect nearby conventions and project guidance before editing.
  3. Look for unnecessary branching, duplication, awkward names, redundant abstractions, and unclear control flow.
  4. Apply small behavior-preserving refinements.
  5. Run focused tests, type checks, lint checks, or syntax validation when feasible.
  6. Report only meaningful changes and any verification performed.

Output Expectations

When reporting results:

  • State which files were simplified.
  • Mention whether behavior was intended to remain unchanged.
  • Include verification commands and results when run.
  • Call out any tests or checks that could not be run.

Source

Adapted from Anthropic's code-simplifier Claude plugin agent: https://github.com/anthropics/claude-plugins-official/blob/main/plugins/code-simplifier/agents/code-simplifier.md

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.