brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
subagent-driven-development3-role pipeline (Implementer -> Spec Reviewer -> Quality Reviewer) for plan-driven multi-task implementation. Supports subagent dispatch (Agent tool) and Agent Teams (TeamCreate). Use when a plan file exists in docs/plans/ and work spans 3+ tasks.
Independent GitHub snapshot · Automated classification · Original documentation governs
NO AGENT DISPATCH WITHOUT A COMMITTED PLAN FILE IN docs/plans/ — agents without a written plan produce unreviewed, unverifiable output
Turns an approved plan into working, reviewed code using a 3-role pipeline: Implementer → Spec Reviewer → Quality Reviewer.
Works in two dispatch modes: subagent (Agent tool, sequential) and team (TeamCreate, concurrent).
Prerequisites — both must be true:
docs/plans/YYYY-MM-DD-<feature>.md (created via /plan-review)Mode selection:
| Condition | Use |
|---|---|
| ≤5 tasks OR tech stack has no specialized implementer agent | Subagent mode |
| 6+ tasks OR Java / NestJS / Flutter / Python with tech-specific implementer adds value | Team mode |
Present to the developer at start:
Plan: [file]. [N] tasks detected.
1. Subagent mode — Agent tool, general-purpose agents, best for ≤5 tasks
2. Team mode — TeamCreate with tech-specific agents, best for 6+ tasks
This pipeline runs identically in both modes — only the dispatch mechanism differs.
Use when the feature touches an unfamiliar external API, a new compliance domain, or a third-party service the team hasn't integrated before.
Dispatch a general-purpose agent with:
docs/research/<feature>.mdThe research agent should produce: API capabilities, key constraints, auth model, rate limits, SDK options, and gotchas. Save to docs/research/<feature>.md and commit before starting Step 0.
The spec reviewer in Step 2 receives this file path inline — include it in the spec reviewer prompt so it can verify the implementer's API usage against the research findings.
Skip when: the tech stack is familiar, no external unknowns, or the plan was produced from a previous research session.
Context Isolation: After the Research agent completes and docs/research/<feature>.md is committed, issue /clear before dispatching the Spec/Implementer. Pass the research doc path as the only context carry-forward — do NOT carry the Research agent's conversation into Step 0.
Before parsing tasks, validate the plan structure. This runs ONCE before any dispatch.
PR-Sizing Check: Every task in the plan must be bounded to ≤1 PR. Flag any task that:
If any task fails the PR-sizing check:
PLAN VALIDATION FAILED:
Task N: "[task title]" is too large for a single PR.
Touches: [list services/files]
Required split: [suggested sub-tasks A, B]
→ Update the plan file before continuing.
Context Brief Check: Every task must have a ## Context Brief section (see docs/plans/TEMPLATE.md). If missing:
PLAN VALIDATION FAILED:
Task N: "[task title]" is missing ## Context Brief section.
Required fields: affected_files, preconditions, verification_command
→ Add the context brief to the plan file before continuing.
Rollback Check: Every task must have a rollback_strategy field. If missing:
PLAN VALIDATION FAILED:
Task N: "[task title]" is missing rollback_strategy.
→ Add rollback strategy before continuing.
Skip validation only for plans with a single task (≤1 task = trivial, no gate needed).
Read the full plan file once. Extract every task as a structured object:
Task N:
title: [task title from plan]
full_text: [complete task description including acceptance criteria]
tech_stack: [inferred from context — Java / NestJS / Python / Flutter / Angular / General]
files_affected: [list if stated]
Create a TaskCreate entry for each task before starting any implementation.
Dispatch the implementer with:
.claude/skills/java-spring-api/")Implementer flow:
leverage-patterns.md test-first), self-reviewsDispatch the spec reviewer with:
reference/handoff-tags.md format)Spec reviewer flow:
CONDITIONAL PASS = implementer must fix open issues before Step 3 startsDispatch the quality reviewer (routed by tech stack — see routing table below) with:
FILES_CHANGED)Quality reviewer flow:
TaskUpdate: completed → advance to next taskDEFERRED: entries from implementer tags → add to PR body as Known Gaps / DeferredAfter all tasks complete:
code-reviewer agent on all changed files for a final cross-task consistency check| Tech Stack | Agent |
|---|---|
| Java / Spring Boot | spring-reactive-reviewer |
| NestJS | nestjs-reviewer |
| Python / FastAPI | code-reviewer |
| Flutter | riverpod-reviewer |
| Agentic AI | agentic-ai-reviewer |
| Angular / General | code-reviewer |
All agents dispatched via the Agent tool.
Implementer:
Agent tool:
subagent_type: general-purpose
prompt: [implementer-prompt.md content] + [task full_text] + [tech-stack skill reference]
Spec Reviewer:
Agent tool:
subagent_type: general-purpose
prompt: [spec-reviewer-prompt.md content] + [task spec] + [implementer output]
Quality Reviewer:
Agent tool:
subagent_type: [from routing table above]
prompt: "Review the following files for [tech stack] quality, patterns, and standards.
Files changed: [list]. Focus on: correctness, error handling, test coverage,
naming, and adherence to project conventions in .claude/rules/."
Do NOT dispatch implementer and spec reviewer in parallel — spec review depends on implementer output. Do NOT dispatch multiple implementers in parallel — file conflicts are guaranteed.
Use when 6+ tasks or when a tech-specific implementer agent provides meaningful leverage.
1. TeamCreate — name the team after the feature (e.g., "auth-service")
2. Spawn agents:
- implementer: subagent_type = tech-specific developer agent
(java-spring-api | nestjs-api | python-dev | agentic-ai-dev | angular-spa | flutter-mobile)
- spec-reviewer: subagent_type = general-purpose
- quality-reviewer: subagent_type = from routing table above
3. Assign tasks via TaskUpdate (owner field) + SendMessage with full task context
TaskList to track progress across all tasksAlways send full task context in the message body — never tell teammates to "read the plan". Include: task title, acceptance criteria, files affected, and any prior reviewer findings.
Before dispatching agents in parallel, verify independence first.
Read reference/parallel-dispatch-checklist.md for the decision tree, pre-dispatch checklist, post-completion conflict check, and examples.
Rule: If tasks share files, config, or have ordering dependencies → sequential only.
Context contamination is the #1 silent failure in multi-phase pipelines. A Research agent that mentions "the auth layer is messy" will cause a Spec agent to include auth cleanup in scope — work that was never requested.
Without isolation:
Research agent → analyzes codebase → notices auth is messy → mentions it
→ Spec agent absorbs the mention → adds auth refactor to spec
→ Implementer touches auth it was never asked to touch
→ Scope creep introduced silently, never caught
With isolation:
Research agent → outputs ONLY facts to docs/research/<feature>.md
/clear → Spec/Implementer starts fresh with only the research doc
→ Scope stays exactly what was planned
1. Research mandate — "NO improvement suggestions" The Research agent prompt MUST include: "Describe what exists. Do NOT propose changes." Violations: suggesting refactors, flagging tech debt for fixing, recommending alternatives. Allowed: noting constraints, documenting gotchas, describing current behavior.
2. /clear between Research and Step 0
After docs/research/<feature>.md is committed:
/clear (or equivalent context reset between agent dispatches)3. Per-phase context containment Each phase receives exactly what it needs — no more:
| Phase | What to pass in | What NOT to pass in |
|---|---|---|
| Step -1 Research | Plan file path, specific unknowns | Nothing else |
| Step 0–1 Implementer | Task full_text + research doc path (if exists) | Research agent conversation |
| Step 2 Spec Reviewer | Task spec + implementer output + handoff tag | Research agent opinions |
| Step 3 Quality Reviewer | Files changed + handoff tags | Prior reviewer conversations |
/clear after research, pass only the doc path| When | Reference |
|---|---|
| Implementer hits a bug during implementation | systematic-debugging skill |
| Before marking any task complete | verification-before-completion skill |
| Creating the PR | CLAUDE.md git workflow (conventional commits, feature branch, squash merge) |
| Plan file must exist | docs/plans/ convention — /plan-review creates it |
| Writing a new plan | docs/plans/TEMPLATE.md — required format for context briefs, rollback, and mutations |
| Security findings during review | security-reviewer agent |
| Passing context between pipeline stages | reference/handoff-tags.md — structured tag format |
No plan file found:
BLOCKED: No plan file found in docs/plans/.
Run /plan-review to generate and save a plan before invoking SDD.
Implementer asks questions before starting: Answer them directly. Do not dispatch another implementer — respond to the current one and let it proceed.
Review loop exceeds 3 iterations on same issue:
STOPPED: [reviewer] has flagged [issue] 3 times without resolution.
Options:
A) Escalate — bring in the human to resolve the design conflict
B) Waive — mark issue as known gap with explicit approval
C) Redesign — scrap this task's implementation and start fresh
Team mode: teammate goes unresponsive:
Check TaskList for stuck in_progress tasks. Send a follow-up SendMessage. If still unresponsive after one retry, stop and notify the developer.