agentleFS
hsienchiaoleehsienchiaolee/agent-skills/simplify/SKILL.md

simplify

Skill0 starsChanged 2 months agoMITView on GitHub

Simplify code and tests changed by the current pull request, branch, commit range, or local working tree while preserving behavior. Use when the user invokes simplify, asks to clean up or refactor recent changes, reduce duplication or complexity, improve clarity and maintainability, or perform a focused simplification pass before review or commit.

73 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use clonedeps, deepwork 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.
  • hbollonSkill

    clonedeps

    Clone important project dependency source code into an ignored local workspace so OpenCode can inspect library internals. Use when the user asks to clone dependencies, inspect dependency/source internals, understand SDK/framework behavior from source, debug library implementation details, or make core dependency repos locally readable. Do not use for ordinary API/docs questions where @librarian is enough.

    Also in 3 projects that use this

  • hbollonSkill

    deepwork

    Orchestrator-only workflow for heavy coding sessions, multi-phase implementation, and risky refactors. Use for complex work that needs planning, review gates, and persistent progress tracking.

    Also in 3 projects that use this

  • JordanCoinSkill

    codemap

    Analyze codebase structure, dependencies, changes, cross-agent handoffs, and get code-aware intelligence. Use when user asks about project structure, where code is located, how files connect, what changed, how to resume work, before starting any coding task, when you need risk analysis and skill guidance, or when Codemap should tune project config before analysis.

    Also in 4 projects that use this

  • llama-farmSkill

    commit-push-pr

    Commit changes, push to GitHub, and open a PR. Includes quality checks (security, patterns, simplification). Use --quick to skip checks.

    Also in 3 projects that use this

  • nicolasestremSkill

    finalize

    Complete project finalization with quality gates and git workflow automation.

    Also in 3 projects that use this

  • PostHogSkill

    react-doctor

    Diagnose and fix React codebase health issues. Use when reviewing React code, fixing performance problems, auditing security, or improving code quality.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

22 rules. 0 are common, 21 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 71 edited versions we read keep these.

  • 21

    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:

    Read the repository instructions and identify its required checks.

    line 14
  2. Distinctive:

    Add all staged, unstaged, and untracked changes to that committed scope.

    line 22
  3. Distinctive:

    If the scope is empty, report that there is nothing to simplify and stop.

    line 23
  4. Distinctive:

    Read the complete diff before editing.

    line 27
  5. Distinctive:

    Run the repository's required checks before editing.

    line 34
  6. Distinctive:

    Reuse: Prefer an existing project helper or idiom over new duplicate logic.

    line 41
  7. Distinctive:

    Efficiency: Remove demonstrably redundant work, allocations, or repeated lookups when the result is also at least as readable.

    line 46
  8. Distinctive:

    Do not create or preserve single-line pass-through functions.

    line 52
  9. Distinctive:

    Keep code DRY, but extract shared logic only when it represents one stable concept.

    line 59
  10. Distinctive:

    Do not launch parallel review subagents unless the user explicitly asks for them.

    line 63
  11. Distinctive:

    Treat string and data literals as behavior.

    line 70
  12. Distinctive:

    Do not mix in new features, speculative architecture, or unrelated bug fixes.

    line 74
  13. Distinctive:

    Prefer explicit readable control flow over dense expressions, nested conditionals, clever one-liners, or fewer lines for their own sake.

    line 76
  14. Distinctive:

    Keep abstractions that communicate a useful boundary.

    line 78
  15. Distinctive:

    Avoid generated, vendored, and imported artifacts unless the repository explicitly treats them as source.

    line 82
  16. Distinctive:

    Leave code unchanged when an alternative is merely different, not clearly simpler.

    line 84
  17. Very specific:

    Keep tests DRY. Move repeated per-example setup and cleanup into framework lifecycle hooks such as GSpec before_each/after_each or …

    line 91
  18. Distinctive:

    Keep distinct behaviors independently diagnosable.

    line 96
  19. Distinctive:

    Never weaken assertions, delete unique coverage, replace focused checks with broad snapshots, or make tests pass by changing expectations.

    line 98
  20. Distinctive:

    Prefer readable test arrangement over minimizing test line count.

    line 100
  21. Distinctive:

    Run all required formatting, linting, and test commands after editing.

    line 108
  22. Distinctive:

    If a check fails, fix or revert the simplification.

    line 109

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

Simplify Changed Code

Refine the selected change set in place. Prefer the smallest clear design that preserves observable behavior, project conventions, and useful test coverage. Make edits when worthwhile; do not stop at a review report.

