원클릭으로
simplify
Use when the user says "simplify this diff", or asks for a compression pass over a change-set.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when the user says "simplify this diff", or asks for a compression pass over a change-set.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Demolish bloated code and re-derive it clean, cutting every surface the rebuilt contract does not name. Use for a repo-wide bloat sweep, when patching a subsystem has stopped paying, or when the user says "this whole module is bloated", "rewrite this properly", or "break it and rebuild".
Use when the user says "deslop", "remove debug code", "find placeholders or stub code", or "remove dead code".
Dispatch compress operations. Use when the user says "tidy" or names a file, diff, memory, workspace, git stack, or doc to tidy.
Reduce internal duplication, dead code, and ceremony. Use when you spot dead fields, redundant wrappers, or speculative abstractions in code you are already editing.
Use when modernizing APIs, removing compat shims, killing feature flags, or rewriting a subsystem cleanly.
Design-by-Contract (DbC). Use when crossing public API boundaries, guarding complex state invariants, or hardening untrusted inputs and integration seams.
| name | simplify |
| description | Use when the user says "simplify this diff", or asks for a compression pass over a change-set. |
| metadata | {"short-description":"Three-axis compress pass on a diff"} |
A deliberate simplification pass invoked on a specific change-set. Decompose simplification into three axes that fail independently and so can be reviewed independently: reuse (what already exists), quality (shape of the new code), efficiency (cost of the new code). Three parallel read-only review agents, one per axis, emit findings against the same diff; the orchestrator composes, audits, and applies fixes one issue-class per atomic commit.
Reuse axis detects new code written where a utility already exists. Quality axis detects unnecessary surface (params, state, comments-of-what) and structure without functional cause (wrappers, ladders, copy-paste variants). Efficiency axis detects work that need not happen and structure that bloats hot paths. Behavior is preserved, entropy is reduced.
Axis prompts (verbatim, copy-pasteable):
references/reuse.md: Agent 1 prompt, four rules, Graft focusreferences/quality.md: Agent 2 prompt, nine patterns, Excess + Sprawlreferences/efficiency.md: Agent 3 prompt, seven patterns, Excess + Sprawlreferences/orchestration.md: single-message dispatch recipe, composition, Reviewer audit, fix-sequencingcleanup-codebase's territory.refactor-break-compat's territory.review.fix. simplify is self-sourcing.Phase 1: Detect diff scope. The diff must capture all branch state under review: every commit since the branch diverged from its base, plus staged, plus unstaged. The orchestrator does not guess the base; it resolves an explicit anchor, or errors. Resolve via the first base ref that exists, then run git diff <base> (no ..HEAD, so working-tree changes are included):
git merge-base HEAD origin/maingit merge-base HEAD origin/mastergit merge-base HEAD maingit merge-base HEAD master@{upstream} (the branch's configured upstream tracking ref, full divergence)If none of the five resolve, gate the working-tree-only fallback on two ordered checks: first that HEAD exists as a commit at all, then that it has no parent:
git rev-parse --verify HEAD 2>/dev/null. If it fails, HEAD is unborn (fresh git init, no commits yet). Skip git diff entirely and fall through to the user-named-files / no-git-context path below. Do not run git diff HEAD on an unborn HEAD; it errors and would mask the unborn state.git rev-parse --verify HEAD^ 2>/dev/null. If it fails, HEAD is the repo's root commit (real commit, no parent), so there is no committed history that could be silently dropped. The entire scope IS the working tree. Use git diff HEAD. Surface a one-line note: "scope: working-tree only, on root commit".simplify against <ref>" and abort. Do not fall back to git diff HEAD. On a local-only main/master/trunk/develop with committed work, that would silently drop the committed work, and the scope contract requires capturing every commit since branch divergence plus staged plus unstaged.If there is no git context at all (no .git/), or HEAD is unborn per Check A, fall back to user-named files supplied in the invocation. Empty after all valid resolutions → exit 11. See references/orchestration.md for the exact resolution shell snippet and the explicit-base override syntax.
Phase 2: Dispatch three review agents in one message. Single tool-call message containing three Agent invocations. Each agent receives <axis-prompt from references/> + "\n\n---\n\nDIFF:\n" + <captured diff>. Agents are read-only; no edits, disjoint axes, independence asserted in the spawn message. See references/orchestration.md for the concrete dispatch shape.
Phase 3: Audit, then apply. Wait for all three. Aggregate findings by {axis, file, line, issue-class}; dedupe identical cross-axis findings. Dispatch a Reviewer agent to audit the composed list against completeness / consistency / accuracy / scope; the Reviewer's output is the validated survivor set. The orchestrator applies the survivors directly, one issue-class per atomic commit, and drops non-survivors without comment. No re-adjudication in either direction. Re-run repo-native tests after each commit; on red, auto-revert via git revert HEAD --no-edit.
git revert HEAD --no-edit. No suppressing the type checker or disabling guards to make tests pass.~/.claude/claude/system-prompt-baseline.md <git> charter "one concern per commit" rule. Mixed-class commits trip exit 15.~/.claude/claude/system-prompt-baseline.md, the baseline wins.| Gate | Pass Criteria | Blocking |
|---|---|---|
| Diff scope detected | git diff (or staged / user-named fallback) produced a non-empty change-set | Yes; exit 11 if empty |
| Single-message dispatch | All three review agents launched in one tool-call message | Yes |
| Independence asserted | Spawn message documents the independence argument (disjoint axes, read-only) | Yes |
| Reviewer audit | Composed findings passed completeness / consistency / accuracy / scope check before fixes begin | Yes |
| Behavior preserved | Repo-native tests green after every fix commit | Yes; auto-revert on red, exit 13 |
| No new bloat | Post-fix audit shows no unneeded surface, duplicated logic, structure-without-cause, or broken contract introduced by the simplify patch | Yes; exit 14 |
| Atomic per class | Each commit contains exactly one issue-class (excess-surface OR duplicate OR structure) | Yes; exit 15 if mixed |
| Code | Meaning |
|---|---|
| 0 | Clean: simplification landed, all fix commits green, no new bloat introduced |
| 11 | No changes detected: diff empty after all fallbacks; pass-through, no work to do |
| 12 | False-positive-only findings: agents emitted findings but none survived the Reviewer audit; report attached, no patch needed |
| 13 | Behavior regression on a fix: tests went red; offending commit auto-reverted via git revert HEAD --no-edit |
| 14 | New bloat introduced: post-fix audit caught unneeded surface / duplicated logic / structure-without-cause / broken contract in the simplify patch; reverted, re-plan required |
| 15 | Mixed-concern commit: a fix commit bundled more than one issue-class; must split before merging |