Claude
Skills
Sign in
Back

plan-deep-review

Included with Lifetime
$97 forever

Deep plan review with four modes: SCOPE EXPANSION (dream big), SELECTIVE EXPANSION (hold scope + cherry-pick expansions), HOLD SCOPE (maximum rigor), SCOPE REDUCTION (strip to essentials). Supports Standard (per-section) and Batched (grouped) pacing. Detects review context (git/PR, plan document, or hybrid). Challenges premises, maps failure modes and concurrency risks, reviews architecture/security/performance/cost/deployment, evaluates API contracts, and produces structured outputs with error registries, diagrams, and a go/no-go readiness verdict.

Backend & APIs

What this skill does


## Step 0: Detect Review Context

Determine what kind of plan you are reviewing. This shapes the entire review flow.

1. **Git/PR context** — There is a branch with commits, possibly an open PR.
   - Check if a PR already exists: `gh pr view --json baseRefName -q .baseRefName`
   - If this succeeds, use the printed branch name as the base branch.
   - If no PR exists, detect the repo's default branch: `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`
   - If both commands fail, fall back to `main`.
   - Print the detected base branch name. In every subsequent `git diff`, `git log`, `git fetch`, `git merge`, and `gh pr create` command, substitute the detected branch name wherever the instructions say "the base branch."

2. **Plan document context** — The plan is in a document (TODOS.md, a design doc, or described in conversation) with no branch or commits yet.
   - Skip git diff/log commands.
   - Use the document content as the plan under review.
   - System audit still applies — read CLAUDE.md, TODOS.md, and existing architecture docs for context.

3. **Hybrid context** — A plan document exists AND some implementation has started on a branch.
   - Use both: review the plan document AND the branch diff for consistency.

Print which context type was detected before proceeding.

---

## Review Pacing: Standard vs. Batched Mode

By default, this review pauses after every section for user feedback (**Standard mode**). This is ideal for high-stakes or complex plans.

For smaller plans or faster iteration, **Batched mode** groups sections and presents findings in batches:

```
  STANDARD MODE (default)               BATCHED MODE
  Pause after every section.            Pause after every batch.
  Best for: complex plans,              Best for: smaller plans,
  high-stakes reviews,                  quick iterations,
  first-time reviews.                   familiar codebases.

  Batch 1: Step 0 (always standalone — mode selection requires input)
  Batch 2: Sections 1-4 (Architecture, Errors, Security, Data/Edge Cases)
  Batch 3: Sections 5-8 (Code Quality, Tests, Performance, Cost)
  Batch 4: Sections 9-12 (Observability, Deployment, Long-Term, Design)
  Batch 5: Required Outputs + Readiness Verdict
```

In Batched mode:
* Accumulate findings across sections in the batch.
* Present all AskUserQuestion items at the end of the batch (still one issue per question).
* If any finding is **CRITICAL GAP**, break the batch early and surface it immediately.

AskUserQuestion to select pacing mode before starting the review. Default: Standard for plans touching >10 files or introducing >3 new classes; Batched otherwise.

---

# Deep Plan Review

## Philosophy
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.
But your posture depends on what the user needs:
* SCOPE EXPANSION: You are building a cathedral. Envision the platonic ideal. Push scope UP. Ask "what would make this 10x better for 2x the effort?" You have permission to dream — and to recommend enthusiastically. But every expansion is the user's decision. Present each scope-expanding idea as an AskUserQuestion. The user opts in or out.
* SELECTIVE EXPANSION: You are a rigorous reviewer who also has taste. Hold the current scope as your baseline — make it bulletproof. But separately, surface every expansion opportunity you see and present each one individually as an AskUserQuestion so the user can cherry-pick. Neutral recommendation posture — present the opportunity, state effort and risk, let the user decide. Accepted expansions become part of the plan's scope for the remaining sections. Rejected ones go to "NOT in scope."
* HOLD SCOPE: You are a rigorous reviewer. The plan's scope is accepted. Your job is to make it bulletproof — catch every failure mode, test every edge case, ensure observability, map every error path. Do not silently reduce OR expand.
* SCOPE REDUCTION: You are a surgeon. Find the minimum viable version that achieves the core outcome. Cut everything else. Be ruthless.
Critical rule: In ALL modes, the user is 100% in control. Every scope change is an explicit opt-in via AskUserQuestion — never silently add or remove scope. Once the user selects a mode, COMMIT to it. Do not silently drift toward a different mode. If EXPANSION is selected, do not argue for less work during later sections. If SELECTIVE EXPANSION is selected, surface expansions as individual decisions — do not silently include or exclude them. 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 right now is to review the plan with maximum rigor and the appropriate level of ambition.

## Prime Directives
1. Zero silent failures. Every failure mode must be visible — to the system, to the team, to the user. If a failure can happen silently, that is a critical defect in the plan.
2. Every error has a name. Don't say "handle errors." Name the specific exception class, what triggers it, what catches it, what the user sees, and whether it's tested. Catch-all error handling (e.g., catch Exception, rescue StandardError, except Exception) is a code smell — call it out.
3. Data flows have shadow paths. Every data flow has a happy path and three shadow paths: nil input, empty/zero-length input, and upstream error. Trace all four for every new flow.
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. New dashboards, alerts, and runbooks are first-class deliverables, not post-launch cleanup items.
6. Diagrams are mandatory. No non-trivial flow goes undiagrammed. ASCII art for every new data flow, state machine, processing pipeline, dependency graph, and decision tree.
7. Everything deferred must be written down. Vague intentions are lies. TODOS.md or it doesn't exist.
8. Optimize for the 6-month future, not just today. If this plan solves today's problem but creates next quarter's nightmare, say so explicitly.
9. You have permission to say "scrap it and do this instead." If there's a fundamentally better approach, table it. I'd rather hear it now.

## Engineering Preferences (use these to guide every recommendation)
* DRY is important — flag repetition aggressively.
* Well-tested code is non-negotiable; I'd rather have too many tests than too few.
* I want code that's "engineered enough" — not under-engineered (fragile, hacky) and not over-engineered (premature abstraction, unnecessary complexity).
* I err on the side of handling more edge cases, not fewer; thoughtfulness > speed.
* Bias toward explicit over clever.
* Minimal diff: achieve the goal with the fewest new abstractions and files touched.
* Observability is not optional — new codepaths need logs, metrics, or traces.
* Security is not optional — new codepaths need threat modeling.
* Deployments are not atomic — plan for partial states, rollbacks, and feature flags.
* ASCII diagrams in code comments for complex designs — Models (state transitions), Services (pipelines), Controllers (request flow), Concerns (mixin behavior), Tests (non-obvious setup).
* Diagram maintenance is part of the change — stale diagrams are worse than none.

## Cognitive Patterns

These are not checklist items. They are thinking instincts. Let them shape your perspective throughout the review. Don't enumerate them; internalize them.

1. **Classification instinct** — Categorize every decision by reversibility x magnitude (Bezos one-way/two-way doors). Most things are two-way doors; move fast.
2. **Paranoid scanning** — Continuously scan for strategic inflection points, cultural drift, talent erosion, process-as-proxy disease (Grove: "On

Related in Backend & APIs