{"slug":"simplify","title":"simplify","summary":"Use when the user says \"simplify this diff\" or asks for a compression pass over a change-set. Not for dead-code sweeps: use deslop.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-08T21:38:42.23509Z","repo":{"url":"https://github.com/OutlineDriven/odin-claude-plugin","stars":38,"forks":0,"license":"Apache-2.0","updatedAt":"2026-09-25T15:08:42Z"},"bodyHtml":"<hr>\n<h2>name: simplify\ndescription: 'Use when the user says \"simplify this diff\" or asks for a compression pass over a change-set. Not for dead-code sweeps: use deslop.'</h2>\n<h1>Simplify: axis-decomposed compression pass on a diff</h1>\n<h2>Contract</h2>\n<table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Bound contract</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Trigger</td>\n<td>User asks to simplify a diff, PR, or branch: \"simplify this diff\", \"tighten up\", or \"compress a change-set\"</td>\n</tr>\n<tr>\n<td>Authority</td>\n<td>Reversible local: writes only named local artifacts (working-tree and VCS commits); rollback is version control (<code>git revert HEAD --no-edit</code>). No remote mutation.</td>\n</tr>\n<tr>\n<td>Side effect</td>\n<td>Applies simplification survivors as atomic issue-class commits to the working change-set; auto-reverts any commit that regresses</td>\n</tr>\n<tr>\n<td>Done</td>\n<td>Exit 0: simplification landed as issue-class commits, every fix commit is green, and no new bloat was introduced</td>\n</tr>\n</tbody>\n</table>\n<h2>Inputs</h2>\n<p>Must be supplied:</p>\n<ul>\n<li>An explicit diff scope or a base ref resolvable from HEAD</li>\n</ul>\n<p>Optional:</p>\n<ul>\n<li>User-named files when no git context exists (unborn HEAD or no <code>.git/</code>)</li>\n</ul>\n<p>Derived from the diff:</p>\n<ul>\n<li>Three parallel read-only review agents (reuse / quality / efficiency), each scoped to the diff</li>\n</ul>\n<h2>Procedure</h2>\n<ol>\n<li><p><strong>Phase 1: Detect diff scope.</strong> Capture every commit since the branch diverged from its base, including staged and unstaged changes. Do not guess the base. Resolve via the first base ref that exists, then run <code>git diff &lt;base&gt;</code>:</p>\n<ol>\n<li><code>git merge-base HEAD origin/main</code></li>\n<li><code>git merge-base HEAD origin/master</code></li>\n<li><code>git merge-base HEAD main</code></li>\n<li><code>git merge-base HEAD master</code></li>\n<li><code>@{upstream}</code></li>\n</ol>\n<p>If none of the five resolve, gate on two ordered checks:</p>\n<ul>\n<li>Check A: <code>git rev-parse --verify HEAD 2&gt;/dev/null</code>. If it fails, HEAD is unborn. Skip <code>git diff</code>; fall through to user-named files or no-git-context path.</li>\n<li>Check B: only if Check A succeeded, <code>git rev-parse --verify HEAD^ 2&gt;/dev/null</code>. If it fails, HEAD is the root commit. Use <code>git diff HEAD</code>. Surface: \"scope: working-tree only, on root commit\".</li>\n<li>Otherwise: committed history exists but no base ref resolves. Print an explicit error and abort. Do not fall back to <code>git diff HEAD</code>; that would silently drop committed work.</li>\n</ul>\n<p>If no git context or HEAD is unborn, use user-named files supplied in the invocation. Empty after all valid resolutions → exit 11.</p>\n<p><strong>Explicit-base override:</strong> <code>simplify against &lt;ref&gt;</code> bypasses the resolution above and runs <code>git --no-pager diff \"&lt;ref&gt;\"</code> directly.</p>\n<p>Done when: the diff is captured or an exit code is returned.</p>\n</li>\n<li><p><strong>Phase 2: Dispatch three review agents in one <code>task</code> call.</strong> Issue a single <code>task</code> tool call with a <code>tasks</code> array of three items, never three sequential messages. Each agent receives <code>&lt;axis-prompt from references/&gt; + \"\\n\\n---\\n\\nDIFF:\\n\" + &lt;captured diff&gt;</code>. All three agents are read-only; disjoint axes; independence asserted in the spawn message:</p>\n<blockquote>\n<p>\"Three agents dispatched in parallel. Axes are disjoint by construction: reuse-axis owns Graft (existing-utility detection), quality-axis owns Excess + Sprawl on code shape, efficiency-axis owns Excess + Sprawl on execution cost. All three agents are read-only; none edits files; none reads or writes shared mutable state.\"</p>\n</blockquote>\n<p>Agent type: <code>Explore</code> (read-only).</p>\n<p>Axes:</p>\n<ul>\n<li>reuse (Agent 1): four rules (REPLACE, DUPLICATE, INLINE-COULD-USE-UTILITY, STDLIB-REIMPLEMENT). Detects new code written where a utility already exists.</li>\n<li>quality (Agent 2): nine patterns (redundant-state, parameter-sprawl, copy-paste-variation, leaky-abstractions, stringly-typed, redundant-structural-nesting, nested-conditionals, unnecessary-comments, dead-code-unused-imports-exports). Detects unnecessary surface and structure without functional cause.</li>\n<li>efficiency (Agent 3): seven patterns (unnecessary-work, missed-concurrency, hot-path-bloat, recurring-no-op-updates, unnecessary-existence-checks, memory-listener-leaks, overly-broad-operations). Detects work that need not happen and structure that bloats hot paths.</li>\n</ul>\n<p>See <code>references/orchestration.md</code> for the concrete dispatch shape and shell snippet.</p>\n<p>Done when: all three agents return their findings.</p>\n</li>\n<li><p><strong>Phase 3: Audit, then apply.</strong> Wait for all three agents. Aggregate findings by <code>{axis, file, line, issue-class}</code>. Deduplicate identical cross-axis findings: keep each once, attribute it to the first reporter, and note the second axis as a co-signer. Dispatch a Reviewer agent (also <code>Explore</code>-typed and read-only) to audit the composed list for completeness, consistency, accuracy, and scope. The Reviewer's output is the <strong>validated survivor set</strong>. The orchestrator applies survivors directly, one issue class per atomic commit, and drops non-survivors without comment or re-adjudication. After each commit, run repo-native tests. On red, auto-revert via <code>git revert HEAD --no-edit</code> and stop that class's run.</p>\n<p>Commit sequencing by class:</p>\n<ol>\n<li>Duplicate commit: reuse-axis survivors + any other axis flagged <code>issue-class: duplicate</code></li>\n<li>Excess-surface commit: quality-axis + efficiency-axis survivors flagged <code>issue-class: excess-surface</code></li>\n<li>Structure commit: quality-axis + efficiency-axis survivors flagged <code>issue-class: structure</code></li>\n</ol>\n<p>Commit message format: capitalized imperative subject, ≤50 chars target, ≤72 hard, no trailing period.</p>\n<p>After the final commit, audit the simplify patch itself for unneeded surface, duplicated logic, structure without cause, or a broken consumer contract. If the audit finds any, revert the entire simplify chain via <code>git revert &lt;first-simplify-commit&gt;^..HEAD --no-edit</code> and exit 14.</p>\n<p>Done when: all survivor commits are applied and green, or an exit code is returned.</p>\n</li>\n</ol>\n<h2>Failure and recovery</h2>\n<table>\n<thead>\n<tr>\n<th>Exit code</th>\n<th>Trigger</th>\n<th>Recovery</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>0</td>\n<td>Clean</td>\n<td>none</td>\n</tr>\n<tr>\n<td>11</td>\n<td>Empty diff after all fallbacks</td>\n<td>Pass-through, no work to do</td>\n</tr>\n<tr>\n<td>12</td>\n<td>Findings emitted but survivor set empty after Reviewer audit</td>\n<td>Report attached, no patch applied</td>\n</tr>\n<tr>\n<td>13</td>\n<td>Behavior regression on a fix commit</td>\n<td>Offending commit auto-reverted; stop simplify run for that class; already-landed commits remain</td>\n</tr>\n<tr>\n<td>14</td>\n<td>Post-fix audit caught new bloat in the simplify patch</td>\n<td>Entire simplify chain reverted; orchestrator may re-plan and re-invoke</td>\n</tr>\n<tr>\n<td>15</td>\n<td>Mixed-concern commit (bundles more than one issue-class)</td>\n<td>Must split before merging</td>\n</tr>\n</tbody>\n</table>\n<p>Partial-result rule: commits already landed before a failure remain. A rollback does not revert previously successful class commits.</p>\n<p>Non-mutation rule: sequential dispatch (not a single <code>task</code> call with a <code>tasks</code> array of three items) is rejected at the validation gate before any agent runs.</p>\n<h2>Output</h2>\n<p>Terminal classification with an exit code. On exit 0: the change-set is compressed along reuse / quality / efficiency axes with one atomic commit per issue class, every fix commit green, and no new bloat introduced.</p>\n","files":[{"path":"agents/openai.yaml","sizeBytes":157,"isText":true},{"path":"references/efficiency.md","sizeBytes":4767,"isText":true},{"path":"references/orchestration.md","sizeBytes":6026,"isText":true},{"path":"references/quality.md","sizeBytes":7156,"isText":true},{"path":"references/reuse.md","sizeBytes":4131,"isText":true},{"path":"SKILL.md","sizeBytes":6809,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-08T21:40:13.061412Z","sha256":"BF7479091FE2F49A567C1DAD4B4295BFF21B3A4B8EEBC48F174C7FB60A426A9E","sizeBytes":14546},"review":null,"source":{"repositoryUrl":"https://github.com/OutlineDriven/odin-claude-plugin","path":"plugins/odin-code/skills/simplify","license":"Apache-2.0","commit":"8ce0e87a3e88043cdeb4be21eec5565bbdc638ea","subtreeSha":"A23710DBF11EE7B766E7AEDF7B2F31D3D362087F290ABE8E52E98417C2570DF5","lastSyncedAt":"2026-09-26T23:11:44.497011Z"},"reviewedAt":"2026-09-08T21:43:02.733014Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/OutlineDriven/odin-claude-plugin/tree/main/plugins/odin-code/skills/simplify"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install outlinedriven-odin-claude-plugin@llmmart"},{"target":"git","command":"git clone https://github.com/OutlineDriven/odin-claude-plugin.git"}]}