# π¦ Quality Gates for CursorRIPER Ξ£
# Symbol: Ξ (Kappa)
# Version: 1.0.0
## π Gate System Definition
```
service = "Enterprise Quality Gate System"
symbol = "Ξ"
enforcement = "Sequential gate progression with approvals"
```
## π― Gate Definitions
```
Ξ = {
Ξβ: {
name: "PRD Approval Gate",
phase: "Requirements",
blockers: {
prd_completeness: 100%,
objectives_clear: validated(Ξ‘β),
requirements_complete: validated(Ξ‘β),
stories_estimated: all(Ξ‘β.estimation > 0),
acceptance_defined: all(Ξ‘β
.criteria.length > 0)
},
approvers: [Ξβ],
artifacts_required: [
"Complete PRD document",
"User story backlog",
"Success metrics defined"
],
next: Ξβ,
rollback: draft_state
},
Ξβ: {
name: "Design Review Gate",
phase: "Architecture",
blockers: {
architecture_documented: exists(tech_spec),
api_contracts_defined: validated(api_spec),
security_review_passed: security_score > 80,
performance_targets_set: defined(sla_metrics),
database_design_complete: exists(data_model)
},
approvers: [Ξβ],
artifacts_required: [
"Technical specification",
"Architecture diagrams",
"API documentation",
"Security assessment"
],
next: Ξβ,
rollback: Ξβ
},
Ξβ: {
name: "Code Review Gate",
phase: "Implementation",
blockers: {
tests_passing: test_suite.pass_rate === 100%,
coverage_threshold: code_coverage > 80%,
linting_passed: lint_errors === 0,
no_security_vulnerabilities: security_scan.critical === 0,
documentation_complete: api_docs_generated()
},
approvers: [Ξβ, Ξβ],
artifacts_required: [
"Source code",
"Unit tests",
"Integration tests",
"Code documentation"
],
next: Ξβ,
rollback: development_branch
},
Ξβ: {
name: "QA Signoff Gate",
phase: "Testing",
blockers: {
acceptance_tests_passed: acceptance_suite.pass_rate === 100%,
regression_suite_clean: regression_failures === 0,
performance_benchmarks_met: all(perf_metrics < threshold),
accessibility_compliant: a11y_score > 90,
browser_compatibility: all(browsers.tested)
},
approvers: [Ξβ],
artifacts_required: [
"Test execution reports",
"Bug tracking status",
"Performance reports",
"QA signoff document"
],
next: Ξβ
,
rollback: Ξβ
},
Ξβ
: {
name: "Deployment Approval Gate",
phase: "Release",
blockers: {
staging_validation_complete: staging_tests.passed,
rollback_plan_documented: exists(rollback_procedure),
monitoring_configured: all(alerts.configured),
runbooks_updated: documentation.current,
change_approval_obtained: change_ticket.approved
},
approvers: [Ξβ
],
artifacts_required: [
"Deployment plan",
"Rollback procedures",
"Monitoring configuration",
"Release notes"
],
next: production_release,
rollback: Ξβ
}
}
```
## π Gate Enforcement
```
enforce_gate(Ξα΅’) = {
current_gate: get_active_gate(),
# Check sequential progression
validate_sequence: Ξα΅’ === current_gate.next ?
proceed : deny("Must complete " + current_gate.name),
# Check blockers
check_blockers: Ξα΅’.blockers.map(b => ({
blocker: b.name,
status: evaluate(b.condition),
details: b.status ? "β Passed" : "β " + b.failure_reason
})),
# Check artifacts
check_artifacts: Ξα΅’.artifacts_required.map(a => ({
artifact: a,
exists: find_artifact(a),
valid: validate_artifact(a)
})),
# Require approval
get_approval: {
eligible_approvers: Ξα΅’.approvers β© available_approvers(),
request_approval: send_approval_request(eligible_approvers),
wait_for_approval: blocking_wait(timeout: 48h)
},
# Log completion
complete_gate: {
log: record_gate_completion(Ξα΅’, approvals, timestamp),
transition: move_to_next_phase(Ξα΅’.next),
notify: broadcast_gate_completion(Ξα΅’)
}
}
```
## π Gate Checklists
```
generate_checklist(Ξα΅’) = {
metadata: {
gate: Ξα΅’.name,
phase: Ξα΅’.phase,
generated: timestamp()
},
blockers_checklist: Ξα΅’.blockers.map(b =>
"[ ] " + b.description + " (" + b.condition + ")"
),
artifacts_checklist: Ξα΅’.artifacts_required.map(a =>
"[ ] " + a + " - uploaded and validated"
),
approval_checklist: Ξα΅’.approvers.map(role =>
"[ ] Approval from " + Ξ_roles[role].name
),
format: markdown_checklist()
}
```
## π¨ Gate Violations
```
handle_gate_violation(violation_type, Ξα΅’) = {
bypassed_gate: {
severity: "CRITICAL",
action: rollback_to_gate(Ξα΅’),
notify: escalate_to_management(),
audit: log_security_event()
},
incomplete_artifacts: {
severity: "HIGH",
action: block_progression(),
notify: remind_artifact_owners(),
timeout: 24h
},
failed_blockers: {
severity: "MEDIUM",
action: return_to_previous_phase(),
notify: assigned_teams(),
guidance: suggest_remediation()
},
missing_approval: {
severity: "HIGH",
action: halt_until_approved(),
notify: ping_approvers(),
escalate: after_48h
}
}
```
## β‘ Gate Commands
```
S_gates = {
!kg: "check_current_gate",
!kga: "approve_gate",
!kgc: "view_gate_checklist",
!kgb: "show_gate_blockers",
!kgh: "gate_history",
!kgr: "request_gate_approval",
!kgs: "skip_gate (emergency only)"
}
```
## π Gate Metrics
```
track_gate_metrics() = {
cycle_time_per_gate: {
Ξβ: avg_days(start β approval),
Ξβ: avg_days(approval β design_complete),
Ξβ: avg_days(design β code_complete),
Ξβ: avg_days(code β qa_signoff),
Ξβ
: avg_days(qa β deployment)
},
blocker_frequency: count_by_blocker_type(),
approval_delays: avg_approval_time_by_role(),
rollback_rate: rollbacks / total_attempts,
quality_impact: {
defect_escape_rate: bugs_in_prod / total_bugs,
gate_effectiveness: prevented_issues / total_gates
}
}
```
## π Gate Automation
```
automate_gate_checks() = {
continuous_validation: {
run_every: 15_minutes,
check: current_gate.blockers,
notify: on_status_change
},
artifact_monitoring: {
watch: artifact_directories,
validate: on_new_upload,
update: checklist_status
},
approval_reminders: {
initial: after_24h,
followup: every_12h,
escalate: after_72h
}
}
```
## π Gate Integration
```
# Gate + Mode enforcement
gate_mode_requirements = {
Ξβ: requires(Ξ©β β¨ Ξ©β), # Research or Innovate
Ξβ: requires(Ξ©β β¨ Ξ©β), # Innovate or Plan
Ξβ: requires(Ξ©β), # Execute only
Ξβ: requires(Ξ©β β¨ Ξ©β
), # Execute or Review
Ξβ
: requires(Ξ©β
) # Review only
}
# Gate + Role validation
gate_role_matrix = {
(Ξβ, Ξβ): can_approve,
(Ξβ, Ξβ): can_approve,
(Ξβ, Ξβ): can_request,
(Ξβ, Ξβ): can_approve,
(Ξβ, Ξβ): can_approve,
(Ξβ
, Ξβ
): can_approve
}
```