MCPInstall

simplify

Simplify the requested code or diff while preserving behavior and meaningful coverage.

Installs
456
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/legendapp/legend-skills --skill simplify
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads simplify automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Simplify

Produce the smallest clear implementation that fully satisfies the required behavior. Minimize concepts and moving parts, not line count.

Cadence

  • Before adding code, decide the smallest change that meets the requirement; each new concept must earn its place.
  • During construction, apply the priorities locally while discovering behavior. Allow clearly temporary instrumentation or scaffolding when it accelerates learning.
  • At convergence, once a logical behavior slice passes, simplify that slice, remove superseded attempts and scaffolding, and rerun focused validation.
  • For an explicitly requested branch audit, compare with the intended base. Otherwise review only the requested change; do not broaden a small cleanup into a whole-branch audit.

Workflow

  1. Identify the required behavior, invariants, constraints, and non-goals.
  2. Inspect the relevant diff and separate it into logical concepts. For a final branch audit, compare the full branch with its merge base and check history for superseded attempts when relevant.
  3. Inspect the existing owners, sources of truth, common path, decision points, and nearby code style before adding anything.
  4. Choose the design with the fewest necessary concepts and the least work at runtime.
  5. When changes are requested, implement directly and reuse existing mechanisms where they fit.
  6. Validate behavior with checks proportional to the risk.
  7. Review the final code, tests, names, comments, documentation, configuration, and relevant history for anything that no longer earns its complexity.

Simplification Priorities

  • Match the repository's existing style and patterns: naming, file layout, error handling, test style, and the libraries it already uses. Do not introduce a new pattern where an existing one fits.
  • Prefer deletion, reuse, or a direct change over a new abstraction.
  • Keep one source of truth; avoid mirrored state, overlapping guards, duplicate registries, and compensating mechanisms.
  • Where the repository has no convention, prefer straightforward positive control flow over early-return chains or empty branches.
  • On hot paths, minimize allocations, callback recreation, subscriptions, renders, passes, I/O, and native work.
  • For prose, remove repetition and keep the shortest wording or example that remains self-sufficient.

Over-engineering Checklist

Remove these when they serve no required behavior, invariant, useful clarity, measured performance need, or existing repository convention:

  • one-use helpers that can be inlined instead;
  • defensive null or type checks for states the types or callers already rule out;
  • config flags, options, or parameters for variation no current caller needs;
  • wrapper types or classes that only forward;
  • new files, modules, or abstractions where an existing owner fits;
  • fallback, compatibility, or migration paths the task does not require;
  • try/catch blocks that swallow errors or silently fall back;
  • speculative generality: extension points or cases nothing uses yet.

Line-level Pass

  • Read every added block with the existing code around it, not just the diff hunk.
  • Flag new code that duplicates a statement, return, or branch the surrounding code already has.
  • Flag cases where guarding, wrapping, or skipping existing code would be smaller than adding a parallel path.
  • Flag existing lines that became unreachable or redundant.
  • Apply or report each case with the smaller rewrite; a diff-level "lean/proportional" verdict is not enough.
  • Example: a fast path if (sortsAfterTail) { queue.push(task); return; } before a scan loop that already ends with queue.push(task) duplicates the push. Guard the loop with if (!sortsAfterTail) so one trailing push serves both paths.

Existing Work

Establish a passing baseline before simplifying working code. Test one questionable concept at a time, rerun the relevant validation, and restore it if behavior or meaningful coverage weakens. Do not restructure several accumulated fix attempts before establishing which changes are causally necessary.

When duplicate or ineffective regression coverage is suspected, deliberately break the claimed invariant and confirm the remaining test fails. Passing tests alone do not prove that every test or implementation concept is necessary.

Do not rewrite branch history without authorization.

Performance Changes

Name the exact common-path work being removed: allocations, scans, mounts, renders, subscriptions, I/O, or native calls. Control-flow evidence plus regression tests can justify removing work that is structurally unused. Require a benchmark, profile, or repeated repro when an optimization changes semantics or introduces a tradeoff. Do not add complexity for theoretical gains.

Guardrails

  • Preserve correctness, required behavior, type safety, distinct regression coverage, and useful clarity.
  • Do not replace clear code with compressed or clever code merely to reduce lines.
  • Make scoped, behavior-preserving improvements directly. If a simplification beyond the requested change would alter a public API or add a new concept, explain and suggest it instead.
  • Leave unrelated and user-authored changes untouched.

Stop when every remaining concept supports a requirement, invariant, useful clarity, existing repository convention, or measured performance need. Report only material simplifications, validation, and unresolved opportunities.

FAQ

What does the simplify skill do?

Simplify the requested code or diff while preserving behavior and meaningful coverage.

How do I install simplify?

Run npx skills add https://github.com/legendapp/legend-skills --skill simplify in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/simplify/ (personal) or .claude/skills/simplify/ (project).

Which AI agents can use simplify?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is simplify safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains simplify?

It is published by legendapp in legendapp/legend-skills. It has 456 recorded installs.

More from legendapp/legend-skills

View all →

legend-list-best-practices

legendapp/legend-skills

Implement or audit @legendapp/list usage, including recycling, measurement, invalidation, and scroll anchoring.

legend-state-best-practices

legendapp/legend-skills

Open the skill to read its SKILL.md instructions.

react-coding-style

legendapp/legend-skills

Open the skill to read its SKILL.md instructions.

Frontend & Design466 installs

diagnose

legendapp/legend-skills

Open the skill to read its SKILL.md instructions.

423 installs

diagnose-fix-loop

legendapp/legend-skills

Open the skill to read its SKILL.md instructions.

420 installs

commit

legendapp/legend-skills

Open the skill to read its SKILL.md instructions.

Popular testing & qa skills

View category →

tdd

mattpocock/skills

Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

Testing & QA1.2M installs

grilling

mattpocock/skills

Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.

Testing & QA996.2K installs

migrate-to-shoehorn

mattpocock/skills

Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.

Testing & QA484.1K installs

run-train

lllllllama/rigorpilot-skills

Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.

Testing & QA337.8K installs

test-driven-development

obra/superpowers

Use when implementing any feature or bugfix, before writing implementation code

Testing & QA261.8K installs

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

Testing & QA216.8K installs