Skip to main content
skill CX Codex

simplify · legendapp — Claude Code skill: what it does, how to install

Simplifies code or diffs while preserving runtime behavior and test coverage. It strips unneeded abstractions and speculative generality without sacrificing readability.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add LegendApp/legend-skills --skill simplify -a claude-code
Open on GitHub

What simplify does

The skill directs the agent to minimize concepts and moving parts rather than chasing a smaller line count. It inspects existing repository conventions, common execution paths, and error handling patterns first. Instead of adding new layers, it leans toward deletion, reuse, and direct inline logic.

Its checklist actively targets over-engineering. That includes single-use helper functions, redundant wrappers, defensive checks for impossible states, and config options built for hypothetical use cases. During diff reviews, the skill inspects surrounding code to catch duplicate branches and unreachable statements.

Performance tweaks require concrete benchmarks or profiling data. The workflow strictly enforces a passing test baseline before any cleanup begins. Unverified edits cannot slip through.

What it helps with

  • clean up single-use helpers and redundant wrappers in pull requests
  • detect duplicate control flow and unreachable code around changes
  • remove speculative config options and unused extension points
  • audit branch diffs against the merge base without inflating scope

Example prompts for the agent

  • Simplify this diff while preserving all existing tests and behavior.
  • Audit the branch against main and strip unneeded scaffolding.
  • Review src/services/auth.ts for over-engineering and inline single-use helpers.

How to install simplify

1Skills CLI (Vercel)

npx skills add LegendApp/legend-skills --skill simplify -a claude-code

2Manually: put the files in place

~/.claude/skills/simplify/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/simplify/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about simplify

How to install simplify in Claude Code?

Run npx skills add LegendApp/legend-skills --skill simplify -a claude-code. You can also place the skill file directly into ~/.claude/skills/simplify/SKILL.md.

How does simplify evaluate simplicity?

It focuses on reducing conceptual complexity rather than code length. Replacing clear implementations with compressed or clever tricks is explicitly disallowed.

Can simplify be used for performance optimizations?

Yes, but optimizations require benchmark or profiling evidence. The skill strictly rejects adding structural complexity for theoretical speed gains.

Source text

SKILL.md · MIT
---
name: simplify
description: "Simplify the requested code or diff while preserving behavior and meaningful coverage."
---

# 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.

© LegendApp · MIT · LegendApp/legend-skills

Similar skills

All skills for Code review and refactoring →

simplify by other authors comes first.

From the same set9

legend-list-best-practices A skill for @legendapp/list work: it implements the list by the library's own contracts or audits existing usage for recycling, measurement and scroll anchoring bugs. CX Codex +1 546installs legend-state-best-practices A skill that sets the rules for @legendapp/state: observable ownership, subscriptions, effects and persistence. Useful when you build or audit reactive code. CX Codex +1 475installs react-coding-style A skill that steers your coding agent through React implementation and review: narrow subscriptions, stable identities, honest hook dependencies. CX Codex +1 466installs diagnose A skill that investigates a bug through falsifiable hypotheses, discriminating probes and recorded evidence, then reports how solid the answer is. CX Codex +1 423installs diagnose-fix-loop A skill that keeps the agent looping: diagnose, make one scoped fix, verify with the same signal, diagnose again. It targets causes, not symptoms. CX Codex +1 420installs commit Turns the changes from your current task into one or more tidy commits and keeps unrelated work out. Handy when the working tree has piled up several unrelated edits. CX Codex +1 404installs commit-confirm A wrapper for the $commit skill that inspects the entire project, proposes a commit plan, and waits for approval before touching Git. CX Codex +1 394installs git-integrate Drives a rebase, merge, cherry-pick or revert through verified completion and leaves unrelated work alone. Useful when an operation stalls on a conflict. CX Codex +1 389installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor