Reference
Spell — Plan
At a glance
| Field | Value |
|---|---|
| Invoke as | /spell-plan |
| Argument | Feature or initiative to plan (e.g., "user authentication for a mobile app") |
| Agent | agent |
| When to use | Use PROACTIVELY when a feature description needs to become a PRD before architecture or implementation. |
Executive Summary
- This prompt generates a PRD.md from a feature description or TODO item.
- It follows a structured analysis pattern — requirements, acceptance criteria, and constraints.
- Output feeds directly into
spell-architectas the next phase of the Spell Loop. - See Development Methodology for full Spell Loop reference.
Generate a Product Requirements Document for the described feature or initiative.
Use these files for context:
- governance/development-methodology.md — Spell Loop methodology
- project.md — Project goals and priorities
- DECISIONS.md — Existing ADRs to respect
Workflow:
-
Configure tracking mode first — decide how this work will be tracked before requirement intake:
tracking_mode: internal | externalexternal_provider: ado | github | jira | other
Resolve in this order, matching spell-open-session's own resolution chain (EF-14): root
.arcane.json(if present) → the committed self-hosted source manifest (src/assets/.arcane.json, read only when it declaresselfHosted: true) → the current feature PRD frontmatter → ask. Do not re-ask when any of the first three sources already sets it.Rules:
- If not explicitly set and ADO context is already present (work item ID + org/project), default to
tracking_mode: external,external_provider: adofor backward compatibility. - If none of the three sources above set it and no ADO context exists, ask: "Track work in this repo (TODO.md / PRDs)" [internal] vs "Track work in an external tracker (Azure DevOps / GitHub / Jira / other)" [external].
- If
tracking_mode=internal, do not require an external tracker ID. - If
tracking_mode=externalandexternal_provider=ado, collect org/project and resolve process template + available work item types before planning:
Then enforce level-to-type mapping using the first available type in order:az devops project show --org https://dev.azure.com/{org} --project {project} --query "capabilities.processTemplate.templateName" --output tsv az boards work-item-type list --org https://dev.azure.com/{org} --project {project} --output json --query "[].name"- Epic-level:
Epic → Feature → User Story → Issue - Feature-level:
Feature → User Story → Issue - Story-level:
User Story → Issue → Task - Task-level:
Task → Issue - Defect-level:
Bug → Issue → Task
- Epic-level:
- If
tracking_mode=externalandexternal_provider=github, collect the repo ({owner}/{repo}, resolve fromgit remote get-url origin; ask if ambiguous) and, if the PRD's scope is known to need one, an existing issue number. GitHub Issues has no configurable work-item-type hierarchy the way ADO does — see governance/development-methodology.md → GitHub Issues Conventions for the labels-and-task-list substitute. - If
external_provider=jiraorother, record as TODO and continue with internal artifacts unless the operator provides explicit provider workflow steps.
-
Gather requirements — accept input from any of these sources:
Source Format How to fetch Description in prompt Inline text Use as-is ADO work item ID (external/ado mode) #507or507with org nameRun: az boards work-item show --id {id} --org https://dev.azure.com/{org} --output jsonand extractSystem.Description,Microsoft.VSTS.Common.AcceptanceCriteria, andSystem.TitleGitHub issue number (external/github mode) #42or42Run: gh issue view {id} --json title,body,labelsand extracttitleandbodyas the feature descriptionFile path Path to existing doc Read the file If the input is an ADO work item ID or a GitHub issue number, fetch its content first, then use it as the feature description. If it has child work items (ADO) or a task-list of related issues (GitHub — see governance's GitHub Issues Conventions), fetch those too for additional context.
Ask clarifying questions if the feature description is ambiguous. You need to understand:
- What problem does this solve?
- Who is the user/audience?
- What business does this belong to?
- Are there existing ADRs or constraints?
- If
tracking_mode=externalandexternal_provider=ado: What is the ADO work item ID? — required before proceeding in ADO mode. Store it asadoWorkItemIdin PRD frontmatter so it flows tospell-architectandstories.json. - If
tracking_mode=externalandexternal_provider=github: What is the GitHub issue number, if one already exists? — optional (unlike ADO, a PRD doesn't require a pre-existing issue); store it asgithubIssueIdin PRD frontmatter when known.
-
Research context — check the relevant business docs under
{BUSINESS_ROOT}/(resolve from.arcane.json'sbusiness_rootfield, defaultventures/if unset) and any existing code repos. -
Generate PRD.md with these sections:
# PRD: [Feature Name] --- tracking: tracking_mode: [internal|external] external_provider: [ado|github|jira|other|null] adoWorkItemId: [number|null] githubIssueId: [number|null] --- ## Problem Statement [What problem are we solving? Why now?] ## Target Users [Who benefits? Which business?] ## Requirements ### Must Have - [Requirement with acceptance criteria] ### Should Have - [Requirement with acceptance criteria] ### Won't Have (this iteration) - [Explicitly excluded scope] ## Constraints - [Technical: frameworks, platforms, existing architecture] - [Business: budget, timeline, dependencies] - [Security: per threat model] ## Acceptance Criteria - [ ] [Testable criterion 1] - [ ] [Testable criterion 2] ## Dependencies - [Other features, services, or decisions needed] ## Open Questions - [Unresolved items that need human decision]Include an example config snippet when presenting the draft:
tracking: tracking_mode: external external_provider: ado adoWorkItemId: 541 -
Validate against existing ADRs — ensure the PRD doesn't contradict established decisions.
5a. Check acceptance criteria against Won't Have. Read each acceptance criterion against the PRD's own Won't Have (this iteration) list. Flag any criterion that can only hold if a Won't Have item is done: ⚠ AC conflicts with Won't Have: "<criterion>" needs "<Won't Have item>". Resolve every flag before saving: rewrite the criterion so the excluded work is not needed, move the item out of Won't Have, or record the conflict under Open Questions. A conflict that reaches implementation can only be resolved by disclosure, after the work is built.
-
Save to disk — derive the feature folder from the tracking configuration and slugified feature name, then write the PRD:
# external/ado example: adoWorkItemId=541, feature name="Phase 2A" → slug="phase-2a" # FEATURE_DIR="features/{adoWorkItemId}-{slug}" # external/github example: githubIssueId=42, feature name="Phase 2A" → slug="phase-2a" # FEATURE_DIR="features/{githubIssueId}-{slug}" # internal or a provider without a known issue ID: # FEATURE_DIR="features/{slug}" mkdir -p "$FEATURE_DIR" # Write PRD.md to the feature folderSave the generated PRD.md using:
features/{adoWorkItemId}-{slug}/PRD.mdwhentracking_mode=externalandexternal_provider=adofeatures/{githubIssueId}-{slug}/PRD.mdwhentracking_mode=external,external_provider=github, and agithubIssueIdis knownfeatures/{slug}/PRD.mdotherwise (internal mode, or an external provider without a known issue ID) Confirm the resolved path to the user.
-
Present for review — show the PRD to the user for approval before proceeding to
spell-architect.Action required — what only the operator can do. When this run leaves an action that only the operator can take, report it in one block at the very top of the final report, before every other section and before any optional next step. The block exists because these are the operator's decisions to make, not because the agent is stuck: write it as a hand-off of authority, never as a plea for help. Frame it with a horizontal rule above and below, so it stands apart in a terminal as well as on a rendered page:
--- ## 🚧 Action required **Now** - <exactly what to do: the command, the link, or the question> — <why only the operator can do it> **When you're at your desk** - <exactly what to do> — <why only the operator can do it> ---- What belongs in it: an action only the operator can take — approving or merging a pull request, accepting a decision record, answering a question the work is waiting on, confirming a
guardedpush, running an interactive command such asspell unblock-push, or a step on an external platform the agent cannot reach. An optional suggestion, a next spell to run, or anything the agent could do itself is not a required action and stays out of the block. - Two tiers, one block. Now holds what the work is not correct or complete without. When you're at your desk holds what only the operator can do but that can wait: a permission rule, a leftover remote branch, a credential to set up. Leave out a tier that has nothing in it; never split the tiers into two blocks.
- One line per action. Say exactly what to do, then, after the dash, why only the operator can do it. Write the command, link or question out in full; never point elsewhere with "see above".
- Never only among optional steps. An action required for correctness is never listed only under next steps, suggestions,
Carry ForwardorWhat's Next?. It may be repeated there, but it always appears in this block. - Done items stay, struck through. Within one session, once an item has been listed, keep it in every later report of the block; when the operator has done it, strike it through (
~~<the line>~~) rather than dropping it, so progress shows and nothing disappears silently. The session's close carries only the open items forward. - Omit it when empty. When nothing is left for the operator and nothing was struck through this session, leave the block out entirely: no heading, no rules and no "None" line.
- Every final report. The block belongs in whatever report ends the run, including a report written when the spell stops early.
- Report the Now tier to the presence channel. When the Now tier has open items, also run
spell presence report --status waiting --required-action "<line 1>" --required-action "<line 2>", one flag per open line of that tier; the other tier is not blocking and is not reported. With no presence channel configured on this machine the command prints nothing and exits 0, so the block itself and the rest of the run are unchanged. - Enforcement: explicitly advisory prose (ARC-023) — no check reads a spell's actual output for this block; it holds by these instructions alone.
- What belongs in it: an action only the operator can take — approving or merging a pull request, accepting a decision record, answering a question the work is waiting on, confirming a
-
Provider TODO handling — if
external_provider=jiraorexternal_provider=other, add a TODO note in PRD open questions that provider-specific automation/linking is pending.githubdoes not need this — it has a real, working flow (Step 1 above).
Rules:
- Every requirement must have at least one testable acceptance criterion.
- Scope must be small enough for one sprint (1-2 weeks of agent work).
- If the scope is too large, recommend splitting into multiple PRDs.
- Flag any requirements that would need a new ADR decision.