Unified quality gate for agent output — self-validation, verification evidence, and review-correction loops. Consolidates accuracy-validation, verification-before-completion, and task-review-correction into a single three-phase pipeline. Use before delivery, at completion, and during rework.
Installation
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Unified quality gate for agent output — self-validation, verification evidence, and review-correction loops. Consolidates accuracy-validation, verification-before-completion, and task-review-correction into a single three-phase pipeline. Use before delivery, at completion, and during rework.
role
worker
user-invocable
true
Quality Gate Pipeline
Overview
Single quality gate that every agent passes through before output is accepted. Replaces three formerly separate skills (accuracy-validation, verification-before-completion, task-review-correction) with a unified pipeline of three phases that run in sequence.
Constraints
Do not deliver output containing unverified claims; pause and verify first
Do not claim completion without fresh verification evidence from this session
Do not reference test results or tool output from earlier in the conversation — re-run and show current output
Do not substitute reasoning or explanation for actual evidence
Max 3 review-correction cycles before escalating to the Orchestrator
Each correction cycle must reduce total defect count; flat or increasing defects trigger escalation
The Three Phases
Phase 1: Self-Validation (before delivery)
Every agent runs this checklist mentally before presenting output.
Factual Accuracy
All file paths referenced actually exist (verify with tool, don't assume)
All function/class/variable names match what's in the codebase
Version numbers, API signatures, and config values are verified, not recalled from training
No statistics or citations are fabricated
Claims about an external tool or product's UI (menu paths, button/control labels, screen layouts, settings locations) are backed by a citation the agent actually has — a fetched doc, a user-provided screenshot/description, or tool output — not recalled from training as if current and authoritative. When no citation exists, say so plainly (e.g. "I don't have a verified/current view of this menu — check the tool's current UI") rather than describing specifics; this is the same Low confidence fallback as any other recalled/guessed claim (see Confidence Assessment below).
Instruction Fidelity
Output addresses what the user actually asked, not a reinterpretation
Iron Law: No completion claims without fresh verification evidence. Skipping any step is falsification, not verification.
The Gate Function:
IDENTIFY — What command proves your claim? (e.g., npm test, cargo build)
RUN — Execute the command fresh and completely. Not from cache, not from memory.
READ — Read the complete output and exit code. Don't skim.
VERIFY — Does the output actually confirm your claim? If not, report actual status.
ONLY THEN — Make the claim, with supporting evidence pasted.
Required Evidence (all tasks):
Tests pass: Run the whole test suite. Paste output with pass/fail counts.
Build succeeds: If the project has a build step, run it. Paste output.
Lint clean: If the project has a linter, run it. Paste output.
No regressions: Test count should not decrease.
Coverage & Mutation (necessary-not-sufficient): Coverage thresholds and mutation score gate entry but do not alone gate exit. Saturating at 100% line coverage and 1.0 mutation score on small slices is expected and does not indicate structural quality. They are required to pass but are not the final signal.
Structural Quality gate: Before claiming "done", the work must carry a clean-or-triaged structure-review + complexity-review signal. Options:
Clean: Both agents produced no error/warning findings on the latest diff.
Triaged: Every error/warning finding is logged as a deferred item (with owner + tracking reference) per the Phase 3 exit criteria — and surfaced in the completion summary.
Waiver: For hotfixes, documentation-only changes, or work pre-approved by the Orchestrator as out-of-scope for structural review, include a waiver statement: structural-review-waiver: <reason> in the completion summary. Waivers are surfaced, not hidden.
Quality Ownership: green means the entire suite, not just the tests your
change touched. A failing test is a failing test regardless of whether this change
caused it — "already broken" / "not my diff" is not a pass. A red signal you
observe must be fixed, or explicitly surfaced and triaged (file an issue, or
record a quarantine with a reason via /triage) and reported as not green.
Never claim completion over a red suite by attributing the failure to someone else's
change. You own the quality state you can see, not just your delta.
If defects increase or stay flat after 2 cycles, escalate to Orchestrator
Exit criteria: all critical and major defects resolved (fixed and re-verified). Minor defects may be deferred — but deferred ≠ resolved: each must be logged with an owner and a tracking reference and surfaced in the completion summary, never folded into "done." A slice carrying deferred items is "complete with known follow-ups," not silently "complete."
Escalation: Summarize defect pattern and attempted corrections → escalate to Orchestrator for re-routing → log with escalation_reason in task metrics.
Performance Metrics: hallucination_detected, rework_cycles, defects_found are logged automatically by hooks/task_completion_metrics.py on task completion — no skill-level logging step needed. To surface non-default values, populate .claude/session-metrics.json with the relevant fields before the session ends.
Context Summarization: When context is high, increase Phase 1 rigor
Human Oversight Protocol: Escalation from Phase 3 feeds into the approval gate system