Skip to content

feat(review): add /review:quality-gate code-design mode with bundled criteria and cascade severity #8329

Description

@kyle-sexton

Parent

Refs #8326 · Source: PLAN Phase 1 (part 2 of 3), topic malleable-design-defaults

Depends on

Outcome

/review:quality-gate code-design exists: a review mode that loads the consumer's review criteria through the standards contract, and falls back to small bundled universal criteria when the consumer has none. It flags Duplicated Code that the diff introduces with no shared source or sync check, naming the repeated fact or logic and the later change that would make the copies diverge. When a consumer standard contradicts a bundled default, it applies the consumer standard and says which default it overrode. It also reads the Quality bar: line; when that line is absent, it treats the bar as production and says so in the output.

Key interfaces

From the plan's ## Design:

review skills/quality-gate code-design mode (new) | bundled universal code-design criteria, cascade severity, consumer-criteria loading | reactive

Quality bar: prototype | internal | production
Overrides bundled default <principle> per <standards file>

Repetition severity (code-design mode and code-reviewer): in code, CRITICAL only for Duplicated Code the diff introduces, naming the repeated fact or logic and the later otherwise-correct change that would diverge, with no shared source or sync check keeping the copies aligned; every other repetition or cascade finding (Shotgun Surgery included) SUGGESTION; Markdown SUGGESTION; quality bar prototype SUGGESTION everywhere; consumer severity vocabulary and criteria win.

A missing quality-bar line counts as production for review severity, and the review names that assumption.

Variation verdict: consumer review criteria are contained in the code-design mode, which loads them through the standards-contract resolution ladder; consumer criteria win over bundled ones.

Exempt from CRITICAL (judgment; no review guide read states them): contract-restatement markers, registries the repo declares, generated files, fixtures, rename diffs. No numeric file threshold.

Conventions followed: the planning plugin's standards-contract reference (resolution ladder, provenance); the review plugin's severity tier tests; .claude/rules/skill-bodies-state-current-rules.md.

Done when

  • grep -c "code-design" on the quality-gate SKILL.md is ≥ 2 (argument hint, router row, description trigger), and a code-design context file exists in the quality-gate skill.
  • First, probe that a docs/standards/ file written by an eval case's scaffold_script is readable in an eval run; record the result in the PR body.
  • Eval cases (case.yaml dirs under the review plugin's evals/): qg-code-design-cascade (introduced unsynced repetition is CRITICAL), qg-code-design-sanctioned (registry and rename diffs are not CRITICAL), qg-code-design-markdown (SUGGESTION), qg-code-design-prototype (SUGGESTION), qg-code-design-override (emits the override line). /evals:plugin-eval with and without the plugin; difference in the PR body.
  • After the commit, bash scripts/check-changed-skills.sh origin/main exits 0 and bash scripts/check-affected.sh --tests exits 0 with no SKIP line.
  • A changelog fragment for the review plugin.

Out of scope

  • code-reviewer severity changes (next item).
  • Phase-boundary dispatch from implementation skills.

Metadata

Metadata

Assignees

Labels

agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.

Fields

No fields configured for Feature.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions