Skip to main content

Quality Gate

A quality gate is a checkpoint in the SpecWeave workflow that validates work meets specific criteria before proceeding to the next phase.

SpecWeave Quality Gates

1. Pre-Implementation Gate

Validates specifications before starting implementation. Say "assess quality before we start", use sw:qa 0001 --pre in Claude Code, or type qa 0001 --pre in other AI tools.

Checks:

  • ✅ Clarity - Requirements are clear and unambiguous
  • ✅ Testability - Acceptance criteria are testable
  • ✅ Completeness - All necessary sections present
  • ✅ Feasibility - Technical approach is sound

2. Completion Gate

Validates work before closing an increment. Say "we're done", use sw:done 0001 in Claude Code, or type done 0001 in other AI tools.

Three validation gates:

  1. Tasks Complete - All tasks in tasks.md marked done
  2. Tests Pass - 60%+ test coverage
  3. Docs Updated - Living docs synchronized

3. Quality Assessment Gate

Comprehensive quality check before release. Say "full quality assessment", use sw:qa 0001 --gate in Claude Code, or type qa 0001 --gate in other AI tools.

7 Quality Dimensions (weighted scoring):

  1. Clarity (18%)
  2. Testability (22%)
  3. Completeness (18%)
  4. Feasibility (13%)
  5. Maintainability (9%)
  6. Edge Cases (9%)
  7. Risk Assessment (11%)

Gate Decisions:

  • 🟢 PASS - Ready to proceed
  • 🟡 CONCERNS - Should fix before release
  • 🔴 FAIL - Must fix before proceeding

Risk Scoring

Quality gates include risk assessment using Probability × Impact method:

Risk LevelScoreAction
CRITICAL≥9.0Immediate action required
HIGH6.0-8.9Address before release
MEDIUM3.0-5.9Monitor
LOW<3.0Acceptable

Example Output

$ sw:qa 0001 --gate

📊 Quality Assessment: 0001-user-authentication

📈 Overall Score: 85/100 (PASS)

Dimension Scores:
✅ Clarity: 90/100
✅ Testability: 88/100
✅ Completeness: 85/100
✅ Feasibility: 82/100
⚠️ Maintainability: 75/100
✅ Edge Cases: 80/100
✅ Risk Assessment: 78/100

🎯 Gate Decision: 🟢 PASS

📝 Recommendations:
- Consider extracting AuthService into smaller modules
- Add rate limiting tests for login endpoint

✅ Ready for release

Configuration

Quality gate thresholds in .specweave/config.json:

{
"validation": {
"quality_judge": {
"enabled": true,
"pass_threshold": 70,
"concerns_threshold": 50
}
}
}
  • Increments - What gates validate
  • Acceptance Criteria - What gates check
  • Test Coverage - Coverage requirements
  • TDD - Test-first approach