$npx -y skills add dsifry/metaswarm --skill design-review-gateAutomatic review gate that runs after brainstorming completes - spawns PM, Architect, Designer, Security, and CTO agents in parallel, iterates until all approve
| 1 | # Design Review Gate |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | This skill automatically activates after a design document is created (typically via `superpowers:brainstorming`). It ensures complex features receive proper review before implementation begins by spawning five specialist agents: |
| 6 | |
| 7 | 1. **Product Manager Agent** - Use case validation and user benefit review |
| 8 | 2. **Architect Agent** - Technical architecture review |
| 9 | 3. **Designer Agent** - UX/API design quality review |
| 10 | 4. **Security Design Agent** - Security threat modeling and protection review |
| 11 | 5. **CTO Agent** - Codebase alignment and TDD readiness review |
| 12 | |
| 13 | All five must approve before proceeding to implementation. |
| 14 | |
| 15 | --- |
| 16 | |
| 17 | ## Coordination Mode Note |
| 18 | |
| 19 | This skill supports both coordination modes: |
| 20 | |
| 21 | - **Task Mode** (default): Spawn 5 parallel `Task()` subagents for each review round. Fresh instances per round. |
| 22 | - **Team Mode**: `TeamCreate("review-{design-doc-name}")`, spawn 5 reviewers as named teammates (`pm`, `architect`, `designer`, `security`, `cto`). Reviewers retain context through revision cycles — saves 5 cold starts per re-review round. After approval, send `shutdown_request` to all, then `TeamDelete`. |
| 23 | |
| 24 | In either mode, the review criteria, iteration protocol, and escalation rules are identical. See `./guides/agent-coordination.md` for mode detection. |
| 25 | |
| 26 | --- |
| 27 | |
| 28 | ## Activation Triggers |
| 29 | |
| 30 | This skill auto-activates when: |
| 31 | |
| 32 | 1. A design document is committed to `docs/plans/*-design.md` |
| 33 | 2. The `superpowers:brainstorming` skill completes |
| 34 | 3. User explicitly requests: `/review-design <path-to-design.md>` |
| 35 | |
| 36 | --- |
| 37 | |
| 38 | ## Workflow |
| 39 | |
| 40 | ### Phase 1: Spawn Review Agents (Parallel) |
| 41 | |
| 42 | ```typescript |
| 43 | // Spawn all five agents in parallel for efficiency |
| 44 | const [pmResult, architectResult, designerResult, securityResult, ctoResult] = await Promise.all([ |
| 45 | Task({ |
| 46 | subagent_type: "general-purpose", |
| 47 | description: "PM review", |
| 48 | prompt: pmReviewPrompt(designDocPath), |
| 49 | }), |
| 50 | Task({ |
| 51 | subagent_type: "general-purpose", |
| 52 | description: "Architect review", |
| 53 | prompt: architectReviewPrompt(designDocPath), |
| 54 | }), |
| 55 | Task({ |
| 56 | subagent_type: "general-purpose", |
| 57 | description: "Designer review", |
| 58 | prompt: designerReviewPrompt(designDocPath), |
| 59 | }), |
| 60 | Task({ |
| 61 | subagent_type: "general-purpose", |
| 62 | description: "Security design review", |
| 63 | prompt: securityDesignReviewPrompt(designDocPath), |
| 64 | }), |
| 65 | Task({ |
| 66 | subagent_type: "general-purpose", |
| 67 | description: "CTO review", |
| 68 | prompt: ctoReviewPrompt(designDocPath), |
| 69 | }), |
| 70 | ]); |
| 71 | ``` |
| 72 | |
| 73 | ### Phase 2: Aggregate Results |
| 74 | |
| 75 | Each agent returns a structured review: |
| 76 | |
| 77 | ```typescript |
| 78 | interface ReviewResult { |
| 79 | agent: "product-manager" | "architect" | "designer" | "security-design" | "cto"; |
| 80 | verdict: "APPROVED" | "NEEDS_REVISION"; |
| 81 | blockers: string[]; // MUST fix before implementation |
| 82 | suggestions: string[]; // Nice to have |
| 83 | questions: string[]; // Clarifications needed |
| 84 | use_case_analysis?: { |
| 85 | // PM agent only |
| 86 | total_use_cases: number; |
| 87 | clear: number; |
| 88 | needs_work: number; |
| 89 | missing_scenarios: string[]; |
| 90 | }; |
| 91 | threat_model?: { |
| 92 | // Security agent only |
| 93 | high_risk: string[]; |
| 94 | medium_risk: string[]; |
| 95 | mitigations_required: string[]; |
| 96 | }; |
| 97 | } |
| 98 | ``` |
| 99 | |
| 100 | ### Phase 3: Check Gate |
| 101 | |
| 102 | ``` |
| 103 | IF all five agents return APPROVED: |
| 104 | → Proceed to implementation |
| 105 | → Create epic with approved design |
| 106 | |
| 107 | ELSE: |
| 108 | → Consolidate feedback |
| 109 | → Present to user |
| 110 | → Iterate on design |
| 111 | → Re-run gate (max 3 iterations) |
| 112 | ``` |
| 113 | |
| 114 | ### Phase 4: Human Escalation |
| 115 | |
| 116 | After 3 failed iterations: |
| 117 | |
| 118 | 1. Create summary of remaining blockers |
| 119 | 2. Ask human to decide: override, defer, or cancel |
| 120 | |
| 121 | --- |
| 122 | |
| 123 | ## Agent Prompts |
| 124 | |
| 125 | ### Product Manager Agent Prompt |
| 126 | |
| 127 | ````markdown |
| 128 | You are the PRODUCT MANAGER AGENT reviewing a design document. |
| 129 | |
| 130 | ## Your Task |
| 131 | |
| 132 | Review this design for use case clarity and user benefit validation. |
| 133 | |
| 134 | ## Design Document |
| 135 | |
| 136 | <path>: {designDocPath} |
| 137 | |
| 138 | ## Review Criteria |
| 139 | |
| 140 | ### 1. Use Case Validation |
| 141 | |
| 142 | - [ ] Each use case follows WHO/WANTS/SO THAT/WHEN format |
| 143 | - [ ] User personas are clearly defined |
| 144 | - [ ] Use cases are realistic and based on user needs |
| 145 | - [ ] Edge cases and error scenarios considered from user perspective |
| 146 | |
| 147 | ### 2. User Benefit Review |
| 148 | |
| 149 | - [ ] Value proposition clearly articulated |
| 150 | - [ ] Benefits are measurable (time saved, success rate, etc.) |
| 151 | - [ ] User journey impact understood |
| 152 | - [ ] Improvement is significant enough to build |
| 153 | |
| 154 | ### 3. Scope Assessment |
| 155 | |
| 156 | - [ ] MVP clearly defined (must have vs nice to have) |
| 157 | - [ ] No feature creep detected |
| 158 | - [ ] Scope matches user needs, not technical possibilities |
| 159 | - [ ] "Solution looking for problem" anti-pattern avoided |
| 160 | |
| 161 | ### 4. Success Criteria |
| 162 | |
| 163 | - [ ] Success metrics are user-focused (not just technical) |
| 164 | - [ ] Metrics are measurable and have thresh |