---
name: agentic-sdlc
description: 5-phase AI-powered SDLC — Discovery → Planning → Implementation → Validation → Production. UI-first, test-plan-first, human checkpoints at every phase. Source: Sal Ariola, CTO Sprout (1,150 engineers, ~1B people payroll).
version: 1.0.0
metadata:
  filePattern: "**/*.md"
priority: 83
---

# Agentic SDLC

## The Framework (Black Magic Principles)

| Principle | Meaning |
|-----------|---------|
| **Spec-based** | Start from user stories and acceptance criteria — always |
| **Context-driven** | Design system + coding standards + patterns loaded as context |
| **Agentic** | Agents handle cross-functional work; humans approve at checkpoints |
| **Engineering practices** | DORA metrics, CI/CD, shift-left testing — non-negotiable |

## 5 Phases

### Phase 1: Discovery
1. Is this a UI feature or backend-only?
2. **If UI**: UI agent generates prototype FROM design system (HTML mockup, no backend yet)
3. Stakeholders review prototype → approve colors, layout, user flows
4. Requirements **extracted FROM prototype** (not written from assumptions)
5. ✅ Human checkpoint before proceeding

### Phase 2: Planning
1. Generate PRD from approved prototype
2. Story refinement agent creates user stories (can generate 100+)
3. Solutions architect + backend + frontend agents review each user story:
   - Create tasks, ask clarifying questions, mark actionable/needs-refinement
4. EM reviews refined stories
5. Push to GitHub + Jira (human engineers also need visibility)
6. ✅ Human checkpoint before proceeding

### Phase 3: Implementation
**Trigger**: developer runs `orchestrate` command on a user story

1. QA agent reads user story → creates test plan (**BEFORE any coding starts**)
2. Implementation agents (frontend/backend) receive user story + test plan
3. Agents implement the feature
4. Shift-left: integration + unit tests written alongside implementation
5. 6 specialist reviewers run **in parallel** (security, performance, architecture, accessibility, etc.)
6. Developer reviews output → approves
7. ✅ Human checkpoint before proceeding

### Phase 4: Validation
1. Smoke testing
2. Manual QA (human tests user story acceptance criteria)
3. QA agent runs E2E tests + regression testing
4. Quality gate: all tests pass
5. ✅ Human checkpoint before proceeding

### Phase 5: Production
1. CI/CD pipeline runs
2. Security scan (always-on, not optional)
3. Deploy → Monitor

## Non-Negotiable Rules

- **UI-first**: prototype before PRD, never PRD before prototype
- **Test-plan-first**: QA creates test plan before implementation agents start
- **Quality at every phase**: not just at the end
- **Human has final say** at every major checkpoint
- **Security is always-on**: a constant, not a phase
- **Agents handle the "what"**: humans decide the "whether"

## Capacity Math

| Before (Human Teams) | After (Agentic) |
|----------------------|-----------------|
| PM + Tech Lead + QA = 3-person triad | 1 engineer + agents |
| 8-month legacy refactor with full team | 3 weeks with 1 senior |
| Sequential review bottlenecks | 6 specialists in parallel |

## Anti-Patterns
- ❌ Writing the PRD before prototyping (assumptions compound)
- ❌ Starting implementation before the test plan exists
- ❌ Quality review only at the end (too late, too expensive)
- ❌ Skipping human checkpoints (agents make mistakes; humans catch them)
- ❌ Security as an afterthought (embed it at every phase)
- ❌ Removing humans from the loop entirely (outcome is still the engineer's)
