Quality gate pipeline

From bdfinst/agentic-dev-team · View interactive version

Quality gate pipeline is an AI agent skill from the GitHub repository bdfinst/agentic-dev-team. 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.

How to use this skill

Skill file

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

The Three Phases

Phase 1: Self-Validation (before delivery)

Every agent runs this checklist mentally before presenting output.

Factual Accuracy

Instruction Fidelity

Internal Consistency

Confidence Assessment

| Confidence | Meaning | Action |

| --- | --- | --- |

| High | Verified via tool output or direct file read | Deliver as-is |

| Medium | Inferred from context, not directly verified | Flag with caveat |

| Low | Recalled from training or guessed | Verify before delivering, or mark as unverified |

Hallucination Detection Signals

Strong signals (likely hallucination):

When a signal fires: Pause → Verify (use tools) → Correct → Log (hallucination_detected: true in metrics)

Phase 2: Verification Evidence (before completion claims)

Iron Law: No completion claims without fresh verification evidence. Skipping any step is falsification, not verification.

The Gate Function:

  1. IDENTIFY — What command proves your claim? (e.g., npm test, cargo build)
  2. RUN — Execute the command fresh and completely. Not from cache, not from memory.
  3. READ — Read the complete output and exit code. Don't skim.
  4. VERIFY — Does the output actually confirm your claim? If not, report actual status.
  5. ONLY THEN — Make the claim, with supporting evidence pasted.

Required Evidence (all tasks):

  1. Tests pass: Run the whole test suite. Paste output with pass/fail counts.
  2. Build succeeds: If the project has a build step, run it. Paste output.
  3. Lint clean: If the project has a linter, run it. Paste output.
  4. No regressions: Test count should not decrease.
  5. 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.
  6. Structural Quality gate: Before claiming "done", the work must carry a clean-or-triaged structure-review signal (nesting depth, cognitive load, and async-pattern judgment are folded into this lens, #2093). Options:

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.

Additional Evidence by task type:

| Task Type | Additional Evidence |

| ----------- | ------------------- |

| Bug fix | Red-green cycle: failing test → passing test |

| New feature | Feature working via test output or demo command |

| Refactor | Same test count, same pass count |

| Config change | Config loads without error |

| Documentation | Commands/code blocks in doc actually work |

| Agent work | Inspect VCS diff independently — don't trust self-report |

Evidence Format:

## Verification
- Tests: `npm test` → 47 passed, 0 failed (output below)
- Build: `npm run build` → success, 0 warnings
- Lint: `npm run lint` → 0 errors, 0 warnings

Red Flag Language — stop and verify when you catch yourself saying:

Phase 3: Review-Correction Loop (post-delivery rework)

Activated when output is returned for rework, during peer review, or when self-reviewing before delivery (complements Phase 1).

Defect Severity:

| Severity | Definition | Required Action |

| --- | --- | --- |

| Critical | Wrong, breaks functionality, contradicts requirements | Immediate correction, block delivery |

| Major | Significant gap in completeness or correctness | Correct before acceptance |

| Minor | Small inaccuracy, suboptimal approach | Correct if time permits |

| Cosmetic | Formatting, naming, style | Bundle with next change |

Correction Scope:

Review Checklist:

  1. Requirements compliance — all acceptance criteria addressed, no silent scope changes
  2. Correctness — intended result, edge cases handled, no regressions
  3. Completeness — all files touched, no TODOs remain, integration points addressed
  4. Consistency — matches project conventions, no contradictions
  5. Quality — appropriately simple, readable, sufficient documentation

Iteration Rules:

Escalation: Summarize defect pattern and attempted corrections → escalate to Orchestrator for re-routing → log with escalation_reason in task metrics.

When to Apply Each Phase

| Situation | Phases to run |

| ----------- | -------------- |

| Initial development, about to deliver | Phase 1 → Phase 2 |

| Claiming task completion | Phase 2 (at minimum) |

| Output returned for rework | Phase 3 → Phase 2 |

| Peer-reviewing another agent's output | Phase 1 (as reviewer) → Phase 3 if defects found |

| Trivial one-line fix | Phase 2 only (verify it works) |

Output

Phase 1: Confidence-scored validation — report failures only.

Phase 2: Verification evidence block with tool output.

Phase 3: Defect table (severity, scope, status: fixed/deferred/escalated).

Integration

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.