Definition of done for each lifecycle phase. No work item may advance to the next phase until all quality gates for the current phase are satisfied.
- Overview
- Phase 1: Discovery Gates
- Phase 2: Planning Gates
- Phase 3: Implementation Gates
- Phase 4: Validation Gates
- Phase 5: Ship Gates
- Gate Enforcement
- Exemption Process
- Metrics and Reporting
Quality gates are checkpoints that ensure work meets a defined standard before progressing. They exist at each of the five lifecycle phases defined in UNIFIED_AGENT_TEAMS.md.
Each gate is evaluated as:
- Pass: All criteria met. Work may advance to the next phase.
- Conditional Pass: Minor criteria unmet but documented. Work may advance with a follow-up task created for the gaps.
- Fail: One or more critical criteria not met. Work must not advance until resolved.
Purpose: Ensure the problem is well-understood before investing in a solution.
| # | Gate | Criteria | Verification |
|---|---|---|---|
| D1 | Product docs updated | docs/product/ contains problem statement and user stories for this work item |
File exists and is non-empty |
| D2 | Issue created | A tracking issue exists in the issue tracker with labels, assignee, and milestone | Issue URL recorded in backlog |
| D3 | Scope identified | Affected teams and file scope patterns are documented | Listed in backlog entry |
| D4 | Stakeholders notified | Relevant teams have been tagged or notified of the upcoming work | Notification logged in state |
| # | Gate | Criteria | Verification |
|---|---|---|---|
| D5 | User research | User interviews or data analysis supporting the problem statement | Link to research artifact |
| D6 | Competitive analysis | Review of how similar problems are solved elsewhere | Document in docs/product/ |
- [ ] Problem statement written in docs/product/
- [ ] User stories or acceptance criteria defined
- [ ] Tracking issue created with appropriate labels
- [ ] Affected teams identified (minimum: primary team)
- [ ] Initial scope estimate documentedPurpose: Ensure the solution design is sound and agreed upon before building.
| # | Gate | Criteria | Verification |
|---|---|---|---|
| P1 | ADRs authored | Architecture Decision Records created for significant technical decisions | Files exist in docs/adr/ or docs/architecture/specs/adr/ |
| P2 | ADRs approved | ADRs have been reviewed and approved by relevant team leads | Approval recorded (comment or status) |
| P3 | Specs complete | Technical specification in docs/architecture/specs/ covers approach, API contracts, data models, and edge cases |
Spec document exists and reviewed |
| P4 | Tasks broken down | Work is decomposed into tasks assigned to specific teams | Tasks listed in AGENT_BACKLOG.md |
| P5 | Dependencies mapped | Cross-team dependencies identified and sequenced | Dependency table updated |
| # | Gate | Criteria | Verification |
|---|---|---|---|
| P6 | Risk assessment | Identified risks with mitigation strategies | Section in spec document |
| P7 | Prototype/spike | Proof of concept for high-risk technical approaches | Branch or document reference |
| P8 | Capacity check | Team has bandwidth for the estimated effort | Sprint capacity confirmed |
- [ ] ADR(s) written for key decisions
- [ ] ADR(s) approved by relevant reviewers
- [ ] Technical spec complete in docs/architecture/specs/
- [ ] API contracts defined (if applicable)
- [ ] Data model changes documented (if applicable)
- [ ] Tasks created and assigned in AGENT_BACKLOG.md
- [ ] Cross-team dependencies identifiedPurpose: Ensure code quality and completeness before requesting review.
| # | Gate | Criteria | Verification |
|---|---|---|---|
| I1 | /check passes |
Running /check (lint, type-check, unit tests) completes without errors |
Exit code 0 |
| I2 | Tests added | New or modified code has corresponding test coverage | Coverage diff shows no decrease |
| I3 | Coverage threshold | Test coverage meets or exceeds project minimum (default: 80%) | Coverage report |
| I4 | No lint violations | Zero lint errors (warnings acceptable if pre-existing) | Lint report clean |
| I5 | Type-safe | No TypeScript errors (for TS projects) or equivalent type checks pass | Type-check exit code 0 |
| I6 | Conventional commits | All commits follow conventional commit format | Commit messages validated |
| # | Gate | Criteria | Verification |
|---|---|---|---|
| I7 | Performance baseline | No regression in benchmark results | Benchmark comparison |
| I8 | Bundle size check | No unexpected increase in build output size | Size report |
| I9 | Documentation inline | Public APIs have JSDoc/TSDoc comments | Doc coverage tool |
- [ ] /check passes locally (lint + type-check + tests)
- [ ] New tests written for new/changed code
- [ ] Test coverage meets threshold (>= 80%)
- [ ] No new lint errors introduced
- [ ] Types are correct (no `any` escape hatches without justification)
- [ ] Commits follow conventional commit format
- [ ] Code follows project style guidePurpose: Ensure the solution is reviewed, tested, and ready for production.
| # | Gate | Criteria | Verification |
|---|---|---|---|
| V1 | PR created | Pull request opened with description, test plan, and linked issue | PR URL exists |
| V2 | CI passes | All continuous integration checks pass (lint, test, build, type-check) | CI status green |
| V3 | Code review approved | At least one approval from a team member with relevant expertise | PR approval count >= 1 |
| V4 | No merge conflicts | PR is rebased or merged with the target branch without conflicts | Git status clean |
| V5 | PR description complete | Description includes: summary, test plan, breaking changes (if any) | PR template filled |
| # | Gate | Criteria | Verification |
|---|---|---|---|
| V6 | E2E tests pass | End-to-end test suite passes against the PR branch | E2E CI job green |
| V7 | Manual testing | UI or user-facing changes manually verified | Tester sign-off |
| V8 | Security scan | No new vulnerabilities introduced | Security scan report |
| V9 | Accessibility audit | UI changes meet WCAG 2.1 AA standards | Audit report |
- [ ] Pull request created with full description
- [ ] Issue linked in PR description
- [ ] All CI checks passing
- [ ] At least one code review approval
- [ ] No merge conflicts with target branch
- [ ] Test plan documented and executed
- [ ] Breaking changes documented (if applicable)Purpose: Ensure the change is deployed safely and operational documentation is current.
| # | Gate | Criteria | Verification |
|---|---|---|---|
| S1 | PR merged | Pull request merged to the target branch | Merge commit exists |
| S2 | Operations docs updated | docs/operations/ reflects any new operational procedures, configuration changes, or monitoring requirements |
Docs updated |
| S3 | CHANGELOG updated | CHANGELOG.md has an entry for this change under the appropriate section | Entry exists |
| S4 | Deployment successful | Change deployed to target environment without errors | Deployment log |
| S5 | Monitoring confirmed | No anomalies in error rates, latency, or resource usage post-deploy | Monitoring dashboard |
| # | Gate | Criteria | Verification |
|---|---|---|---|
| S6 | Rollback tested | Rollback procedure verified in staging | Rollback log |
| S7 | Stakeholder notification | Relevant stakeholders informed of the change | Notification sent |
| S8 | Feature flag cleanup | Temporary feature flags removed or documented for cleanup | Flag audit |
- [ ] Pull request merged
- [ ] docs/operations/ updated (if applicable)
- [ ] CHANGELOG.md entry added
- [ ] Deployment completed successfully
- [ ] Post-deploy monitoring reviewed (15-minute window minimum)
- [ ] Backlog item marked as completedThe following gates are enforced automatically through CI and tooling:
- I1, I4, I5: Enforced by
/checkcommand and CI pipeline. - I3: Enforced by coverage thresholds in test configuration.
- V2: Enforced by GitHub branch protection rules.
- V3: Enforced by required review settings.
- V4: Enforced by merge conflict detection.
The following gates require human or AI agent verification:
- D1-D4: Verified by the orchestrator during phase transition.
- P1-P5: Verified during planning review.
- S2-S5: Verified post-deployment by the shipping team.
| Role | Can Override |
|---|---|
| Team Lead | Optional gates for their own team |
| Orchestrator | Conditional pass on non-critical required gates |
| Project Owner | Any gate (must document reason) |
When a quality gate cannot be satisfied and an exemption is needed:
- Document the reason in the task notes explaining why the gate cannot be met.
- Identify the risk of proceeding without the gate.
- Create a follow-up task to address the gap within the next sprint.
- Get approval from the appropriate override authority (see table above).
- Record the exemption in the task history for audit purposes.
| Metric | Definition | Target |
|---|---|---|
| Gate pass rate | Percentage of gates passed on first attempt | > 85% |
| Phase cycle time | Average time to move through a single phase | < 2 days |
| Exemption rate | Percentage of gates exempted vs. total evaluations | < 5% |
| Rework rate | Percentage of items sent back to a previous phase | < 10% |
- Per-task: Gate results logged in
.claude/state/orchestrator.jsonafter each evaluation. - Per-sprint: Aggregate metrics reviewed during sprint retrospective.
- Per-milestone: Trend analysis to identify systemic quality gaps.
Quality gates are maintained by Retort. See UNIFIED_AGENT_TEAMS.md for the lifecycle model that these gates support.