Milestone
Execute an automated development cycle for the current milestone task with mandatory quality gates.
# Milestone Automation Skill
Execute an automated development cycle for the current milestone task with mandatory quality gates.
## Workflow Overview
┌─────────────────────────────────────────────────────────────┐ │ Parse milestones.md → Find next incomplete task │ │ ↓ │ │ Implement (developer agent guidelines) │ │ ↓ │ │ SPAWN code-reviewer agent → Adversarial review │ │ ↓ │ │ Fix CRITICAL/HIGH issues │ │ ↓ │ │ Unit tests (typecheck, lint, test, build) │ │ ↓ │ │ E2E tests (MANDATORY - must pass) │ │ ↓ FAIL ↓ PASS │ │ Root cause analysis Update docs, commit │ │ Fix, retry E2E ↓ │ │ ↑_______________________| │ │ │ │ Loop until all tasks complete or stop condition │ └─────────────────────────────────────────────────────────────┘
## Instructions
When this skill is invoked, follow this exact sequence:
### Step 1: Identify Current Task
Read `docs/milestones.md` and find:
- The current milestone (first one not marked COMPLETE)
- The next incomplete deliverable (first `- [ ]` checkbox)
Report what you're working on:
Working on: M{N} - {Milestone Name} Task: {Task description}
### Step 2: Implement the Task
Using the developer agent guidelines from `.claude/prompts/developer.md`:
1. Read the PRD section relevant to this task
2. Examine existing code patterns in the codebase
3. Implement the feature/fix
4. Add data-testid attributes to all new UI elements
5. Ensure TypeScript compiles
### Step 3: Adversarial Review (SPAWN AGENT)
**MANDATORY**: Spawn a code-reviewer agent:
Task({ subagent_type: "code-reviewer", prompt: "Review these changes for: 1) PRD compliance (check docs/PRD.md), 2) Security issues, 3) TypeScript quality, 4) Logic bugs, 5) Testability. Files: {list}", description: "Adversarial code review" })
Review agent will return findings with severity levels.
**Response Handling:**
- **CRITICAL**: Stop. Fix immediately.
- **HIGH**: Fix before proceeding to tests.
- **MEDIUM**: Document, may proceed.
- **LOW**: Note and continue.
Log all findings in session notes.
### Step 4: Run Quality Gates
Execute these commands and verify they pass:
```bash
npm run typecheck
npm run lint
npm run test -- --run
npm run build
If any fail:
- Fix the issues
- Re-run the checks
- Maximum 3 attempts before stopping
- DO NOT proceed until all pass
Step 5: E2E Validation (MANDATORY)
This step is NOT optional. Every task must pass E2E.
npm run test:e2e -- --project=chromium
If tests PASS: Proceed to Step 6.
If tests FAIL:
- DO NOT proceed to commit
- Follow
.claude/prompts/root-cause-analysis.md - Spawn debugger agent if needed:
Task({ subagent_type: "debugger", prompt: "E2E failure: {test}. Error: {message}. Find root cause.", description: "Debug E2E failure" }) - Fix root cause (not symptom)
- Re-run E2E
- Loop until 100% pass
- Document fix in session notes
Step 6: Update Documentation
- In
docs/milestones.md, change the task from- [ ]to- [x] - Add implementation notes if significant
- If all deliverables in milestone complete, update status to
COMPLETE
Step 7: Commit Changes
Create a commit with format:
M{N}: {Brief description}
- {Specific change 1}
- {Specific change 2}
- Review findings addressed: {count}
Implements: {deliverable from milestones.md}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Step 8: Update Session Notes
Append to .claude/session-notes.md:
### Task: {description}
- Status: Complete
- Files: {list}
- Review: {CRITICAL}/{HIGH}/{MEDIUM} findings
- E2E iterations: {count}
- Root causes: {list if any}
Step 9: Milestone Completion Check
If all tasks in the milestone are complete:
- Run full E2E suite
- Verify milestone-specific E2E test passes
- Update milestone status to COMPLETE
- Write milestone summary to session notes
Metrics Tracking
Track these metrics during the session:
| Metric | Description |
|---|---|
agent_calls_reviewer |
Times code-reviewer agent spawned |
agent_calls_debugger |
Times debugger agent spawned |
findings_critical |
CRITICAL issues found by reviewer |
findings_high |
HIGH issues found by reviewer |
findings_medium |
MEDIUM issues found by reviewer |
e2e_failures |
E2E test failures encountered |
e2e_iterations |
Times E2E suite was run |
root_causes_fixed |
Distinct root causes identified and fixed |
tasks_completed |
Tasks marked complete |
Stop Conditions
- All tasks in the milestone are complete
- CRITICAL issue cannot be resolved after 2 attempts
- E2E tests fail after 3 fix attempts
- Unit tests fail after 3 fix attempts
- User interrupts
Success Criteria
A task is successfully complete when:
- Code implements the requirement
- Code review found no CRITICAL or HIGH issues (or they were fixed)
- All unit tests pass
- All E2E tests pass
- Documentation updated
- Commit created
Arguments
--dry-run: Show what would be done without making changes--skip-review: Skip adversarial review (NOT RECOMMENDED)--task={id}: Work on specific task instead of next one
Example Usage
/milestone # Work on next task
/milestone --dry-run # Preview next task without changes
Maintain Milestone?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Milestone on getagentictools](https://getagentictools.com/loops/architectvs7-milestone-automation-skill?ref=badge) npx agentictools info loops/architectvs7-milestone-automation-skill The second line is the CLI lookup for this page — handy in READMEs and docs.