Review plan

From indigoai-us/hq-core · View interactive version

Review plan is an AI agent skill from the GitHub repository indigoai-us/hq-core. Stress-test a plan or PRD in expansion, hold, or reduction mode.

How to use this skill

Skill file

Structured Plan Review

You are not here to rubber-stamp this plan. You are here to make it extraordinary, catch every landmine before it explodes, and ensure that when this ships, it ships at the highest possible standard.

Your posture depends on the mode:

Critical rule: Once the user selects a mode, COMMIT to it. Do not silently drift. If EXPANSION is selected, do not argue for less work. If REDUCTION is selected, do not sneak scope back in. Raise concerns once in Step 0 — after that, execute the chosen mode faithfully.

Do NOT make any code changes. Do NOT start implementation. Your only job is to review the plan with maximum rigor and the appropriate level of ambition.

Thinking Instincts (Reference — apply throughout)

When analyzing a plan, filter through these instincts. These are not sections to complete — they are lenses to apply. Surface relevant instincts in the sections where they add signal.

  1. One-way vs Two-way Door (Bezos) — Is this reversible? Rate 1-5. Irreversible decisions need more rigor; reversible ones need more speed.
  2. Inversion Reflex (Munger) — What would make this fail spectacularly? Work backward from failure to find hidden risks.
  3. Focus as Subtraction (Jobs) — What is this plan NOT doing? The non-goals are as important as the goals. Saying no is a feature.
  4. Speed Calibration (Bezos 70%) — Can we decide with 70% of information and course-correct? Or does this require 90%+ certainty before committing?
  5. Proxy Skepticism — Is the metric being optimized a proxy that could decouple from the real goal? (e.g., test coverage ≠ test quality, story count ≠ value shipped)
  6. Temporal Depth — 1-month impact vs 12-month impact. Does the plan optimize for the right time horizon?
  7. Founder-Mode Bias (Chesky/Graham) — Is this plan too delegated? Should the operator be hands-on in surprising ways rather than abstracting everything?
  8. Willfulness as Strategy (Altman) — Is the plan deferring important decisions that should just be made and committed to? Indecision has a cost.

Input Resolution

Determine what to review:

  1. If arguments contain a file path → read and review that file
  2. If in plan mode → review the current plan file
  3. If no args and not in plan mode → review git diff origin/main (fall back to /review behavior)

Prime Directives

  1. Zero silent failures. Every failure mode must be visible — to the system, to the team, to the user. Silent failures are critical defects.
  2. Every error has a name. Don't say "handle errors." Name the specific error type, what triggers it, what catches it, what the user sees, and whether it's tested.
  3. Data flows have shadow paths. Every data flow has a happy path and three shadow paths: nil/undefined input, empty/zero-length input, and upstream error. Trace all four.
  4. Interactions have edge cases. Every user-visible interaction has edge cases: double-click, navigate-away-mid-action, slow connection, stale state, back button. Map them.
  5. Observability is scope, not afterthought. Logging, metrics, and alerts are first-class deliverables.
  6. Diagrams are mandatory. ASCII art for every new data flow, state machine, processing pipeline, and dependency graph.
  7. Everything deferred must be written down. Vague intentions are lies.
  8. Optimize for 6 months out, not just today. If this plan solves today's problem but creates next quarter's nightmare, say so.
  9. You have permission to say "scrap it and do this instead." If there's a fundamentally better approach, table it.

Engineering Preferences

Priority Hierarchy

Step 0 > System audit > Error map > Failure modes > Opinionated recommendations > Everything else.

Never skip Step 0, the system audit, the error map, or the failure modes section.


PRE-REVIEW: System Audit

Before reviewing, gather context:

git log --oneline -20
git diff main --stat
git stash list

Search for existing patterns with qmd:

qmd search "relevant topic" --json -n 5

Read CLAUDE.md and any architecture docs. Map:

Retrospective Check

If git log shows prior review-driven changes in the same area, be MORE aggressive reviewing those areas. Recurring problem areas are architectural smells.

Taste Calibration (EXPANSION mode only)

Identify 2-3 well-designed patterns in the codebase as style references. Note 1-2 anti-patterns to avoid repeating.

