next-backend-quality-loop
Why It Exists
This skill's origin is documented in .omc/plans/quality-loop-skills.md,
which set out to genericize two existing Angular/.NET quality-loop skills
(quality-loop-frontend/quality-loop-backend, sourced from a repo called
arcos-web) toward this family's actual stack — and the plan's own decisions
tell a more interesting story than the shipped skill's description alone.
The plan initially named this skill backend-quality-loop and specified,
explicitly, that it should mirror the existing global frontend-quality-loop
skill's design: always loop and fix, with no read-only default, "for
consistency with the sibling skill already in daily use." That design
decision shipped differently — the actual skill is report-only by default,
with --fix as an explicit opt-in and --critic layering an independent
reviewer pass on top of it, closer to the two arcos-web originals' own
report-vs-flag shape than to the plan's stated preference. It was also
renamed from backend-quality-loop to next-backend-quality-loop before
shipping.
The plan's "reuse, don't duplicate" principle is the other load-bearing decision: every lens that maps onto an existing next-starters skill's already- documented invariants is written as a citation to that skill rather than a re-derived checklist — the plan is explicit that this is meant to keep one source of truth per rule, not two copies that can silently drift apart from each other.
What It Does
Grades changed backend code across six lenses: build-test (runs
typecheck/build/test and gates every other lens, since grading code that
doesn't compile just manufactures phantom findings), validation (path
params with no matching Zod schema, unvalidated request reads), contract
(OpenAPI spec drift between the server and the generated client, citing
kubb-react-query's own drift-check invariant rather than re-deriving it),
env-standards (deferring to runtime-env-config's invariants), db-standards
(floating DB promises, interpolated SQL, RLS/auth-hook SQL misplaced outside
the db:post step, tables shipped with no RLS at all — citing local-dev-stack
and prod-deploy), and test-coverage (every new Zod schema needs an
invalid-input test; every new RLS policy needs a real canary-row test, not an
empty-result-set assumption).
How To Use It
Trigger phrases: grading backend code in the Hono/Drizzle/Zod/Kubb/Supabase stack this repo's starters ship — request validation, OpenAPI contract drift, runtime env handling, database and RLS safety, and test coverage of new schemas and policies.
skills add git@github.com:catesandrew/next-starters.git --skill skills/next-backend-quality-loop -g
npm install @next-starters/skill-next-backend-quality-loop
/plugin marketplace add catesandrew/next-starters
/plugin install next-backend-quality-loop@next-starters
Gotchas & Invariants
build-testgates every other lens — if the project doesn't compile or its tests are already red, the skill reports that and stops rather than producing findings about code that may not even survive a fix.- The default is report-only, with zero edits.
--fixruns a bounded auto-fix loop that exits on zero CRITICAL/HIGH findings (not zero findings total — low-severity notes are reported and left alone). --criticwithout--fixis a no-op: report-only mode produces no diff, so there's nothing for a reviewer pass to review.- The diff-scoping logic deliberately includes untracked files alongside the tracked diff against trunk — a brand-new file that's part of the change under review has no diff against trunk at all and would otherwise be silently skipped.
- An empty result set from an RLS-protected table is never accepted as proof a policy works — the required proof is a real canary-row round trip: insert through a privileged connection, re-probe as the restricted role, confirm genuine invisibility, then delete the canary.
Related Skills
- next-frontend-quality-loop — the frontend-side sibling grader, built from the same plan and the same "reuse, don't duplicate" principle.
Sourced from: skills/next-backend-quality-loop/metadata.json, skills/next-backend-quality-loop/SKILL.md, .omc/plans/quality-loop-skills.md (local research artifact, not tracked in this repo), git commit b56785a