Elaborate Plans
Elaborate existing Plans with detailed, actionable guidance distilled from higher-quality models, filling gaps and making them easier for simpler models to execute during development.
Pre-flight
{{WORKSPACE}} = workspace root. Resolve once per session and reuse: git rev-parse --show-toplevel; fall back to cwd outside a git repo.
- Before your first write, read
{{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/conventions.md — statuses, retries, artifact paths, and file ownership are defined there and are binding.
- Working folder:
{{WORKSPACE}}
- Target folders:
{{WORKSPACE}}/plans/ (you should only modify files in this folder)
- Required input:
Plan ID (e.g., "AUTH-001") or Plan file path (e.g., "plans/AUTH-001-user-authentication.md")
References
Read reference specs on-demand when the workflow requires them — do NOT read all upfront.
Always needed
Plan: Read {{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/plan.md — for Plan format, milestone fields (including the mandatory Retries header field), and elaboration format
Plans Index: Read {{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/plans-index.md — for index lookup and status updates
On-demand (read only when needed)
- Contexts (working file): Read
{{WORKSPACE}}/knowledge/contexts.md when checking domain language for elaborations — the spec at {{MAESTRO_CONFIG}}/references/contexts.md defines the format only
- Repo Fingerprint (working file): Read
{{WORKSPACE}}/knowledge/repo-fingerprint.md when checking the tech stack
- Stack Overrides (working file): Read
{{WORKSPACE}}/knowledge/tech-preferences.md if present — declared categories steer which technologies guidance targets
- Instruments (working file): Read
{{WORKSPACE}}/knowledge/instruments.md — if it exists, target the composition section's model as the quality bar and keep guidance executable by the implementation section's model (that is the whole point of elaboration)
Testing Principles: Read {{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/testing-principles.md — when elaborating test strategy
Design Principles: Read {{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/design-principles.md — when elaborating code patterns
Tech Preferences: Read {{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/tech-preferences.md — when elaborating tech choices
Cross-references
For how references relate to each other, see {{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/references-map.md.
Validation
- If required input is missing, abort with error
- If
Plan file doesn't exist in plans directory, abort with error
- If
Plan is already marked as Done or Failed, abort with error
Core Workflow
Phase 0: Setup
- Parse Input: Determine if input is a
Plan ID or file path
- Locate Plan: If
Plan ID provided, read {{WORKSPACE}}/plans/index.md to find the full Plan filename
- Read Plan: Read the full
Plan file to understand its structure, milestones, and current detail level
- Read Context: Read the working knowledge files (
{{WORKSPACE}}/knowledge/contexts.md, {{WORKSPACE}}/knowledge/repo-fingerprint.md) to understand domain language and technical stack
Phase 1: Gap Analysis
- Identify Gaps: Analyze each milestone for missing detail:
- Vague or ambiguous implementation steps
- Missing error handling guidance
- Unclear testing strategies
- Absence of code patterns or examples
- Undefined edge cases
- Complexity Assessment: Evaluate which milestones would benefit most from elaboration based on technical complexity and dependencies
- Knowledge Gaps: Identify areas where external documentation or best practices would be helpful
Phase 2: Knowledge Gathering
- Tech Stack Research: Search the web to gather:
- Latest documentation for referenced technologies and frameworks
- Best practices for the specific implementation patterns
- Common pitfalls and how to avoid them
- Codebase Patterns: Search the codebase to find:
- Existing similar implementations in the codebase
- Established patterns for the technology stack
- Relevant utility functions or helper classes
- Domain Alignment: Ensure elaboration uses terminology from the working
knowledge/contexts.md
Phase 3: Elaboration Generation
For every milestone — even ones needing no other elaboration — ensure a Why & Limits block exists (add it when missing; refine it when thin). This is mandatory: it is your constraint-transmission channel to cheaper executors, and constraints embedded in the milestone get read where rules in reference docs may not. Content:
- Why: one line — the design rationale a
play agent cannot infer from the task text alone (what breaks elsewhere if done differently; which milestones consume this milestone's shape)
- Must not: explicit negative scope — files/areas owned by other milestones or read-only zones (
knowledge/), forbidden actions (committing, adding dependencies), each with a one-clause reason
- If blocked:
return Failed with the blocker named — do not improvise outside scope
Hard limit: 3 bullets, one line each (Plan spec, Why & Limits).
For each milestone identified as needing elaboration, additionally add:
Implementation Guidance:
- Detailed step-by-step breakdown
- Specific file paths and directory structures
- Code patterns and examples following existing codebase conventions
- Prerequisite checks and setup steps
- Integration points with existing code
Error Handling:
- Common error scenarios and how to handle them
- Validation requirements
- Failure modes and recovery strategies
- Rollback procedures if needed
Testing Strategy:
- Specific test cases to implement
- Edge cases to cover
- Mock data requirements
- Test file locations and naming conventions (unit tests co-located; E2E flat in
tests/)
Best Practices:
- Performance considerations
- Security considerations
- Code organization patterns
- Documentation requirements
Code Examples:
- Relevant code snippets following project conventions
- Interface implementations
- Configuration examples
- Data structure definitions
Common Pitfalls:
- Mistakes to avoid
- Anti-patterns to watch for
- Debugging hints for common issues
Phase 4: User Review
- Present Elaborations: Present proposed elaborations to the user:
- "I've elaborated the
Plan with detailed implementation guidance, code patterns, testing strategies, and best practices. Key additions include: [summary of major elaborations]. Should I apply these enhancements to the Plan?"
- Options: "Yes, apply all", "Review specific sections", "No, cancel"
- Selective Review: If user chooses "Review specific sections", present elaborations section by section for approval
Phase 5: Plan Enhancement
- Apply Elaborations: Update the
Plan file with approved elaborations
- Maintain Structure: Ensure elaborations are added without breaking the existing
Plan structure and DAG dependencies
- Preserve Metadata: Keep original
Plan metadata (Test Tier, Docs Affected, Status, and every milestone's Retries count) unchanged
- Update Index: If elaborations significantly change the
Plan scope, consider updating the description in {{WORKSPACE}}/plans/index.md
Elaboration Format
Add elaborations as nested bullet points under each milestone, preserving the canonical milestone header exactly as defined in the Plan spec (including Retries):
- ⏳ **Milestone 1 (ID: 1, Dependencies: [], Retries: 0)**: [Short Title] - Specific detailed task description.
**Why & Limits:**
- Why: [Rationale the executor cannot infer — what breaks if done differently]
- Must not: [Files owned by other milestones, forbidden actions — each with a one-clause reason]
- If blocked: Return Failed with the blocker named — do not improvise outside scope.
**Implementation Guidance:**
- Step 1: [Detailed step with file paths]
- Step 2: [Detailed step with specific actions]
- Follow the pattern in [existing-file](path/to/existing-file)
**Code Pattern:**
```typescript
// Example following project conventions
interface Example {
// Specific implementation
}
```
**Testing Strategy:**
- Create test file at `tests/auth.spec.ts`
- Test cases: [specific cases]
- Mock data: [specific mock requirements]
**Error Handling:**
- Handle [specific error scenario]
- Validate [specific conditions]
- Fallback: [specific fallback strategy]
**Common Pitfalls:**
- Avoid [specific mistake]
- Watch for [specific anti-pattern]
**Best Practices:**
- Use [specific pattern] for [specific purpose]
- Consider [specific performance/security implication]
Quality Checklist
Before completing the elaboration:
Error Handling
- If
Plan file cannot be found, abort with error message suggesting user check the Plans Index
- If
Plan is already Done or Failed, abort with error message suggesting the Plan may not need elaboration
- If web research fails for a specific technology, note this in elaborations and proceed with codebase patterns only
- If user rejects elaborations, do not modify the
Plan file
- If elaborations would fundamentally change the
Plan scope, suggest creating a new Plan instead
Integration with Other Skills
- compose: Typically runs compose → elaborate → orchestrate in sequence
- orchestrate: Elaborated
Plans provide better guidance for subagent execution
- rehearse: Can be called if rehearse identifies areas needing more technical detail
- tune: May recommend elaboration when an
Issue reveals the Plan lacked detail
Execution
Use the Plan ID or file path from the invocation, then proceed with Phase 0: Setup.
1---2name: elaborate3description: Elaborate plans - distill detail from higher-quality models into a Plan to fill gaps and simplify execution for simpler models; invoked via "/elaborate PLAN-001" after compose but before orchestrate to add implementation guidance and test strategy4---56# Elaborate Plans78Elaborate existing `Plan`s with detailed, actionable guidance distilled from higher-quality models, filling gaps and making them easier for simpler models to execute during development.910## Pre-flight1112- `{{WORKSPACE}}` = workspace root. Resolve once per session and reuse: `git rev-parse --show-toplevel`; fall back to cwd outside a git repo.13- Before your first write, read `{{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/conventions.md` — statuses, retries, artifact paths, and file ownership are defined there and are binding.14- Working folder: `{{WORKSPACE}}`15- Target folders: `{{WORKSPACE}}/plans/` (you should only modify files in this folder)16- Required input: `Plan` ID (e.g., "AUTH-001") or `Plan` file path (e.g., "plans/AUTH-001-user-authentication.md")1718## References1920Read reference specs on-demand when the workflow requires them — do NOT read all upfront.2122### Always needed23- **`Plan`:** Read `{{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/plan.md` — for Plan format, milestone fields (including the mandatory `Retries` header field), and elaboration format24- **`Plans Index`:** Read `{{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/plans-index.md` — for index lookup and status updates2526### On-demand (read only when needed)27- **Contexts (working file):** Read `{{WORKSPACE}}/knowledge/contexts.md` when checking domain language for elaborations — the spec at `{{MAESTRO_CONFIG}}/references/contexts.md` defines the format only28- **Repo Fingerprint (working file):** Read `{{WORKSPACE}}/knowledge/repo-fingerprint.md` when checking the tech stack29- **Stack Overrides (working file):** Read `{{WORKSPACE}}/knowledge/tech-preferences.md` if present — declared categories steer which technologies guidance targets30- **Instruments (working file):** Read `{{WORKSPACE}}/knowledge/instruments.md` — if it exists, target the `composition` section's model as the quality bar and keep guidance executable by the `implementation` section's model (that is the whole point of elaboration)31- **`Testing Principles`:** Read `{{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/testing-principles.md` — when elaborating test strategy32- **`Design Principles`:** Read `{{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/design-principles.md` — when elaborating code patterns33- **`Tech Preferences`:** Read `{{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/tech-preferences.md` — when elaborating tech choices3435### Cross-references36For how references relate to each other, see `{{WORKSPACE}}/{{MAESTRO_CONFIG}}/references/references-map.md`.3738## Validation3940- If required input is missing, abort with error41- If `Plan` file doesn't exist in plans directory, abort with error42- If `Plan` is already marked as Done or Failed, abort with error4344## Core Workflow4546### Phase 0: Setup47481. **Parse Input:** Determine if input is a `Plan` ID or file path492. **Locate Plan:** If `Plan` ID provided, read `{{WORKSPACE}}/plans/index.md` to find the full `Plan` filename503. **Read Plan:** Read the full `Plan` file to understand its structure, milestones, and current detail level514. **Read Context:** Read the working knowledge files (`{{WORKSPACE}}/knowledge/contexts.md`, `{{WORKSPACE}}/knowledge/repo-fingerprint.md`) to understand domain language and technical stack5253### Phase 1: Gap Analysis54551. **Identify Gaps:** Analyze each milestone for missing detail:56 - Vague or ambiguous implementation steps57 - Missing error handling guidance58 - Unclear testing strategies59 - Absence of code patterns or examples60 - Undefined edge cases612. **Complexity Assessment:** Evaluate which milestones would benefit most from elaboration based on technical complexity and dependencies623. **Knowledge Gaps:** Identify areas where external documentation or best practices would be helpful6364### Phase 2: Knowledge Gathering65661. **Tech Stack Research:** Search the web to gather:67 - Latest documentation for referenced technologies and frameworks68 - Best practices for the specific implementation patterns69 - Common pitfalls and how to avoid them702. **Codebase Patterns:** Search the codebase to find:71 - Existing similar implementations in the codebase72 - Established patterns for the technology stack73 - Relevant utility functions or helper classes743. **Domain Alignment:** Ensure elaboration uses terminology from the working `knowledge/contexts.md`7576### Phase 3: Elaboration Generation7778For **every** milestone — even ones needing no other elaboration — ensure a **`Why & Limits`** block exists (add it when missing; refine it when thin). This is mandatory: it is your constraint-transmission channel to cheaper executors, and constraints embedded in the milestone get read where rules in reference docs may not. Content:7980- **Why:** one line — the design rationale a `play` agent cannot infer from the task text alone (what breaks elsewhere if done differently; which milestones consume this milestone's shape)81- **Must not:** explicit negative scope — files/areas owned by other milestones or read-only zones (`knowledge/`), forbidden actions (committing, adding dependencies), each with a one-clause reason82- **If blocked:** `return Failed with the blocker named — do not improvise outside scope`8384Hard limit: 3 bullets, one line each (`Plan` spec, `Why & Limits`).8586For each milestone identified as needing elaboration, additionally add:8788**Implementation Guidance:**89- Detailed step-by-step breakdown90- Specific file paths and directory structures91- Code patterns and examples following existing codebase conventions92- Prerequisite checks and setup steps93- Integration points with existing code9495**Error Handling:**96- Common error scenarios and how to handle them97- Validation requirements98- Failure modes and recovery strategies99- Rollback procedures if needed100101**Testing Strategy:**102- Specific test cases to implement103- Edge cases to cover104- Mock data requirements105- Test file locations and naming conventions (unit tests co-located; E2E flat in `tests/`)106107**Best Practices:**108- Performance considerations109- Security considerations110- Code organization patterns111- Documentation requirements112113**Code Examples:**114- Relevant code snippets following project conventions115- Interface implementations116- Configuration examples117- Data structure definitions118119**Common Pitfalls:**120- Mistakes to avoid121- Anti-patterns to watch for122- Debugging hints for common issues123124### Phase 4: User Review1251261. **Present Elaborations:** Present proposed elaborations to the user:127 - "I've elaborated the `Plan` with detailed implementation guidance, code patterns, testing strategies, and best practices. Key additions include: [summary of major elaborations]. Should I apply these enhancements to the `Plan`?"128 - Options: "Yes, apply all", "Review specific sections", "No, cancel"1292. **Selective Review:** If user chooses "Review specific sections", present elaborations section by section for approval130131### Phase 5: Plan Enhancement1321331. **Apply Elaborations:** Update the `Plan` file with approved elaborations1342. **Maintain Structure:** Ensure elaborations are added without breaking the existing `Plan` structure and DAG dependencies1353. **Preserve Metadata:** Keep original `Plan` metadata (Test Tier, Docs Affected, Status, and every milestone's `Retries` count) unchanged1364. **Update Index:** If elaborations significantly change the `Plan` scope, consider updating the description in `{{WORKSPACE}}/plans/index.md`137138## Elaboration Format139140Add elaborations as nested bullet points under each milestone, preserving the canonical milestone header exactly as defined in the `Plan` spec (including `Retries`):141142```markdown143- ⏳ **Milestone 1 (ID: 1, Dependencies: [], Retries: 0)**: [Short Title] - Specific detailed task description.144 **Why & Limits:**145 - Why: [Rationale the executor cannot infer — what breaks if done differently]146 - Must not: [Files owned by other milestones, forbidden actions — each with a one-clause reason]147 - If blocked: Return Failed with the blocker named — do not improvise outside scope.148 **Implementation Guidance:**149 - Step 1: [Detailed step with file paths]150 - Step 2: [Detailed step with specific actions]151 - Follow the pattern in [existing-file](path/to/existing-file)152 **Code Pattern:**153 ```typescript154 // Example following project conventions155 interface Example {156 // Specific implementation157 }158 ```159 **Testing Strategy:**160 - Create test file at `tests/auth.spec.ts`161 - Test cases: [specific cases]162 - Mock data: [specific mock requirements]163 **Error Handling:**164 - Handle [specific error scenario]165 - Validate [specific conditions]166 - Fallback: [specific fallback strategy]167 **Common Pitfalls:**168 - Avoid [specific mistake]169 - Watch for [specific anti-pattern]170 **Best Practices:**171 - Use [specific pattern] for [specific purpose]172 - Consider [specific performance/security implication]173```174175## Quality Checklist176177Before completing the elaboration:178179- [ ] `Plan` file successfully read and understood180- [ ] Gaps identified in existing milestones181- [ ] Knowledge gathered from documentation and codebase182- [ ] `Why & Limits` present on **every** milestone (mandatory — even milestones that needed no other elaboration)183- [ ] Elaborations follow project conventions and patterns184- [ ] Code examples match existing codebase style185- [ ] Domain language from the working `contexts.md` used correctly186- [ ] Testing strategies are specific and actionable187- [ ] Error handling covers common scenarios188- [ ] Best practices are relevant to the tech stack189- [ ] User approval obtained for elaborations190- [ ] `Plan` structure and DAG dependencies preserved191- [ ] Original `Plan` metadata maintained, including per-milestone `Retries`192193## Error Handling194195- If `Plan` file cannot be found, abort with error message suggesting user check the `Plans Index`196- If `Plan` is already Done or Failed, abort with error message suggesting the `Plan` may not need elaboration197- If web research fails for a specific technology, note this in elaborations and proceed with codebase patterns only198- If user rejects elaborations, do not modify the `Plan` file199- If elaborations would fundamentally change the `Plan` scope, suggest creating a new `Plan` instead200201## Integration with Other Skills202203- **compose**: Typically runs compose → elaborate → orchestrate in sequence204- **orchestrate**: Elaborated `Plan`s provide better guidance for subagent execution205- **rehearse**: Can be called if rehearse identifies areas needing more technical detail206- **tune**: May recommend elaboration when an `Issue` reveals the `Plan` lacked detail207208## Execution209210Use the `Plan` ID or file path from the invocation, then proceed with Phase 0: Setup.