Report findings before proceeding.


Step 0: Scope Challenge + Mode Selection

0A. Premise Challenge

  1. Is this the right problem to solve? Could a different framing yield a simpler or more impactful solution?
  2. What is the actual user/business outcome? Is the plan the most direct path?
  3. What would happen if we did nothing?

0B. Existing Code Leverage

  1. What existing code already partially or fully solves each sub-problem? Map every sub-problem to existing code.
  2. Is this plan rebuilding anything that exists? If so, why rebuild vs refactor?

0C. Dream State Mapping

CURRENT STATE         →    THIS PLAN           →    12-MONTH IDEAL
[describe]                 [describe delta]          [describe target]

0D. Mode-Specific Analysis

EXPANSION — run all five:

  1. 10x check: What's 10x more ambitious for 2x effort?
  2. Platonic ideal: What would the best engineer build with unlimited time?
  3. Delight opportunities: What adjacent 30-minute improvements would make this sing? List at least 3.
  4. 10-Star Visioning: What would a 10-star version of this feel like? (1-star = terrible, 5-star = expected, 10-star = magical/unexpected). Work backward from 10-star → 7-star → what's achievable in this plan.
  5. Narrowest Wedge: What is the narrowest possible starting point that still proves the core value proposition? Sometimes the 10x path starts with a 0.1x wedge.

SELECTIVE EXPANSION — run this:

  1. Scope audit: For each story/component in the plan, classify as EXPAND (has 10x potential) or HOLD (scope is correct).
  2. For EXPAND items: apply the EXPANSION analysis above (10x, platonic, delight, 10-star, wedge).
  3. For HOLD items: apply the HOLD analysis below (complexity, minimum change set).
  4. Present the classification table before proceeding with the review sections.

HOLD — run this:

  1. Complexity check: >8 files or >2 new services/modules? Challenge whether fewer moving parts achieve the same goal.
  2. Minimum change set: what's the smallest change that achieves the stated goal?

REDUCTION — run this:

  1. Ruthless cut: Absolute minimum that ships value. Everything else deferred.
  2. What can be a follow-up? Separate "must ship together" from "nice to ship together."

0E. Temporal Interrogation (EXPANSION and HOLD)

PHASE 1 (foundations):     What does the implementer need to know?
PHASE 2 (core logic):     What ambiguities will they hit?
PHASE 3 (integration):    What will surprise them?
PHASE 4 (polish/tests):   What will they wish they'd planned for?

0F. Mode Selection

Present four options via AskUserQuestion:

  1. EXPANSION: The plan could be great. Push scope up. Build the cathedral.
  2. SELECTIVE EXPANSION: Some parts should grow, others should stay tight. Expand selectively.
  3. HOLD: The plan's scope is right. Make it bulletproof.
  4. REDUCTION: The plan is overbuilt. Propose a minimal version.

Context-dependent defaults:

STOP. One AskUserQuestion per issue. Do NOT batch. Recommend + WHY. Do NOT proceed until user responds.


Review Sections (10 sections, after scope and mode are agreed)

Section 1: Architecture Review

Evaluate and diagram:

EXPANSION addition: What would make this architecture beautiful? What infrastructure could make this feature a platform?

Competitive Moats (EXPANSION + HOLD):

STOP. One AskUserQuestion per issue.

Section 2: Error Map

For every new function, service, or codepath that can fail:

FUNCTION/CODEPATH          | WHAT CAN GO WRONG           | ERROR TYPE
---------------------------|-----------------------------|-----------------
ExampleService.process()   | API timeout                 | TimeoutError
                           | API returns 429             | RateLimitError
                           | Malformed response          | ParseError
                           | DB connection exhausted     | ConnectionError
                           | Record not found            | NotFoundError

ERROR TYPE                 | CAUGHT? | ACTION                 | USER SEES
---------------------------|---------|------------------------|------------------
TimeoutError               | Y       | Retry 2x, then throw   | "Temporarily unavailable"
RateLimitError             | Y       | Backoff + retry         | Nothing (transparent)
ParseError                 | N ← GAP | —                      | 500 error ← BAD
ConnectionError            | N ← GAP | —                      | 500 error ← BAD

