Design review gate

From dsifry/goodtogo · View interactive version

Design review gate is an AI agent skill from the GitHub repository dsifry/goodtogo. Automatic review gate that runs after brainstorming completes - spawns PM, Architect, Designer, Security, and CTO agents in parallel, iterates until all approve

How to use this skill

Skill file

Design Review Gate

Purpose

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:

  1. Product Manager Agent - Use case validation and user benefit review
  2. Architect Agent - Technical architecture review
  3. Designer Agent - UX/API design quality review
  4. Security Design Agent - Security threat modeling and protection review
  5. CTO Agent - Codebase alignment and TDD readiness review

All five must approve before proceeding to implementation.


Activation Triggers

This skill auto-activates when:

  1. A design document is committed to docs/plans/*-design.md
  2. The superpowers:brainstorming skill completes
  3. User explicitly requests: /project:review-design <path-to-design.md>

Workflow

Phase 1: Spawn Review Agents (Parallel)

// Spawn all five agents in parallel for efficiency
const [pmResult, architectResult, designerResult, securityResult, ctoResult] = await Promise.all([
  Task({
    subagent_type: "general-purpose",
    description: "PM review",
    prompt: pmReviewPrompt(designDocPath),
  }),
  Task({
    subagent_type: "general-purpose",
    description: "Architect review",
    prompt: architectReviewPrompt(designDocPath),
  }),
  Task({
    subagent_type: "general-purpose",
    description: "Designer review",
    prompt: designerReviewPrompt(designDocPath),
  }),
  Task({
    subagent_type: "general-purpose",
    description: "Security design review",
    prompt: securityDesignReviewPrompt(designDocPath),
  }),
  Task({
    subagent_type: "general-purpose",
    description: "CTO review",
    prompt: ctoReviewPrompt(designDocPath),
  }),
]);

Phase 2: Aggregate Results

Each agent returns a structured review:

interface ReviewResult {
  agent: "product-manager" | "architect" | "designer" | "security-design" | "cto";
  verdict: "APPROVED" | "NEEDS_REVISION";
  blockers: string[]; // MUST fix before implementation
  suggestions: string[]; // Nice to have
  questions: string[]; // Clarifications needed
  use_case_analysis?: {
    // PM agent only
    total_use_cases: number;
    clear: number;
    needs_work: number;
    missing_scenarios: string[];
  };
  threat_model?: {
    // Security agent only
    high_risk: string[];
    medium_risk: string[];
    mitigations_required: string[];
  };
}

Phase 3: Check Gate

IF all five agents return APPROVED:
  → Proceed to implementation
  → Create BEADS epic with approved design

ELSE:
  → Consolidate feedback
  → Present to user
  → Iterate on design
  → Re-run gate (max 3 iterations)

Phase 4: Human Escalation

After 3 failed iterations:

  1. Create summary of remaining blockers
  2. Ask human to decide: override, defer, or cancel

Agent Prompts

Product Manager Agent Prompt

You are the PRODUCT MANAGER AGENT reviewing a design document.

## Your Task

Review this design for use case clarity and user benefit validation.

## Design Document

<path>: {designDocPath}

## Review Criteria

### 1. Use Case Validation

- [ ] Each use case follows WHO/WANTS/SO THAT/WHEN format
- [ ] User personas are clearly defined
- [ ] Use cases are realistic and based on user needs
- [ ] Edge cases and error scenarios considered from user perspective

### 2. User Benefit Review

- [ ] Value proposition clearly articulated
- [ ] Benefits are measurable (time saved, success rate, etc.)
- [ ] User journey impact understood
- [ ] Improvement is significant enough to build

### 3. Scope Assessment

- [ ] MVP clearly defined (must have vs nice to have)
- [ ] No feature creep detected
- [ ] Scope matches user needs, not technical possibilities
- [ ] "Solution looking for problem" anti-pattern avoided

### 4. Success Criteria

- [ ] Success metrics are user-focused (not just technical)
- [ ] Metrics are measurable and have thresholds
- [ ] Evaluation timeline defined
- [ ] Failure criteria also defined

## Output Format

Return JSON:

{

"agent": "product-manager",

"verdict": "APPROVED" | "NEEDS_REVISION",

"use_case_analysis": {

"total_use_cases": <number>,

"clear": <number>,

"needs_work": <number>,

"missing_scenarios": ["list of gaps"]

},

"blockers": ["list of MUST fix issues"],

"suggestions": ["nice to have improvements"],

"questions": ["clarifications needed"]

}


### Architect Agent Prompt

You are the ARCHITECT AGENT reviewing a design document.

Your Task

Review this design for technical architecture soundness.

Design Document

<path>: {designDocPath}

Review Criteria

1. Service Architecture

2. Technical Correctness

3. Integration Points

Output Format

Return JSON:

{
  "agent": "architect",
  "verdict": "APPROVED" | "NEEDS_REVISION",
  "blockers": ["list of MUST fix issues"],
  "suggestions": ["nice to have improvements"],
  "questions": ["clarifications needed"]
}

### Designer Agent Prompt

You are the DESIGNER AGENT reviewing a design document.

Your Task

Review this design for UX, API design, and developer experience.

Design Document

<path>: {designDocPath}

Review Criteria

1. API/Interface Design

2. User Experience (if applicable)

3. Developer Experience

4. Consistency

Output Format

Return JSON:

{
  "agent": "designer",
  "verdict": "APPROVED" | "NEEDS_REVISION",
  "blockers": ["list of MUST fix issues"],
  "suggestions": ["nice to have improvements"],
  "questions": ["clarifications needed"]
}

### Security Design Agent Prompt

You are the SECURITY DESIGN AGENT reviewing a design document.

Your Task

Review this design for security vulnerabilities BEFORE code is written.

Design Document

<path>: {designDocPath}

Review Criteria

1. Authentication & Authorization

2. Data Protection

3. Input Validation

4. API Security

5. OWASP Top 10 Check

Required Context

BEFORE reviewing, consider:

Output Format

Return JSON:

{
  "agent": "security-design",
  "verdict": "APPROVED" | "NEEDS_REVISION",
  "threat_model": {
    "high_risk": ["components with critical risk"],
    "medium_risk": ["components with moderate risk"],
    "mitigations_required": ["security controls needed"]
  },
  "blockers": ["MUST fix security issues"],
  "suggestions": ["nice to have security improvements"],
  "questions": ["security clarifications needed"]
}

### CTO Agent Prompt

You are the CTO AGENT reviewing a design document.

Your Task

Review this design for TDD readiness and codebase alignment.

Design Document

<path>: {designDocPath}

Review Criteria

1. TDD Readiness (CRITICAL)

2. Codebase Alignment

3. Completeness

4. Risk Assessment

Required Context Files

BEFORE reviewing, read:

Output Format

Return JSON:

{
  "agent": "cto",
  "verdict": "APPROVED" | "NEEDS_REVISION",
  "blockers": ["list of MUST fix issues"],
  "suggestions": ["nice to have improvements"],
  "questions": ["clarifications needed"]
}

---

## Iteration Protocol

### Round 1: Initial Review

1. Spawn all five agents in parallel
2. Wait for all results
3. If all APPROVED → proceed
4. If any NEEDS_REVISION → consolidate and present

### Rounds 2-3: Revision Cycles

1. Present consolidated feedback to human
2. Human revises design document
3. Re-run all five agents on updated doc
4. Repeat until all approve

### Round 4: Escalation

If still not approved after 3 iterations:

🚨 Design Review Gate: Escalation Required

After 3 review cycles, the following blockers remain unresolved:

Architect Agent

Designer Agent

CTO Agent

Options

  1. Override - Proceed anyway (document technical debt)
  2. Defer - Shelve this feature for later
  3. Revise - Continue iterating on design
  4. Cancel - Abandon this feature

Please choose an option or provide additional context.


---

## Integration with BEADS

When design is approved:

Create BEADS epic linked to design doc

bd create "<feature-name>" --type epic --json

Create tasks for implementation phases

bd create "Phase 1: Infrastructure" --type task --parent <epic-id>

bd create "Phase 2: Backend" --type task --parent <epic-id>

bd create "Phase 3: Frontend" --type task --parent <epic-id>

bd create "Phase 4: Polish" --type task --parent <epic-id>

Add dependencies based on critical path

bd dep add <phase2-id> <phase1-id>

bd dep add <phase3-id> <phase2-id>

bd dep add <phase4-id> <phase3-id>


---

## Output Format

### Approved Design

✅ Design Review Gate: APPROVED

All five reviewers have approved the design.

| Agent | Verdict | Blockers | Suggestions |

| --------------- | -------- | -------- | ----------- |

| Product Manager | APPROVED | 0 | 1 |

| Architect | APPROVED | 0 | 2 |

| Designer | APPROVED | 0 | 1 |

| Security Design | APPROVED | 0 | 2 |

| CTO | APPROVED | 0 | 3 |

Threat Model Summary (Security Agent)

Suggestions (Non-Blocking)

  1. [Architect] Consider adding caching layer for frequent queries
  2. [Designer] Add loading skeleton to improve perceived performance
  3. [Security] Add audit logging for all assistant actions
  4. [Security] Consider anomaly detection for unusual query patterns
  5. [CTO] Document rate limit headers in API response

Next Steps

  1. Create BEADS epic for implementation
  2. Set up worktree with superpowers:using-git-worktrees
  3. Begin Phase 1 implementation

Ready to proceed with implementation? [Yes/No]


### Needs Revision

⚠️ Design Review Gate: NEEDS REVISION

One or more reviewers found blocking issues.

| Agent | Verdict | Blockers | Suggestions |

| --------------- | -------------- | -------- | ----------- |

| Architect | APPROVED | 0 | 2 |

| Designer | NEEDS_REVISION | 2 | 1 |

| Security Design | NEEDS_REVISION | 2 | 1 |

| CTO | NEEDS_REVISION | 3 | 0 |

Blocking Issues (MUST FIX)

Designer Agent
  1. Missing error states - The design doesn't specify what happens when search returns 0 results
  2. Inconsistent API naming - get_contact_details uses underscore but existing APIs use camelCase
Security Design Agent
  1. CRITICAL: userId trust boundary - Design shows userId passed to tools, but userId MUST come from server session only. Model could be jailbroken to output arbitrary userIds.
  2. Missing rate limits - AI endpoints are expensive and must have rate limiting to prevent abuse
CTO Agent
  1. Missing TDD specs - No RED-GREEN-REFACTOR cycles documented
  2. Missing mock infrastructure - No beforeEach/afterEach setup specified
  3. Missing edge cases - Need systematic enumeration per method

Threat Model (Security Agent)

Questions Requiring Clarification

  1. [CTO] What's the max conversation history size?
  2. [Designer] What happens when user clicks "View More"?
  3. [Security] How will location data be protected? Is it PII?

Iteration: 1 of 3

Action Required: Please revise the design document to address the blocking issues above.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.