agentleFS
toveruxtoverux/cantrips/skills/simplify/SKILL.md

simplify

Skill3 starsChanged 4 months agoMITView on GitHub

Optional pre-review quality pass — preserving fixes through the reuse, simplification, efficiency, and test-value lenses, pruning tests and comments that carry no value. Bug hunting is /review-gate's job.

119 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use codex-system, design-tracker 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.
  • gaebalaiSkill

    codex-system

    PROACTIVELY consult Codex CLI, your highly capable supporter with exceptional reasoning and task completion abilities. Codex is a trusted expert you should ALWAYS consult BEFORE making decisions on: design choices, implementation approaches, debugging strategies, refactoring plans, or any non-trivial problem. When uncertain, consult Codex. Don't hesitate - Codex provides better analysis. Explicit triggers: "think deeper", "analyze", "second opinion", "consult codex".

    Also in 3 projects that use this

  • gaebalaiSkill

    design-tracker

    PROACTIVELY track and document project design decisions without being asked. Activate automatically when detecting architecture discussions, implementation decisions, pattern choices, library selections, or any technical decisions. Also use when user explicitly says "記録して", "設計どうなってる", "record this". Do NOT wait for user to ask - record important decisions immediately.

    Also in 3 projects that use this

  • mike22890Skill

    clonedeps

    将项目依赖的第三方库源码克隆到本地,便于深入阅读和调试。当需要查看库的实现细节、阅读源码、调试第三方依赖、理解 SDK/framework 内部机制、查看 node_modules 之外的原始代码、分析开源库架构、学习他人代码、查看依赖的 TypeScript 类型定义时使用。

    Also in 3 projects that use this

  • mdrubelamin2Skill

    verification-planning

    Plans how to prove a change works or broke nothing: frames the claim, designs an evidence path from the system itself, and requires every check to be able to fail.

    Also in 3 projects that use this

  • devbrother2024Skill

    artifact-design

    단독 self-contained HTML 산출물(랜딩 페이지, 정적 문서·리포트, 독립 대시보드, 데모·게임, 개발 전 UX/UI 대안 비교 목업)을 만들 때 팔레트·타이포그래피·레이아웃을 의도적으로 설계하고 템플릿·AI스러운 디자인을 피하도록 돕는 디자인 가이드. HTML/CSS를 쓰기 전에 로드한다. "랜딩 만들어줘", "이 내용 단일 HTML로 예쁘게", "UX 대안 HTML로 비교해줘", "디자인 잡아줘"처럼 단독 HTML 아티팩트를 만들거나 비교하는 요청에 활성화하고, 기존 앱(React·Vue 등)의 인앱 컴포넌트 수정이나 순수 백엔드·로직 작업에는 쓰지 않는다.

    Also in 3 projects that use this

  • codebycoreySkill

    batch

    Create multiple proposals from free-form feature descriptions. Use when planning several features at once, batch creating proposals, or setting up related changes.

    Also in 4 projects that use this

  • +3 more from gaebalai

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 111 edited versions we read keep these.

  • 9

    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:

    Never cut or weaken a sentence that directs an agent to act, forbids an action, gates a step behind a condition, or states how completion …

    line 24
  2. Distinctive:

    If the scope comes up empty, stop and ask the user what to simplify.

    line 40
  3. Distinctive:

    Every dispatch names the definition by its scoped name and passes no model.

    line 46
  4. Distinctive:

    Before applying each fix, confirm it satisfies the preservation contract for that material.

    line 57
  5. Distinctive:

    If it can't clear that test, skip it.

    line 58
  6. Distinctive:

    Write each fix from the line at the candidate's location, read in place — never from the candidate's description of it.

    line 59
  7. Distinctive:

    Run the one whose material this pass touched, and both where it touched both — code checks cannot observe prose, and the prose re-read …

    line 70
  8. Distinctive:

    No scoping mechanism → full suite.

    line 76
  9. Distinctive:

    If no checks are configured, state that in the summary.

    line 80

“Common” is measured: kept by at least 6 in 10 of the 111 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 recently changed material while preserving what it does. Prioritize readable, explicit results over compact ones — fewer lines is not the goal.

The contract below governs every step of this pass, and travels verbatim to each lens finder dispatched in Step 2.

<preservation-contract> Preserve what the material does. Which test that is depends on the material, and a file is judged by its own kind — a diff holding both kinds is held to both:
  • Code — same output for every input, same error behavior, same side effects and ordering. A test preserves the contract it guards, by a named remaining test where the test itself goes. An interface or data shape that existed only in an earlier iteration of the current unshipped scope is not protected behavior once verified to have no deployed, persisted, public, external, dependent-branch, or in-repo caller outside the scope.
  • Agent-facing prose (a skill, an AGENTS.md or CLAUDE.md, a rules file — anything an agent loads and acts on) — the instruction set is what is preserved. Cut text that repeats, rambles, or restates what another file already says. Never cut or weaken a sentence that directs an agent to act, forbids an action, gates a step behind a condition, or states how completion is judged — rewording one into a suggestion is weakening it. Where a sentence's kind is uncertain, it stays.</preservation-contract>

Step 1: Resolve the scope

Strip every proof-test:<path> token from the input before reading the rest as the scope. The proof-test path is context for Steps 2 and 3, never scope; a caller may pass several.

  1. If the user named a scope (a file, a directory, "the function I just wrote"), use it as authoritative — do not widen it.
  2. Otherwise, use the diff between the current branch and its merge-base with the default branch (git diff <default-branch>...) plus the uncommitted changes (git diff HEAD), which a merge-base diff leaves out. With no base ref, the uncommitted changes alone. Either way, add the files git does not track (git ls-files --others --exclude-standard): a file git does not track appears in no diff, so it joins the scope whole. Snapshot each of those untracked files before Step 3 edits anything — git holds no pre-pass state for them, and Step 4 verifies against pre-pass text.
  3. Outside a git repository, use the files edited earlier in this conversation.

