Thermo-Nuclear Code Quality Review
Use this skill for an unusually strict review focused on implementation quality, maintainability, abstraction quality, and codebase health.
Above all, this skill should push the reviewer to be ambitious about code structure. Do not merely identify local cleanup opportunities. Actively search for "code judo" moves: restructurings that preserve behavior while making the implementation dramatically simpler, smaller, more direct, and more elegant.
Core Prompt
Start from this baseline:
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 behavior.
Work to improve abstractions, modularity, reduce Spaghetti code, improve succinctness and legibility.
Be ambitious, if there is a clear path to improving the implementation that involves restructuring some of the codebase, go for it.
Be extremely thorough and rigorous. Measure twice, cut once.
Non-Negotiable Additional Standards
Apply the baseline prompt above, plus these explicit review rules:
Be ambitious about structural simplification.
- Do not stop at "this could be a bit cleaner."
- Look for opportunities to reframe the change so that whole branches, helpers, modes, conditionals, or layers disappear entirely.
- Prefer the solution that makes the code feel inevitable in hindsight.
- Assume there is often a "code judo" move available: a re-organization that uses the existing architecture more effectively and makes the change dramatically simpler and more elegant.
- If you see a path to delete complexity rather than rearrange it, push hard for that path.
- Fix: delete the layer of indirection rather than polish it, or reframe the state or ownership model so the conditionals disappear entirely.
Do not let a PR push a file from under 1k lines to over 1k lines without a very strong reason.
- Treat this as a strong code-quality smell by default.
- Prefer extracting helpers, subcomponents, modules, or local abstractions instead of letting a file sprawl past 1000 lines.
- If the diff crosses that threshold, explicitly ask whether the code should be decomposed first.
- Only waive this if there is a compelling structural reason and the resulting file is still clearly organized.
- Fix: extract a helper or pure function, or split the file into smaller focused modules.
Do not allow random spaghetti growth in existing code.
- Be highly suspicious of new ad-hoc conditionals, scattered special cases, or one-off branches inserted into unrelated flows.
- If a change adds "weird if statements in random places", treat that as a design problem, not a stylistic nit.
- Prefer pushing the logic into a dedicated abstraction, helper, state machine, policy object, or separate module instead of tangling an existing path.
- Call out changes that make the surrounding code harder to reason about, even if they technically work.
- Fix: turn the special-case logic into a simpler default flow with fewer exceptions, or collapse duplicate branches into one clear path.
Bias toward cleaning the design, not just accepting working code.
- If behavior can stay the same while the structure becomes meaningfully cleaner, push for the cleaner version.
- Do not rubber-stamp "it works" implementations that leave the codebase messier.
- Strongly prefer simplifications that remove moving pieces altogether over refactors that merely spread the same complexity around.
Prefer direct, boring, maintainable code over hacky or magical code.
- Treat brittle, ad-hoc, or "magic" behavior as a code-quality problem.
- Be skeptical of generic mechanisms that hide simple data-shape assumptions.
- Flag thin abstractions, identity wrappers, or pass-through helpers that add indirection without buying clarity.
- Fix: delete wrappers that do not meaningfully clarify the API.
Push hard on type and boundary cleanliness when they affect maintainability.
- Question unnecessary optionality,
unknown, any, or cast-heavy code when a clearer type boundary could exist.
- Prefer explicit typed models or shared contracts over loosely-shaped ad-hoc objects.
- If a branch relies on silent fallback to paper over an unclear invariant, ask whether the boundary should be made explicit instead.
- Fix: replace condition chains with a typed model or explicit dispatcher, and make the type boundary explicit.
Keep logic in the canonical layer and reuse existing helpers.
- Call out feature logic leaking into shared paths or implementation details leaking through APIs.
- Prefer existing canonical utilities/helpers over bespoke one-offs.
- Push code toward the right package, service, or module instead of normalizing architectural drift.
- Fix: move the logic behind a dedicated abstraction in the package or module that already owns the concept, and reuse the existing canonical helper instead of a near-duplicate.
Treat unnecessary sequential orchestration and non-atomic updates as design smells when the cleaner structure is obvious.
- If independent work is serialized for no good reason, ask whether the flow should run in parallel instead.
- If related updates can leave state half-applied, push for a more atomic structure.
- Do not over-index on micro-optimizations, but do flag avoidable orchestration complexity that makes the implementation more brittle.
- Fix: separate orchestration from business logic, parallelize independent work, and restructure related updates into a more atomic flow.
Primary Review Questions
Turn each Non-Negotiable Standard (0-7) into a question when reviewing: does this change violate it?
What to Flag Aggressively
Flag any violation of the Non-Negotiable Standards above aggressively; do not soften it into a stylistic nit.
Push past "maybe rename this" feedback and a merely-cleaner-but-still-messy version to name the structural fix when one exists.
Review Tone
Be direct, serious, and demanding about quality.
Do not be rude, but do not soften major maintainability issues into mild suggestions.
If the code is making the codebase messier, say so clearly.
If the implementation missed an opportunity for a dramatic simplification, say that clearly too.
Good phrases:
this pushes the file past 1k lines. can we decompose this first?
this adds another special-case branch into an already busy flow. can we move this behind its own abstraction?
this works, but it makes the surrounding code more spaghetti. let's keep the behavior and restructure the implementation.
this feels like feature logic leaking into a shared path. can we isolate it?
this abstraction seems unnecessary. can we just keep the direct flow?
why does this need a cast / optional here? can we make the boundary more explicit instead?
this looks like a bespoke helper for something we already have elsewhere. can we reuse the canonical one?
i think there's a code-judo move here that makes this much simpler. can we reframe this so these branches disappear?
this refactor moves complexity around, but doesn't really delete it. is there a way to make the model itself simpler?
Output Expectations
Prioritize findings in this order:
- Structural code-quality regressions
- Missed opportunities for dramatic simplification / code-judo restructuring
- Spaghetti / branching complexity increases
- Boundary / abstraction / type-contract problems that make the code harder to reason about
- File-size and decomposition concerns
- Modularity and abstraction issues
- Legibility and maintainability concerns
Do not flood the review with low-value nits if there are larger structural issues.
Prefer a smaller number of high-conviction comments over a long list of cosmetic notes.
Approval Bar
Do not approve merely because behavior seems correct. Block on any unresolved violation of a Non-Negotiable Standard (0-7) unless the author gives a clear justification.
If a Standard is violated without justification, leave explicit, actionable feedback and push for a cleaner decomposition.
1---2name: thermo-nuclear-code-quality-review3description: Runs an extremely strict maintainability review: abstraction quality, giant files, spaghetti growth.4---56# Thermo-Nuclear Code Quality Review78Use this skill for an unusually strict review focused on implementation quality, maintainability, abstraction quality, and codebase health.910Above all, this skill should push the reviewer to be **ambitious** about code structure. Do not merely identify local cleanup opportunities. Actively search for "code judo" moves: restructurings that preserve behavior while making the implementation dramatically simpler, smaller, more direct, and more elegant.1112## Core Prompt1314Start from this baseline:1516> Perform a deep code quality audit of the current branch's changes.17> Rethink how to structure / implement the changes to meaningfully improve code quality without impacting behavior.18> Work to improve abstractions, modularity, reduce Spaghetti code, improve succinctness and legibility.19> Be ambitious, if there is a clear path to improving the implementation that involves restructuring some of the codebase, go for it.20> Be extremely thorough and rigorous. Measure twice, cut once.2122## Non-Negotiable Additional Standards2324Apply the baseline prompt above, plus these explicit review rules:25260. **Be ambitious about structural simplification.**27 - Do not stop at "this could be a bit cleaner."28 - Look for opportunities to reframe the change so that whole branches, helpers, modes, conditionals, or layers disappear entirely.29 - Prefer the solution that makes the code feel inevitable in hindsight.30 - Assume there is often a "code judo" move available: a re-organization that uses the existing architecture more effectively and makes the change dramatically simpler and more elegant.31 - If you see a path to delete complexity rather than rearrange it, push hard for that path.32 - Fix: delete the layer of indirection rather than polish it, or reframe the state or ownership model so the conditionals disappear entirely.33341. **Do not let a PR push a file from under 1k lines to over 1k lines without a very strong reason.**35 - Treat this as a strong code-quality smell by default.36 - Prefer extracting helpers, subcomponents, modules, or local abstractions instead of letting a file sprawl past 1000 lines.37 - If the diff crosses that threshold, explicitly ask whether the code should be decomposed first.38 - Only waive this if there is a compelling structural reason and the resulting file is still clearly organized.39 - Fix: extract a helper or pure function, or split the file into smaller focused modules.40412. **Do not allow random spaghetti growth in existing code.**42 - Be highly suspicious of new ad-hoc conditionals, scattered special cases, or one-off branches inserted into unrelated flows.43 - If a change adds "weird if statements in random places", treat that as a design problem, not a stylistic nit.44 - Prefer pushing the logic into a dedicated abstraction, helper, state machine, policy object, or separate module instead of tangling an existing path.45 - Call out changes that make the surrounding code harder to reason about, even if they technically work.46 - Fix: turn the special-case logic into a simpler default flow with fewer exceptions, or collapse duplicate branches into one clear path.47483. **Bias toward cleaning the design, not just accepting working code.**49 - If behavior can stay the same while the structure becomes meaningfully cleaner, push for the cleaner version.50 - Do not rubber-stamp "it works" implementations that leave the codebase messier.51 - Strongly prefer simplifications that remove moving pieces altogether over refactors that merely spread the same complexity around.52534. **Prefer direct, boring, maintainable code over hacky or magical code.**54 - Treat brittle, ad-hoc, or "magic" behavior as a code-quality problem.55 - Be skeptical of generic mechanisms that hide simple data-shape assumptions.56 - Flag thin abstractions, identity wrappers, or pass-through helpers that add indirection without buying clarity.57 - Fix: delete wrappers that do not meaningfully clarify the API.58595. **Push hard on type and boundary cleanliness when they affect maintainability.**60 - Question unnecessary optionality, `unknown`, `any`, or cast-heavy code when a clearer type boundary could exist.61 - Prefer explicit typed models or shared contracts over loosely-shaped ad-hoc objects.62 - If a branch relies on silent fallback to paper over an unclear invariant, ask whether the boundary should be made explicit instead.63 - Fix: replace condition chains with a typed model or explicit dispatcher, and make the type boundary explicit.64656. **Keep logic in the canonical layer and reuse existing helpers.**66 - Call out feature logic leaking into shared paths or implementation details leaking through APIs.67 - Prefer existing canonical utilities/helpers over bespoke one-offs.68 - Push code toward the right package, service, or module instead of normalizing architectural drift.69 - Fix: move the logic behind a dedicated abstraction in the package or module that already owns the concept, and reuse the existing canonical helper instead of a near-duplicate.70717. **Treat unnecessary sequential orchestration and non-atomic updates as design smells when the cleaner structure is obvious.**72 - If independent work is serialized for no good reason, ask whether the flow should run in parallel instead.73 - If related updates can leave state half-applied, push for a more atomic structure.74 - Do not over-index on micro-optimizations, but do flag avoidable orchestration complexity that makes the implementation more brittle.75 - Fix: separate orchestration from business logic, parallelize independent work, and restructure related updates into a more atomic flow.7677## Primary Review Questions7879Turn each Non-Negotiable Standard (0-7) into a question when reviewing: does this change violate it?8081## What to Flag Aggressively8283Flag any violation of the Non-Negotiable Standards above aggressively; do not soften it into a stylistic nit.8485Push past "maybe rename this" feedback and a merely-cleaner-but-still-messy version to name the structural fix when one exists.8687## Review Tone8889Be direct, serious, and demanding about quality.90Do not be rude, but do not soften major maintainability issues into mild suggestions.91If the code is making the codebase messier, say so clearly.92If the implementation missed an opportunity for a dramatic simplification, say that clearly too.9394Good phrases:9596- `this pushes the file past 1k lines. can we decompose this first?`97- `this adds another special-case branch into an already busy flow. can we move this behind its own abstraction?`98- `this works, but it makes the surrounding code more spaghetti. let's keep the behavior and restructure the implementation.`99- `this feels like feature logic leaking into a shared path. can we isolate it?`100- `this abstraction seems unnecessary. can we just keep the direct flow?`101- `why does this need a cast / optional here? can we make the boundary more explicit instead?`102- `this looks like a bespoke helper for something we already have elsewhere. can we reuse the canonical one?`103- `i think there's a code-judo move here that makes this much simpler. can we reframe this so these branches disappear?`104- `this refactor moves complexity around, but doesn't really delete it. is there a way to make the model itself simpler?`105106## Output Expectations107108Prioritize findings in this order:1091101. Structural code-quality regressions1112. Missed opportunities for dramatic simplification / code-judo restructuring1123. Spaghetti / branching complexity increases1134. Boundary / abstraction / type-contract problems that make the code harder to reason about1145. File-size and decomposition concerns1156. Modularity and abstraction issues1167. Legibility and maintainability concerns117118Do not flood the review with low-value nits if there are larger structural issues.119Prefer a smaller number of high-conviction comments over a long list of cosmetic notes.120121## Approval Bar122123Do not approve merely because behavior seems correct. Block on any unresolved violation of a Non-Negotiable Standard (0-7) unless the author gives a clear justification.124125If a Standard is violated without justification, leave explicit, actionable feedback and push for a cleaner decomposition.