agentleFS
andeeplusandeeplus/aplus/skills/code-quality/SKILL.md

code-quality

Skill2 starsChanged 38 days agoMITView on GitHub

Run an extremely strict maintainability review for abstraction quality, giant files, and spaghetti-condition growth. Use for a strict code quality review, a deep code quality audit, or a harsh maintainability review.

77 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use spring-boot, logging-patterns and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ffsshhttiikkSkill

    spring-boot

    Spring Boot framework and Java enterprise patterns

    Also in 3 projects that use this

  • DIL8654Skill

    logging-patterns

    Keep logs structured, correlated, low-noise, and safe for production support. Use when adding operational logging, reviewing observability, or improving diagnostics in .NET services.

    Also in 3 projects that use this

  • mstuder-slalomSkill

    jpa-patterns

    JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.

    Also in 3 projects that use this

  • ffsshhttiikkSkill

    design-patterns

    Practical application and coding skills for Design Patterns

    Also in 4 projects that use this

  • glommerSkill

    pr-workflow

    General guidelines for Commits, formatting, CI, dependencies, security

    Also in 4 projects that use this

  • vm0-aiSkill

    cli-design

    Design patterns and conventions for the Okou CLI user experience

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

47 rules. 0 are common, 46 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 71 edited versions we read keep these.

  • 46

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill for an unusually strict review focused on implementation quality, maintainability, abstraction quality, and codebase health.

    line 14
  2. Distinctive:

    Start from this baseline:

    line 20
  3. Distinctive:

    Do not stop at "this could be a bit cleaner."

    line 33
  4. Distinctive:

    Look for opportunities to reframe the change so that whole branches, helpers, modes, conditionals, or layers disappear entirely.

    line 34
  5. Distinctive:

    Prefer the solution that makes the code feel inevitable in hindsight.

    line 35
  6. Distinctive:

    If you see a path to delete complexity rather than rearrange it, push hard for that path.

    line 37
  7. Distinctive:

    Treat this as a strong code-quality smell by default.

    line 40
  8. Distinctive:

    Prefer extracting helpers, subcomponents, modules, or local abstractions instead of letting a file sprawl past 1000 lines.

    line 41
  9. Distinctive:

    If the diff crosses that threshold, explicitly ask whether the code should be decomposed first.

    line 42
  10. Distinctive:

    Only waive this if there is a compelling structural reason and the resulting file is still clearly organized.

    line 43
  11. Distinctive:

    If a change adds "weird if statements in random places", treat that as a design problem, not a stylistic nit.

    line 47
  12. Distinctive:

    Prefer pushing the logic into a dedicated abstraction, helper, state machine, policy object, or separate module instead of tangling an …

    line 48
  13. Distinctive:

    Call out changes that make the surrounding code harder to reason about, even if they technically work.

    line 49
  14. Distinctive:

    If behavior can stay the same while the structure becomes meaningfully cleaner, push for the cleaner version.

    line 52
  15. Distinctive:

    Do not rubber-stamp "it works" implementations that leave the codebase messier.

    line 53
  16. Distinctive:

    Treat brittle, ad-hoc, or "magic" behavior as a code-quality problem.

    line 57
  17. Distinctive:

    Prefer explicit typed models or shared contracts over loosely-shaped ad-hoc objects.

    line 63
  18. Distinctive:

    If a branch relies on silent fallback to paper over an unclear invariant, ask whether the boundary should be made explicit instead.

    line 64
  19. Distinctive:

    Call out feature logic leaking into shared paths or implementation details leaking through APIs.

    line 67
  20. Distinctive:

    Prefer existing canonical utilities/helpers over bespoke one-offs.

    line 68
  21. Distinctive:

    If independent work is serialized for no good reason, ask whether the flow should run in parallel instead.

    line 72
  22. Distinctive:

    If related updates can leave state half-applied, push for a more atomic structure.

    line 73
  23. Distinctive:

    Do not over-index on micro-optimizations, but do flag avoidable orchestration complexity that makes the implementation more brittle.

    line 74
  24. Distinctive:

    Prefer cohesive modules, explicit contracts and local changes.

    line 85
  25. Distinctive:

    Keep the direct implementation when a general mechanism adds more concepts or coordination than it saves.

    line 86
  26. Distinctive:

    When you identify a code-quality problem, prefer suggestions like:

    line 131
  27. Distinctive:

    Delete a whole layer of indirection rather than polishing it.

    line 133
  28. Distinctive:

    Delete wrappers that do not meaningfully clarify the API.

    line 143
  29. Distinctive:

    Do not be satisfied with "maybe rename this" feedback when the real issue is structural.

    line 150
  30. Distinctive:

    Do not be satisfied with a merely cleaner version of the same messy idea if there is a plausible path to a much simpler idea.

    line 151
  31. Distinctive:

    Do not be rude, but do not soften major maintainability issues into mild suggestions.

    line 156
  32. Distinctive:

    If the code is making the codebase messier, say so clearly.

    line 157
  33. Distinctive:

    If the implementation missed an opportunity for a dramatic simplification, say that clearly too.

    line 158
  34. Distinctive:

    Do not flood the review with low-value nits if there are larger structural issues.

    line 184
  35. Distinctive:

    Prefer a smaller number of high-conviction comments over a long list of cosmetic notes.

    line 185
  36. Distinctive:

    Do not treat an orthogonality miss as a blocker unless the user asked to treat it as blocking.

    line 186
  37. Distinctive:

    Do not approve merely because behavior seems correct.

    line 190
  38. Distinctive:

    no clear structural regression

    line 193
  39. Distinctive:

    no obvious missed opportunity to make the implementation dramatically simpler when such a path is visible

    line 194
  40. Distinctive:

    no unjustified file-size explosion

    line 195
  41. Distinctive:

    no obvious spaghetti-growth from special-case branching

    line 196
  42. Distinctive:

    no obviously hacky or magical abstraction that makes the code harder to reason about

    line 197
  43. Very specific:

    no unnecessary wrapper/cast/optionality churn obscuring the real design

    line 198
  44. Distinctive:

    no clear architecture-boundary leak or avoidable canonical-helper duplication

    line 199
  45. Distinctive:

    no missed opportunity for an obvious decomposition that would materially improve maintainability

    line 200
  46. Distinctive:

    Treat these as presumptive blockers unless the author can justify them clearly:

    line 202
  47. Distinctive:

    If those conditions are not met, leave explicit, actionable feedback and push for a cleaner decomposition.

    line 211