Establish the scope

  1. Read the repository instructions and identify its required checks.
  2. Honor an explicit user-provided commit, range, branch, or path scope.
  3. Otherwise determine the comparison base without fetching or mutating Git:
    • On a pull-request or non-default branch, prefer the PR base from available metadata. Fall back to the remote default branch, then local main or master. Include committed changes since the merge base.
    • On the default branch, include commits ahead of its upstream when an upstream exists. Do not revisit unrelated already-pushed history.
  4. Add all staged, unstaged, and untracked changes to that committed scope.
  5. If the scope is empty, report that there is nothing to simplify and stop.
  6. State exactly which range and local changes are included. Treat the initial diff as the intended behavior and changed paths as the editing boundary.

Read the complete diff before editing. Inspect surrounding code, callers, scenes, and tests only as needed to understand the changed behavior. Modify an adjacent file only when the simplification cannot remain coherent without it; call out that scope expansion.

Confirm the baseline

Run the repository's required checks before editing. If the baseline is red, stop and report the failure rather than refactoring on top of it.

Look for meaningful simplifications

Evaluate production code and tests with three concerns in mind:

  • Reuse: Prefer an existing project helper or idiom over new duplicate logic. Consolidate repeated concepts, not merely similar-looking syntax.
  • Clarity: Reduce avoidable nesting, branches, state, indirection, boilerplate, stale comments, and misleading names. Keep responsibilities coherent and execution paths easy to trace.
  • Efficiency: Remove demonstrably redundant work, allocations, or repeated lookups when the result is also at least as readable. Avoid speculative micro-optimization.

Prefer direct code:

  • Do not create or preserve single-line pass-through functions. Update callers to invoke the underlying operation directly. If an external API or framework requires the callable, leave that boundary intact rather than adding another wrapper.
  • Inline a function or variable used only once when it merely renames a simple operation or fragments the local flow. Keep a single-use helper only when its logic is complex enough that a precise name materially improves understanding.
  • Keep code DRY, but extract shared logic only when it represents one stable concept. Do not trade small duplication for indirection or hidden coupling.

Apply project-specific standards from repository instructions and nearby code. Do not launch parallel review subagents unless the user explicitly asks for them; this is a focused editing workflow, not an independent code review.

Preserve behavior

  • Preserve public APIs, outputs, errors, ordering, timing-sensitive behavior, side effects, serialization formats, and saved-data compatibility.
  • Treat string and data literals as behavior. Do not rewrite user-facing text, error messages, keys, paths, prompts, fixtures, or snapshots merely for style.
  • For Godot changes, preserve node paths and names, exported properties, resources, signals, input mappings, scene-tree lifecycle, and process timing.
  • Do not mix in new features, speculative architecture, or unrelated bug fixes. Report a discovered behavior issue separately instead of hiding it in cleanup.
  • Prefer explicit readable control flow over dense expressions, nested conditionals, clever one-liners, or fewer lines for their own sake.
  • Keep abstractions that communicate a useful boundary. Add or merge an abstraction only when it makes the affected callers easier to understand.
  • Preserve comments that explain constraints or intent. Remove only comments that restate self-evident code or no longer match it.
  • Avoid generated, vendored, and imported artifacts unless the repository explicitly treats them as source.
  • Leave code unchanged when an alternative is merely different, not clearly simpler.

Simplify tests carefully

  • Preserve behavioral, boundary, negative-path, integration, and regression coverage.
  • Keep tests DRY. Move repeated per-example setup and cleanup into framework lifecycle hooks such as GSpec before_each/after_each or beforeEach/afterEach when the shared lifecycle remains clear.
  • Consolidate repeated assertions with a helper or data-driven case only when intent and failure diagnostics become clearer.
  • Keep distinct behaviors independently diagnosable. Do not hide meaningful cases in opaque loops or oversized shared fixtures.
  • Never weaken assertions, delete unique coverage, replace focused checks with broad snapshots, or make tests pass by changing expectations.
  • Prefer readable test arrangement over minimizing test line count.

Apply and verify

  1. Apply only high-confidence simplifications with a clear readability, maintainability, or non-speculative efficiency benefit.
  2. Review the resulting diff against the original scope and remove drive-by or behavior-changing edits.
  3. Run all required formatting, linting, and test commands after editing.
  4. If a check fails, fix or revert the simplification; do not weaken the check.
  5. Report the reviewed scope, material simplifications, changed paths, and exact verification results. If no worthwhile edits exist, say so plainly.

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.