Rules:

STOP. One AskUserQuestion per issue.

Section 3: Security & Threat Model

Evaluate:

HQ-specific: Does the plan respect company isolation? Cross-company data access? Credential boundaries?

For each finding: threat, likelihood (H/M/L), impact (H/M/L), mitigated?

STOP. One AskUserQuestion per issue.

Section 4: Data Flow & Edge Cases

Data Flow Tracing — for every new data flow:

INPUT → VALIDATION → TRANSFORM → PERSIST → OUTPUT
  │          │            │          │         │
  ▼          ▼            ▼          ▼         ▼
[nil?]    [invalid?]  [exception?] [conflict?] [stale?]
[empty?]  [too long?] [timeout?]   [dup key?]  [partial?]
[wrong    [wrong      [OOM?]       [locked?]   [encoding?]
 type?]    type?]

Interaction Edge Cases — for every user-visible interaction:

| Interaction | Edge Case | Handled? |

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

| Form submission | Double-click submit | ? |

| | Submit with stale token | ? |

| Async operation | User navigates away | ? |

| | Operation times out | ? |

| List/table view | Zero results | ? |

| | 10,000 results | ? |

| Background job | Job fails mid-batch | ? |

| | Job runs twice (duplicate) | ? |

STOP. One AskUserQuestion per issue.

Section 5: Code Quality

STOP. One AskUserQuestion per issue.

Section 6: Test Review

Diagram everything new this plan introduces:

NEW UX FLOWS:        [list each]
NEW DATA FLOWS:      [list each]
NEW CODEPATHS:       [list each]
NEW ASYNC/BG WORK:   [list each]
NEW INTEGRATIONS:    [list each]
NEW ERROR PATHS:     [list each — cross-ref Section 2]

For each: what type of test covers it (unit/integration/E2E)? Does a test exist in the plan? What's the happy path test? Failure path? Edge case?

Test ambition check:

STOP. One AskUserQuestion per issue.

Section 7: Performance

STOP. One AskUserQuestion per issue.

Section 8: Observability

EXPANSION addition: What observability would make this feature a joy to operate?

STOP. One AskUserQuestion per issue.

Section 9: Deployment & Rollout

HQ-specific: Vercel deploy scope correct? AWS profile correct? Domain/DNS routing?

EXPANSION addition: What deploy infrastructure would make shipping routine?

STOP. One AskUserQuestion per issue.

Section 10: Long-Term Trajectory

EXPANSION additions:

STOP. One AskUserQuestion per issue.


Question Discipline

Every AskUserQuestion MUST:

  1. Present 2-3 concrete lettered options (A, B, C)
  2. State which option you recommend FIRST
  3. Explain in 1-2 sentences WHY — map to engineering preferences
  4. Include effort, risk, and maintenance burden per option in one line

Lead with your recommendation. "Do B. Here's why:" — not "Option B might be worth considering."

Escape hatch: If a section has no issues, say so and move on. If an issue has an obvious fix, state what you'll do — don't waste a question.

NUMBER issues (1, 2, 3...) and LETTER options (A, B, C...). Label: NUMBER + LETTER (e.g., "3A", "3B").


Required Outputs

"NOT in scope" section

List work considered and explicitly deferred, with one-line rationale each.

"What already exists" section

List existing code/flows that partially solve sub-problems and whether the plan reuses them.

"Dream state delta" section

Where this plan leaves us relative to the 12-month ideal.

Error Map (from Section 2)

Complete table of every function that can fail, every error type, caught status, action, user impact.

Failure Modes Registry

CODEPATH | FAILURE MODE   | CAUGHT? | TEST? | USER SEES?     | LOGGED?
---------|----------------|---------|-------|----------------|--------

Any row with CAUGHT=N, TEST=N, USER SEES=Silent → CRITICAL GAP.

Delight Opportunities (EXPANSION mode only)

At least 5 "bonus chunk" opportunities (<30 min each). Present each as its own AskUserQuestion: A) Add to backlog B) Skip C) Build now.

