Commit da21aa00
da21aa00e738Merged
Scott Nixon <[email protected]> ยท 9 months ago ยท 1 file ยท +1 added
Description
Add plan-to-execute meta-pipeline (attractor-azz)
Details
- Commit
- da21aa00e738
- Parent
- 01d2a78f0a24
templates/plan-to-execute.dotaddedView file
1+
digraph PlanToExecute {2+
label="Plan to Execute: Generate PRD โ Spec โ Beads Tasks โ Pipeline"3+
goal="Transform a feature description into a complete, validated pipeline with beads task tracking."4+
model="sonnet"5+
6+
start [shape="Mdiamond"]7+
done [shape="Msquare"]8+
9+
// --- Generate PRD ---10+
generate_prd [11+
shape="box"12+
label="Generate PRD"13+
allowed_tools="Write"14+
prompt="Read the feature_description from context.15+
16+
Using the PRD template structure (see templates/prd-template.md):17+
- Title and metadata (Status: Draft, Author, Created date)18+
- Overview (1-2 paragraphs)19+
- Goals (numbered list)20+
- Non-Goals21+
- User Stories (US-N format)22+
- Functional Requirements (FR-N format with code examples)23+
- Technical Constraints24+
- Success Criteria (numbered, measurable)25+
- Risks & Mitigations (table format)26+
- Out of Scope27+
- References28+
29+
Write the complete PRD to .attractor/prd.md in markdown format."30+
]31+
32+
// --- Review PRD ---33+
review_prd [34+
shape="hexagon"35+
label="Review PRD"36+
prompt="Review the generated PRD at .attractor/prd.md37+
38+
Does the PRD clearly capture:39+
- What problem we're solving?40+
- Why it matters now?41+
- Specific goals and success criteria?42+
- User stories with measurable outcomes?43+
- Technical requirements and constraints?44+
45+
Respond with 'continue' to proceed to spec generation, or 'reject' to regenerate the PRD."46+
]47+
48+
// --- Generate Spec ---49+
generate_spec [50+
shape="box"51+
label="Generate Spec"52+
allowed_tools="Read,Write"53+
prompt="Read the PRD from .attractor/prd.md54+
55+
Using the Technical Specification template structure (see templates/spec-template.md):56+
- Title and metadata (Status: Draft, PRD link)57+
- Architecture Overview (high-level design, before/after)58+
- File Changes (numbered list of files/components with before/after code)59+
- Implementation Phases (Phase N with checkbox tasks and dependencies)60+
* CRITICAL: This section drives the beads decompose step61+
* Structure: ### Phase N: [Title] with - [ ] tasks listed62+
- Configuration (environment variables, settings table)63+
- Testing Strategy (unit, integration, E2E, manual tests)64+
- Rollback Plan (steps to revert, verification)65+
66+
Write the complete spec to .attractor/spec.md in markdown format."67+
]68+
69+
// --- Review Spec ---70+
review_spec [71+
shape="hexagon"72+
label="Review Spec"73+
prompt="Review the generated Technical Specification at .attractor/spec.md74+
75+
Does the spec clearly describe:76+
- How the feature will be architecturally implemented?77+
- What files will be changed and why?78+
- Specific implementation phases with clear tasks?79+
- Configuration and testing requirements?80+
- How to roll back if problems occur?81+
82+
Respond with 'continue' to proceed to task decomposition, or 'reject' to regenerate the spec."83+
]84+
85+
// --- Decompose to Beads ---86+
decompose [87+
shape="box"88+
label="Decompose to Beads"89+
allowed_tools="Read,Write,Bash(bd:*)"90+
prompt="Read the spec from .attractor/spec.md91+
92+
Parse the Implementation Phases section and create beads tasks:93+
1. Create a beads epic: bd create --type=epic --title='[Feature Name] Epic' --priority=294+
Copy the epic ID95+
2. For each Phase in the spec:96+
- Create a phase epic: bd create --type=epic --title='Phase N: [Title]' --priority=297+
- Add dependency: bd dep add <phase-epic> <parent-epic>98+
3. For each task in each Phase:99+
- Create beads task: bd create --type=task --title='[Task description]' --priority=2100+
- Add dependency: bd dep add <task-id> <phase-epic>101+
4. Write the root epic ID to .attractor/epic_id.txt102+
5. Sync beads: bd sync"103+
]104+
105+
// --- Scaffold Pipeline ---106+
scaffold [107+
shape="parallelogram"108+
label="Scaffold Pipeline"109+
allowed_tools="Read,Write,Bash(sed:*)"110+
prompt="Read the epic ID from .attractor/epic_id.txt111+
112+
Use sed to replace EPIC_ID in the epic-runner template:113+
sed 's/EPIC_ID/<epic-id>/g' templates/epic-runner.dot > .attractor/pipeline.dot114+
115+
This creates a ready-to-run pipeline that executes all beads tasks."116+
]117+
118+
// --- Validate Pipeline ---119+
validate_pipeline [120+
shape="parallelogram"121+
label="Validate Pipeline"122+
allowed_tools="Bash(attractor-cli:*)"123+
prompt="Run: attractor-cli validate .attractor/pipeline.dot124+
125+
Check for errors:126+
- Missing nodes127+
- Invalid shapes128+
- Unresolved edge labels129+
- Type mismatches130+
131+
If valid, proceed to execution. If invalid, fix the pipeline or respond with FAIL to regenerate."132+
]133+
134+
// --- Execute Pipeline ---135+
execute_pipeline [136+
shape="parallelogram"137+
label="Execute Pipeline"138+
allowed_tools="Bash(attractor-cli:*),Bash(bd:*)"139+
prompt="Run: attractor-cli run .attractor/pipeline.dot -w .140+
141+
This executes the full pipeline:142+
- Picks next ready task143+
- Investigates changes needed144+
- Implements the changes145+
- Runs tests146+
- Verifies completion147+
- Loops until all tasks are done148+
149+
Monitor output and respond with status updates."150+
]151+
152+
// --- Edges ---153+
start -> generate_prd154+
155+
generate_prd -> review_prd156+
157+
review_prd -> generate_prd [label="reject", condition="preferred_label=reject"]158+
review_prd -> generate_spec [label="continue"]159+
160+
generate_spec -> review_spec161+
162+
review_spec -> generate_spec [label="reject", condition="preferred_label=reject"]163+
review_spec -> decompose [label="continue"]164+
165+
decompose -> scaffold166+
167+
scaffold -> validate_pipeline168+
169+
validate_pipeline -> scaffold [label="fail", condition="preferred_label=FAIL"]170+
validate_pipeline -> execute_pipeline [label="pass"]171+
172+
execute_pipeline -> done173+
}