diff options
| author | main <main@swarm.moe> | 2026-05-21 11:14:51 -0400 |
|---|---|---|
| committer | main <main@swarm.moe> | 2026-05-21 11:14:51 -0400 |
| commit | 89dba1d9c0034e6bc544b0f002a65ffe0b29e7dc (patch) | |
| tree | dbdc2a5f283eeb9444c202ece801462732a98fd8 /skills | |
| parent | 8e748db6ba0b52091fc4c3664c0bfba5c7185e68 (diff) | |
| download | rust_starter-89dba1d9c0034e6bc544b0f002a65ffe0b29e7dc.zip | |
Make exterminate-slop report-first
Diffstat (limited to 'skills')
| -rw-r--r-- | skills/exterminate-slop/SKILL.md | 157 | ||||
| -rw-r--r-- | skills/exterminate-slop/agents/openai.yaml | 4 |
2 files changed, 115 insertions, 46 deletions
diff --git a/skills/exterminate-slop/SKILL.md b/skills/exterminate-slop/SKILL.md index 4d15305..d309c9d 100644 --- a/skills/exterminate-slop/SKILL.md +++ b/skills/exterminate-slop/SKILL.md @@ -1,13 +1,13 @@ --- name: exterminate-slop -description: "Perform an exhaustive language-aware subtree audit and refactor pass for primitive obsession, under-abstraction, duplicated logic, defensive ceremony, and code-volume bloat. Use when Codex needs to inspect every source file in a requested scope, keep a persisted worklog/ledger, and refactor toward strong types, DRY abstractions, and sharply reduced code without behavior drift." +description: "Perform an exhaustive language-aware subtree audit for primitive obsession, under-abstraction, duplicated logic, defensive ceremony, and code-volume bloat. Use when Codex needs to inspect every source file in a requested scope, keep a persisted worklog/ledger, and produce a long, comprehensive, prioritized defect report that is directly executable as an implementation specification." --- # Exterminate Slop Read the target repo's AGENTS.md files first. -This is a slop extermination pass, not a style review. The objective is to crush code volume and ceremony while increasing semantic density. Preserve externally observable behavior unless the user explicitly asks for behavior change. Do not preserve backward compatibility by default. +This is a slop extermination audit, not a style review. The objective is to identify every material opportunity to crush code volume and ceremony while increasing semantic density, then write a standalone prioritized defect report precise enough to execute. Preserve externally observable behavior unless the user explicitly asks for behavior change. Do not preserve backward compatibility by default. ## Language Lens @@ -18,25 +18,24 @@ Before the first source read, determine the dominant implementation language for - Python: [references/languages/python.md](references/languages/python.md) - TypeScript: [references/languages/typescript.md](references/languages/typescript.md) -If the scope truly crosses language boundaries, start with the dominant language and load a second note only when edits must cross that boundary. If no note exists for the dominant language, proceed with this generic core and record the missing note in the worklog. +If the scope truly crosses language boundaries, start with the dominant language and load a second note only when the report or implementation must cross that boundary. If no note exists for the dominant language, proceed with this generic core and record the missing note in the worklog. ## Contract - Require a concrete source subtree. If the user names only a repo, choose the smallest plausible subtree and state the assumption. -- Default to `audit_plus_refactor` unless the user clearly wants findings only. +- Default to `defect_report`. Execute code changes only when the user explicitly asks for implementation. - Build a full manifest of in-scope source files for the chosen language. No sampling and no "representative files." - Exclude generated, vendored, build-output, fixture, snapshot, and dependency files unless the user explicitly includes them. - Create one persistent `/tmp` worklog before the first source read. Chat is summary only; the worklog is the durable source of truth. -- Take a cheap code-volume baseline for the manifest before edits. At minimum count lines; token count is welcome when cheap. +- Create one standalone `/tmp` defect report as the terminal artifact of the default pass. +- Take a cheap code-volume baseline for the manifest. At minimum count lines; token count is welcome when cheap. - Partition the manifest into intentional logical cliques before deep reading. - Read at most 8 files per wave. - Write a `/tmp` checkpoint after every wave before reading more files. - Record raw suspects during coverage, then promote only threshold-clearing suspects into the formal ledger after full coverage. -- Force a decision on every promoted ledger row. -- Do not edit until the promoted ledger exists, unless the user explicitly asked for a narrow hotfix instead of a full extermination pass. -- Refactor in abstraction batches, not in arbitrary file order. -- Run the narrowest meaningful checks after edits, then widen if the abstraction crosses boundaries. -- Re-scan the manifest and record residual slop plus code-volume delta. +- Force a decision and priority on every promoted ledger row. +- Do not edit source during `defect_report` mode. If implementation is requested, write the defect report first, then execute from it in priority/dependency order. +- Re-scan the manifest when implementation occurs and record residual slop plus code-volume delta. Files may be re-read. Re-reading is expected when a file belongs to multiple logical cliques or when a later duplication cluster changes the correct abstraction boundary. @@ -44,15 +43,16 @@ Files may be re-read. Re-reading is expected when a file belongs to multiple log ### 0. Create The Worklog -Create a path shaped like: +Create paths shaped like: ```text /tmp/exterminate-slop-<repo-or-dir>-<subtree-slug>.md +/tmp/exterminate-slop-<repo-or-dir>-<subtree-slug>-defect-report.md ``` -Seed it with the worklog skeleton below. +Seed the worklog with the skeleton below. -The worklog must hold the language lens, manifest, volume baseline, clique plan, wave checkpoints, rejected clusters, promoted ledger, edits, verification, residual sweep, and volume delta. +The worklog must hold the language lens, manifest, volume baseline, clique plan, wave checkpoints, rejected clusters, promoted ledger, defect report path, implementation batches if any, verification if any, residual sweep if any, and volume delta if any. If interrupted or resumed, reopen the same worklog before continuing. @@ -158,16 +158,86 @@ Allowed `kind` values: - `ceremonial_layer` - `volume_bloat` +Allowed `priority` values: + +- `P0`: systemic invariant failure, severe duplication contagion, or high-confidence volume collapse that should dominate the implementation plan +- `P1`: substantial local or cross-module payoff with a clear implementation shape +- `P2`: real defect with moderate payoff, narrower blast radius, or dependency on higher-priority cleanup +- `P3`: valid but marginal, risky, or best recorded as residual work + Allowed `decision` values: -- `refactor_now` +- `specify_now` - `defer` - `false_positive` - `needs_broader_design` -For every row, choose exactly one decision. The ledger is authoritative even if chat shows only a condensed view. +For every row, choose exactly one priority and one decision. The ledger is authoritative even if chat shows only a condensed view. + +### 7. Write The Defect Report + +Write the standalone defect report after the promoted ledger exists. It must be long, comprehensive, prioritized, and directly executable. Do not merely dump the ledger; synthesize it into an implementation specification. + +Use this shape: + +```markdown +# Exterminate Slop Defect Report: <scope> + +## Executive Summary + +Summarize inspected scope, language note, manifest coverage, dominant slop patterns, and the top defects. + +## Scope And Method + +- scope root +- language note +- manifest size +- excluded surfaces +- clique-wave summary +- worklog path +- volume baseline + +## Priority Order + +| priority | defect_id | title | kind | confidence | blast_radius | expected_payoff | dependencies | +|----------|-----------|-------|------|------------|--------------|-----------------|--------------| + +## Defects + +### <priority> <defect_id>: <title> -### 7. Refactor In Batches +**Kind:** +**Priority:** +**Confidence:** +**Sites:** +**Evidence:** +**Why This Is A Defect:** +**Proposed Shape:** +**Implementation Specification:** +**Behavior Preservation:** +**Verification:** +**Expected Code-Volume Effect:** +**Risks / Edge Cases:** +**Depends On / Blocks:** + +## Rejected Clusters + +Account briefly for suspects that did not deserve implementation. + +## Execution Notes + +Give recommended implementation order, batching boundaries, and pre-edit checks. + +## Residual Unknowns + +Record only real uncertainty, not generic caution. +``` + +Implementation specifications should describe the semantic move, files/sites affected, expected abstraction boundary, behavior-preservation obligations, and verification surface. They should be precise enough for an implementer to act without rerunning the audit from scratch. + +### 8. Optional Execution + +If the user explicitly asked for implementation, execute from the defect report in priority/dependency order after the report exists. Group work by semantic move: @@ -181,14 +251,7 @@ Group work by semantic move: Prefer the clean shape over compatibility. Apply the language note's sharper moves where it speaks. -### 8. Verify And Sweep - -After edits: - -- run relevant checks on the touched surface -- re-scan the same manifest -- measure code-volume delta -- update the worklog with eliminated rows, deferred rows, false positives, residual hotspots, verification, and volume results +After edits, run relevant checks on the touched surface, re-scan the same manifest, measure code-volume delta, and update the worklog with eliminated rows, deferred rows, false positives, residual hotspots, verification, and volume results. Prefer the narrowest checks that still validate the changed surface, then widen if needed. @@ -198,8 +261,9 @@ Prefer the narrowest checks that still validate the changed surface, then widen ```text worklog_path: +defect_report_path: scope_root: -inspection_mode: audit_only | audit_plus_refactor +mode: defect_report | defect_report_then_execute language: language_note: wave_size_limit: 8 @@ -216,7 +280,9 @@ rejected_clusters: promoted_ledger: -edits: +report_summary: + +implementation_batches: verification: @@ -230,7 +296,7 @@ volume_delta: ```text scope_root: -inspection_mode: audit_only | audit_plus_refactor +mode: defect_report | defect_report_then_execute language: language_note: wave_size_limit: 8 @@ -246,8 +312,8 @@ Rules: - include every source file in the requested subtree for the selected language - mark files as inspected only after reading them - allow files to appear in multiple clique waves -- do not delete rows from the manifest during refactoring -- use the same manifest again for the residual sweep +- do not delete rows from the manifest during implementation +- use the same manifest again for the residual sweep if implementation occurs ### Clique Wave Checkpoint @@ -300,20 +366,21 @@ Good rejection reasons: ### Promoted Ledger ```text -| row_id | path | symbol_or_site | kind | evidence | suspected_abstraction | duplication_cluster | volume_effect | confidence | decision | decision_reason | -|--------|------|----------------|------|----------|-----------------------|---------------------|---------------|------------|----------|-----------------| -| S001 | src/foo | User.id: string | primitive_semantics | parsed, validated, and compared in 3 places | UserId domain type | id-handling-1 | deletes repeated validation | high | refactor_now | domain identifier with repeated normalization | -| B001 | src/bar | run(..., dryRun: boolean) | boolean_mode | positional flag controls strategy | ExecutionMode variant | mode-flags-1 | removes branch duplication | high | refactor_now | bool hides a mode split | -| D001 | src/baz | copy/update loop | duplicate_logic | same field-by-field patch in 4 sites | owned patch function | patching-2 | deletes 40 lines | medium | refactor_now | one owner is obvious | +| defect_id | priority | path | symbol_or_site | kind | evidence | proposed_shape | duplication_cluster | volume_effect | confidence | implementation_order | decision | decision_reason | +|-----------|----------|------|----------------|------|----------|----------------|---------------------|---------------|------------|----------------------|----------|-----------------| +| S001 | P1 | src/foo | User.id: string | primitive_semantics | parsed, validated, and compared in 3 places | UserId domain type | id-handling-1 | deletes repeated validation | high | 1 | specify_now | domain identifier with repeated normalization | +| B001 | P1 | src/bar | run(..., dryRun: boolean) | boolean_mode | positional flag controls strategy | ExecutionMode variant | mode-flags-1 | removes branch duplication | high | 2 | specify_now | bool hides a mode split | +| D001 | P0 | src/baz | copy/update loop | duplicate_logic | same field-by-field patch in 4 sites | owned patch function | patching-2 | deletes 40 lines | medium | 0 | specify_now | one owner is obvious | ``` Requirements: - `evidence` must name the concrete smell, not a vague feeling -- `suspected_abstraction` must be specific +- `proposed_shape` must be specific - `volume_effect` must state deletion/compression potential when relevant - `duplication_cluster` must group related rows when applicable -- `decision_reason` must explain why the row did or did not graduate into an edit +- `implementation_order` must respect dependencies, not merely priority labels +- `decision_reason` must explain why the row did or did not graduate into the report - do not create rows for suspects that failed promotion; summarize those as rejected clusters instead ## Adjudication Checklist @@ -327,12 +394,12 @@ For every ledger row, ask: - Does this cross a boundary where the weak shape becomes contagious? - Would a stronger type or abstraction delete nearby code? - Is the abstraction name sharp enough to carry the invariant? -- Can the fix be made locally, or does it require a broader design cut? +- Can the fix be specified locally, or does it require a broader design cut? Decision mapping: -- `refactor_now`: the abstraction is clear and locally actionable now -- `defer`: the smell is real but the present diff would be premature +- `specify_now`: the abstraction is clear and actionable enough for the defect report +- `defer`: the smell is real but the present specification would be premature - `false_positive`: the shape is genuinely incidental or boundary-correct - `needs_broader_design`: the smell is real but the right abstraction spans a larger domain cut @@ -341,31 +408,33 @@ Decision mapping: Always include: - the `/tmp` worklog path +- the `/tmp` defect report path - language note used - manifest coverage summary - clique-wave summary - rejected-cluster summary - promoted-ledger summary -- volume baseline and delta +- priority summary +- volume baseline and expected code-volume payoff -If you edited code, also include: +If you edited code because implementation was explicitly requested, also include: - abstraction batches executed - verification summary - residual sweep summary - -If you did not edit code, include the highest-value next moves. +- actual volume delta ## Hard Failure Modes - do not inspect only "important" files - do not skip the `/tmp` worklog or keep checkpoint state only in chat +- do not omit the standalone defect report - do not read more than 8 files without a persisted checkpoint - do not silently compact a wave because you feel you "basically got it" - do not treat one clique as if it exhausts all duplication relationships - do not promote everything into the formal ledger just to feel exhaustive - do not drop non-promoted suspects on the floor; summarize them as rejected clusters -- do not jump into edits before the promoted ledger exists +- do not edit source in `defect_report` mode - do not propose generic cleanup without row-level evidence - do not preserve compatibility unless the user asked for it - do not let tests, lint, or formatters substitute for the extermination pass diff --git a/skills/exterminate-slop/agents/openai.yaml b/skills/exterminate-slop/agents/openai.yaml index 29a8acf..b9ddc4a 100644 --- a/skills/exterminate-slop/agents/openai.yaml +++ b/skills/exterminate-slop/agents/openai.yaml @@ -1,4 +1,4 @@ interface: display_name: "Exterminate Slop" - short_description: "Language-aware slop eradication" - default_prompt: "Use $exterminate-slop to perform an exhaustive subtree pass for primitive obsession, weak types, duplicated logic, defensive ceremony, and code-volume bloat." + short_description: "Prioritized slop defect report" + default_prompt: "Use $exterminate-slop to audit a subtree for primitive obsession, weak types, duplicated logic, defensive ceremony, and code-volume bloat, then write a comprehensive prioritized defect report." |