64 lines
1.7 KiB
Markdown
64 lines
1.7 KiB
Markdown
---
|
|
name: stories
|
|
description: "Generate prd.json and sprint contracts by dispatching the planner agent. Does not write source code."
|
|
---
|
|
|
|
# /plan — Generate PRD and Sprint Contracts
|
|
|
|
Dispatch the planner agent to decompose a spec into stories. The planner agent cannot write source code or run bash commands — it can only write to `.loop/`.
|
|
|
|
## Instructions
|
|
|
|
### 1. Check prerequisites
|
|
|
|
Verify `.loop/config.json` exists. If not, tell the user to run `/agent-loop:init` first and stop.
|
|
|
|
### 2. Find the spec
|
|
|
|
Check these locations:
|
|
- `docs/superpowers/specs/*.md`
|
|
- `docs/specs/*.md`
|
|
- `SPEC.md`, `PRD.md`, `DESIGN.md` at project root
|
|
|
|
If found, read the spec content.
|
|
|
|
If not found, ask: "What do you want to build? 1-3 sentences." Use their answer as the spec.
|
|
|
|
### 3. Read project context
|
|
|
|
Read the project root listing and any key config files (package.json, etc.) to understand the tech stack. Read `.loop/config.json` for the mode.
|
|
|
|
### 4. Dispatch planner agent
|
|
|
|
Use the Agent tool to launch the `agent-loop:planner` agent:
|
|
|
|
```
|
|
Agent(
|
|
subagent_type: "agent-loop:planner",
|
|
prompt: "Generate prd.json and sprint contracts for this project.\n\nMode: {mode}\nProject root: {path}\n\nSpec:\n{spec content}\n\nProject tech stack: {detected stack}",
|
|
description: "Planning: generate stories"
|
|
)
|
|
```
|
|
|
|
### 5. Present results
|
|
|
|
After the planner finishes, read `.loop/prd.json` and show the user:
|
|
|
|
> **Plan Ready — Review Before Running**
|
|
>
|
|
> **Stories:**
|
|
> 1. US-001: {title}
|
|
> 2. US-002: {title}
|
|
> ...
|
|
>
|
|
> **Review:**
|
|
> - `.loop/prd.json` — stories and acceptance criteria
|
|
> - `.loop/contracts/` — done conditions per story
|
|
>
|
|
> Adjust anything, then:
|
|
> ```
|
|
> /agent-loop:run
|
|
> ```
|
|
|
|
**STOP. Do not start the loop. Do not write source code.**
|