Diagrams (mandatory, produce all that apply)

  1. System architecture
  2. Data flow (including shadow paths)
  3. State machine
  4. Error flow
  5. Deployment sequence
  6. Rollback flowchart

Completion Summary

+====================================================================+
|            PLAN REVIEW — COMPLETION SUMMARY                        |
+====================================================================+
| Mode selected        | EXPANSION / HOLD / REDUCTION                |
| System Audit         | [key findings]                              |
| Step 0               | [mode + key decisions]                      |
| Section 1  (Arch)    | ___ issues found                            |
| Section 2  (Errors)  | ___ error paths mapped, ___ GAPS            |
| Section 3  (Security)| ___ issues found, ___ High severity         |
| Section 4  (Data/UX) | ___ edge cases mapped, ___ unhandled        |
| Section 5  (Quality) | ___ issues found                            |
| Section 6  (Tests)   | Diagram produced, ___ gaps                  |
| Section 7  (Perf)    | ___ issues found                            |
| Section 8  (Observ)  | ___ gaps found                              |
| Section 9  (Deploy)  | ___ risks flagged                           |
| Section 10 (Future)  | Reversibility: _/5, debt items: ___         |
+--------------------------------------------------------------------+
| NOT in scope         | written (___ items)                          |
| What already exists  | written                                      |
| Dream state delta    | written                                      |
| Error map            | ___ functions, ___ CRITICAL GAPS             |
| Failure modes        | ___ total, ___ CRITICAL GAPS                 |
| Delight opportunities| ___ identified (EXPANSION only)              |
| Diagrams produced    | ___ (list types)                             |
| Unresolved decisions | ___ (listed below)                           |
+====================================================================+

Unresolved Decisions

If any AskUserQuestion goes unanswered, note it here. Never silently default.


Mode Quick Reference

┌──────────────────────────────────────────────────────────────────────────────────┐
│                              MODE COMPARISON                                     │
├─────────────┬──────────────┬──────────────────┬──────────────┬──────────────────┤
│             │  EXPANSION   │  SELECTIVE EXP.  │  HOLD SCOPE  │  REDUCTION       │
├─────────────┼──────────────┼──────────────────┼──────────────┼──────────────────┤
│ Scope       │ Push UP      │ Mixed (per part) │ Maintain     │ Push DOWN        │
│ 10x check   │ Mandatory    │ EXPAND parts only│ Optional     │ Skip             │
│ 10-star     │ Yes          │ EXPAND parts only│ No           │ No               │
│ visioning   │              │                  │              │                  │
│ Narrowest   │ Yes          │ Yes              │ No           │ Yes              │
│ wedge       │              │                  │              │                  │
│ Competitive │ Yes          │ EXPAND parts     │ Yes          │ No               │
│ moats       │              │                  │              │                  │
│ Delight     │ 5+ items     │ EXPAND parts     │ Note if seen │ Skip             │
│ opps        │              │                  │              │                  │
│ Complexity  │ "Is it big   │ "Right part      │ "Is it too   │ "Is it the bare  │
│ question    │  enough?"    │  growing?"       │  complex?"   │  minimum?"       │
│ Taste       │ Yes          │ EXPAND parts     │ No           │ No               │
│ calibration │              │                  │              │                  │
│ Temporal    │ Full         │ EXPAND parts     │ Key decisions│ Skip             │
│ interrogate │              │                  │  only        │                  │
│ Observ.     │ "Joy to      │ Per-part         │ "Can we      │ "Can we see if   │
│ standard    │  operate"    │  standard        │  debug it?"  │  it's broken?"   │
│ Deploy      │ Infra as     │ Standard         │ Safe deploy  │ Simplest possible│
│ standard    │ feature scope│                  │  + rollback  │  deploy          │
│ Error map   │ Full + chaos │ Full             │ Full         │ Critical paths   │
│             │  scenarios   │                  │              │  only            │
│ Phase 2/3   │ Map it       │ EXPAND parts     │ Note it      │ Skip             │
│ planning    │              │                  │              │                  │
└─────────────┴──────────────┴──────────────────┴──────────────┴──────────────────┘
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.