| name | phase-enforcement |
| description | AID methodology phase gate enforcement. Ensures work follows correct phase order (PRD -> Tech Spec -> Impl Plan -> Dev -> QA). Enforces gates, validates transitions. |
Phase Enforcement Skill
Claude MUST check current phase before any work, REFUSE work that belongs to later phase.
Priority 1: Phase Gate Enforcement
Before any work:
- Read
.aid/state.json for current phase
- Classify the requested work
- Check if work is allowed
- REFUSE if not allowed (show violation)
- At phase completion: mandatory sub-agent review
- After review passes: collect feedback via /aid end
Mandatory: Sub-Agent Review at Transitions
Before Phase N -> N+1:
- Spawn review sub-agent
- Sub-agent reviews all deliverables
- Returns PASS/FAIL with findings
- FAIL: Address issues, retry
- PASS: Proceed to feedback
5-Phase Development Lifecycle
| Phase | Name | Document | Folder |
|---|
| 1 | PRD | Product Requirements | docs/prd/ |
| 2 | Tech Spec | Technical Specification | docs/tech-spec/ |
| 3 | Impl Plan | Task Breakdown | docs/implementation-plan/ |
| 4 | Development | Code & Tests | src/ |
| 5 | QA & Ship | Deployment | Production |
Work Classification
| Category | Examples | First Allowed |
|---|
| requirements | PRD, user stories | Phase 1 |
| architecture | System design, APIs | Phase 2 |
| planning | Jira, task breakdown | Phase 3 |
| coding | Components, tests | Phase 4 |
| qa | Testing, deployment | Phase 5 |
Phase Permissions
- Phase 1: requirements
- Phase 2: requirements, architecture
- Phase 3: requirements, architecture, planning
- Phase 4: requirements, architecture, planning, coding
- Phase 5: all
Gate Check Requirements
Phase 1 -> 2
Phase 2 -> 3
Phase 3 -> 4
Phase 4 -> 5
Violation Template
PHASE GATE VIOLATION
Current Phase: [N] [Name]
Requested: [What]
Category: [Category]
This work belongs to Phase [X].
Complete first: [List]
Commands: /phase, /gate-check, /aid end
Sub-Agent Review Prompts
PRD Review (Phase 1 -> 2)
Tech Spec Review (Phase 2 -> 3)
Impl Plan Review (Phase 3 -> 4)
Phase 3 Golden Rules:
- NO WORD LEFT BEHIND - PRD → Epic/Story, Tech Spec → Task
- SMALL TASKS - Larger docs = smaller tasks
- PROCESS IN CHUNKS - Read → Write immediately
- VERIFY - 100% coverage required
Sub-Phases: 3a Consolidation → 3b Breakdown → 3c Enrichment → 3d Jira → 3e Verification
Checklist:
Development Review (Phase 4 -> 5)
Exceptions
Always Allowed: Reading files, documentation updates, questions, /phase, /gate-check
Override: User says "override: [reason]" - logged to .aid/overrides.log
State File
.aid/state.json:
{
"current_phase": 2,
"phase_name": "tech-spec",
"feature_name": "user-auth",
"phases_completed": [1],
"subagent_review": {"phase_1": {"status": "passed"}}
}