agentleFS
ronaknnathanironaknnathani/relay/skills/simplify/SKILL.md

simplify

Skill3 starsChanged 5 months agoMITView on GitHub

Reduce complexity in recently changed code — cut needless abstraction, dead code, and duplication; improve names and structure — WITHOUT changing behavior. Quality only; it does not hunt for bugs (use review for that). Use after implementing a chunk of work, before review, or whenever a diff feels more complicated than the problem it solves. Triggers on "clean this up" / "tidy this" / "refactor this" when code already exists; for an underspecified goal with no code yet, use `clarify`.

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

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 71 edited versions we read keep these.

  • 4

    Distinctive

    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:

    Look at the changed code for:

    line 21
  2. Distinctive:

    If the "simplified" version is longer or harder to follow, it isn't a simplification — revert it.

    line 50
  3. Distinctive:

    Establish a baseline: Run the tests covering the change — or, if there is no suite or it cannot run, the narrowest available behavior check …

    line 54
  4. Distinctive:

    Tests are out of scope: Never edit a test to make it pass — a breaking test means behavior changed, so revert the simplification, not the …

    line 66

“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

Make a change simpler and clearer without changing what it does. The bar: readable, explicit code over clever, compact code — would a senior engineer call this overcomplicated? Scope is the recently changed code — the working diff (e.g. git diff against the branch point) unless the caller names files. This is quality-only: it does not hunt for bugs (that's review).

Step 0 — the invariant

Preserve functionality. Never change what the code does, only how it does it. Every original feature, output, and behavior stays intact. If a simplification would alter behavior, it is a review or implementation concern, not a simplification — stop and surface it.

Scan — three buckets

Look at the changed code for:

  • Structural — nesting depth ≥ 3, functions longer than ~50 lines, nested ternaries, boolean-flag parameters that select behavior, indirection that only forwards a call.
  • Naming — data/result/temp/foo, names that mislead, names that imply something broader or different than the thing actually is.
  • Redundancy — duplicated logic, dead/unreachable code, unused parameters/variables/fields, over-abstraction (a helper, wrapper, or interface used in exactly one place), defensive code for states an upstream invariant already makes impossible.

The deletion test

For each abstraction or layer of indirection, ask: would removing it concentrate complexity (then keep it — it's earning its keep) or merely relocate it (then remove it — it's not)? A single-use helper usually relocates; inline it. A wrapper that hides a genuinely complex subsystem behind a small interface usually concentrates; keep it.

Two-sided guardrail

Simplifying is a balance, not a race to fewer lines. Pair every "look for" with a "don't":

Look forDon't
reduce nesting and indirectionintroduce a nested ternary or a dense one-liner
inline a single-use helperinline a helper that names a genuinely complex step
remove a redundant abstractionremove a helpful abstraction that organizes the code
consolidate duplicated logicmerge unrelated concerns into one function
clearer names, fewer obvious commentsmake the code harder to debug or extend

If the "simplified" version is longer or harder to follow, it isn't a simplification — revert it.

Process

  1. Establish a baseline. Run the tests covering the change — or, if there is no suite or it cannot run, the narrowest available behavior check (build, typecheck, or lint) — and confirm it is green before you start. Never fabricate a green result; if the baseline is already red for unrelated reasons, note that and rely on the narrower check.
  2. Understand before changing (Chesterton's Fence). Work out why the code is shaped the way it is — a guard, retry, or special case may exist for a real reason. Remove a guard only when its premise is verifiable in the code you can see; if confirming it needs reasoning about whether an upstream invariant truly holds, leave it and flag for review.
  3. One simplification at a time → re-run that check → keep it only if it stays green; revert immediately if not. Tests are necessary but not sufficient: for a change on a path the suite does not exercise, reason explicitly about input/output equivalence — error paths, ordering, side effects, short-circuit evaluation — before keeping it.
  4. Tests are out of scope. Never edit a test to make it pass — a breaking test means behavior changed, so revert the simplification, not the test. Do not refactor, consolidate, or delete tests or fixtures even when they look redundant; that silently weakens coverage.
  5. Keep the simplify diff separate from feature/fix changes, so a reviewer reads pure refactor.
  6. Verify functionality preserved at the end: the baseline check is green and you have reasoned about any untested paths you touched.

Red flags

  • The simplified code is longer, or harder to follow, than before.
  • Editing, consolidating, or deleting a test or fixture (tests are out of scope).
  • Calling behavior "unchanged" from a passing suite alone, on code the suite does not exercise.
  • Removing an abstraction or guard without applying the deletion test / Chesterton's Fence.
  • Touching code outside the working diff ("while I'm here…").
  • Optimizing for fewer lines at the cost of clarity.

Verification checklist

  • The baseline check (tests for the changed code, or build/typecheck/lint) is green before and after — never a fabricated green.
  • For any change on a path the suite does not cover, I reasoned about input/output equivalence, not just "tests pass".
  • No test or fixture was edited, consolidated, or deleted — tests stayed out of scope.
  • Every removed abstraction/guard passed the deletion test (and Chesterton's Fence for guards).
  • The change stayed within the working diff.
  • The diff is genuinely clearer — not merely shorter.

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.