If the scope comes up empty, stop and ask the user what to simplify.

Step 2: Dispatch the lens finders in parallel

Dispatch cantrips:finder:reuse, cantrips:finder:simplification and cantrips:finder:efficiency in parallel, with cantrips:finder:test-value beside them where the resolved scope holds a test file, each message carrying the preservation contract above verbatim and the resolved scope (the full diff or file set) — no cap and no brief, the test-value message alone also carrying the proof tests (the proof-test: paths, else the tests the session's evidence names), since each definition holds its lens with the restraints printed under it, the rules governing every lens, and the contract it answers in: a JSON array of candidates, each carrying its fix. On a scope the user did not name, the test-value message limits that lens to the tests the work added or changed and the Simplification message limits its Comments item to the comments the work added or changed; on a user-named scope they read the material whole. Every dispatch names the definition by its scoped name and passes no model; the definition pins the model and a background run. Where the harness loads no plugin agent definitions, read <role>.md, skip its frontmatter, paste its body into a general-purpose dispatch run in the background, and apply the model its frontmatter names where the dispatch primitive exposes a selector. Where a dispatch fails for a reason that survives correcting the invocation, or the harness offers no way to make a dispatch at all, run that pass inline under the same preservation contract and scope, hunting through the lens and the rules governing every lens, read from that finder's definition past its role framing, and disclose the substitution.

Step 3: Apply fixes

Proceed once all lens passes are complete, whether a dispatched finder returned its candidates or this context ran it, aggregate the candidates, and apply each one's fix directly. A false positive or a fix not worth its churn: note it, skip it, move on — settle it yourself rather than raising it to the user.

Inspect beyond the resolved scope when needed to evaluate a finding, but edit only that scope and the import/export lines it needs. For a user-named file or directory scope, those import/export lines must also be inside it; skip any fix that would edit outside the mutation boundary.

Before applying each fix, confirm it satisfies the preservation contract for that material. If it can't clear that test, skip it. Write each fix from the line at the candidate's location, read in place — never from the candidate's description of it.

Never simplify away a safety check. Input validation at trust boundaries, error handling that prevents data loss, security checks (authorization, escaping, sanitization), and accessibility affordances stay — even when a finding frames them as redundant. In agent-facing prose the equivalent is a gate or a prohibition: a sentence that stops an agent doing something, or makes it stop and check first.

Protect the proof tests. Each test the current work relied on to show its change works stays exactly as it is: every proof-test: path, else the tests the session's evidence names. Skip any finding from any reviewer that would delete, weaken, rename, move, merge, or rewrite one, or remove or rename the test-only code it calls. Behavior-preserving changes to the production code it exercises still apply. When you cannot tell which tests those are, delete or rewrite none of the tests the current work added or changed.

Step 4: Verify what was preserved

Each verification below observes one kind of material. Run the one whose material this pass touched, and both where it touched both — code checks cannot observe prose, and the prose re-read cannot observe code.

Where the pass touched code:

  • Typecheck and lint the full project — they catch the common simplification regressions: broken imports, dropped narrowings, dead code other modules still reference.
  • Run tests scoped to the blast radius of the changes; broaden when shared or heavily-imported code was touched. No scoping mechanism → full suite.

On a failure, fix the underlying break or revert the specific simplification that caused it — a repair that would land outside the mutation boundary leaves revert the only route, and weakening assertions, types, or skipping tests defeats the preservation guarantee either way. A test is removed only as a test-value finding, and any remaining tests that finding named must still pass afterwards. If no checks are configured, state that in the summary.

Where the pass touched agent-facing prose, diff each changed file against its state before this pass and read every line the pass removed or reworded. For a file git tracks that state is HEAD; for an untracked one it is the Step 1 snapshot, since git holds none. That pre-pass text is the only place a cut instruction still exists, so re-reading the file as it now stands cannot find one. For each removed or reworded line, confirm it carried no directive, prohibition, gate, or completion criterion — and restore it where it did. Then reread every sentence the pass wrote in place, as its reader will meet it, and fix what that reading catches.

Step 5: Summarize

Report fixes applied per lens (reuse, simplification, efficiency, test value), findings skipped (as false positives, as not worth the churn, or as fixes the mutation boundary put out of reach), open work or possible defects a candidate named, and which verifications ran — the code checks with their results, the prose diff-read and reread, or both. The measure is what improved and that the contract held — many clarity and safety fixes preserve or add lines.

Close with a flow pointer (the message's final paragraph, a blockquote in full italics opening Next: — or Next steps: over one bullet per pointer — each pointer naming its skill the way this skill was itself invoked, same prefix and namespace, and ending in a one-clause rationale after an em dash): /review-gate [--fix | --loop] (user-invoked) — the gate that hunts for bugs and spec drift, in this session; suggest low for a trivial or mechanical diff, high for a large, cross-cutting, or risky one, medium otherwise; pair any level with --fix to apply the findings once, or with --loop to converge the gate to green. Where the first rendered step that names a skill is /review-gate, precede the blockquote with a paragraph of its own recommending that the user compact the conversation first. Where this session engaged a deputy through /deputy and has not dismissed it, a choice is put to the deputy as ROUNDS.md says and rendered as the one step it chose, any other closing is rendered as written, and each rendered step that names a skill is then taken: one marked (user-invoked) by notifying the user where the harness has a tool for it and waiting for them to type it, any other by invoking it, notifying nobody.

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.