agentleFS
renky1025renky1025/agent-skills/claude-simplify/SKILL.md

claude-simplify

Skill11 starsChanged 48 days agoMITView on GitHub

Review changed code for reuse, quality, and efficiency, then fix the issues found by launching three parallel review agents (reuse, quality, efficiency) over the diff. Use after completing a feature or bugfix, before committing or opening a PR, or whenever the user asks to simplify, clean up, or optimize recent changes. Trigger phrases: \"simplify this\", \"review my changes\", \"clean up the code\", \"check for issues\", \"refactor\", \"code review\", \"optimize\", 「审查我的改动」「清理代码」「简化代码」「检查有没有问题」「代码审查」.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    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:

    Identify the changes: Run git diff (use git diff HEAD when changes are staged).

    line 37
  2. Distinctive:

    If there is no git diff, review the files the user named or that you edited earlier in this conversation.

    line 38
  3. Distinctive:

    No git changes at all -> review the most recently modified files the user mentioned.

    line 51
  4. Distinctive:

    Do not modify code outside the reviewed change set.

    line 66
  5. Distinctive:

    Never revert changes you did not make and were not asked to touch.

    line 67
  6. Distinctive:

    Do not damage unrelated work: If a fix would alter pre-existing code beyond the diff, report it and leave the code alone.

    line 71
  7. Distinctive:

    Cover all three lenses: before declaring the review done.

    line 74
  8. Distinctive:

    Done when: all three agents have returned, their findings are resolved or explicitly skipped, and the summary is delivered.

    line 88

≈ “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: Code Review and Cleanup

Purpose

Turn a freshly written change set into a cleaner one. It runs three independent review lenses over the diff — reuse, quality, efficiency — aggregates their findings, and applies the fixes directly, so the output is improved code plus a short account of what changed.

When to Use

  • Immediately after finishing a feature, bugfix, or refactor, before committing.
  • The user asks to simplify, clean up, review, or optimize the code they just wrote.
  • A diff is about to become a PR and needs a quality pass first.
  • Trigger phrases: "simplify this", "review my changes", "clean up the code", "check for issues", "refactor", "code review", "optimize"; 「审查我的改动」「清理代码」 「简化代码」「代码审查」.

When NOT to Use

  • The user wants the diff explained, not changed -> answer directly, run no agents.
  • The request is a repo-wide audit of unchanged code -> scope here is the diff only; review the touched code or hand off to a broader audit skill.
  • The request is a security review of untrusted third-party code -> hand off to skill-security-check.
  • The user wants new functionality or a redesign, not cleanup -> that is a feature task, not this skill.

Workflow

  1. Identify the changes. Run git diff (use git diff HEAD when changes are staged). If there is no git diff, review the files the user named or that you edited earlier in this conversation.
  2. Launch the three review agents in parallel. In a single message, start the reuse, quality, and efficiency agents and give each the full diff plus its checklist from references/review-checklists.md.
  3. Wait for all three to finish, then aggregate their findings into one list.
  4. Fix each issue directly. Skip false positives and low-value findings silently — note them, do not argue.
  5. Summarize what was fixed, what was flagged but deliberately skipped, and confirm when the code was already clean.

Decision Rules

  • No git changes at all -> review the most recently modified files the user mentioned; never invent a diff.
  • A finding is a false positive or not worth addressing -> skip it and record it in the summary; do not debate the reviewer.
  • A finding touches the changed lines or their immediate helpers -> fix it in place.
  • A finding would require changing unrelated, pre-existing code -> report it instead of editing (see Priority).
  • The same problem is reported by more than one agent -> fix once, list it once.
  • User gave a focus area via argument-hint -> weight that lens, but still run all three.

Constraints

  • Pass the full diff to every agent; a truncated diff produces shallow findings.
  • Launch the three agents in one message so they run concurrently.
  • Fix issues; do not merely report them, unless Priority says otherwise.
  • Do not modify code outside the reviewed change set.
  • Never revert changes you did not make and were not asked to touch.

Priority

  1. Do not damage unrelated work. If a fix would alter pre-existing code beyond the diff, report it and leave the code alone.
  2. Apply fixes that are contained in the diff and its immediate helpers.
  3. Cover all three lenses before declaring the review done; do not stop after the first agent returns findings.

Verification

  • The review scope equals the actual diff (or the named files when no diff exists).
  • All three agents ran against the full diff.
  • Every accepted finding is either fixed or explicitly listed as skipped with a reason.
  • No file outside the reviewed change set was modified.
  • The final summary covers found-and-fixed, skipped, and (if applicable) already-clean.

Output

  • Outcome: the changed code updated in place, plus a short summary of the review.
  • Done when: all three agents have returned, their findings are resolved or explicitly skipped, and the summary is delivered.
  • Evidence: the summary listing found/fixed issues, intentionally skipped findings with reasons, and a clean-code confirmation when nothing was found.

References

Load only when needed:

  • references/review-checklists.md — read when launching the three review agents, to get each agent's checklist; also read when the user asks what the review inspects.

Related Skills

  • clean-code — the underlying smell taxonomy and refactoring catalogue behind the quality lens; consult it when a finding needs justification.
  • skill-security-check — use instead when the code under review is untrusted or third-party.

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.