agentleFS
mindfortaimindfortai/security-skills/skills/code-quality/SKILL.md

code-quality

Skill16 starsChanged 5 months agoMITView on GitHub

Audits a branch or PR diff for maintainability, complexity, testability, and architecture regressions. Use when reviewing BASE...HEAD or PR diffs for code health issues before merge.

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 10 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

14 rules. 0 are common, 12 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 71 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill for a strict diff-first maintainability audit.

    line 9
  2. Distinctive:

    Do not turn this into a full repository architecture review.

    line 16
  3. Distinctive:

    Read surrounding code only to understand local patterns, ownership boundaries, and whether the diff breaks them.

    line 17
  4. Distinctive:

    Do not report personal style preferences.

    line 19
  5. Distinctive:

    Do not report issues that are pre-existing unless the diff worsens them.

    line 20
  6. Distinctive:

    Do not modify code unless the user explicitly asks for fixes.

    line 21
  7. Distinctive:

    Use PR metadata when available, but judge the actual diff rather than the PR description.

    line 33
  8. Distinctive:

    Look for places where a smaller, simpler change would solve the problem:

    line 47
  9. Distinctive:

    Avoid vague findings like "this is messy." Name the concrete maintenance cost.

    line 98
  10. Distinctive:

    Run local tests, type checks, linters, builds, or focused smoke tests when they can confirm a claimed regression or boundary break safely.

    line 102
  11. Distinctive:

    Use temporary stubs only to isolate unavailable external dependencies or slow services.

    line 103
  12. Distinctive:

    When subagents are available, ask an independent subagent to challenge high-severity quality findings for whether the diff truly introduced …

    line 105
  13. Very specific:

    Use status values such as net_new, regression, pre_existing, needs_verification, or no_confirmed_findings.

    line 122
  14. Very specific:

    If no findings are found, still emit the header and one no_confirmed_findings informational row.

    line 130

“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 a strict diff-first maintainability audit. The goal is to catch code quality regressions introduced by the branch before they become expensive to own.

This skill is intentionally orthogonal to pr-review. This one asks: "Will this change make the codebase harder to understand, test, change, operate, or safely extend?"

Ground Rules

  • Review the diff first.
  • Do not turn this into a full repository architecture review.
  • Read surrounding code only to understand local patterns, ownership boundaries, and whether the diff breaks them.
  • Be direct and critical, but only report issues that are actionable.
  • Do not report personal style preferences.
  • Do not report issues that are pre-existing unless the diff worsens them.
  • Do not modify code unless the user explicitly asks for fixes.

Evidence Setup

Gather the diff evidence:

git status --short --branch
git diff --stat BASE...HEAD
git diff BASE...HEAD

Use PR metadata when available, but judge the actual diff rather than the PR description.

Audit Checklist

Size And Shape

  • Files or functions that become too large to reason about.
  • "1k-line file" pressure: newly large files, large functions, or large components that should be decomposed.
  • Unfocused changes that mix unrelated concerns.
  • Copy-pasted logic instead of a local abstraction.
  • Abstractions added before there is real repeated complexity.

Code Judo

Look for places where a smaller, simpler change would solve the problem:

  • Replacing a narrow fix with a broad framework.
  • Adding configuration or indirection where direct code would be clearer.
  • Creating new concepts that duplicate existing project concepts.
  • Solving one edge case by making every caller understand new complexity.
  • Moving complexity to a worse layer instead of removing it.

Boundaries And Architecture

  • UI code reaching into persistence, infra, auth, or policy logic directly.
  • Business logic leaking across layers.
  • Shared modules taking dependencies on app-specific code.
  • New circular dependencies or awkward import directions.
  • Tenant, auth, billing, or security policies duplicated outside their owner.
  • Background jobs, API handlers, and UI flows implementing divergent versions of the same rule.

Readability And Maintainability

  • Dense branching, boolean traps, unclear names, hidden side effects.
  • State mutation that is hard to follow.
  • Error handling that obscures the real failure.
  • Comments that explain confusing code instead of simplifying the code.
  • Magic constants, temporal coupling, or implicit ordering requirements.
  • Public APIs whose names or types make misuse likely.

Testability

  • Logic that can only be tested through slow or flaky end-to-end paths.
  • New code without seams for unit or integration testing where the repo expects them.
  • Excessive mocking that hides the actual contract.
  • Tests that assert implementation details instead of behavior.
  • Missing regression tests for changed behavior.

Operational Quality

  • Logs that are noisy, misleading, or missing the identifiers needed to debug.
  • Metrics, traces, or errors that lose critical context.
  • Config changes that are hard to roll out or roll back.
  • Migrations or release steps that require undocumented manual ordering.

Finding Standard

A finding must answer:

  • What exact diff change caused the maintainability issue?
  • Which future maintenance task becomes harder?
  • Which boundary, pattern, invariant, or testability property is degraded?
  • Why this matters enough to block or change before merge?
  • What smaller or cleaner alternative should be used?

Avoid vague findings like "this is messy." Name the concrete maintenance cost.

Validation

  • Run local tests, type checks, linters, builds, or focused smoke tests when they can confirm a claimed regression or boundary break safely.
  • Use temporary stubs only to isolate unavailable external dependencies or slow services. Do not stub the contract, boundary, or behavior that the finding claims has regressed.
  • Clean up scratch files, local config changes, temporary fixtures, and ad hoc scripts before final output unless the user asked for durable tests.
  • When subagents are available, ask an independent subagent to challenge high-severity quality findings for whether the diff truly introduced the cost and whether the proposed better shape fits local patterns.

Severity

  • High: likely to cause recurring bugs, block future work, violate core architecture boundaries, or create long-lived ownership confusion.
  • Medium: meaningful complexity, duplication, or testability regression that should be fixed before merge.
  • Low: localized maintainability issue with clear cleanup path.
  • Informational: useful note that should not block.

Output Format

Output findings as CSV with this exact header:

id,severity,confidence,status,category,title,location,asset_or_flow,actor,issue,impact,evidence,fix,test,scope_notes

Use status values such as net_new, regression, pre_existing, needs_verification, or no_confirmed_findings. Use category values such as size, code-judo, boundary, readability, testability, or operability.

Example row:

F-001,medium,high,net_new,boundary,Route duplicates billing policy outside service,api/routes/billing.py:96,billing plan update,tenant admin,The diff implements plan-change rules in the route instead of the billing policy service,Future billing changes must update two divergent policy paths and can create authorization drift,Existing billing routes call BillingPolicy but the new route bypasses it,Move plan-change decision into BillingPolicy and keep route as orchestration,Add route test that exercises BillingPolicy denial and allowed cases,Reviewed diff and adjacent billing routes

If no findings are found, still emit the header and one no_confirmed_findings informational row. Put pre-existing quality issues, coverage, and residual risk after the CSV unless the user asks for CSV only.

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.