Add the /plan orchestrator prompt for outline steps 0-10, four stub agents (plan-gate, plan-researcher, plan-validator, plan-recorder) and the plan-track skill. Steps 8-10 hand off to the hand-invoked /to-spec and /to-tickets, which the user runs as their approval. /next now offers /plan as a handoff. Bump plan to 0.4.0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
185 lines
7.2 KiB
Markdown
185 lines
7.2 KiB
Markdown
# plan plugin — outline
|
||
|
||
Status: outline, refined in a first grilling round, with a bare-bones MVP built (see "What ships
|
||
today"). This is the maintainer's intent for the plugin.
|
||
|
||
The plugin is set up on its own, separate from `delivery`, and is meant to grow on its own first.
|
||
How the two connect is deliberately left open (see "Open for later").
|
||
|
||
## Purpose
|
||
|
||
Cover picking up a new ticket or idea and turning it into a spec and a ticket breakdown that
|
||
agents further down the chain (planning or implementation) can act on with the least extra
|
||
context gathering.
|
||
|
||
The goal is to optimise:
|
||
|
||
- the ticket creation process;
|
||
- context management and agent instructions for downstream agents, including the context and
|
||
instructions written into issues;
|
||
- reuse of the context that already exists (repo, tracker, docs) and of online sources.
|
||
|
||
## Sources to consult
|
||
|
||
- **The repo and its context**: current practices, rules, functionality, patterns and
|
||
conventions.
|
||
- **The internet and other sources**: tools, documentation, best practices, examples and
|
||
standards.
|
||
|
||
## Tracks
|
||
|
||
The work takes one of two tracks:
|
||
|
||
- **Spec and tickets**: a spec issue in the tracker, broken down into tickets.
|
||
- **Ticket(s) only**: one or more tickets with no spec.
|
||
|
||
The plugin recommends a track, with its reason, after the initial grilling (step 2). The user
|
||
confirms it at agreement (step 6), because the plan can change the size of the work.
|
||
|
||
## Interaction flow
|
||
|
||
0. **Entry.** There are three ways in, and all of them continue at step 1:
|
||
- an existing ticket;
|
||
- a new idea, as free text;
|
||
- a ticket picked through `/next`.
|
||
1. **Gate.** A cheap check before any grilling: is it a duplicate of an open issue or PR, is it
|
||
already done, does it contradict an ADR, or is it outside the repo's scope (`docs/VISION.md`)?
|
||
If any of these is true, stop.
|
||
2. **Initial grilling**, only if required, to explore the ticket's or idea's intention. It ends
|
||
with a recommended track.
|
||
3. **Research** in the repo and online, scoped to the recommended track.
|
||
4. **Deep validation.** Check that the work is feasible and fits the repo as it is now. If it does
|
||
not, go back to grilling (step 2) or stop.
|
||
5. **Offer a plan** with options, considerations, recommendations, impact, expected results and
|
||
the track.
|
||
6. **Agreement.** The user agrees and confirms the track, or the flow goes back to grilling or
|
||
research.
|
||
7. **Record decisions.** Open a docs PR that updates AGENTS.md, GLOSSARY.md, the ADRs and any
|
||
other relevant docs with what was decided. The spec links to it, so tickets point at decisions
|
||
that are already written down rather than pending.
|
||
8. **Write the spec** as an issue in the tracker (Gitea included). This step runs on the spec and
|
||
tickets track only.
|
||
9. **Propose a breakdown** into tickets. If the breakdown shows a gap in the spec, go back to
|
||
step 8.
|
||
10. **Approval and filing.** One explicit approval covers the whole batch. The plugin files the
|
||
tickets and sets `Status/Ready for Agent` on the ones that carry acceptance criteria. A
|
||
ticket without acceptance criteria is never set ready.
|
||
|
||
### Loops
|
||
|
||
The flow is a loop, not a straight line. The named loop-backs are:
|
||
|
||
- research → grilling (step 3 or 4 back to 2);
|
||
- disagreement → grilling or research (step 6 back to 2 or 3);
|
||
- breakdown → spec (step 9 back to 8).
|
||
|
||
After two loops on the same point, the plugin asks whether to park the idea instead of
|
||
circling.
|
||
|
||
### Sequence diagram
|
||
|
||
```mermaid
|
||
sequenceDiagram
|
||
autonumber
|
||
actor U as User
|
||
participant P as plan (orchestrator)
|
||
participant R as Repo<br/>(AGENTS.md, ADRs, VISION, code)
|
||
participant W as Web / docs
|
||
participant T as Tracker (Gitea)
|
||
|
||
%% Step 0 — Entry
|
||
alt existing ticket
|
||
U->>P: ticket #N
|
||
P->>T: read issue
|
||
else new idea
|
||
U->>P: free text
|
||
else via /next
|
||
U->>P: /next [metric]
|
||
P->>T: rank open issues
|
||
P-->>U: ranked list
|
||
U->>P: pick one
|
||
end
|
||
|
||
%% Step 1 — Gate
|
||
P->>T: duplicate open issue/PR? already done?
|
||
P->>R: contradicts an ADR? outside VISION scope?
|
||
opt any gate hit
|
||
P-->>U: stop, with reason
|
||
end
|
||
|
||
%% Steps 2–6 — the discovery loop
|
||
loop until agreed (after 2 loops on one point, offer to park)
|
||
opt intent unclear
|
||
P->>U: grilling questions (step 2)
|
||
U-->>P: answers
|
||
end
|
||
P-->>U: recommended track + reason
|
||
|
||
par Research (step 3), scoped to track
|
||
P->>R: practices, patterns, conventions
|
||
and
|
||
P->>W: tools, docs, standards, examples
|
||
end
|
||
|
||
P->>R: deep validation: feasible, fits repo now? (step 4)
|
||
alt doesn't fit
|
||
P-->>U: back to grilling, or stop
|
||
else fits
|
||
P-->>U: plan: options, impact, results, track (step 5)
|
||
alt user agrees and confirms track (step 6)
|
||
U->>P: agree + track
|
||
else disagreement
|
||
U->>P: back to grilling or research
|
||
end
|
||
end
|
||
end
|
||
|
||
%% Step 7 — Record decisions
|
||
P->>T: open docs PR (AGENTS.md, GLOSSARY, ADRs)
|
||
|
||
%% Steps 8–9 — Spec and breakdown
|
||
loop until breakdown shows no spec gap
|
||
opt track = spec + tickets
|
||
P->>T: write/update spec issue, link docs PR (step 8)
|
||
end
|
||
P-->>U: proposed ticket breakdown (step 9)
|
||
end
|
||
|
||
%% Step 10 — Approval and filing
|
||
U->>P: one approval for the whole batch
|
||
P->>T: file tickets
|
||
P->>T: set Status/Ready for Agent<br/>(only tickets with acceptance criteria)
|
||
P-->>U: links to spec, tickets, docs PR
|
||
```
|
||
|
||
## What ships today
|
||
|
||
- `.apm/prompts/next.prompt.md`: the `/next` command. It ranks open issues by a metric, lets the
|
||
user pick one, validates it and presents a plan. It is read-only. Building happens through
|
||
`/ship`.
|
||
- `.apm/prompts/ship.prompt.md`: the `/ship` command. It executes the plan in context with
|
||
subagents: implement, review with a clean context, push, open a PR, watch CI. **This is
|
||
temporary.** Implementation does not belong in this plugin long term. It ships here so `/next`
|
||
has a working handoff until implementation has a home.
|
||
|
||
- `.apm/prompts/plan.prompt.md`: the `/plan` command, the MVP orchestrator for steps 0–10. It
|
||
dispatches the agents below, grills with `grilling`, and picks the track with `plan-track`.
|
||
Steps 8–10 run upstream's hand-invoked `/to-spec` and `/to-tickets`: `/plan` tells the user to
|
||
type them, and the user running them is the approval.
|
||
- `.apm/agents/`: `plan-gate` (step 1), `plan-researcher` (step 3), `plan-validator` (step 4),
|
||
all read-only, and `plan-recorder` (step 7, the docs PR).
|
||
- `.apm/skills/plan-track/`: the track criteria.
|
||
|
||
All of these are minimal stubs, to be built out.
|
||
|
||
## Open for later
|
||
|
||
- How plan hands off to `delivery`, and how the two plugins relate. Today `delivery` says only a
|
||
human sets `Status/Ready for Agent`, while plan may set it (step 10). When the two meet, one
|
||
of those rules has to change.
|
||
- Templates for the spec and tickets. Plan will own them.
|
||
- How epics are represented and tickets linked (milestones, map issues, dependency edges).
|
||
- Where research output goes: folded into the spec, or kept as findings files.
|
||
- Whether the tracker issue carries the session's state, so planning can be resumed across
|
||
sessions.
|