Resources
1Install
npx skillscat add kochetkov-ma/claude-brewcode/brewcode-plan Install via the SkillsCat registry.
Create Plan — [task-dir or SPEC path or plan file]
/brewcode:plan Instructions
ROLE: Plan Creator | OUTPUT: PLAN.md + KNOWLEDGE.jsonl + artifacts/ + backup/
Input Detection
| Input | Action |
|---|---|
Path to {TS}_{NAME}_task/ dir |
Read SPEC.md from it |
Path to SPEC.md file |
Derive task dir from parent |
.claude/plans/LATEST.md or plan file |
Plan Mode: parse plan, create task dir, skip SPEC |
| Empty | Check .claude/TASK.md quick ref for latest task dir |
Flag Parsing
Parse $ARGUMENTS for flags BEFORE input detection:
| Flag | Effect |
|---|---|
-n, --noask |
Skip all user questions, auto-approve defaults |
Strip flag from $ARGUMENTS. Remaining text = path.
Workflow (SPEC input)
Check Adapted Templates (REQUIRED FIRST)
EXECUTE using Bash tool:
test -f .claude/tasks/templates/PLAN.md.template && echo "PLAN.md.template" || echo "PLAN.md.template MISSING"STOP if MISSING — Run
/brewcode:setupfirst.Read SPEC
- Resolve input path per Input Detection table
- Read SPEC.md from task directory
- Extract: goal, requirements, analysis, context files, risks, decisions
Scan Project for Reference Examples
- Find 1-2 canonical files per expected phase type (controller, service, test, etc.)
- These become Reference Examples (R1, R2...) in PLAN.md
Generate Phase Breakdown (5-12 phases)
Based on SPEC analysis and project structure:
- Each phase = one logical unit of work
- Dependencies between phases identified
- Agents assigned per phase
- Verification phases (NV) after each execution phase
Present Phases to User (AskUserQuestion)
If
--noask: Skip. Auto-approve all phases.Otherwise: Use AskUserQuestion to present the proposed phase split:
- Phase count and descriptions
- Agent assignments
- Dependency chain
- User can approve, adjust, or request changes
Generate Artifacts
Using
.claude/tasks/templates/PLAN.md.template(project-adapted):- Fill PLAN.md with phases, agents, context files, criteria
- Completion Criteria from SPEC.md decisions/goals
- Write
.claude/tasks/{TS}_{NAME}_task/PLAN.md - Create empty
KNOWLEDGE.jsonlin task dir - Create
artifacts/directory - Create
backup/directory
Quorum Plan Review (3 agents)
ONE message with 3 Task calls in PARALLEL: Task(subagent_type="Plan", prompt="Review plan against SPEC #1") Task(subagent_type="Plan", prompt="Review plan against SPEC #2") Task(subagent_type="Plan", prompt="Review plan against SPEC #3")Agent prompt:
> **Context:** BC_PLUGIN_ROOT is available in your context (injected by pre-task.mjs hook). Review PLAN at {PLAN_PATH} against SPEC at {SPEC_PATH} Check: phases cover all requirements, agent assignments match expertise, dependencies correct, verification criteria measurable, risks mitigated Output: list of remarks with rationaleQuorum rule (2/3): Only remarks confirmed by 2+ agents are accepted.
Verification Agent
Task(subagent_type="reviewer", prompt=" > **Context:** BC_PLUGIN_ROOT is available in your context (injected by pre-task.mjs hook). Verify PLAN covers ALL SPEC requirements...")Present Review Results (AskUserQuestion)
If
--noask: Auto-accept all quorum-confirmed remarks. Fix all in PLAN.md.Otherwise: Present confirmed remarks + verification results to user.
User approves/rejects each. Fix approved remarks in PLAN.md.
Workflow (Plan Mode input)
Check Templates — same as above
Read Plan File
- Parse
.claude/plans/LATEST.mdor provided plan file - Extract structure, goals, steps
- Parse
Create Task Dir + Scan Project
- Generate timestamp and name slug
- Create
.claude/tasks/{TS}_{NAME}_task/ - Scan project for context files and reference examples
Split into Granular Phases (finer than plan)
- Each plan item may become 1-3 phases
- Add verification phases
Present Phases to User (AskUserQuestion)
- Same as SPEC workflow step 4 (respects
--noask)
- Same as SPEC workflow step 4 (respects
Generate Artifacts
- PLAN.md, KNOWLEDGE.jsonl, artifacts/, backup/
- No SPEC.md in this flow (plan replaces spec)
Update Quick Ref (REQUIRED)
Add task link to TOP of .claude/TASK.md (preserve history):
IF .claude/TASK.md exists:
1. Read existing content
2. Prepend: ".claude/tasks/{TS}_{NAME}_task/PLAN.md\n---\n"
3. Append: existing content
ELSE:
Create with: ".claude/tasks/{TS}_{NAME}_task/PLAN.md"Validation (REQUIRED)
EXECUTE using Bash tool:
TS_NAME="{TS}_{NAME}"
test -d ".claude/tasks/${TS_NAME}_task" && echo "TASK_DIR" || echo "TASK_DIR MISSING"
test -f ".claude/tasks/${TS_NAME}_task/PLAN.md" && echo "PLAN" || echo "PLAN MISSING"
test -f ".claude/tasks/${TS_NAME}_task/KNOWLEDGE.jsonl" && echo "KNOWLEDGE" || echo "KNOWLEDGE MISSING"
test -d ".claude/tasks/${TS_NAME}_task/artifacts" && echo "ARTIFACTS" || echo "ARTIFACTS MISSING"
test -d ".claude/tasks/${TS_NAME}_task/backup" && echo "BACKUP" || echo "BACKUP MISSING"
head -1 .claude/TASK.md 2>/dev/null | grep -q "${TS_NAME}" && echo "QUICK_REF" || echo "QUICK_REF MISSING"STOP if any MISSING — Create missing artifacts before proceeding.
Output
# Plan Created
## Detection
| Field | Value |
|-------|-------|
| Arguments | `{received args}` |
| Input Type | `{SPEC path or Plan Mode file}` |
| Noask | `{yes or no}` |
## Files Created
- PLAN: .claude/tasks/{TS}_{NAME}_task/PLAN.md
- KNOWLEDGE: .claude/tasks/{TS}_{NAME}_task/KNOWLEDGE.jsonl
- ARTIFACTS: .claude/tasks/{TS}_{NAME}_task/artifacts/
- BACKUP: .claude/tasks/{TS}_{NAME}_task/backup/
- QUICK REF: .claude/TASK.md (task added to top, history preserved)
Run: /brewcode:start .claude/tasks/{TS}_{NAME}_task/PLAN.md