From potenlab-workflow
Execute all tasks in a phase with wave-based parallel coder agents (max 4 per wave)
npx claudepluginhub potenlab/marketplace-potenlab --plugin potenlab-workflow<phase-number><objective>
Execute all pending tasks in a specific development phase using wave-based parallel execution (max 4 agents per wave). Spawns potenlab-small-coder / potenlab-high-coder agents based on progress.json complexity classification. Updates progress.json after EACH wave so completed tasks immediately unblock dependents.
</objective>
<execution_context>
Read and apply rules from @{{POTENLAB_HOME}}/CLAUDE.md before proceeding.
</execution_context>
<process>
## How It Works
---
## Step 1: Get Phase Number
### Option A: From arguments
If the user provides a phase number:
Extract.../execute-phaseExecutes all plans in a specified phase using wave-based parallelization and subagents. Supports optional flags: --wave N, --gaps-only, --interactive, --tdd.
/execute-phaseExecutes all plans in specified phase (<phase-number>) with wave-based parallelization. --gaps-only runs only missing plans.
/execute-phaseExecutes all plans in phase N using wave-based ordered execution, spawning subagents per plan where the platform supports it.
<execution_context> Read and apply rules from @{{POTENLAB_HOME}}/CLAUDE.md before proceeding. </execution_context>
/potenlab:execute-phase [phase_number]
|
v
STEP 1: Get phase number (from arg or AskUserQuestion)
|
v
STEP 2: Read progress.json, filter executable tasks
|
v
STEP 3: Group tasks by complexity → plan waves (max 4 per wave)
|
v
STEP 4: WAVE LOOP
| ┌──────────────────────────────────────────────┐
| │ 4a. Re-read progress.json, filter tasks │
| │ 4b. Take next batch (up to 4 tasks) │
| │ 4c. Spawn agents in parallel (1 message) │
| │ 4d. Wait for all agents in wave │
| │ 4e. Update progress.json IMMEDIATELY │
| │ 4f. If more executable tasks → loop to 4a │
| └──────────────────────────────────────────────┘
|
v
STEP 5: Final report (all waves combined)
If the user provides a phase number:
/potenlab:execute-phase 0
/potenlab:execute-phase 3
Extract the phase number directly. Do NOT ask questions — proceed to Step 2.
If the user invokes with no argument, you MUST use AskUserQuestion:
AskUserQuestion:
question: "Which phase would you like to execute?"
header: "Phase"
options:
- label: "Phase 0: Foundation"
description: "Project setup, design tokens, config files"
- label: "Phase 1: Backend"
description: "Database schema, migrations, RLS policies"
- label: "Phase 2: Shared UI"
description: "Shared components in src/components/"
- label: "Phase 3: Features"
description: "Feature modules in src/features/"
Read progress.json first to determine which phases exist, then build the options dynamically.
Glob: **/progress.json
Read: [found path]
If progress.json does NOT exist:
progress.jsonnot found. Run/potenlab:complete-planfirst to generate the task tracker.
STOP. Do NOT proceed.
Parse progress.json and locate the phase object matching the requested phase number.
From the target phase, collect tasks that meet ALL criteria:
executable_tasks = phase.tasks.filter(task =>
task.status === "pending" AND
task.blocked_by.length === 0
)
Split executable_tasks into two groups based on progress.json classification:
small_tasks = executable_tasks.filter(t => t.complexity === "low")
→ Each spawns a potenlab-small-coder agent
high_tasks = executable_tasks.filter(t => t.complexity === "high")
→ Each spawns a potenlab-high-coder agent
Combine and chunk into waves of max 4. Report the execution plan before spawning.
CRITICAL: Max 4 agents per wave. Update progress.json AFTER EACH wave. Re-filter between waves.
Repeat until no more executable tasks:
complexity: "low" → potenlab-small-codercomplexity: "high" → potenlab-high-coderblocked_by arrays across ALL phasespotenlab-small-coder (for complexity === "low"):
Task:
subagent_type: potenlab-small-coder
description: "Task {task.id}: {task.name}"
prompt: |
Execute task {task.id}: {task.name}
[Read all plans, implement small task, verify]
Do NOT update progress.json — orchestrator handles that after each wave.
Return: "COMPLETED: {task.id} — {task.name} | Files: [list]"
Or: "BLOCKED: {task.id} — {reason}"
potenlab-high-coder (for complexity === "high"):
Task:
subagent_type: potenlab-high-coder
description: "Task {task.id}: {task.name}"
prompt: |
Execute task {task.id}: {task.name}
[Read all plans, implement complex task, self-review, verify]
Do NOT update progress.json — orchestrator handles that after each wave.
Return: "COMPLETED: {task.id} — {task.name} | Files: [list]"
Or: "BLOCKED: {task.id} — {reason}"
Report with results grouped by wave, summary counts, phase progress, newly unblocked tasks, and next steps.
blocked_by is empty before including a taskcomplexity: "low" and potenlab-high-coder for complexity: "high"blocked_by is non-emptystatus is already "completed"