Implementation Planning Skill
Standard workflow only. If task_complexity is simple and workflow mode is Express, do not activate this skill. Simple tasks use the Express workflow, which does not activate implementation-planning. Return to the Express Workflow section.
Activate this skill during Phase 2 of Maestro orchestration, after the design document has been approved. This skill provides the methodology for generating detailed, actionable implementation plans that map directly to subagent assignments.
Codebase Grounding
Do not generate an implementation plan from guesses about the repository.
Use the built-in codebase_investigator before phase decomposition when:
- The task modifies an existing codebase
- File ownership, integration points, or validation commands are still unclear after reading the approved design
- Parallelization decisions depend on understanding current module boundaries or likely file overlap
Ask the investigator for:
- The modules and files most likely to change
- Existing architectural boundaries and conventions the plan must preserve
- Integration seams, dependencies, and shared ownership hotspots
- Validation commands and test entry points already used by the project
- Parallelization or conflict risks that should prevent batching
Skip the investigator only for greenfield tasks, documentation-only work, or plans where the current turn already established the relevant repo structure from direct reads.
Reuse investigator findings directly in the implementation plan:
- File inventories should reflect real candidate paths, not placeholders
- Validation criteria should prefer repo-native commands the investigator surfaced
- Parallel batches should account for actual ownership overlap and conflict risk
Plan Generation Methodology
Input Analysis
Before generating the plan, thoroughly analyze the approved design document for:
- Read
task_complexity from the approved design document's frontmatter. Apply phase count guidance and domain analysis scaling accordingly. Record task_complexity in implementation plan frontmatter.
- Components and their responsibilities
- Interfaces and contracts between components
- Data models and their relationships
- External dependencies and integrations
- Technology stack decisions
- Quality requirements that influence implementation order
Phase Decomposition
Break the implementation into phases following these principles:
- Foundation First: Infrastructure, configuration, and shared types/interfaces come first
- Dependencies Flow Downward: A phase can only depend on phases with lower IDs
- Single Responsibility: Each phase delivers a cohesive unit of functionality
- Agent Alignment: Each phase maps to one or two agent specializations
- Agent Capability Match: Verify the assigned agent's tool tier supports the phase deliverables (see compatibility check below)
- Testability: Each phase should be independently validatable
Phase Ordering Strategy
Layer 1: Foundation (types, interfaces, configuration)
|
Layer 2: Core Domain (business logic, data models)
|
Layer 3: Infrastructure (database, external services, API layer)
|
Layer 4: Integration (connecting components, middleware)
|
Layer 5: Quality (testing, security review, performance)
|
Layer 6: Documentation & Polish
Agent-Deliverable Compatibility Check
Before finalizing agent assignments, verify each phase's agent can deliver its requirements:
| Phase Deliverable |
Required Tier |
Compatible Agents |
| Creates/modifies files |
Full Access or Read+Write |
analytics-engineer, cobol-engineer, coder, copywriter, data-engineer, design-system-engineer, devops-engineer, hlasm-assembler-specialist, i18n-specialist, ibm-i-specialist, integration-engineer, ml-engineer, mlops-engineer, mobile-engineer, observability-engineer, platform-engineer, product-manager, prompt-engineer, refactor, release-manager, technical-writer, tester, ux-designer |
| Runs shell commands |
Full Access or Read+Shell |
accessibility-specialist, analytics-engineer, cobol-engineer, coder, data-engineer, database-administrator, db2-dba, debugger, design-system-engineer, devops-engineer, hlasm-assembler-specialist, i18n-specialist, ibm-i-specialist, integration-engineer, ml-engineer, mlops-engineer, mobile-engineer, observability-engineer, performance-engineer, platform-engineer, refactor, security-engineer, seo-specialist, site-reliability-engineer, tester, zos-sysprog |
| Analysis/review only |
Any tier |
All agents |
Phase Count Guidance
Scale decomposition granularity to task_complexity (read from design document frontmatter):
- simple: 1-3 phases. Prefer single-phase execution when feasible. Combine foundation + implementation. Skip separate documentation/polish phases.
- medium: 3-5 phases. Use the layer model but combine Quality and Documentation into the final implementation phase where practical.
- complex: No phase count cap. Full layer decomposition strategy applies.
Parallelization Identification
Phases can run in parallel when:
- They have no shared file dependencies (no overlapping files_created or files_modified)
- They are at the same dependency depth (same layer)
- They do not share data model ownership
- Their validation can run independently
Mark parallel-eligible phases with parallel: true and group them into execution batches.
Implementation Detail Requirements
Per-Phase Specification
Each phase in the plan must include:
Objective
A clear, measurable statement of what this phase delivers.
Agent Assignment
Which agent(s) execute this phase, with rationale for selection.
Files to Create
For each new file:
- Full relative path from project root
- Purpose and responsibility
- Key interfaces, classes, or functions to define
- Complete type signatures for public APIs
Files to Modify
For each existing file:
- Full relative path from project root
- Specific changes required and why
- Expected before/after for critical sections
Implementation Details
Provide sufficient detail for the assigned agent to execute without ambiguity:
- Interface definitions with complete type signatures
- Base class contracts with abstract method signatures
- Dependency injection patterns and registration points
- Error handling strategy (error types, propagation, recovery)
- Configuration requirements (environment variables, config files)
Validation Criteria
Specific commands to run and expected outcomes:
- Build/compile commands
- Lint/format checks
- Unit test commands
- Integration test commands (if applicable)
- Manual verification steps (if applicable)
Dependencies
blocked_by: Phase IDs that must complete before this phase starts
blocks: Phase IDs that cannot start until this phase completes
Dependency Minimization
List only direct blockers in blocked_by. Do not include transitive dependencies — they inflate dependency depth and prevent parallelism.
Anti-pattern (over-specified):
- Phase 2: blocked_by: [1]
- Phase 3: blocked_by: [1, 2] — Phase 1 is redundant, already reachable via Phase 2
- Phase 4: blocked_by: [1, 2, 3] — Phases 1, 2 are redundant
Result: depths 0, 1, 2, 3 — zero parallel phases.
Correct (minimized):
- Phase 2: blocked_by: [1]
- Phase 3: blocked_by: [1] — Only needs Phase 1 output, not Phase 2
- Phase 4: blocked_by: [2, 3] — Needs both done
Result: depths 0, 1, 2 — Phases 2 and 3 run in parallel at depth 1.
Ask for each dependency: "Does this phase truly need the output of that specific phase, or is it transitively covered?"
If validate_plan is available, review its parallelization_profile and redundant_dependency warnings before presenting the plan. Revise blocked_by to eliminate redundancies when possible.
Agent Assignment Criteria
Matching Tasks to Agents
| Task Domain |
Primary Agent |
Secondary Agent |
Rationale |
| System design, architecture |
architect |
- |
Read-only analysis, design expertise |
| Cloud architecture, multi-region topology |
cloud-architect |
devops-engineer |
Architecture first, implementation second |
| Enterprise integration architecture |
solutions-architect |
integration-engineer |
Cross-team design before implementation |
| API contracts, endpoints |
api-designer |
coder |
Design then implement |
| Feature implementation |
coder |
- |
Full implementation access |
| Code quality review |
code-reviewer |
- |
Read-only verification |
| Database schema, queries |
data-engineer |
- |
Schema + implementation |
| RDBMS tuning, indexes, migration safety |
database-administrator |
data-engineer |
DBA analysis before schema/code changes |
| DB2 administration |
db2-dba |
data-engineer |
DB2-specific operations and design |
| Bug investigation |
debugger |
- |
Read + shell for investigation |
| CI/CD, infrastructure |
devops-engineer |
- |
Full DevOps access |
| Internal platforms, paved paths |
platform-engineer |
devops-engineer |
Platform conventions and implementation |
| B2B integrations, ETL, message brokers |
integration-engineer |
- |
Full integration implementation |
| SLOs, runbooks, reliability |
site-reliability-engineer |
observability-engineer |
Reliability assessment plus telemetry implementation |
| Observability, metrics, traces |
observability-engineer |
- |
Full telemetry implementation |
| Performance analysis |
performance-engineer |
- |
Read + shell for profiling |
| Code restructuring |
refactor |
- |
Write + shell access (for validation) |
| Security assessment |
security-engineer |
- |
Read + shell for scanning |
| Test creation |
tester |
- |
Full test implementation |
| Documentation |
technical-writer |
- |
Write access for docs |
| Release notes, changelogs, rollout |
release-manager |
- |
Write access for release artifacts |
| Technical SEO audit |
seo-specialist |
- |
Read + shell + web search |
| Marketing copy, content |
copywriter |
- |
Read/write |
| Content planning |
content-strategist |
- |
Read + web search/fetch |
| UX design, user flows |
ux-designer |
- |
Read/write + web search |
| WCAG compliance audit |
accessibility-specialist |
- |
Read + shell + web search |
| Requirements, product |
product-manager |
- |
Read/write + web search |
| Tracking, analytics |
analytics-engineer |
coder |
Implement then instrument |
| Internationalization |
i18n-specialist |
coder |
Implement then localize |
| Design tokens, theming |
design-system-engineer |
coder |
Tokens then consume |
| Legal, regulatory |
compliance-reviewer |
- |
Read + web search/fetch |
| Mobile platform work |
mobile-engineer |
tester |
Mobile implementation plus validation |
| Model training, inference integration |
ml-engineer |
tester |
ML implementation plus evaluation |
| Model registry, drift, model CI/CD |
mlops-engineer |
devops-engineer |
Model operations and deployment |
| Prompt design, few-shot, RAG tuning |
prompt-engineer |
coder |
Prompt spec before integration |
| Mainframe COBOL, JCL, CICS/IMS |
cobol-engineer |
tester |
Mainframe implementation and validation |
| IBM HLASM for z/OS |
hlasm-assembler-specialist |
- |
Assembly implementation |
| IBM i RPG/CL, DB2 for i |
ibm-i-specialist |
- |
IBM i implementation |
| z/OS systems programming, JCL, RACF |
zos-sysprog |
security-engineer |
System-level analysis and controls |
Assignment Rules
- Match the primary task domain to the agent specialization
- Consider tool requirements — does the task need shell access? Write access?
- For parallel phases, assign non-overlapping file ownership to each agent
- Prefer single-agent phases for clarity; use multi-agent only when distinct specializations are needed
- Never assign more files to an agent than it can handle within its
max_turns limit
Token Budget Estimation
Estimate token consumption per phase based on:
- Number of files to read (input tokens)
- Complexity of output expected (output tokens)
- Agent's max_turns limit as upper bound
- Historical averages: ~500 input tokens per file read, ~200 output tokens per file written
Resource Estimation
Do not invent provider pricing or model tiers. Agent model selection is runtime-owned through agent frontmatter and runtime configuration. Estimate execution size in stable, codebase-derived terms instead:
- Input complexity: number of files likely to be read, average file size, and prior-phase context
- Output complexity: number of files created or modified, validation output volume, and expected handoff detail
- Retry budget: note phases likely to need retries because of broad file ownership, external dependencies, or uncertain validation
Include a lightweight plan-level resource summary when useful:
| Phase |
Agent |
Est. Files Read |
Est. Files Written |
Retry Risk |
Notes |
| 1 |
[agent] |
[N] |
[N] |
LOW/MEDIUM/HIGH |
[why] |
Plan Document Generation
Output Location
The write path depends on whether your runtime provides a Plan Mode surface (check get_runtime_context, loaded at session start, step 0).
- Plan Mode active: Some runtimes restrict writes to a temporary staging directory during Plan Mode. Write the plan there first, then copy to the permanent location after approval. Call
exit_plan_mode with the plan path to present the plan for user approval.
- Plan Mode not active or not available: Write the implementation plan directly to the project's plans directory.
Permanent location: <state_dir>/plans/YYYY-MM-DD-<topic-slug>-impl-plan.md (where <state_dir> resolves from MAESTRO_STATE_DIR, default docs/maestro).
If your runtime does not provide a Plan Mode transition, track planning progress using the plan-update mechanism from your runtime context, write directly to the final location, and use the user-prompt tool from runtime context for the approval gate.
Document Structure
Use the implementation-plan template loaded via get_skill_content.
Required Sections
- Plan Overview: Summary of total phases, agents involved, estimated effort
- Dependency Graph: Visual representation showing phase dependencies and parallel opportunities
- Execution Strategy Table: Stage-by-stage breakdown with agent assignments and execution mode
- Phase Details: Full specification for each phase (objective, agent, files, details, validation, dependencies)
- File Inventory: Complete table mapping every file to its phase and purpose
- Risk Classification: Per-phase risk assessment (LOW/MEDIUM/HIGH) with rationale
- Execution Profile: Summary of parallel vs sequential characteristics to inform mode selection:
Execution Profile:
- Total phases: [N]
- Parallelizable phases: [M] (in [B] batches)
- Sequential-only phases: [S]
- Estimated parallel wall time: [time estimate based on batch execution]
- Estimated sequential wall time: [time estimate based on serial execution]
Note: Native parallel execution currently runs agents in autonomous mode.
All tool calls are auto-approved without user confirmation.
Completion Criteria
The implementation plan is complete when:
- Every component from the design document maps to at least one phase
- All phase dependencies are acyclic (no circular dependencies)
- Parallel opportunities are identified and marked
- Each phase has clear validation criteria
- File ownership is non-overlapping for parallel phases
- The user has given explicit approval of the complete plan
Before presenting the plan for approval, check whether validate_plan appears in your available tools. If it does, call it with the plan structure and task_complexity to verify phase count constraints, file ownership, acyclic dependencies, and agent validity. If it does not, self-check against the phase count limits above.
Post-Generation
After writing the implementation plan:
- Confirm the file path to the user
- Present the dependency graph and execution strategy
- Highlight parallel execution opportunities
- Provide resource estimates when useful
- If your runtime provides Plan Mode, call
exit_plan_mode with the plan path to present the plan for user approval. If Plan Mode is not available, present the completed plan for user approval using the user-prompt tool from runtime context.
- Ensure the approved plan is at
<state_dir>/plans/YYYY-MM-DD-<slug>-impl-plan.md as the permanent project reference (copy from the staging directory if Plan Mode was used)
- Ask if the user is ready to proceed to execution (Phase 3)
- Upon approval, create the session state file via the session-management skill
Source: josstei/maestro-orchestrate — distributed by TomeVault.
1---2name: implementation-planning-23description: Generates detailed implementation plans from finalized designs4---56# Implementation Planning Skill78**Standard workflow only.** If `task_complexity` is `simple` and workflow mode is Express, do not activate this skill. Simple tasks use the Express workflow, which does not activate implementation-planning. Return to the Express Workflow section.910Activate this skill during Phase 2 of Maestro orchestration, after the design document has been approved. This skill provides the methodology for generating detailed, actionable implementation plans that map directly to subagent assignments.1112## Codebase Grounding1314Do not generate an implementation plan from guesses about the repository.1516Use the built-in `codebase_investigator` before phase decomposition when:17- The task modifies an existing codebase18- File ownership, integration points, or validation commands are still unclear after reading the approved design19- Parallelization decisions depend on understanding current module boundaries or likely file overlap2021Ask the investigator for:22- The modules and files most likely to change23- Existing architectural boundaries and conventions the plan must preserve24- Integration seams, dependencies, and shared ownership hotspots25- Validation commands and test entry points already used by the project26- Parallelization or conflict risks that should prevent batching2728Skip the investigator only for greenfield tasks, documentation-only work, or plans where the current turn already established the relevant repo structure from direct reads.2930Reuse investigator findings directly in the implementation plan:31- File inventories should reflect real candidate paths, not placeholders32- Validation criteria should prefer repo-native commands the investigator surfaced33- Parallel batches should account for actual ownership overlap and conflict risk3435## Plan Generation Methodology3637### Input Analysis38Before generating the plan, thoroughly analyze the approved design document for:39- Read `task_complexity` from the approved design document's frontmatter. Apply phase count guidance and domain analysis scaling accordingly. Record `task_complexity` in implementation plan frontmatter.40- Components and their responsibilities41- Interfaces and contracts between components42- Data models and their relationships43- External dependencies and integrations44- Technology stack decisions45- Quality requirements that influence implementation order4647### Phase Decomposition4849Break the implementation into phases following these principles:50511. **Foundation First**: Infrastructure, configuration, and shared types/interfaces come first522. **Dependencies Flow Downward**: A phase can only depend on phases with lower IDs533. **Single Responsibility**: Each phase delivers a cohesive unit of functionality544. **Agent Alignment**: Each phase maps to one or two agent specializations555. **Agent Capability Match**: Verify the assigned agent's tool tier supports the phase deliverables (see compatibility check below)566. **Testability**: Each phase should be independently validatable5758### Phase Ordering Strategy5960```61Layer 1: Foundation (types, interfaces, configuration)62 |63Layer 2: Core Domain (business logic, data models)64 |65Layer 3: Infrastructure (database, external services, API layer)66 |67Layer 4: Integration (connecting components, middleware)68 |69Layer 5: Quality (testing, security review, performance)70 |71Layer 6: Documentation & Polish72```7374### Agent-Deliverable Compatibility Check7576Before finalizing agent assignments, verify each phase's agent can deliver its requirements:7778| Phase Deliverable | Required Tier | Compatible Agents |79|-------------------|--------------|-------------------|80| Creates/modifies files | Full Access or Read+Write | analytics-engineer, cobol-engineer, coder, copywriter, data-engineer, design-system-engineer, devops-engineer, hlasm-assembler-specialist, i18n-specialist, ibm-i-specialist, integration-engineer, ml-engineer, mlops-engineer, mobile-engineer, observability-engineer, platform-engineer, product-manager, prompt-engineer, refactor, release-manager, technical-writer, tester, ux-designer |81| Runs shell commands | Full Access or Read+Shell | accessibility-specialist, analytics-engineer, cobol-engineer, coder, data-engineer, database-administrator, db2-dba, debugger, design-system-engineer, devops-engineer, hlasm-assembler-specialist, i18n-specialist, ibm-i-specialist, integration-engineer, ml-engineer, mlops-engineer, mobile-engineer, observability-engineer, performance-engineer, platform-engineer, refactor, security-engineer, seo-specialist, site-reliability-engineer, tester, zos-sysprog |82| Analysis/review only | Any tier | All agents |8384<HARD-GATE>85Read-Only agents (architect, api-designer, cloud-architect, code-reviewer, compliance-reviewer, content-strategist, solutions-architect)86CANNOT be assigned to phases that create or modify files. If a phase requires file creation87and domain expertise from a Read-Only agent, split it: the Read-Only agent produces a spec88or analysis, then a write-capable agent (typically coder) implements the files based on that output.89</HARD-GATE>9091### Phase Count Guidance9293Scale decomposition granularity to `task_complexity` (read from design document frontmatter):94- **simple**: 1-3 phases. Prefer single-phase execution when feasible. Combine foundation + implementation. Skip separate documentation/polish phases.95- **medium**: 3-5 phases. Use the layer model but combine Quality and Documentation into the final implementation phase where practical.96- **complex**: No phase count cap. Full layer decomposition strategy applies.9798### Parallelization Identification99100Phases can run in parallel when:101- They have no shared file dependencies (no overlapping files_created or files_modified)102- They are at the same dependency depth (same layer)103- They do not share data model ownership104- Their validation can run independently105106Mark parallel-eligible phases with `parallel: true` and group them into execution batches.107108## Implementation Detail Requirements109110### Per-Phase Specification111112Each phase in the plan must include:113114#### Objective115A clear, measurable statement of what this phase delivers.116117#### Agent Assignment118Which agent(s) execute this phase, with rationale for selection.119120#### Files to Create121For each new file:122- Full relative path from project root123- Purpose and responsibility124- Key interfaces, classes, or functions to define125- Complete type signatures for public APIs126127#### Files to Modify128For each existing file:129- Full relative path from project root130- Specific changes required and why131- Expected before/after for critical sections132133#### Implementation Details134135Provide sufficient detail for the assigned agent to execute without ambiguity:136- Interface definitions with complete type signatures137- Base class contracts with abstract method signatures138- Dependency injection patterns and registration points139- Error handling strategy (error types, propagation, recovery)140- Configuration requirements (environment variables, config files)141142#### Validation Criteria143Specific commands to run and expected outcomes:144- Build/compile commands145- Lint/format checks146- Unit test commands147- Integration test commands (if applicable)148- Manual verification steps (if applicable)149150#### Dependencies151- `blocked_by`: Phase IDs that must complete before this phase starts152- `blocks`: Phase IDs that cannot start until this phase completes153154### Dependency Minimization155156List only **direct** blockers in `blocked_by`. Do not include transitive dependencies — they inflate dependency depth and prevent parallelism.157158Anti-pattern (over-specified):159- Phase 2: blocked_by: [1]160- Phase 3: blocked_by: [1, 2] — Phase 1 is redundant, already reachable via Phase 2161- Phase 4: blocked_by: [1, 2, 3] — Phases 1, 2 are redundant162163Result: depths 0, 1, 2, 3 — zero parallel phases.164165Correct (minimized):166- Phase 2: blocked_by: [1]167- Phase 3: blocked_by: [1] — Only needs Phase 1 output, not Phase 2168- Phase 4: blocked_by: [2, 3] — Needs both done169170Result: depths 0, 1, 2 — Phases 2 and 3 run in parallel at depth 1.171172Ask for each dependency: "Does this phase truly need the output of that specific phase, or is it transitively covered?"173174If `validate_plan` is available, review its `parallelization_profile` and `redundant_dependency` warnings before presenting the plan. Revise `blocked_by` to eliminate redundancies when possible.175176## Agent Assignment Criteria177178### Matching Tasks to Agents179180| Task Domain | Primary Agent | Secondary Agent | Rationale |181|-------------|--------------|-----------------|-----------|182| System design, architecture | `architect` | - | Read-only analysis, design expertise |183| Cloud architecture, multi-region topology | `cloud-architect` | `devops-engineer` | Architecture first, implementation second |184| Enterprise integration architecture | `solutions-architect` | `integration-engineer` | Cross-team design before implementation |185| API contracts, endpoints | `api-designer` | `coder` | Design then implement |186| Feature implementation | `coder` | - | Full implementation access |187| Code quality review | `code-reviewer` | - | Read-only verification |188| Database schema, queries | `data-engineer` | - | Schema + implementation |189| RDBMS tuning, indexes, migration safety | `database-administrator` | `data-engineer` | DBA analysis before schema/code changes |190| DB2 administration | `db2-dba` | `data-engineer` | DB2-specific operations and design |191| Bug investigation | `debugger` | - | Read + shell for investigation |192| CI/CD, infrastructure | `devops-engineer` | - | Full DevOps access |193| Internal platforms, paved paths | `platform-engineer` | `devops-engineer` | Platform conventions and implementation |194| B2B integrations, ETL, message brokers | `integration-engineer` | - | Full integration implementation |195| SLOs, runbooks, reliability | `site-reliability-engineer` | `observability-engineer` | Reliability assessment plus telemetry implementation |196| Observability, metrics, traces | `observability-engineer` | - | Full telemetry implementation |197| Performance analysis | `performance-engineer` | - | Read + shell for profiling |198| Code restructuring | `refactor` | - | Write + shell access (for validation) |199| Security assessment | `security-engineer` | - | Read + shell for scanning |200| Test creation | `tester` | - | Full test implementation |201| Documentation | `technical-writer` | - | Write access for docs |202| Release notes, changelogs, rollout | `release-manager` | - | Write access for release artifacts |203| Technical SEO audit | `seo-specialist` | - | Read + shell + web search |204| Marketing copy, content | `copywriter` | - | Read/write |205| Content planning | `content-strategist` | - | Read + web search/fetch |206| UX design, user flows | `ux-designer` | - | Read/write + web search |207| WCAG compliance audit | `accessibility-specialist` | - | Read + shell + web search |208| Requirements, product | `product-manager` | - | Read/write + web search |209| Tracking, analytics | `analytics-engineer` | `coder` | Implement then instrument |210| Internationalization | `i18n-specialist` | `coder` | Implement then localize |211| Design tokens, theming | `design-system-engineer` | `coder` | Tokens then consume |212| Legal, regulatory | `compliance-reviewer` | - | Read + web search/fetch |213| Mobile platform work | `mobile-engineer` | `tester` | Mobile implementation plus validation |214| Model training, inference integration | `ml-engineer` | `tester` | ML implementation plus evaluation |215| Model registry, drift, model CI/CD | `mlops-engineer` | `devops-engineer` | Model operations and deployment |216| Prompt design, few-shot, RAG tuning | `prompt-engineer` | `coder` | Prompt spec before integration |217| Mainframe COBOL, JCL, CICS/IMS | `cobol-engineer` | `tester` | Mainframe implementation and validation |218| IBM HLASM for z/OS | `hlasm-assembler-specialist` | - | Assembly implementation |219| IBM i RPG/CL, DB2 for i | `ibm-i-specialist` | - | IBM i implementation |220| z/OS systems programming, JCL, RACF | `zos-sysprog` | `security-engineer` | System-level analysis and controls |221222### Assignment Rules2231. Match the primary task domain to the agent specialization2242. Consider tool requirements — does the task need shell access? Write access?2253. For parallel phases, assign non-overlapping file ownership to each agent2264. Prefer single-agent phases for clarity; use multi-agent only when distinct specializations are needed2275. Never assign more files to an agent than it can handle within its `max_turns` limit228229### Token Budget Estimation230Estimate token consumption per phase based on:231- Number of files to read (input tokens)232- Complexity of output expected (output tokens)233- Agent's max_turns limit as upper bound234- Historical averages: ~500 input tokens per file read, ~200 output tokens per file written235236### Resource Estimation237238Do not invent provider pricing or model tiers. Agent model selection is runtime-owned through agent frontmatter and runtime configuration. Estimate execution size in stable, codebase-derived terms instead:239240- **Input complexity**: number of files likely to be read, average file size, and prior-phase context241- **Output complexity**: number of files created or modified, validation output volume, and expected handoff detail242- **Retry budget**: note phases likely to need retries because of broad file ownership, external dependencies, or uncertain validation243244Include a lightweight plan-level resource summary when useful:245246| Phase | Agent | Est. Files Read | Est. Files Written | Retry Risk | Notes |247|-------|-------|-----------------|--------------------|------------|-------|248| 1 | [agent] | [N] | [N] | LOW/MEDIUM/HIGH | [why] |249250## Plan Document Generation251252### Output Location253254The write path depends on whether your runtime provides a Plan Mode surface (check `get_runtime_context`, loaded at session start, step 0).255256- **Plan Mode active**: Some runtimes restrict writes to a temporary staging directory during Plan Mode. Write the plan there first, then copy to the permanent location after approval. Call `exit_plan_mode` with the plan path to present the plan for user approval.257- **Plan Mode not active or not available**: Write the implementation plan directly to the project's plans directory.258259Permanent location: `<state_dir>/plans/YYYY-MM-DD-<topic-slug>-impl-plan.md` (where `<state_dir>` resolves from `MAESTRO_STATE_DIR`, default `docs/maestro`).260261If your runtime does not provide a Plan Mode transition, track planning progress using the plan-update mechanism from your runtime context, write directly to the final location, and use the user-prompt tool from runtime context for the approval gate.262263### Document Structure264Use the `implementation-plan` template loaded via `get_skill_content`.265266### Required Sections2672681. **Plan Overview**: Summary of total phases, agents involved, estimated effort2692. **Dependency Graph**: Visual representation showing phase dependencies and parallel opportunities2703. **Execution Strategy Table**: Stage-by-stage breakdown with agent assignments and execution mode2714. **Phase Details**: Full specification for each phase (objective, agent, files, details, validation, dependencies)2725. **File Inventory**: Complete table mapping every file to its phase and purpose2736. **Risk Classification**: Per-phase risk assessment (LOW/MEDIUM/HIGH) with rationale2747. **Execution Profile**: Summary of parallel vs sequential characteristics to inform mode selection:275 ```276 Execution Profile:277 - Total phases: [N]278 - Parallelizable phases: [M] (in [B] batches)279 - Sequential-only phases: [S]280 - Estimated parallel wall time: [time estimate based on batch execution]281 - Estimated sequential wall time: [time estimate based on serial execution]282283 Note: Native parallel execution currently runs agents in autonomous mode.284 All tool calls are auto-approved without user confirmation.285 ```286287### Completion Criteria288The implementation plan is complete when:289- Every component from the design document maps to at least one phase290- All phase dependencies are acyclic (no circular dependencies)291- Parallel opportunities are identified and marked292- Each phase has clear validation criteria293- File ownership is non-overlapping for parallel phases294- The user has given explicit approval of the complete plan295296Before presenting the plan for approval, check whether `validate_plan` appears in your available tools. If it does, call it with the plan structure and `task_complexity` to verify phase count constraints, file ownership, acyclic dependencies, and agent validity. If it does not, self-check against the phase count limits above.297298### Post-Generation299After writing the implementation plan:3001. Confirm the file path to the user3012. Present the dependency graph and execution strategy3023. Highlight parallel execution opportunities3034. Provide resource estimates when useful3045. If your runtime provides Plan Mode, call `exit_plan_mode` with the plan path to present the plan for user approval. If Plan Mode is not available, present the completed plan for user approval using the user-prompt tool from runtime context.3056. Ensure the approved plan is at `<state_dir>/plans/YYYY-MM-DD-<slug>-impl-plan.md` as the permanent project reference (copy from the staging directory if Plan Mode was used)3067. Ask if the user is ready to proceed to execution (Phase 3)3078. Upon approval, create the session state file via the session-management skill308309---310> Source: [josstei/maestro-orchestrate](https://github.com/josstei/maestro-orchestrate) — distributed by [TomeVault](https://tomevault.io).311<!-- tomevault:4.0:skill_md:2026-06-26 -->