From 3862514d6f6005a9b5e6fcb806c153230ad2ded2 Mon Sep 17 00:00:00 2001 From: Lukasz Boryn Date: Fri, 19 Jun 2026 01:04:46 +0200 Subject: [PATCH] feat(skills): port nuke-review structural-quality skill from cursor team-kit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds engineering/nuke-review/SKILL.md — adaptation of cursor/plugins thermo-nuclear-code-quality-review. User-invoked (disable-model-invocation: true). 100 lines after trimming the upstream ~200-line original. Trims: consolidated the three checklists (Primary Questions / What to Flag / Preferred Remedies) into one 6-theme "What to look for, what to push for" section; the 8 Non-negotiable Standards kept verbatim as headlines with sub-bullets compressed; 3 of the original ~9 "Good phrases" kept inline as voice cues (a sibling would weaken the priming effect). Positions the four post-green review surfaces as distinct axes: - review-angles correctness / robustness (finder angles) - nuke-review structural quality / code judo (NEW) - winnow mechanical debloat (line-count scoreboard) - cavecrew-octobot invocation cheatsheet for caveman:cavecrew-reviewer (the agent that executes any of the three axes) bdd/SKILL.md "After green" section now lists all three axes (was: review-angles only); compensating cut to the Vocabulary blurb keeps it at 103 lines (pre-existing over-cap, no further regression). Cross-refs added in review-angles, winnow, cavecrew-octobot See-also. Source: cursor/plugins@main cursor-team-kit/skills/thermo-nuclear-code-quality-review/SKILL.md --- README.md | 4 + skills/engineering/bdd/SKILL.md | 12 +-- skills/engineering/nuke-review/SKILL.md | 100 ++++++++++++++++++ skills/engineering/review-angles/SKILL.md | 4 +- skills/engineering/winnow/SKILL.md | 3 +- skills/productivity/cavecrew-octobot/SKILL.md | 5 + 6 files changed, 119 insertions(+), 9 deletions(-) create mode 100644 skills/engineering/nuke-review/SKILL.md diff --git a/README.md b/README.md index 7a94812..5f41c9e 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ skill list. locks, readiness surfaces — the failures a green unit suite misses. - **review-angles** — recall-biased correctness checklist for the post-green review pass (stale refs, TOCTOU, ordering state, durability, invalidation). +- **nuke-review** — exceptionally strict structural-quality review for code + judo moves; ported from cursor/plugins thermo-nuclear-code-quality-review. + Pairs with `review-angles` (correctness) and `winnow` (debloat) as the + three post-green review axes. User-invoked. - **bdd** — strict red-green-refactor loop with BDD Given/When/Then scenarios as the unit of work. - **diagnose** — six-phase bug hunt: feedback loop → reproduce → diff --git a/skills/engineering/bdd/SKILL.md b/skills/engineering/bdd/SKILL.md index 80a6d08..f300b13 100644 --- a/skills/engineering/bdd/SKILL.md +++ b/skills/engineering/bdd/SKILL.md @@ -14,8 +14,7 @@ description: Drive implementation with a strict red-green-refactor loop where ev ## Vocabulary Before step 1, anchor on [../codebase-design/SKILL.md](../codebase-design/SKILL.md) — -module, interface, seam, adapter, depth, leverage, locality. Language siblings -below restate the vocabulary in R / Python idiom. +module, interface, seam, adapter, depth, leverage, locality. ## Language references — Python Pytest only — `@pytest.fixture`, `parametrize`, scenario as docstring. @@ -86,10 +85,11 @@ Testthat ed. 3+, `box::use`, `describe`/`it`. A green suite is a *claim*, not a proof: it never exercised thread death, caller ordering, stale data, or the shape the real producer emits (see [anti-patterns.md](anti-patterns.md) *"Fixtures that don't match what the -producer emits"*). After the loop is green, **budget a recall-biased -review pass** — [`../review-angles/SKILL.md`](../review-angles/SKILL.md) — and -refute it ([refute.md](../review-angles/refute.md)) before calling it done. -Fix findings red-test-first, like any other feature. +producer emits"*). After the loop is green, **budget a review pass** across +three axes: correctness ([`../review-angles/SKILL.md`](../review-angles/SKILL.md)), +structural quality ([`../nuke-review/SKILL.md`](../nuke-review/SKILL.md)), +mechanical debloat ([`../winnow/SKILL.md`](../winnow/SKILL.md)). Refute +each finding ([refute.md](../review-angles/refute.md)); fix red-test-first. ## Guardrails - **Never** skip red, write >1 failing test at once, or refactor while red. diff --git a/skills/engineering/nuke-review/SKILL.md b/skills/engineering/nuke-review/SKILL.md new file mode 100644 index 0000000..71d0e82 --- /dev/null +++ b/skills/engineering/nuke-review/SKILL.md @@ -0,0 +1,100 @@ +--- +name: nuke-review +description: Exceptionally strict structural-quality review for code judo moves — restructurings that preserve behaviour while making implementation dramatically simpler. Push for whole branches / helpers / modes to disappear, not just be polished. Flag file-size sprawl past 1k lines, ad-hoc spaghetti conditionals in unrelated flows, type/boundary muddiness, canonical-layer drift, and avoidable sequential orchestration. Use when the user says "nuke-review", "/nuke-review", "thermo-nuclear review", "code judo", "harsh maintainability review", "deep quality audit", or wants the strict structural review that goes beyond review-angles' correctness axis. +disable-model-invocation: true +--- + +# nuke-review + +Adapted from [thermo-nuclear-code-quality-review](https://github.com/cursor/plugins/blob/main/cursor-team-kit/skills/thermo-nuclear-code-quality-review/SKILL.md). +**Structural-quality review** — goal is to *delete* moving pieces, not rearrange them. +Pair with [`../review-angles/SKILL.md`](../review-angles/SKILL.md) (correctness) +and [`../winnow/SKILL.md`](../winnow/SKILL.md) (debloat). + +## Core prompt + +> Perform a deep code quality audit of the current branch's changes. Rethink +> how to structure / implement the changes to meaningfully improve code +> quality without impacting behaviour. Work to improve abstractions, +> modularity, reduce spaghetti, improve succinctness and legibility. Be +> ambitious — if there is a clear path to restructuring some of the codebase, +> go for it. Measure twice, cut once. + +## Non-negotiable standards + +0. **Be ambitious about structural simplification.** Hunt for code-judo + moves where whole branches, helpers, modes, conditionals, or layers + disappear. Prefer the solution that makes the code feel inevitable in hindsight. +1. **A PR pushing a file from <1k to >1k lines is a smell.** Prefer + extraction; if the threshold is crossed, ask explicitly whether the code + should be decomposed first. +2. **No random spaghetti growth.** Suspicious of new ad-hoc conditionals, + scattered special cases, one-off branches in unrelated flows. Push the + logic into a dedicated abstraction. +3. **Clean the design, don't accept working code.** If behaviour stays the + same while structure becomes cleaner, push for the cleaner version. + Prefer simplifications that *remove* pieces over refactors that spread complexity around. +4. **Direct, boring, maintainable over hacky or magical.** Skeptical of + generic mechanisms that hide simple data-shape assumptions; thin + abstractions and identity wrappers add indirection without buying clarity. +5. **Type and boundary cleanliness.** Question unnecessary optionality, + `unknown`, `any`, cast-heavy code where a clearer boundary could exist. + Silent fallback over an unclear invariant → make the boundary explicit. +6. **Logic in the canonical layer; reuse canonical helpers.** Flag feature + logic leaking into shared paths, implementation leaking through APIs, + bespoke one-offs where a canonical utility exists. +7. **Sequential orchestration and non-atomic updates are smells when a + cleaner shape is obvious.** Independent work serialised → ask about + parallel. Half-applied state → push for atomic. + +## What to look for, what to push for + +**Code judo & decomposition.** Refactors that move complexity around without +reducing concepts; large files crossing 1k lines. Push for the path that +*deletes* a layer, not the one that polishes it; split the file first. + +**Spaghetti.** New ad-hoc conditionals, one-off booleans, nullable modes +inserted into unrelated paths. Push for a dedicated abstraction, state +machine, or policy object — not tangling an existing flow. + +**Indirection.** Thin wrappers, identity abstractions, generic "magic" hiding +simple structure. Push to delete the wrapper. + +**Type & boundary muddiness.** Unnecessary casts, `any`, `unknown`, optional +params, silent fallback over unclear invariants. Push to make the type +boundary explicit so control flow simplifies. + +**Canonical placement.** Feature logic leaking into shared paths, bespoke +helpers duplicating canonical utilities, logic in the wrong layer. Push to +move it home and reuse the canonical helper. + +**Atomicity & orchestration.** Sequential flow where independent work could +parallelize; related updates that can leave state half-applied. Push for +parallel or atomic shapes. + +## How to phrase findings — direct, serious, demanding; not rude +- *"this pushes the file past 1k lines. can we decompose this first?"* +- *"this works, but it makes the surrounding code more spaghetti. let's keep the behaviour and restructure the implementation."* +- *"i think there's a code-judo move here that makes this much simpler. can we reframe so these branches disappear?"* + +## Output + +Prioritise (high → low): structural regressions, missed code-judo, spaghetti +growth, boundary / type-contract problems, file-size, modularity, legibility. +A small number of high-conviction comments beats a long list of cosmetic notes. + +## Approval bar + +Don't approve because behaviour is correct. Each is a presumptive blocker unless justified: +- preserves incidental complexity when a code-judo move would delete it +- pushes a file past 1000 lines +- adds ad-hoc branching that tangles an existing flow +- scatters feature checks across shared code +- adds an unnecessary abstraction, wrapper, or cast-heavy contract +- duplicates a canonical helper or puts logic in the wrong layer + +## See also +- [`../review-angles/SKILL.md`](../review-angles/SKILL.md) — the *correctness* axis: stale refs, TOCTOU, ordering, durability. +- [`../winnow/SKILL.md`](../winnow/SKILL.md) — the *mechanical debloat* axis: single-tag findings, `net: -N lines` scoreboard. Pairs naturally — nuke-review judges shape; winnow clears chaff. +- [`../codebase-design/SKILL.md`](../codebase-design/SKILL.md) — the vocabulary nuke-review applies (deep modules, seams, leverage, locality). +- [`../../productivity/cavecrew-octobot/SKILL.md`](../../productivity/cavecrew-octobot/SKILL.md) — how to spawn `caveman:cavecrew-reviewer` to *execute* this axis on a diff. diff --git a/skills/engineering/review-angles/SKILL.md b/skills/engineering/review-angles/SKILL.md index c6f7bfa..f4a0d8b 100644 --- a/skills/engineering/review-angles/SKILL.md +++ b/skills/engineering/review-angles/SKILL.md @@ -70,5 +70,5 @@ angle is worth more than a green suite. sit *after*; fixes land as new red-first scenarios here. - [`../background-work/SKILL.md`](../background-work/SKILL.md) — the threading / lock / readiness angles, split out because they share a setup. -- [`../winnow/SKILL.md`](../winnow/SKILL.md) — the *structural* axis (what to - delete) review-angles deliberately leaves alone; opposite concern. +- [`../nuke-review/SKILL.md`](../nuke-review/SKILL.md) — the *structural-quality* review axis (code-judo). Different axis from these angles' correctness focus. +- [`../winnow/SKILL.md`](../winnow/SKILL.md) — the *mechanical debloat* axis (what to delete). Different again. diff --git a/skills/engineering/winnow/SKILL.md b/skills/engineering/winnow/SKILL.md index 08da188..271f03b 100644 --- a/skills/engineering/winnow/SKILL.md +++ b/skills/engineering/winnow/SKILL.md @@ -76,11 +76,12 @@ it sharp. ## See also - [`../sieve/SKILL.md`](../sieve/SKILL.md) — the judgment gate. Sieve decides what earns its place; winnow mechanically clears what doesn't. +- [`../nuke-review/SKILL.md`](../nuke-review/SKILL.md) — *structural-quality* review (code-judo). Pairs naturally — nuke-review judges shape; winnow clears chaff. - [`../codebase-design/SKILL.md`](../codebase-design/SKILL.md) — the **deletion test** formalised: if removing a module makes complexity vanish, it was a pass-through; if it reappears across N callers, it earned its keep. The `delete` and `yagni` tags are this test mechanised. - [`../bdd/refactoring-r.md`](../bdd/refactoring-r.md) — file the architectural follow-ups a winnow surfaces; don't auto-cut them mid-pass. -- [`../review-angles/SKILL.md`](../review-angles/SKILL.md) — the correctness +- [`../review-angles/SKILL.md`](../review-angles/SKILL.md) — the *correctness* axis winnow deliberately does not touch. diff --git a/skills/productivity/cavecrew-octobot/SKILL.md b/skills/productivity/cavecrew-octobot/SKILL.md index f0f9e1c..b1801c7 100644 --- a/skills/productivity/cavecrew-octobot/SKILL.md +++ b/skills/productivity/cavecrew-octobot/SKILL.md @@ -70,3 +70,8 @@ fan out concurrently. ## Verify - The `Agent` call used a `caveman:`-prefixed `subagent_type`. - A review pass named the diff source (`jj diff` / `-r @-`) in its prompt. + +## See also (review axis/discipline lives here, not in the cavecrew skill) +- [`../../engineering/review-angles/SKILL.md`](../../engineering/review-angles/SKILL.md) — *correctness*. +- [`../../engineering/nuke-review/SKILL.md`](../../engineering/nuke-review/SKILL.md) — *structural quality* (code-judo). +- [`../../engineering/winnow/SKILL.md`](../../engineering/winnow/SKILL.md) — *mechanical debloat*.