feat: bash setup script, planner agent with disallowedTools, simplified skills
This commit is contained in:
@@ -1,154 +1,63 @@
|
||||
---
|
||||
name: plan
|
||||
description: "Generate prd.json and sprint contracts from a spec or feature description. Requires .loop/ directory. Does NOT write source code or start the loop."
|
||||
description: "Generate prd.json and sprint contracts by dispatching the planner agent. Does not write source code."
|
||||
---
|
||||
|
||||
# /plan — Generate PRD and Sprint Contracts
|
||||
|
||||
Read a spec or feature description, decompose it into stories, and write `.loop/prd.json` and `.loop/contracts/`. This skill does NOT write any project source code or start the loop.
|
||||
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/`.
|
||||
|
||||
## STOP: What This Skill Does NOT Do
|
||||
## Instructions
|
||||
|
||||
- Does NOT write any project source code (no .js, .py, .ts, .html, .css, etc.)
|
||||
- Does NOT start the loop or invoke /agent-loop:run
|
||||
- Does NOT make git commits to project code
|
||||
### 1. Check prerequisites
|
||||
|
||||
## Prerequisites
|
||||
Verify `.loop/config.json` exists. If not, tell the user to run `/agent-loop:init` first and stop.
|
||||
|
||||
`.loop/config.json` must exist. If not, tell the user to run `/agent-loop:init` first and stop.
|
||||
### 2. Find the spec
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Find the feature spec or description
|
||||
|
||||
Check these locations for an existing spec:
|
||||
Check these locations:
|
||||
- `docs/superpowers/specs/*.md`
|
||||
- `docs/specs/*.md`
|
||||
- `SPEC.md`, `PRD.md`, `DESIGN.md` at project root
|
||||
|
||||
If found: "I found a spec at `{path}`. Using it."
|
||||
If found, read the spec content.
|
||||
|
||||
If not found, check if the user passed a description as an argument. If nothing: ask "What do you want to build? 1-3 sentences."
|
||||
If not found, ask: "What do you want to build? 1-3 sentences." Use their answer as the spec.
|
||||
|
||||
### 2. Analyze the project
|
||||
### 3. Read project context
|
||||
|
||||
- Read relevant source directories
|
||||
- Check for existing tests and conventions
|
||||
- Run `git log --oneline -20` if git history exists
|
||||
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.
|
||||
|
||||
### 3. Ask 2-3 clarifying questions
|
||||
### 4. Dispatch planner agent
|
||||
|
||||
Only questions where human judgment is needed. Do NOT ask what you can answer from the code or spec.
|
||||
Use the Agent tool to launch the `agent-loop:planner` agent:
|
||||
|
||||
### 4. Generate prd.json
|
||||
|
||||
**CRITICAL: Use this EXACT schema. The loop orchestrator will break if you deviate.**
|
||||
|
||||
Write `.loop/prd.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"project": "<project name>",
|
||||
"branchName": "loop/<feature-slug>",
|
||||
"description": "<one-line description>",
|
||||
"userStories": [
|
||||
{
|
||||
"id": "US-001",
|
||||
"title": "Short descriptive title",
|
||||
"description": "What this story delivers",
|
||||
"acceptanceCriteria": [
|
||||
"Specific, verifiable criterion",
|
||||
"Another criterion"
|
||||
],
|
||||
"priority": 1,
|
||||
"passes": false,
|
||||
"notes": "",
|
||||
"rejections": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
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"
|
||||
)
|
||||
```
|
||||
|
||||
**Rules:**
|
||||
- Top-level array key MUST be `userStories`. Not `sprints`, `stories`, or `tasks`.
|
||||
- IDs: `US-001`, `US-002`, etc.
|
||||
- `passes`: always `false`. `notes`: always `""`. `rejections`: always `0`.
|
||||
- Each priority is unique (1 = highest).
|
||||
- Each story fits in one agent context window (1-3 files changed).
|
||||
- Acceptance criteria must be independently verifiable — not "works well" but "returns X when given Y".
|
||||
### 5. Present results
|
||||
|
||||
### 5. Generate sprint contracts
|
||||
|
||||
Create `.loop/contracts/` directory. For each story, write `.loop/contracts/{id}.contract.md`:
|
||||
|
||||
```markdown
|
||||
# Sprint Contract: {id} — {title}
|
||||
|
||||
## What Will Be Built
|
||||
Concrete deliverable description.
|
||||
|
||||
## Done Conditions
|
||||
- [ ] Specific testable condition
|
||||
- [ ] All acceptance criteria from prd.json met
|
||||
|
||||
## Evaluation Criteria
|
||||
- [ ] What the evaluator checks
|
||||
- [ ] No regressions
|
||||
|
||||
## Out of Scope
|
||||
- Things NOT in this story
|
||||
|
||||
## Key Files
|
||||
- path/to/file — what changes
|
||||
|
||||
## Dependencies
|
||||
- Depends on: [IDs or "none"]
|
||||
- Blocks: [IDs or "none"]
|
||||
```
|
||||
|
||||
### 6. Initialize progress.md
|
||||
|
||||
Write `.loop/progress.md`:
|
||||
|
||||
```markdown
|
||||
# Progress
|
||||
|
||||
## Codebase Patterns
|
||||
|
||||
- [Patterns from analysis]
|
||||
|
||||
---
|
||||
|
||||
## Session Log
|
||||
|
||||
### Planning Session
|
||||
Date: {today}
|
||||
|
||||
**PRD created:** {N} stories for "{description}"
|
||||
|
||||
---
|
||||
```
|
||||
|
||||
### 7. Present for review
|
||||
After the planner finishes, read `.loop/prd.json` and show the user:
|
||||
|
||||
> **Plan Ready — Review Before Running**
|
||||
>
|
||||
> | Stories | Mode | Branch |
|
||||
> |---------|------|--------|
|
||||
> | {N} | {mode} | {branchName} |
|
||||
>
|
||||
> **Stories:**
|
||||
> 1. US-001: {title}
|
||||
> 2. US-002: {title}
|
||||
> ...
|
||||
>
|
||||
> **Review before running:**
|
||||
> **Review:**
|
||||
> - `.loop/prd.json` — stories and acceptance criteria
|
||||
> - `.loop/contracts/` — done conditions per story
|
||||
>
|
||||
> When ready:
|
||||
> Adjust anything, then:
|
||||
> ```
|
||||
> /agent-loop:run
|
||||
> ```
|
||||
|
||||
**STOP HERE. Do NOT start the loop. Wait for the user to run /agent-loop:run explicitly.**
|
||||
**STOP. Do not start the loop. Do not write source code.**
|
||||
|
||||
Reference in New Issue
Block a user