Quick Summary
Goal: Enforce quality gates, verify compliance with standards, and track quality metrics across the development lifecycle.
Renamed: formerly /qc-specialist — that name no longer resolves as a slash command; use /quality-gate-review.
Workflow:
- Identify Gate — Determine which quality gate applies (Idea>PBI, PBI>Dev, Dev>QA, QA>Release)
- Verify Checklist — Run through pass/fail criteria for the gate stage
- Generate Report — Produce PASS/FAIL/CONDITIONAL gate status with evidence
- Track Metrics — Log in audit trail and update quality metrics dashboard
Key Rules:
- Every gate must have a clear PASS/FAIL/CONDITIONAL status
- Evidence must be provided for critical checklist items
- Sign-offs are required before release gates can pass
Be skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).
Quality Gate Review
Enforce quality gates, verify compliance with standards, track quality metrics, and generate audit trails across the development lifecycle.
Core Capabilities
1. Quality Gates
Define pass/fail criteria at each stage:
Gate: Idea → PBI
Gate: PBI → Development
Gate: Development → QA
Gate: QA → Release
PO Acceptance Decision (per-AC verdict — how "PO sign-off received" is earned)
For each acceptance criterion from the PBI/story:
- Read criterion — Ensure it's testable and measurable
- Check evidence — Review test results, screenshots, demo recordings
- Verify — Does the implementation satisfy the criterion?
- Verdict — PASS or FAIL with specific evidence
Decision rules: Every acceptance criterion must have a PASS/FAIL verdict. REJECT must list the specific items that failed. CONDITIONAL ACCEPT must list conditions and a timeline.
## Acceptance Decision
**Feature/PBI:** {Reference}
**Reviewer:** {PO name/role}
**Date:** {date}
**Verdict:** ACCEPT | REJECT | CONDITIONAL ACCEPT
### Criteria Review
| # | Criterion | Verdict | Evidence |
|---|-----------|---------|----------|
| 1 | {AC text} | PASS | {Evidence} |
| 2 | {AC text} | FAIL | {Why it failed} |
### Decision Details
- {Rationale for overall verdict}
### Conditions (if CONDITIONAL)
- {Condition — deadline}
### Rejected Items (if REJECT)
- {Item — what needs to change}
Verdict Validation Gate (why-review — MANDATORY before emitting REJECT/CONDITIONAL or any FAIL criterion)
Purpose: ACCEPT/REJECT/CONDITIONAL is a JUDGMENT. Validate it adversarially before it is emitted so a wrong verdict or a mis-classified FAIL criterion does not gate a release on ground that does not hold. This gate validates the verdict only — it routes any required fix back to the owning team/sibling review, it does NOT self-converge a fix-loop.
Trigger: Any REJECT, any CONDITIONAL ACCEPT, or any criterion marked FAIL. Skip ONLY when every criterion PASSES with an unconditional ACCEPT.
Protocol:
- Read the finalized gate report (the Acceptance Decision above) from
plans/reports/{skill}-{date}-{slug}.md (or the exact report path written).
- Invoke
/why-review --validate-findings <report-path> — verify each FAIL criterion and each stated condition has file:line / evidence proof and clears why-review's finding-survival bar.
- If why-review demotes/removes any FAIL criterion or condition: update the verdict and criteria table, then add a
## Why-Review Validation Notes section citing what changed and why.
- If the verdict changed after validation: re-run this gate — maximum 2 validation passes — until the remaining FAIL criteria/conditions are validated. No fix-loop: this skill decides the gate and routes fixes to the owning team; it never restarts a full review over its own fixes.
Anti-bias (MANDATORY before emitting): steel-man the OPPOSITE verdict — argue for ACCEPT if about to REJECT, and for REJECT if about to ACCEPT; the verdict that survives its own counter-argument ships. A gate decision that was never challenged is not validated.
2. Compliance Verification
- Code follows architecture patterns
- Security requirements met
- Accessibility standards (WCAG 2.1 AA)
- Performance benchmarks
3. Audit Trail
Track artifact lifecycle:
{Artifact} | {Action} | {By} | {Date} | {Notes}
4. Quality Metrics
Code Quality
- Cyclomatic complexity
- Mutation score (line-coverage diagnostic only — not a gate)
- Technical debt ratio
- Duplication %
Process Quality
- Defect escape rate
- First-time-right %
- Cycle time
- Lead time
Quality Gate Checklists
Pre-Development Checklist
## Quality Gate: PBI Ready for Development
**PBI:** {PBI-ID}
**Reviewer:** {Name}
**Date:** {Date}
### Requirements
- [ ] Clear problem statement
- [ ] User value articulated
- [ ] Acceptance criteria in GIVEN/WHEN/THEN format
- [ ] Out of scope explicitly listed
### Design
- [ ] Design spec approved (if UI changes)
- [ ] API contract defined (if backend changes)
- [ ] Database changes documented (if applicable)
### Dependencies
- [ ] Upstream dependencies identified
- [ ] No blocking dependencies
- [ ] Integration points documented
### Gate Status: PASS / FAIL / CONDITIONAL
**Notes:**
{Any concerns or conditions}
Pre-QA Checklist
## Quality Gate: Ready for QA (Dev → QA)
**Feature/PBI:** {Reference}
**Reviewer:** {Name}
**Date:** {Date}
### Readiness
- [ ] All acceptance criteria implemented
- [ ] Unit tests passing
- [ ] Code review complete
- [ ] No known CRITICAL/HIGH/MEDIUM findings; binary gates remain blocking
- [ ] Test data prepared
### Gate Status: PASS / FAIL / CONDITIONAL
**Notes:**
{Any concerns or conditions}
Database Performance gate (applies to all stages)
Pre-Release Checklist
## Quality Gate: Ready for Release
**Feature:** {Feature name}
**Release:** {Version}
**Date:** {Date}
### Testing
- [ ] All test cases executed
- [ ] Pass rate: \_\_\_\_%
- [ ] No open CRITICAL/HIGH/MEDIUM findings
- [ ] Any Round 2+ LOW findings are listed as deferred with owner/follow-up
### Code Quality
- [ ] Code review approved
- [ ] Mutation score meets target; surviving mutants triaged (line-coverage reported as a diagnostic only, no threshold)
- [ ] No security vulnerabilities
- [ ] Performance benchmarks met
### Documentation
- [ ] User documentation updated
- [ ] API documentation current
- [ ] Release notes drafted
### Sign-Offs
- [ ] QA Lead: **\*\***\_**\*\*** Date: **\_\_\_**
- [ ] Dev Lead: **\*\***\_**\*\*** Date: **\_\_\_**
- [ ] PO: **\*\*\*\***\_\_**\*\*\*\*** Date: **\_\_\_**
### Gate Status: PASS / FAIL
**Release Decision:**
{Go / No-Go with notes}
Workflow Integration
Running Quality Gate
When user runs /quality-gate {artifact-or-pr}:
- Identify gate type based on artifact/stage
- Load appropriate checklist
- Verify each criterion
- Generate pass/fail report
- Log in audit trail
Metrics Dashboard Template
## Quality Metrics - Sprint {N}
### Code Quality
| Metric | Target | Actual | Trend |
| -------------- | --------------- | ------ | ----- |
| Mutation score | meets target | | ↑↓→ |
| Line coverage | diagnostic only | | ↑↓→ |
| Complexity | <15 | | |
| Duplication | <5% | | |
| Debt Ratio | <10% | | |
### Process Quality
| Metric | Target | Actual |
| ----------------- | ------ | ------ |
| Defect Escape | <5% | |
| First-Time-Right | >90% | |
| Avg Review Cycles | <2 | |
### Defect Trends
| Sprint | Found | Fixed | Escaped |
| ------ | ----- | ----- | ------- |
| N-2 | | | |
| N-1 | | | |
| N | | | |
Output Conventions
File Naming
{YYMMDD}-qc-gate-{stage}-{slug}.md
{YYMMDD}-qc-audit-{feature}.md
{YYMMDD}-qc-metrics-sprint-{n}.md
Quality Checklist
Before completing QC artifacts:
Related
[IMPORTANT] Use TaskCreate to break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI MUST ATTENTION ask user whether to skip.
docs/project-reference/domain-entities-reference.md — Domain entity catalog, relationships, cross-service sync (read when task involves business entities/models)
AI Mistake Prevention — Failure modes to avoid on every task:
Re-read files after context changes. Context compaction, resume, or long-running work can make memory stale; verify current files before acting.
Verify generated content against source evidence. AI hallucinates APIs, names, claims, and document facts. Check the relevant source before documenting or referencing.
Check downstream references before deleting or renaming. Removing an artifact can stale docs, generated mirrors, configs, and callers; map references first.
Trace the full impact chain after edits. Changing a definition can miss derived outputs and consumers. Follow the affected chain before declaring done.
Verify ALL affected outputs, not just the first. One green check is not all green checks; validate every output surface the change can affect.
Assume existing values are intentional — ask WHY before changing OR flagging one as a defect. Before changing or reporting a constant, limit, flag, cutoff, wording, or pattern, read nearby context and history, the CALLER's ordering, and 2+ sibling call sites of the same convention. A doc stating WHAT without WHY is missing rationale, not proof of a missing guard.
Surface ambiguity before acting — don't pick silently. Multiple valid interpretations require an explicit question or stated assumption with risk.
Assert the outcome your system owns, not the intermediate state your infrastructure owns. When verifying async work, assert the final business state — never the delivery/retry bookkeeping held in shared infrastructure that any co-running process can write. Such a check passes when run alone and flakes the moment anything else shares that infrastructure.
Keep shared guidance role-relevant. Universal guidance must help every receiving skill or agent; code-specific obligations belong only in code-specific protocols.
Critical Thinking Mindset — Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence >80% to act.
Anti-hallucination: Never present guess as fact — cite sources for every claim, admit uncertainty freely, self-check output for errors, cross-reference independently, stay skeptical of own confidence — certainty without evidence root of all hallucination.
Sequential Thinking Protocol — Structured multi-step reasoning for complex/ambiguous work. Use when planning, reviewing, debugging, or refining ideas where one-shot reasoning is unsafe.
Trigger when: complex problem decomposition · adaptive plans needing revision · analysis with course correction · unclear/emerging scope · multi-step solutions · hypothesis-driven debugging · cross-cutting trade-off evaluation.
Format (explicit mode — visible thought trail):
Thought N/M: [aspect] — one aspect per thought, state assumptions/uncertainty
Thought N/M [REVISION of Thought K]: ... — when prior reasoning invalidated; state Original / Why revised / Impact
Thought N/M [BRANCH A from Thought K]: ... — explore alternative; converge with decision rationale
Thought N/M [HYPOTHESIS]: ... then [VERIFICATION]: ... — test before acting
Thought N/N [FINAL] — only when verified, all critical aspects addressed, confidence >80%
Mandatory closers: Confidence % stated · Assumptions listed · Open questions surfaced · Next action concrete.
Stop conditions: confidence <80% on any critical decision → escalate via AskUserQuestion · ≥3 revisions on same thought → re-frame the problem · branch count >3 → split into sub-task.
Implicit mode: apply methodology internally without visible markers when adding markers would clutter the response (routine work where reasoning aids accuracy).
Deep-dive: see /sequential-thinking skill (.claude/skills/sequential-thinking/SKILL.md) for worked examples (API design, debugging, architecture), advanced techniques (spiral refinement, hypothesis testing, convergence), and meta-strategies (uncertainty handling, revision cascades).
Goal Contract Satisfaction Loop — Persist the user goal in an external file, execute against it, and loop review/fix until every saved required criterion passes or a blocker escalates. Bounded closed loop — NEVER open-ended autonomous exploration.
- Resolve the active goal (in order): active plan
goal.md → plans/goals/{YYMMDD-HHmm}-{slug}/goal.md → create a new Goal Contract from the current user request (template: .claude/templates/goal-contract-template.md).
- Required sections: Original Request, Purpose, Success Criteria (checkboxes; mark required vs optional), Constraints, Evidence Required, Iteration Log, Goal Satisfaction matrix.
- Before work: read the active goal and map planned work to saved success criteria — execution serves the saved criteria, never chat memory alone.
- After execution/verification: append an Iteration Log entry — result, evidence references (
file:line, command output, report path), remaining gaps.
- Review gate: emit a Goal Satisfaction matrix —
| Success Criterion | Evidence | Status | with PASS/FAIL/BLOCKED. Overall PASS requires every required criterion PASS.
- Loop rule (retry): required criterion FAIL → validate the gap is real → fix → re-review only the affected criteria. Stop cleanly when all required criteria PASS.
- Escalation rule (stop): two consecutive iterations with no criterion progressing, or a blocker needing user input → mark the criterion BLOCKED with a user-facing reason and escalate. NEVER loop indefinitely.
- Skip rule: tiny conversational tasks may skip the goal file ONLY with a recorded one-line reason. User-accepted gate skips are recorded in the goal file with reason and scope.
- Security: NEVER store secrets, tokens, credentials, or private customer data in goal files — store evidence references and redact sensitive values.
Blocked until: active goal resolved (or skip reason recorded) · saved success criteria read before edits · iteration evidence appended after execution · Goal Satisfaction matrix emitted before any PASS verdict.
Trade-Off Interrogation Gate — ALWAYS ask these THREE questions before ANY verdict, score, finding, or recommendation — about the thing under review AND about every recommendation YOU make. — why: naming a benefit without its price is an endorsement, not a review; the costliest trade-offs are the ones nobody wrote down.
- Is there any trade-off? Name what it SACRIFICES. "None" / "pure win" is an unfinished analysis, NOT an answer — to claim none, state which dimensions you checked and why each is unaffected: future change cost · complexity · performance/latency · memory/cost · coupling · reversibility · migration burden · operational load · blast radius · security posture · testability · team skill/ramp · delivery time · UX.
- Is it worth it? Weigh gain against sacrifice EXPLICITLY — what is gained (with a metric) · what it costs · WHO pays · WHEN it comes due — then emit WORTH IT / NOT WORTH IT / UNCLEAR. "Better" with no metric and no cost FAILS this question. NOT WORTH IT → withdraw or replace the recommendation, never keep it as-is.
- Is the trade-off material enough to CONFIRM WITH THE USER? A material trade-off is the user's call, never yours. MATERIAL when ANY holds: irreversible / one-way door (data migration, public contract, storage format, vendor lock-in) · cost shifted onto someone else (another team, ops/on-call, future maintainer, end user) · one quality attribute traded for another (correctness↔speed, security↔convenience, latency↔cost, simplicity↔flexibility) · a boundary crossed (client↔server tier, service contract, event contract, shared library) · a high-consequence path (auth, money, data integrity, breaking change, High/Medium residual risk) · the worth-it verdict is UNCLEAR.
MATERIAL → STOP and confirm via AskUserQuestion BEFORE the verdict stands — state the trade-off, both options, what each sacrifices, and your recommendation. NOT material → record it inline with a one-line justification and proceed.
Non-asking execution contexts — ESCALATE BY HANDOFF, never by silence. AskUserQuestion reaches only the main interactive agent: a sub-agent cannot ask the user, and a terminal/verdict-only mode asks nothing by design. When you are running in such a context, the obligation is redirected, never waived — do ALL of: (a) complete questions 1 and 2 normally; (b) decide materiality and record it in the Trade-Off Assessment row with confirmed? = NO — cannot ask from this context; (c) name the unconfirmed MATERIAL trade-off explicitly in your returned summary/verdict so the CALLER (or parent orchestrator) escalates it via AskUserQuestion on your behalf — a material trade-off mentioned only inside a report file on disk is NOT a handoff; (d) do not emit an unqualified PASS — mark the verdict as carrying an unconfirmed material trade-off, so the caller's gate stays closed until the user answers. The caller inherits the escalation duty the moment it reads your return.
This carve-out is about reachability, not convenience: it applies ONLY where the tool genuinely cannot reach the user (spawned sub-agent, terminal validate/verdict-only mode, non-interactive/headless run). It is NEVER a licence to skip the question, to self-approve a one-way door, or to downgrade materiality because asking is inconvenient — if you CAN ask, you MUST ask.
Emit a Trade-Off Assessment row per reviewed decision and per recommendation: | decision | sacrifices | gain (metric) | who pays, when | WORTH IT/NOT/UNCLEAR | material? | confirmed? |.
BLOCKED until: trade-off named (or dimensions-checked justification given) · worth-it verdict emitted · materiality decided · every MATERIAL trade-off either confirmed with the user OR — in a non-asking context — handed off in the returned verdict for the caller to confirm. A MATERIAL trade-off that is neither confirmed nor handed off can NEVER be PASS, and NEVER gets buried as a Low-severity note.
NEVER answer "no trade-off" without checking · decide a material trade-off silently on the user's behalf · let convergence/delivery pressure authorize walking through a one-way door · bundle several material trade-offs into one vague "proceed?".
Severity Rubric — Classify every finding by consequence, not by effort, reviewer preference, or how annoying the fix is. One scale applies to every review, skill, agent, workflow, and host so a tier has the same meaning everywhere. Choose the highest credible consequence supported by evidence; do not lower a tier to make a round pass.
Finding vs observation (required): An observation becomes a finding only when it names the affected user/system/data/contract, the shipped consequence, the evidence location, and the normalized tier. INFO, advice, preference, duplicate wording, or an unsubstantiated concern is not a finding and must not reopen a loop. If the concern might affect a required behavior or gate but evidence is incomplete, emit NOT VERIFIABLE with the missing evidence and keep it unresolved; never silently convert uncertainty into LOW.
| Severity |
Action |
Definition and examples |
| CRITICAL |
Block immediately; escalate |
Immediate material risk if shipped: authentication/authorization or safety bypass; secrets/PII exposure; irreversible destructive action; data loss/corruption; or a silent failure on a critical path. A failed binary gate that makes the result untrustworthy is represented as a separate synthetic blocker by the executable policy (not as an ordinary severity judgment). |
| HIGH |
Must fix before PASS/merge |
Material correctness or contract risk: wrong behavior on a supported path; violated business/data invariant; meaningful privacy or authority gap; breaking API/schema/compatibility change; likely harm to users/downstream systems; or a missing proof for a behavior-changing fix. |
| MEDIUM |
Must clear the current round; escalate if the fix needs an owner decision |
Bounded but consequential risk: an edge case, resilience/observability/testability/maintainability gap, credible future defect, or local architectural drift whose impact is real but not immediate material loss. An explicit follow-up records the escalation/residual risk; it does not make an open MEDIUM a clean pass. |
| LOW |
Record and defer; never open another fix/re-review round from round 2 onward |
Non-blocking polish with no credible present correctness, security, privacy, authority, availability, or data-integrity impact: wording/formatting, minor documentation or convention drift, optional defensive cleanup, or a cosmetic/refinement suggestion. |
Consequence decision tree (apply in order): (1) Is a binary gate failed? Keep it as a separate hard blocker (the executable helper represents it as synthetic CRITICAL); do not use the ordinary severity label to hide what failed. Otherwise, would shipping permit immediate material security/safety/authority harm, irreversible destruction, data loss/corruption, or a critical-path silent failure? → CRITICAL. (2) Otherwise, does a supported path, invariant, public contract, privacy/authority boundary, compatibility promise, or behavior-changing proof fail with material user/downstream impact? → HIGH. (3) Otherwise, is there a bounded but consequential edge, resilience, observability, testability, maintainability, or architectural gap with a credible impact? → MEDIUM. (4) Otherwise, is the evidence sufficient to show only non-blocking polish with no credible present material impact? → LOW. (5) If the evidence needed to choose between steps 1–4 is missing, → NOT VERIFIABLE, not LOW. When multiple tiers fit, select the highest credible consequence; effort, implementation cost, reviewer discomfort, frequency alone, and proximity to the round cap never decide the tier.
Boundary examples (normalize before applying the round predicate): an auth bypass, exposed secret/PII, destructive command without an authority gate, or failed required test/generation/parity gate is CRITICAL; a wrong supported response, broken invariant/API/schema, meaningful privacy/authority defect, or unproven behavior-changing fix is HIGH; a bounded retry/timeout/alert/testability gap or credible maintainability drift is MEDIUM; a typo, formatting inconsistency, optional cleanup, or cosmetic suggestion proven not to affect present behavior is LOW. A missing fact about any of those boundaries is NOT VERIFIABLE until evidence or an explicitly documented residual-risk decision exists.
Classification procedure (required for every finding): (1) state the affected user, system, data, contract, or gate; (2) assess consequence if the issue ships; (3) assess exposure/likelihood and reversibility/detectability; (4) select the highest tier justified by those facts; (5) cite file:line or equivalent evidence and a confidence percentage. Effort, implementation cost, reviewer discomfort, and proximity to the round cap are never severity inputs. NOT VERIFIABLE is a pending evidence state, not one of the four tiers and never a LOW escape hatch: if the unresolved claim could affect required behavior, security, privacy, authority, availability, data integrity, or a binary gate, it remains an open evidence blocker until resolved or explicitly owner-accepted with documented residual risk. Classify an item LOW only when evidence supports the absence of credible present material impact.
Hard-gate rule: Binary gates (tests, required artifacts, security must-fix checks, generated parity, policy compliance) are not ordinary severity-rated findings. The executable helper records a failed gate as a synthetic CRITICAL blocker solely so one predicate can carry it; the report must still name the gate and failure evidence. A failed gate blocks at every round, including when all ordinary findings are LOW; never disguise a failed gate as LOW.
Score-based skills map their numeric scale onto these tiers — do not invent a parallel vocabulary:
- 0-2 criterion scoring (e.g. production-readiness-review):
0 = CRITICAL/HIGH (criterion unmet, blocks readiness), 1 = MEDIUM (partial, consequential gap), 2 = pass (no finding). If the criterion is only polish, use LOW rather than forcing a 0.
- Two-axis scoring (e.g. performance-review, impact × likelihood): high impact + high exposure → CRITICAL/HIGH; material impact with bounded exposure → HIGH/MEDIUM; low impact and low exposure → LOW. Record the axes and why the selected tier is the highest credible consequence.
- Scorecards /
/20 grades (e.g. architecture-scalability-review): the aggregate score and verdict band are separate from finding severity. A sub-80 area is evidence to investigate, not an automatic CRITICAL/HIGH/MEDIUM/LOW label; classify each underlying gap by the consequence decision tree and keep advisory score deductions separate from blocking findings.
Domain-vocabulary normalization (mandatory): Specialized skills may keep a local reporting vocabulary, but it MUST feed this same four-tier round predicate — never a second severity system:
BLOCKED, HARD FAIL, or FAIL is a blocking local verdict, not an automatic CRITICAL label. Classify the underlying consequence as CRITICAL when it is an immediate material risk or failed binary gate; otherwise classify it as HIGH or MEDIUM with evidence, while preserving the local block until the owning gate is satisfied.
WARN is not permission to ignore a finding. Map it to MEDIUM when the gap is consequential, to LOW only when evidence supports no credible present material impact, or upward to HIGH/CRITICAL when the consequence warrants it. PASS/compliant is not a finding.
- UI
P0/P1/P2/P3/P4 map to CRITICAL/HIGH/MEDIUM/LOW/LOW respectively as a starting point; override upward only when the evidence shows a higher shipped consequence. A P0/P1 accessibility or task-completion floor remains a blocking gate even when a local UI report calls it a priority rather than a severity.
- Numeric SRE/readiness or impact/likelihood scores are evidence inputs, not replacement tiers. Emit the score, the consequence, and the normalized CRITICAL/HIGH/MEDIUM/LOW tier together.
INFO/advisory observations are not findings unless the evidence shows a material consequence.
A finding's tier drives the gate: CRITICAL/HIGH/MEDIUM remain actionable and blocking under the round policy; LOW may be tracked as a follow-up and, from round 2, does not by itself justify another fix/re-review. An owner decision may explain or schedule an open MEDIUM but does not turn it into a clean pass; owner acceptance never makes a failed binary gate pass and must record scope, rationale, and residual risk.
- MANDATORY Classify every finding Critical/High/Medium/Low by consequence using the affected asset, shipped impact, exposure, reversibility, evidence location, and confidence; Critical/High/MEDIUM remain actionable under the round bar, while LOW is recorded/deferred from round 2 onward.
- MANDATORY Keep binary gates separate from severity: a failed test, security must-fix, required artifact, or parity check blocks at every round and is never relabeled LOW.
- MANDATORY Score-based skills (sre 0-2, perf two-axis) map onto the same four tiers — no parallel severity vocabulary.
MUST ATTENTION apply critical + sequential thinking — every claim needs appropriate traced evidence (file:line for repo/code claims; source URL or artifact section for research, product, content, and docs claims); confidence >80% to act, <60% DO NOT recommend. Anti-hallucination: never present guess as fact, admit uncertainty freely, cross-reference independently, stay skeptical of own confidence.
MUST ATTENTION apply sequential-thinking — multi-step Thought N/M, REVISION/BRANCH/HYPOTHESIS markers, confidence % closer; see /sequential-thinking skill.
MUST ATTENTION apply AI mistake prevention — verify generated content against evidence, trace downstream references before deleting or renaming, verify all affected outputs, re-read files after context loss, and surface ambiguity before acting.
- MANDATORY Resolve the active Goal Contract BEFORE work (active plan
goal.md → plans/goals/{YYMMDD-HHmm}-{slug}/goal.md → create from current request) and read saved success criteria before editing.
- MANDATORY Append iteration evidence after execution; emit a Goal Satisfaction matrix (PASS/FAIL/BLOCKED) before reporting PASS; loop on validated FAIL; escalate repeated no-progress or blockers. NEVER store secrets in goal files.
- MANDATORY MUST ATTENTION ALWAYS ASK THE 3 TRADE-OFF QUESTIONS — on the thing under review AND on every recommendation you make: (1) is there any trade-off? name what it SACRIFICES (change cost · complexity · perf · coupling · reversibility · migration · ops load · blast radius · security · testability · delivery time · UX) — "none"/"pure win" is an unfinished analysis, so state the dimensions checked; (2) is it worth it? gain (with a metric) vs cost, WHO pays, WHEN → emit WORTH IT / NOT WORTH IT / UNCLEAR; NOT WORTH IT → withdraw or replace it; (3) is it material enough to confirm with the user? irreversible/one-way door · cost shifted onto another team/ops/maintainer/user · one quality attribute traded for another · a tier/service/event/library boundary crossed · auth/money/data-integrity/breaking-change/High-or-Medium-risk path · verdict UNCLEAR → STOP and confirm via
AskUserQuestion BEFORE the verdict.
- MANDATORY A MATERIAL trade-off with no user confirmation can NEVER be PASS; NEVER bury one as a Low-severity note, NEVER decide it silently, and NEVER let delivery or convergence pressure authorize a one-way door. — why: an un-walked-back one-way door is the user's call to make, not the reviewer's.
- MANDATORY — non-asking contexts escalate BY HANDOFF, never by silence.
AskUserQuestion reaches only the main interactive agent: a sub-agent cannot ask the user, and a terminal/verdict-only mode asks nothing by design. There the duty is REDIRECTED, not waived — still name the trade-off, still decide materiality, record confirmed? = NO — cannot ask from this context, state the unconfirmed MATERIAL trade-off in your RETURNED verdict/summary so the CALLER escalates it (a note only in an on-disk report is not a handoff), and never emit an unqualified PASS. Applies ONLY where the user is genuinely unreachable (spawned sub-agent, terminal validate mode, headless run) — if you CAN ask, you MUST ask.
Project Protocol Overlay — Before executing this skill, resolve any PROJECT overlay rules layered onto it: match this skill's name against the Target column of the project's skill-protocol index (docs/project-reference/skill-protocols-reference.md by default; a referenceDocs entry in docs/project-config.json overrides the path), taking the most specific matching tier ONLY — exact name > glob > *. That precedence orders overlays against EACH OTHER, never against this skill. Read ONLY the matched bodies, resolved as <protocols-dir>/<Name>.md; a row's Body link is display text, never a read path. A matched body that is missing or malformed is REPORTED and skipped — never reconstructed from the index Description. No index, or no match -> proceed with no overlay, silently. Full contract: .claude/skills/project-skill-protocol/references/registry.md.
Overlays are ADDITIVE ONLY: they ADD rules on top of this skill's own protocol and NEVER replace, override, disable, or reinterpret a rule it already states — removing every overlay must return this skill to exactly its documented behavior. An overlay is a BRIEF, not an authority escalation: it can NEVER waive a workflow gate, git discipline, a review gate, or a user-confirmation gate. A genuine overlay-vs-skill conflict, or two equally-specific overlays that directly contradict -> surface both to the user; NEVER resolve silently.
MUST ATTENTION resolve project protocol overlays for this skill BEFORE executing — most specific matching tier only (exact > glob > *, which ranks overlays against each other, NEVER against this skill), read only matched bodies at <protocols-dir>/<Name>.md; a missing or malformed body is reported, never reconstructed. Overlays are ADDITIVE ONLY (they never replace this skill's own rules) and are a brief, NEVER an authority escalation; an equal-specificity contradiction goes to the user.
Closing Reminders
IMPORTANT MUST ATTENTION Goal: Enforce quality gates, verify compliance with standards, track quality metrics, and generate audit trails across the development lifecycle.
Protocols in force (concise digest of the SYNC/shared blocks this skill carries):
- AI Mistake Prevention: verify generated content against evidence, trace downstream references, verify all affected outputs, re-read after context loss, surface ambiguity.
- Critical Thinking: Traced
file:line proof per claim; confidence >80% to act.
- Sequential Thinking: Multi-step Thought N/M with REVISION/BRANCH/HYPOTHESIS markers, confidence closer.
IMPORTANT MUST ATTENTION break work into small todo tasks using TaskCreate BEFORE starting
IMPORTANT MUST ATTENTION search codebase for 3+ similar patterns before creating new code
IMPORTANT MUST ATTENTION cite file:line evidence for every claim (confidence >80% to act)
IMPORTANT MUST ATTENTION add a final review todo task to verify work quality
[TASK-PLANNING] Before acting, analyze task scope and systematically break it into small todo tasks and sub-tasks using TaskCreate.
1---2name: quality-gate-review-23description: [Project Management] Use when enforcing quality gates, verifying standards compliance, tracking metrics, or generating audit trails.4---56## Quick Summary78**Goal:** Enforce quality gates, verify compliance with standards, and track quality metrics across the development lifecycle.910> **Renamed:** formerly `/qc-specialist` — that name no longer resolves as a slash command; use `/quality-gate-review`.1112**Workflow:**13141. **Identify Gate** — Determine which quality gate applies (Idea>PBI, PBI>Dev, Dev>QA, QA>Release)152. **Verify Checklist** — Run through pass/fail criteria for the gate stage163. **Generate Report** — Produce PASS/FAIL/CONDITIONAL gate status with evidence174. **Track Metrics** — Log in audit trail and update quality metrics dashboard1819**Key Rules:**2021- Every gate must have a clear PASS/FAIL/CONDITIONAL status22- Evidence must be provided for critical checklist items23- Sign-offs are required before release gates can pass2425**Be skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).**2627# Quality Gate Review2829Enforce quality gates, verify compliance with standards, track quality metrics, and generate audit trails across the development lifecycle.3031---3233## Core Capabilities3435### 1. Quality Gates3637Define pass/fail criteria at each stage:3839#### Gate: Idea → PBI4041- [ ] Problem statement present42- [ ] Business value articulated43- [ ] No technical solution prescribed44- [ ] Target users identified4546#### Gate: PBI → Development4748- [ ] Acceptance criteria in GIVEN/WHEN/THEN49- [ ] Out of scope defined50- [ ] Dependencies identified51- [ ] Design approved (if applicable)5253#### Gate: Development → QA5455- [ ] Code review approved56- [ ] Mutation score meets target; surviving mutants triaged (line-coverage diagnostic only — not a gate)57- [ ] No blocking lint findings under the canonical severity bar58- [ ] Documentation updated5960#### Gate: QA → Release6162- [ ] All test cases executed63- [ ] No open CRITICAL/HIGH/MEDIUM findings; any Round 2+ LOWs are recorded64 as deferred rather than treated as a reason to reopen a fix/review loop65- [ ] Regression suite passed66- [ ] PO sign-off received6768#### PO Acceptance Decision (per-AC verdict — how "PO sign-off received" is earned)6970For each acceptance criterion from the PBI/story:71721. **Read criterion** — Ensure it's testable and measurable732. **Check evidence** — Review test results, screenshots, demo recordings743. **Verify** — Does the implementation satisfy the criterion?754. **Verdict** — PASS or FAIL with specific evidence7677**Decision rules:** Every acceptance criterion must have a PASS/FAIL verdict. REJECT must list the specific items that failed. CONDITIONAL ACCEPT must list conditions and a timeline.7879```80## Acceptance Decision8182**Feature/PBI:** {Reference}83**Reviewer:** {PO name/role}84**Date:** {date}85**Verdict:** ACCEPT | REJECT | CONDITIONAL ACCEPT8687### Criteria Review8889| # | Criterion | Verdict | Evidence |90|---|-----------|---------|----------|91| 1 | {AC text} | PASS | {Evidence} |92| 2 | {AC text} | FAIL | {Why it failed} |9394### Decision Details95- {Rationale for overall verdict}9697### Conditions (if CONDITIONAL)98- {Condition — deadline}99100### Rejected Items (if REJECT)101- {Item — what needs to change}102```103104#### Verdict Validation Gate (why-review — MANDATORY before emitting REJECT/CONDITIONAL or any FAIL criterion)105106> **Purpose:** ACCEPT/REJECT/CONDITIONAL is a JUDGMENT. Validate it adversarially before it is emitted so a wrong verdict or a mis-classified FAIL criterion does not gate a release on ground that does not hold. This gate validates the verdict only — it routes any required fix back to the owning team/sibling review, it does NOT self-converge a fix-loop.107108**Trigger:** Any REJECT, any CONDITIONAL ACCEPT, or any criterion marked FAIL. Skip ONLY when every criterion PASSES with an unconditional ACCEPT.109110**Protocol:**1111121. Read the finalized gate report (the Acceptance Decision above) from `plans/reports/{skill}-{date}-{slug}.md` (or the exact report path written).1132. Invoke `/why-review --validate-findings <report-path>` — verify each FAIL criterion and each stated condition has `file:line` / evidence proof and clears why-review's finding-survival bar.1143. **If why-review demotes/removes any FAIL criterion or condition:** update the verdict and criteria table, then add a `## Why-Review Validation Notes` section citing what changed and why.1154. **If the verdict changed after validation:** re-run this gate — maximum 2 validation passes — until the remaining FAIL criteria/conditions are validated. No fix-loop: this skill decides the gate and routes fixes to the owning team; it never restarts a full review over its own fixes.116117**Anti-bias (MANDATORY before emitting):** steel-man the OPPOSITE verdict — argue for ACCEPT if about to REJECT, and for REJECT if about to ACCEPT; the verdict that survives its own counter-argument ships. A gate decision that was never challenged is not validated.118119### 2. Compliance Verification120121- Code follows architecture patterns122- Security requirements met123- Accessibility standards (WCAG 2.1 AA)124- Performance benchmarks125126### 3. Audit Trail127128Track artifact lifecycle:129130```131{Artifact} | {Action} | {By} | {Date} | {Notes}132```133134### 4. Quality Metrics135136#### Code Quality137138- Cyclomatic complexity139- Mutation score (line-coverage diagnostic only — not a gate)140- Technical debt ratio141- Duplication %142143#### Process Quality144145- Defect escape rate146- First-time-right %147- Cycle time148- Lead time149150---151152## Quality Gate Checklists153154### Pre-Development Checklist155156```markdown157## Quality Gate: PBI Ready for Development158159**PBI:** {PBI-ID}160**Reviewer:** {Name}161**Date:** {Date}162163### Requirements164165- [ ] Clear problem statement166- [ ] User value articulated167- [ ] Acceptance criteria in GIVEN/WHEN/THEN format168- [ ] Out of scope explicitly listed169170### Design171172- [ ] Design spec approved (if UI changes)173- [ ] API contract defined (if backend changes)174- [ ] Database changes documented (if applicable)175176### Dependencies177178- [ ] Upstream dependencies identified179- [ ] No blocking dependencies180- [ ] Integration points documented181182### Gate Status: PASS / FAIL / CONDITIONAL183184**Notes:**185{Any concerns or conditions}186```187188### Pre-QA Checklist189190```markdown191## Quality Gate: Ready for QA (Dev → QA)192193**Feature/PBI:** {Reference}194**Reviewer:** {Name}195**Date:** {Date}196197### Readiness198199- [ ] All acceptance criteria implemented200- [ ] Unit tests passing201- [ ] Code review complete202- [ ] No known CRITICAL/HIGH/MEDIUM findings; binary gates remain blocking203- [ ] Test data prepared204205### Gate Status: PASS / FAIL / CONDITIONAL206207**Notes:**208{Any concerns or conditions}209```210211### Database Performance gate (applies to all stages)212213- [ ] Database performance (pagination on all list queries; indexes on filter/FK/sort columns) — verified via `/production-readiness-review` and `/performance-review`214215### Pre-Release Checklist216217```markdown218## Quality Gate: Ready for Release219220**Feature:** {Feature name}221**Release:** {Version}222**Date:** {Date}223224### Testing225226- [ ] All test cases executed227- [ ] Pass rate: \_\_\_\_%228- [ ] No open CRITICAL/HIGH/MEDIUM findings229- [ ] Any Round 2+ LOW findings are listed as deferred with owner/follow-up230231### Code Quality232233- [ ] Code review approved234- [ ] Mutation score meets target; surviving mutants triaged (line-coverage reported as a diagnostic only, no threshold)235- [ ] No security vulnerabilities236- [ ] Performance benchmarks met237238### Documentation239240- [ ] User documentation updated241- [ ] API documentation current242- [ ] Release notes drafted243244### Sign-Offs245246- [ ] QA Lead: **\*\***\_**\*\*** Date: **\_\_\_**247- [ ] Dev Lead: **\*\***\_**\*\*** Date: **\_\_\_**248- [ ] PO: **\*\*\*\***\_\_**\*\*\*\*** Date: **\_\_\_**249250### Gate Status: PASS / FAIL251252**Release Decision:**253{Go / No-Go with notes}254```255256---257258## Workflow Integration259260### Running Quality Gate261262When user runs `/quality-gate {artifact-or-pr}`:2632641. Identify gate type based on artifact/stage2652. Load appropriate checklist2663. Verify each criterion2674. Generate pass/fail report2685. Log in audit trail269270---271272## Metrics Dashboard Template273274```markdown275## Quality Metrics - Sprint {N}276277### Code Quality278279| Metric | Target | Actual | Trend |280| -------------- | --------------- | ------ | ----- |281| Mutation score | meets target | | ↑↓→ |282| Line coverage | diagnostic only | | ↑↓→ |283| Complexity | <15 | | |284| Duplication | <5% | | |285| Debt Ratio | <10% | | |286287### Process Quality288289| Metric | Target | Actual |290| ----------------- | ------ | ------ |291| Defect Escape | <5% | |292| First-Time-Right | >90% | |293| Avg Review Cycles | <2 | |294295### Defect Trends296297| Sprint | Found | Fixed | Escaped |298| ------ | ----- | ----- | ------- |299| N-2 | | | |300| N-1 | | | |301| N | | | |302```303304---305306## Output Conventions307308### File Naming309310```311{YYMMDD}-qc-gate-{stage}-{slug}.md312{YYMMDD}-qc-audit-{feature}.md313{YYMMDD}-qc-metrics-sprint-{n}.md314```315316---317318## Quality Checklist319320Before completing QC artifacts:321322- [ ] All checklist items verified323- [ ] Evidence provided for critical items324- [ ] Sign-offs captured325- [ ] Gate status clearly stated326- [ ] Audit trail updated327328## Related329330- `spec`331- `code-review`332333---334335> **[IMPORTANT]** Use `TaskCreate` to break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI MUST ATTENTION ask user whether to skip.336337- `docs/project-reference/domain-entities-reference.md` — Domain entity catalog, relationships, cross-service sync (read when task involves business entities/models)338339<!-- SYNC:ai-mistake-prevention -->340341> **AI Mistake Prevention** — Failure modes to avoid on every task:342>343> **Re-read files after context changes.** Context compaction, resume, or long-running work can make memory stale; verify current files before acting.344> **Verify generated content against source evidence.** AI hallucinates APIs, names, claims, and document facts. Check the relevant source before documenting or referencing.345> **Check downstream references before deleting or renaming.** Removing an artifact can stale docs, generated mirrors, configs, and callers; map references first.346> **Trace the full impact chain after edits.** Changing a definition can miss derived outputs and consumers. Follow the affected chain before declaring done.347> **Verify ALL affected outputs, not just the first.** One green check is not all green checks; validate every output surface the change can affect.348> **Assume existing values are intentional — ask WHY before changing OR flagging one as a defect.** Before changing or reporting a constant, limit, flag, cutoff, wording, or pattern, read nearby context and history, the CALLER's ordering, and 2+ sibling call sites of the same convention. A doc stating WHAT without WHY is missing rationale, not proof of a missing guard.349> **Surface ambiguity before acting — don't pick silently.** Multiple valid interpretations require an explicit question or stated assumption with risk.350> **Assert the outcome your system owns, not the intermediate state your infrastructure owns.** When verifying async work, assert the final business state — never the delivery/retry bookkeeping held in shared infrastructure that any co-running process can write. Such a check passes when run alone and flakes the moment anything else shares that infrastructure.351> **Keep shared guidance role-relevant.** Universal guidance must help every receiving skill or agent; code-specific obligations belong only in code-specific protocols.352353<!-- /SYNC:ai-mistake-prevention -->354355<!-- SYNC:critical-thinking-mindset -->356357> **Critical Thinking Mindset** — Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence >80% to act.358> **Anti-hallucination:** Never present guess as fact — cite sources for every claim, admit uncertainty freely, self-check output for errors, cross-reference independently, stay skeptical of own confidence — certainty without evidence root of all hallucination.359360<!-- /SYNC:critical-thinking-mindset -->361362<!-- SYNC:sequential-thinking-protocol -->363364> **Sequential Thinking Protocol** — Structured multi-step reasoning for complex/ambiguous work. Use when planning, reviewing, debugging, or refining ideas where one-shot reasoning is unsafe.365>366> **Trigger when:** complex problem decomposition · adaptive plans needing revision · analysis with course correction · unclear/emerging scope · multi-step solutions · hypothesis-driven debugging · cross-cutting trade-off evaluation.367>368> **Format (explicit mode — visible thought trail):**369>370> 1. `Thought N/M: [aspect]` — one aspect per thought, state assumptions/uncertainty371> 2. `Thought N/M [REVISION of Thought K]: ...` — when prior reasoning invalidated; state Original / Why revised / Impact372> 3. `Thought N/M [BRANCH A from Thought K]: ...` — explore alternative; converge with decision rationale373> 4. `Thought N/M [HYPOTHESIS]: ...` then `[VERIFICATION]: ...` — test before acting374> 5. `Thought N/N [FINAL]` — only when verified, all critical aspects addressed, confidence >80%375>376> **Mandatory closers:** Confidence % stated · Assumptions listed · Open questions surfaced · Next action concrete.377>378> **Stop conditions:** confidence <80% on any critical decision → escalate via AskUserQuestion · ≥3 revisions on same thought → re-frame the problem · branch count >3 → split into sub-task.379>380> **Implicit mode:** apply methodology internally without visible markers when adding markers would clutter the response (routine work where reasoning aids accuracy).381>382> **Deep-dive:** see `/sequential-thinking` skill (`.claude/skills/sequential-thinking/SKILL.md`) for worked examples (API design, debugging, architecture), advanced techniques (spiral refinement, hypothesis testing, convergence), and meta-strategies (uncertainty handling, revision cascades).383384<!-- /SYNC:sequential-thinking-protocol -->385386<!-- SYNC:goal-contract-satisfaction-loop -->387388> **Goal Contract Satisfaction Loop** — Persist the user goal in an external file, execute against it, and loop review/fix until every saved required criterion passes or a blocker escalates. Bounded closed loop — NEVER open-ended autonomous exploration.389>390> 1. **Resolve the active goal** (in order): active plan `goal.md` → `plans/goals/{YYMMDD-HHmm}-{slug}/goal.md` → create a new Goal Contract from the current user request (template: `.claude/templates/goal-contract-template.md`).391> 2. **Required sections:** Original Request, Purpose, Success Criteria (checkboxes; mark required vs optional), Constraints, Evidence Required, Iteration Log, Goal Satisfaction matrix.392> 3. **Before work:** read the active goal and map planned work to saved success criteria — execution serves the saved criteria, never chat memory alone.393> 4. **After execution/verification:** append an Iteration Log entry — result, evidence references (`file:line`, command output, report path), remaining gaps.394> 5. **Review gate:** emit a Goal Satisfaction matrix — `| Success Criterion | Evidence | Status |` with PASS/FAIL/BLOCKED. Overall PASS requires every required criterion PASS.395> 6. **Loop rule (retry):** required criterion FAIL → validate the gap is real → fix → re-review only the affected criteria. Stop cleanly when all required criteria PASS.396> 7. **Escalation rule (stop):** two consecutive iterations with no criterion progressing, or a blocker needing user input → mark the criterion BLOCKED with a user-facing reason and escalate. NEVER loop indefinitely.397> 8. **Skip rule:** tiny conversational tasks may skip the goal file ONLY with a recorded one-line reason. User-accepted gate skips are recorded in the goal file with reason and scope.398> 9. **Security:** NEVER store secrets, tokens, credentials, or private customer data in goal files — store evidence references and redact sensitive values.399>400> **Blocked until:** active goal resolved (or skip reason recorded) · saved success criteria read before edits · iteration evidence appended after execution · Goal Satisfaction matrix emitted before any PASS verdict.401402<!-- /SYNC:goal-contract-satisfaction-loop -->403404<!-- SYNC:trade-off-interrogation-gate -->405406> **Trade-Off Interrogation Gate** — ALWAYS ask these THREE questions before ANY verdict, score, finding, or recommendation — about the thing under review AND about every recommendation YOU make. — why: naming a benefit without its price is an endorsement, not a review; the costliest trade-offs are the ones nobody wrote down.407>408> 1. **Is there any trade-off?** Name what it SACRIFICES. "None" / "pure win" is an unfinished analysis, NOT an answer — to claim none, state which dimensions you checked and why each is unaffected: future change cost · complexity · performance/latency · memory/cost · coupling · reversibility · migration burden · operational load · blast radius · security posture · testability · team skill/ramp · delivery time · UX.409> 2. **Is it worth it?** Weigh gain against sacrifice EXPLICITLY — what is gained (with a metric) · what it costs · WHO pays · WHEN it comes due — then emit **WORTH IT / NOT WORTH IT / UNCLEAR**. "Better" with no metric and no cost FAILS this question. NOT WORTH IT → withdraw or replace the recommendation, never keep it as-is.410> 3. **Is the trade-off material enough to CONFIRM WITH THE USER?** A material trade-off is the user's call, never yours. **MATERIAL** when ANY holds: irreversible / one-way door (data migration, public contract, storage format, vendor lock-in) · cost shifted onto someone else (another team, ops/on-call, future maintainer, end user) · one quality attribute traded for another (correctness↔speed, security↔convenience, latency↔cost, simplicity↔flexibility) · a boundary crossed (client↔server tier, service contract, event contract, shared library) · a high-consequence path (auth, money, data integrity, breaking change, High/Medium residual risk) · the worth-it verdict is UNCLEAR.411>412> **MATERIAL → STOP and confirm via `AskUserQuestion` BEFORE the verdict stands** — state the trade-off, both options, what each sacrifices, and your recommendation. **NOT material →** record it inline with a one-line justification and proceed.413>414> **Non-asking execution contexts — ESCALATE BY HANDOFF, never by silence.** `AskUserQuestion` reaches only the main interactive agent: a sub-agent cannot ask the user, and a terminal/verdict-only mode asks nothing by design. When you are running in such a context, the obligation is **redirected, never waived** — do ALL of: (a) complete questions 1 and 2 normally; (b) decide materiality and record it in the Trade-Off Assessment row with `confirmed? = NO — cannot ask from this context`; (c) **name the unconfirmed MATERIAL trade-off explicitly in your returned summary/verdict so the CALLER (or parent orchestrator) escalates it via `AskUserQuestion` on your behalf** — a material trade-off mentioned only inside a report file on disk is NOT a handoff; (d) do not emit an unqualified PASS — mark the verdict as carrying an unconfirmed material trade-off, so the caller's gate stays closed until the user answers. The caller inherits the escalation duty the moment it reads your return.415>416> This carve-out is about **reachability, not convenience**: it applies ONLY where the tool genuinely cannot reach the user (spawned sub-agent, terminal validate/verdict-only mode, non-interactive/headless run). It is NEVER a licence to skip the question, to self-approve a one-way door, or to downgrade materiality because asking is inconvenient — if you CAN ask, you MUST ask.417>418> **Emit a Trade-Off Assessment row** per reviewed decision and per recommendation: `| decision | sacrifices | gain (metric) | who pays, when | WORTH IT/NOT/UNCLEAR | material? | confirmed? |`.419>420> **BLOCKED until:** trade-off named (or dimensions-checked justification given) · worth-it verdict emitted · materiality decided · every MATERIAL trade-off either confirmed with the user OR — in a non-asking context — handed off in the returned verdict for the caller to confirm. A MATERIAL trade-off that is neither confirmed nor handed off can NEVER be PASS, and NEVER gets buried as a Low-severity note.421>422> **NEVER** answer "no trade-off" without checking · decide a material trade-off silently on the user's behalf · let convergence/delivery pressure authorize walking through a one-way door · bundle several material trade-offs into one vague "proceed?".423424<!-- /SYNC:trade-off-interrogation-gate -->425426<!-- SYNC:severity-rubric -->427428> **Severity Rubric** — Classify every finding by consequence, not by effort, reviewer preference, or how annoying the fix is. One scale applies to every review, skill, agent, workflow, and host so a tier has the same meaning everywhere. Choose the highest credible consequence supported by evidence; do not lower a tier to make a round pass.429>430> **Finding vs observation (required):** An observation becomes a finding only when it names the affected user/system/data/contract, the shipped consequence, the evidence location, and the normalized tier. `INFO`, advice, preference, duplicate wording, or an unsubstantiated concern is not a finding and must not reopen a loop. If the concern might affect a required behavior or gate but evidence is incomplete, emit `NOT VERIFIABLE` with the missing evidence and keep it unresolved; never silently convert uncertainty into LOW.431>432> | Severity | Action | Definition and examples |433> | --- | --- | --- |434> | CRITICAL | Block immediately; escalate | Immediate material risk if shipped: authentication/authorization or safety bypass; secrets/PII exposure; irreversible destructive action; data loss/corruption; or a silent failure on a critical path. A failed binary gate that makes the result untrustworthy is represented as a separate synthetic blocker by the executable policy (not as an ordinary severity judgment). |435> | HIGH | Must fix before PASS/merge | Material correctness or contract risk: wrong behavior on a supported path; violated business/data invariant; meaningful privacy or authority gap; breaking API/schema/compatibility change; likely harm to users/downstream systems; or a missing proof for a behavior-changing fix. |436> | MEDIUM | Must clear the current round; escalate if the fix needs an owner decision | Bounded but consequential risk: an edge case, resilience/observability/testability/maintainability gap, credible future defect, or local architectural drift whose impact is real but not immediate material loss. An explicit follow-up records the escalation/residual risk; it does not make an open MEDIUM a clean pass. |437> | LOW | Record and defer; never open another fix/re-review round from round 2 onward | Non-blocking polish with no credible present correctness, security, privacy, authority, availability, or data-integrity impact: wording/formatting, minor documentation or convention drift, optional defensive cleanup, or a cosmetic/refinement suggestion. |438>439> **Consequence decision tree (apply in order):** (1) Is a binary gate failed? Keep it as a separate hard blocker (the executable helper represents it as synthetic CRITICAL); do not use the ordinary severity label to hide what failed. Otherwise, would shipping permit immediate material security/safety/authority harm, irreversible destruction, data loss/corruption, or a critical-path silent failure? → **CRITICAL**. (2) Otherwise, does a supported path, invariant, public contract, privacy/authority boundary, compatibility promise, or behavior-changing proof fail with material user/downstream impact? → **HIGH**. (3) Otherwise, is there a bounded but consequential edge, resilience, observability, testability, maintainability, or architectural gap with a credible impact? → **MEDIUM**. (4) Otherwise, is the evidence sufficient to show only non-blocking polish with no credible present material impact? → **LOW**. (5) If the evidence needed to choose between steps 1–4 is missing, → **NOT VERIFIABLE**, not LOW. When multiple tiers fit, select the highest credible consequence; effort, implementation cost, reviewer discomfort, frequency alone, and proximity to the round cap never decide the tier.440>441> **Boundary examples (normalize before applying the round predicate):** an auth bypass, exposed secret/PII, destructive command without an authority gate, or failed required test/generation/parity gate is **CRITICAL**; a wrong supported response, broken invariant/API/schema, meaningful privacy/authority defect, or unproven behavior-changing fix is **HIGH**; a bounded retry/timeout/alert/testability gap or credible maintainability drift is **MEDIUM**; a typo, formatting inconsistency, optional cleanup, or cosmetic suggestion proven not to affect present behavior is **LOW**. A missing fact about any of those boundaries is **NOT VERIFIABLE** until evidence or an explicitly documented residual-risk decision exists.442>443> **Classification procedure (required for every finding):** (1) state the affected user, system, data, contract, or gate; (2) assess consequence if the issue ships; (3) assess exposure/likelihood and reversibility/detectability; (4) select the highest tier justified by those facts; (5) cite `file:line` or equivalent evidence and a confidence percentage. Effort, implementation cost, reviewer discomfort, and proximity to the round cap are never severity inputs. `NOT VERIFIABLE` is a pending evidence state, not one of the four tiers and never a LOW escape hatch: if the unresolved claim could affect required behavior, security, privacy, authority, availability, data integrity, or a binary gate, it remains an open evidence blocker until resolved or explicitly owner-accepted with documented residual risk. Classify an item LOW only when evidence supports the absence of credible present material impact.444>445> **Hard-gate rule:** Binary gates (tests, required artifacts, security must-fix checks, generated parity, policy compliance) are not ordinary severity-rated findings. The executable helper records a failed gate as a synthetic CRITICAL blocker solely so one predicate can carry it; the report must still name the gate and failure evidence. A failed gate blocks at every round, including when all ordinary findings are LOW; never disguise a failed gate as LOW.446>447> **Score-based skills** map their numeric scale onto these tiers — do not invent a parallel vocabulary:448>449> - **0-2 criterion scoring** (e.g. production-readiness-review): `0` = CRITICAL/HIGH (criterion unmet, blocks readiness), `1` = MEDIUM (partial, consequential gap), `2` = pass (no finding). If the criterion is only polish, use LOW rather than forcing a `0`.450> - **Two-axis scoring** (e.g. performance-review, impact × likelihood): high impact + high exposure → CRITICAL/HIGH; material impact with bounded exposure → HIGH/MEDIUM; low impact and low exposure → LOW. Record the axes and why the selected tier is the highest credible consequence.451> - **Scorecards / `/20` grades** (e.g. architecture-scalability-review): the aggregate score and verdict band are separate from finding severity. A sub-80 area is evidence to investigate, not an automatic CRITICAL/HIGH/MEDIUM/LOW label; classify each underlying gap by the consequence decision tree and keep advisory score deductions separate from blocking findings.452>453> **Domain-vocabulary normalization (mandatory):** Specialized skills may keep a local reporting vocabulary, but it MUST feed this same four-tier round predicate — never a second severity system:454>455> - `BLOCKED`, `HARD FAIL`, or `FAIL` is a blocking local verdict, not an automatic CRITICAL label. Classify the underlying consequence as CRITICAL when it is an immediate material risk or failed binary gate; otherwise classify it as HIGH or MEDIUM with evidence, while preserving the local block until the owning gate is satisfied.456> - `WARN` is not permission to ignore a finding. Map it to MEDIUM when the gap is consequential, to LOW only when evidence supports no credible present material impact, or upward to HIGH/CRITICAL when the consequence warrants it. `PASS`/compliant is not a finding.457> - UI `P0`/`P1`/`P2`/`P3`/`P4` map to CRITICAL/HIGH/MEDIUM/LOW/LOW respectively as a starting point; override upward only when the evidence shows a higher shipped consequence. A P0/P1 accessibility or task-completion floor remains a blocking gate even when a local UI report calls it a priority rather than a severity.458> - Numeric SRE/readiness or impact/likelihood scores are evidence inputs, not replacement tiers. Emit the score, the consequence, and the normalized CRITICAL/HIGH/MEDIUM/LOW tier together. `INFO`/advisory observations are not findings unless the evidence shows a material consequence.459>460> A finding's tier drives the gate: CRITICAL/HIGH/MEDIUM remain actionable and blocking under the round policy; LOW may be tracked as a follow-up and, from round 2, does not by itself justify another fix/re-review. An owner decision may explain or schedule an open MEDIUM but does not turn it into a clean pass; owner acceptance never makes a failed binary gate pass and must record scope, rationale, and residual risk.461462<!-- /SYNC:severity-rubric -->463464465<!-- SYNC:severity-rubric:reminder -->466467- **MANDATORY** Classify every finding Critical/High/Medium/Low by consequence using the affected asset, shipped impact, exposure, reversibility, evidence location, and confidence; Critical/High/MEDIUM remain actionable under the round bar, while LOW is recorded/deferred from round 2 onward.468- **MANDATORY** Keep binary gates separate from severity: a failed test, security must-fix, required artifact, or parity check blocks at every round and is never relabeled LOW.469- **MANDATORY** Score-based skills (sre 0-2, perf two-axis) map onto the same four tiers — no parallel severity vocabulary.470471<!-- /SYNC:severity-rubric:reminder -->472473474<!-- SYNC:critical-thinking-mindset:reminder -->475476**MUST ATTENTION** apply critical + sequential thinking — every claim needs appropriate traced evidence (`file:line` for repo/code claims; source URL or artifact section for research, product, content, and docs claims); confidence >80% to act, <60% DO NOT recommend. Anti-hallucination: never present guess as fact, admit uncertainty freely, cross-reference independently, stay skeptical of own confidence.477478<!-- /SYNC:critical-thinking-mindset:reminder -->479480<!-- SYNC:sequential-thinking-protocol:reminder -->481482**MUST ATTENTION** apply sequential-thinking — multi-step Thought N/M, REVISION/BRANCH/HYPOTHESIS markers, confidence % closer; see `/sequential-thinking` skill.483484<!-- /SYNC:sequential-thinking-protocol:reminder -->485486<!-- SYNC:ai-mistake-prevention:reminder -->487488**MUST ATTENTION** apply AI mistake prevention — verify generated content against evidence, trace downstream references before deleting or renaming, verify all affected outputs, re-read files after context loss, and surface ambiguity before acting.489490<!-- /SYNC:ai-mistake-prevention:reminder -->491492<!-- SYNC:goal-contract-satisfaction-loop:reminder -->493494- **MANDATORY** Resolve the active Goal Contract BEFORE work (active plan `goal.md` → `plans/goals/{YYMMDD-HHmm}-{slug}/goal.md` → create from current request) and read saved success criteria before editing.495- **MANDATORY** Append iteration evidence after execution; emit a Goal Satisfaction matrix (PASS/FAIL/BLOCKED) before reporting PASS; loop on validated FAIL; escalate repeated no-progress or blockers. NEVER store secrets in goal files.496497<!-- /SYNC:goal-contract-satisfaction-loop:reminder -->498499<!-- SYNC:trade-off-interrogation-gate:reminder -->500501- **MANDATORY MUST ATTENTION ALWAYS ASK THE 3 TRADE-OFF QUESTIONS** — on the thing under review AND on every recommendation you make: (1) **is there any trade-off?** name what it SACRIFICES (change cost · complexity · perf · coupling · reversibility · migration · ops load · blast radius · security · testability · delivery time · UX) — "none"/"pure win" is an unfinished analysis, so state the dimensions checked; (2) **is it worth it?** gain (with a metric) vs cost, WHO pays, WHEN → emit **WORTH IT / NOT WORTH IT / UNCLEAR**; NOT WORTH IT → withdraw or replace it; (3) **is it material enough to confirm with the user?** irreversible/one-way door · cost shifted onto another team/ops/maintainer/user · one quality attribute traded for another · a tier/service/event/library boundary crossed · auth/money/data-integrity/breaking-change/High-or-Medium-risk path · verdict UNCLEAR → **STOP and confirm via `AskUserQuestion` BEFORE the verdict**.502- **MANDATORY** A MATERIAL trade-off with no user confirmation can NEVER be PASS; NEVER bury one as a Low-severity note, NEVER decide it silently, and NEVER let delivery or convergence pressure authorize a one-way door. — why: an un-walked-back one-way door is the user's call to make, not the reviewer's.503- **MANDATORY — non-asking contexts escalate BY HANDOFF, never by silence.** `AskUserQuestion` reaches only the main interactive agent: a sub-agent cannot ask the user, and a terminal/verdict-only mode asks nothing by design. There the duty is REDIRECTED, not waived — still name the trade-off, still decide materiality, record `confirmed? = NO — cannot ask from this context`, **state the unconfirmed MATERIAL trade-off in your RETURNED verdict/summary so the CALLER escalates it** (a note only in an on-disk report is not a handoff), and never emit an unqualified PASS. Applies ONLY where the user is genuinely unreachable (spawned sub-agent, terminal validate mode, headless run) — if you CAN ask, you MUST ask.504505<!-- /SYNC:trade-off-interrogation-gate:reminder -->506507<!-- SYNC:project-protocol-overlay -->508509> **Project Protocol Overlay** — Before executing this skill, resolve any PROJECT overlay rules layered onto it: match this skill's name against the `Target` column of the project's skill-protocol index (`docs/project-reference/skill-protocols-reference.md` by default; a `referenceDocs` entry in `docs/project-config.json` overrides the path), taking the most specific matching tier ONLY — exact name > glob > `*`. **That precedence orders overlays against EACH OTHER, never against this skill.** Read ONLY the matched bodies, resolved as `<protocols-dir>/<Name>.md`; a row's Body link is display text, never a read path. A matched body that is missing or malformed is REPORTED and skipped — never reconstructed from the index Description. No index, or no match -> proceed with no overlay, silently. Full contract: `.claude/skills/project-skill-protocol/references/registry.md`.510>511> Overlays are **ADDITIVE ONLY**: they ADD rules on top of this skill's own protocol and NEVER replace, override, disable, or reinterpret a rule it already states — removing every overlay must return this skill to exactly its documented behavior. An overlay is a BRIEF, not an authority escalation: it can NEVER waive a workflow gate, git discipline, a review gate, or a user-confirmation gate. A genuine overlay-vs-skill conflict, or two equally-specific overlays that directly contradict -> surface both to the user; NEVER resolve silently.512513<!-- /SYNC:project-protocol-overlay -->514515<!-- SYNC:project-protocol-overlay:reminder -->516517**MUST ATTENTION** resolve project protocol overlays for this skill BEFORE executing — most specific matching tier only (exact > glob > `*`, which ranks overlays against each other, NEVER against this skill), read only matched bodies at `<protocols-dir>/<Name>.md`; a missing or malformed body is reported, never reconstructed. Overlays are ADDITIVE ONLY (they never replace this skill's own rules) and are a brief, NEVER an authority escalation; an equal-specificity contradiction goes to the user.518519<!-- /SYNC:project-protocol-overlay:reminder -->520521## Closing Reminders522523**IMPORTANT MUST ATTENTION Goal:** Enforce quality gates, verify compliance with standards, track quality metrics, and generate audit trails across the development lifecycle.524525**Protocols in force (concise digest of the SYNC/shared blocks this skill carries):**526527- **AI Mistake Prevention:** verify generated content against evidence, trace downstream references, verify all affected outputs, re-read after context loss, surface ambiguity.528- **Critical Thinking:** Traced `file:line` proof per claim; confidence >80% to act.529- **Sequential Thinking:** Multi-step Thought N/M with REVISION/BRANCH/HYPOTHESIS markers, confidence closer.530531**IMPORTANT MUST ATTENTION** break work into small todo tasks using `TaskCreate` BEFORE starting532**IMPORTANT MUST ATTENTION** search codebase for 3+ similar patterns before creating new code533**IMPORTANT MUST ATTENTION** cite `file:line` evidence for every claim (confidence >80% to act)534**IMPORTANT MUST ATTENTION** add a final review todo task to verify work quality535536**[TASK-PLANNING]** Before acting, analyze task scope and systematically break it into small todo tasks and sub-tasks using TaskCreate.