“Common” is measured: kept by at least 6 in 10 of the 71 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code quality

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.

DRY and ETC

  1. Keep shared knowledge in one place (DRY, Don't Repeat Yourself).

    • Consolidate rules, invariants and contracts that must change together; give them one owner and reuse it.
    • Similar-looking code with independent reasons to change can stay separate. Extract an abstraction when the shared knowledge, not just the syntax, is the same.

    Orthogonality is a preference. Do not unmix a project that already mixes concerns. Where the code already keeps two concerns apart, this change should not make one require a change to the other. When you can ask the user, ask once whether this review should treat it as blocking. Otherwise, flag a miss and do not block.

  2. Make the next change easier (ETC, Easier To Change).
    • Prefer cohesive modules, explicit contracts and local changes. Judge an abstraction by a concrete change it makes easier and the coupling it removes.
    • Keep the direct implementation when a general mechanism adds more concepts or coordination than it saves. Name the maintenance cost and propose the smallest durable improvement inside the task's scope.

Primary Review Questions

For every meaningful change, ask:

  • Is there a "code judo" move that would make this dramatically simpler?
  • Can this change be reframed so fewer concepts, branches, or helper layers are needed?
  • Does this improve or worsen the local architecture?
  • Did the diff add branching complexity where a better abstraction should exist?
  • Did a previously cohesive module become more coupled, more stateful, or harder to scan?
  • Did this change couple two concerns the code already kept separate?
  • Is this logic living in the right file and layer?
  • Did this change enlarge a file or component past a healthy size boundary?
  • Are there repeated conditionals that signal a missing model or missing helper?
  • Is the implementation direct and legible, or does it rely on special cases and incidental control flow?
  • Is this abstraction actually earning its keep, or is it just a wrapper?
  • Did the diff introduce casts, optionality, or ad-hoc object shapes that obscure the real invariant?
  • Is this logic living in the canonical layer, or did the diff leak details across a boundary?
  • Is this orchestration more sequential or less atomic than it needs to be?

What to Flag Aggressively

Escalate findings when you see:

  • A complicated implementation where a cleaner reframing could delete whole categories of complexity.
  • Refactors that move code around but fail to reduce the number of concepts a reader must hold in their head.
  • A file crossing 1000 lines due to the PR, especially if the new code could be split out.
  • New conditionals bolted onto unrelated code paths.
  • One-off booleans, nullable modes, or flags that complicate existing control flow.
  • Feature-specific logic leaking into general-purpose modules.
  • Generic "magic" handling that hides simple structure and makes the code harder to reason about.
  • Thin wrappers or identity abstractions that add indirection without simplifying anything.
  • Unnecessary casts, any, unknown, or optional params that muddy the real contract.
  • Copy-pasted logic instead of extracted helpers.
  • Narrow edge-case handling implemented in the middle of an already busy function.
  • Refactors that technically pass tests but make the code less modular or less readable.
  • "Temporary" branching that is likely to become permanent debt.
  • Bespoke helpers where the codebase already has a canonical utility for the job.
  • Logic added in the wrong layer/package when it should live somewhere more central.
  • Sequential async flow where obviously independent work could stay simpler and clearer with parallel execution.
  • Partial-update logic that leaves state less atomic than necessary.

Preferred Remedies

When you identify a code-quality problem, prefer suggestions like:

  • Delete a whole layer of indirection rather than polishing it.
  • Reframe the state model so conditionals disappear instead of getting centralized.
  • Change the ownership boundary so the feature becomes a natural extension of an existing abstraction.
  • Turn special-case logic into a simpler default flow with fewer exceptions.
  • Extract a helper or pure function.
  • Split a large file into smaller focused modules.
  • Move feature-specific logic behind a dedicated abstraction.
  • Replace condition chains with a typed model or explicit dispatcher.
  • Separate orchestration from business logic.
  • Collapse duplicate branches into a single clearer flow.
  • Delete wrappers that do not meaningfully clarify the API.
  • Reuse the existing canonical helper instead of introducing a near-duplicate.
  • Make type boundaries more explicit so the control flow gets simpler.
  • Move the logic to the package/module/layer that already owns the concept.
  • Parallelize independent work when that also simplifies the orchestration.
  • Restructure related updates into a more atomic flow when partial state would be harder to reason about.

Do not be satisfied with "maybe rename this" feedback when the real issue is structural. Do not be satisfied with a merely cleaner version of the same messy idea if there is a plausible path to a much simpler idea.

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:

  1. Structural code-quality regressions
  2. Missed opportunities for dramatic simplification / code-judo restructuring
  3. Spaghetti / branching complexity increases
  4. Boundary / abstraction / type-contract problems that make the code harder to reason about
  5. File-size and decomposition concerns
  6. Modularity and abstraction issues
  7. 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. Do not treat an orthogonality miss as a blocker unless the user asked to treat it as blocking. Do not reclassify that miss as a presumptive blocker below.

Approval Bar

Do not approve merely because behavior seems correct. The bar for approval is:

  • no clear structural regression
  • no obvious missed opportunity to make the implementation dramatically simpler when such a path is visible
  • no unjustified file-size explosion
  • no obvious spaghetti-growth from special-case branching
  • no obviously hacky or magical abstraction that makes the code harder to reason about
  • no unnecessary wrapper/cast/optionality churn obscuring the real design
  • no clear architecture-boundary leak or avoidable canonical-helper duplication
  • no missed opportunity for an obvious decomposition that would materially improve maintainability

Treat these as presumptive blockers unless the author can justify them clearly:

  • the PR preserves a lot of incidental complexity when there is a plausible code-judo move that would delete it
  • the PR pushes a file from below 1000 lines to above 1000 lines
  • the PR adds ad-hoc branching that makes an existing flow more tangled
  • the PR solves a local problem by scattering feature checks across shared code
  • the PR adds an unnecessary abstraction, wrapper, or cast-heavy contract that makes the design more indirect
  • the PR duplicates an existing helper or puts logic in the wrong layer when there is a clear canonical home

If those conditions are not met, leave explicit, actionable feedback and push for a cleaner decomposition.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.