ワンクリックで
maestroimplement
// Execute feature tasks following TDD workflow. Single-agent by default, --team for parallel Agent Teams, Sub Agent Parallels. Use when ready to implement a planned feature.
// Execute feature tasks following TDD workflow. Single-agent by default, --team for parallel Agent Teams, Sub Agent Parallels. Use when ready to implement a planned feature.
Use when bootstrapping, updating, or reviewing AGENTS.md — teaches what makes effective agent memory, how to structure sections, signal vs noise filtering, and when to prune stale entries
Use before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Deep discovery and specification for ambitious features. Full BMAD-inspired interview with classification, vision, journeys, domain analysis, and FR synthesis. Same output contract (spec.md + plan.md) as a standard feature but far richer. Use for multi-component systems, regulated domains, or unclear requirements.
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
Use when working with Docker containers — debugging container failures, writing Dockerfiles, docker-compose for integration tests, image optimization, or deploying containerized applications
| name | maestro:implement |
| description | Execute feature tasks following TDD workflow. Single-agent by default, --team for parallel Agent Teams, Sub Agent Parallels. Use when ready to implement a planned feature. |
| argument-hint | [<feature-name>] [--team] [--parallel] |
| stage | execution |
| audience | both |
Execute tasks from a feature's implementation plan, following the configured workflow methodology (TDD or ship-fast). Supports single-agent mode (default), team mode (--team), and parallel mode (--parallel).
$ARGUMENTS
<feature-name>: Match feature by name or substring. Optional -- auto-selects if only one feature is in the executing state.--team: Enable team mode with parallel workers (kraken/spark).--parallel: Enable parallel mode with Task sub-agents in isolated worktrees.--resume: Skip already-completed tasks (state done) and continue from the next pending task.Parse $ARGUMENTS for explicit flags, then validate the choice is appropriate.
--team --> team mode (see reference/team-mode.md)--parallel --> parallel mode (see reference/parallel-mode.md)--resume --> set resume flag (works with all modes)Before executing, validate that the chosen mode fits the work. Use this checklist when the user has NOT specified a flag and you need to recommend, or to warn when an explicit flag conflicts with the task shape.
MODE SELECTION CHECKLIST
Evaluate: Single Parallel Team
----------------------------------------------------------------
1. Task count 1-3 3-8 4+
2. Independent tasks in phase? any 2+ needed 2+ needed
3. File scope overlap between tasks? n/a low/none low/none
4. Cross-task dependencies? any few moderate ok
5. Task complexity any moderate high
6. Need human review between tasks? yes wave-end task-end
7. Runtime supports Task tool? n/a required n/a
8. Runtime supports Agent Teams? n/a n/a required
Decision rules:
| Condition | Recommended Mode | Reason |
|---|---|---|
| 1-3 tasks, any dependency shape | Single | Overhead of parallelism exceeds benefit |
| 3-8 tasks, 2+ independent per phase, low file overlap | Parallel | Wave-based execution saves time |
| 4+ tasks, high complexity, need orchestration | Team | Workers handle complexity, orchestrator verifies |
| All tasks are sequential (each depends on previous) | Single | No parallelism possible regardless of count |
| Tasks touch many shared files | Single | File conflicts make parallel/team counterproductive |
| Mix of independent and dependent tasks | Parallel | Waves handle the dependency ordering naturally |
Warn and suggest if the user's explicit flag conflicts:
[!] --parallel specified but all 3 tasks are sequential (each depends on previous).
--> Falling back to single-agent mode. No parallelism benefit here.
[!] --team specified but only 2 tasks in this feature.
--> Single-agent mode is more efficient for small features. Proceed with --team anyway? (y/n)
| Aspect | Single | Parallel | Team |
|---|---|---|---|
| Execution | Sequential in main session | Concurrent sub-agents in worktrees | Concurrent workers via delegation |
| Isolation | None (main worktree) | Git worktree per sub-agent | Shared worktree, task-level isolation |
| Who commits | Main session | Main session (after merge) | Orchestrator (after verification) |
| Failure recovery | Fix inline, retry | Retry failed task sequentially | Reassign or fix task |
| Best for | Small features, tight dependencies | Medium features, independent tasks | Large features, complex tasks |
| Overhead | None | Worktree setup + merge | Team setup + monitoring |
maestro_feature_list (MCP) or maestro feature-list (CLI) to list all features. Filter for features with status approved or executing.approved or executing. 0 = error, 1 = auto-select, multiple = ask user.Load context in tiers to minimize upfront token cost:
.maestro/features/<feature-name>/plan.mdmaestro_status to get current feature statemaestro_memory_list to discover relevant memory entries.maestro/features/<feature-name>/memory/ (if exists)maestro_memory_readfeature.json "skills" array. Reference their guidance when relevant to current task (skill descriptions are already in runtime context). Graceful degradation: if missing/empty, proceed without.Call maestro_status to check current feature state. If the feature is in approved status, it will transition to executing when the first task is claimed.
BR check: If feature.json has beads_epic_id, set br_enabled=true. All BR operations below only apply when br_enabled. See reference/br-integration.md for commands.
If br_enabled and .beads/ does not exist: br init --prefix maestro --json.
Call maestro_task_next (MCP) or maestro task-next (CLI) to get the next runnable task with its compiled spec. This replaces manual plan parsing -- maestro manages task state, dependency resolution, and ordering.
If --resume: maestro_task_next automatically skips tasks in done state and returns the next pending task with all dependencies satisfied.
Dependencies are resolved by maestro in this priority order:
br_enabled): Use bv -robot-plan -label "track:{epic_id}" -format json to get dependency-respecting execution order. This is the most reliable source because dependencies are explicit.maestro_task_next respects task dependencies defined during maestro_tasks_sync. Tasks are returned in dependency-respecting order.pending when maestro_task_next is called.Dependency conflict detection:
[!] Task 2.3 references "the schema from Task 2.1" but they are listed as independent.
--> Treating Task 2.3 as dependent on Task 2.1. Adjust execution order.
Follow the TDD or ship-fast methodology for each task.
See reference/single-agent-execution.md for the full Red-Green-Refactor cycle (steps 6a.1-6a.9), ship-fast variant, skill injection protocol, and worked examples.
See reference/tdd-workflow.md for TDD best practices and anti-patterns.
When the last task in a phase completes, run the Phase Completion Protocol.
See reference/phase-completion.md for details (coverage check, full test run, manual verification, user confirmation).
See reference/parallel-mode.md for full protocol: plan analysis for task independence, wave-based sub-agent spawning with worktree isolation, result verification and merge, conflict detection, sequential fallback, and worked examples.
See reference/team-mode.md for full protocol: team creation, task delegation, worker spawning, monitoring, verification, shutdown, and worked examples.
When ALL tasks are done, run the Feature Completion Protocol.
See reference/feature-completion.md for details (mark complete, skill effectiveness recording, cleanup, final commit, summary).
These recovery procedures apply across all modes. Mode-specific recovery is documented in the respective reference files.
When a worker or sub-agent fails during task execution:
FAILURE TRIAGE
1. Read the error output
2. Classify the failure:
Build error --> Fix the code, retry the task
Test failure --> Debug the test or implementation, retry
Missing dependency --> Install/configure, retry
Unclear spec --> STOP, ask user for clarification
Infrastructure --> Check environment, retry once, then STOP
Repeated failure --> STOP after 3 attempts on same task
| Signal | Action |
|---|---|
| Test failure with clear error message | Retry: fix the code and re-run |
| Same test fails 3 times | STOP: ask user -- likely a spec or design issue |
| Build error in generated/config code | Manual fix in main session, then continue |
| Worker reports blocker | Assess blocker, provide decision, re-dispatch |
| Merge conflict after parallel wave | Sequential retry for conflicting tasks |
| Rate limit or infrastructure error | Wait and retry once, then fall back to sequential |
Re-dispatch (spawn a new worker/sub-agent) when:
Fix-in-place (main session fixes directly) when:
If maestro_status shows a task stuck in claimed state with no active worker:
[!] Task 2.1 is marked claimed but no worker is active.
--> This is a stale task from a crashed/interrupted session.
Recovery:
--resume to continue from current statemaestro_task_next call, resetting the task to pending.br update {issue_id} --status open --json to unblock downstreamApply these quality checks during and between task execution.
After each task checkpoint report, ask the operator if they want a Hygienic code review for the latest task. If yes, run a review subagent to inspect the implementation changes and apply feedback before starting the next task.
STOP executing immediately when:
Ask for clarification rather than guessing.
Return to Review (Step 2) when:
Re-planning signals:
Don't force through blockers -- stop and ask.
Recommended workflow:
maestro_init / maestro init -- Initialize maestro for the projectmaestro_feature_create / maestro feature-create -- Create a new featuremaestro_plan_write / maestro plan-write -- Write the implementation planmaestro_plan_approve / maestro plan-approve -- Approve the planmaestro_tasks_sync / maestro task-sync -- Generate tasks from the planmaestro:implement -- You are here. Execute the implementationmaestro:review -- Verify implementation correctnessmaestro_status / maestro status -- Check progressmaestro:revert -- Undo implementation if neededImplementation consumes the plan.md created during planning. Each task produces atomic commits. Run maestro_status to check progress mid-implementation, or maestro:revert to undo if something goes wrong.