arcane-cli 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +253 -0
- package/dist/assets/.arcane/agents/agent-policies-template.md +414 -0
- package/dist/assets/.arcane/governance/agent-approved-paths.md +60 -0
- package/dist/assets/.arcane/governance/agent-policies.md +414 -0
- package/dist/assets/.arcane/governance/agent-work-queue-model.md +61 -0
- package/dist/assets/.arcane/governance/authentication-strategy.md +220 -0
- package/dist/assets/.arcane/governance/cicd-standards.md +227 -0
- package/dist/assets/.arcane/governance/decision-documentation-standard.md +335 -0
- package/dist/assets/.arcane/governance/development-methodology.md +384 -0
- package/dist/assets/.arcane/governance/git-conventions.md +759 -0
- package/dist/assets/.arcane/governance/hardening-checklist.md +117 -0
- package/dist/assets/.arcane/governance/naming-conventions.md +142 -0
- package/dist/assets/.arcane/governance/new-business-setup.md +182 -0
- package/dist/assets/.arcane/governance/poc-management-pattern.md +190 -0
- package/dist/assets/.arcane/governance/portable-bootstrap.md +101 -0
- package/dist/assets/.arcane/governance/product-excellence-standards.md +211 -0
- package/dist/assets/.arcane/governance/rca-process-standard.md +157 -0
- package/dist/assets/.arcane/governance/spell-authoring-standards.md +129 -0
- package/dist/assets/.arcane/governance/testing-standards.md +158 -0
- package/dist/assets/.arcane/governance/threat-model.md +104 -0
- package/dist/assets/.arcane/governance/universal-agent-rules.md +108 -0
- package/dist/assets/.arcane/image-prompts/adelaide-image-prompt.md +140 -0
- package/dist/assets/.arcane/image-prompts/alexander-image-prompt.md +138 -0
- package/dist/assets/.arcane/image-prompts/bess-image-prompt.md +139 -0
- package/dist/assets/.arcane/image-prompts/circe-image-prompt.md +143 -0
- package/dist/assets/.arcane/image-prompts/custodio-image-prompt.md +140 -0
- package/dist/assets/.arcane/image-prompts/iris-image-prompt.md +139 -0
- package/dist/assets/.arcane/image-prompts/kellar-image-prompt.md +141 -0
- package/dist/assets/.arcane/image-prompts/lafayette-image-prompt.md +140 -0
- package/dist/assets/.arcane/image-prompts/lince-image-prompt.md +142 -0
- package/dist/assets/.arcane/image-prompts/mercurio-image-prompt.md +140 -0
- package/dist/assets/.arcane/image-prompts/merlin-image-prompt.md +139 -0
- package/dist/assets/.arcane/image-prompts/prospero-image-prompt.md +141 -0
- package/dist/assets/.arcane/templates/venture-template/overview.md +66 -0
- package/dist/assets/.claude/commands/spell-address-review.md +9 -0
- package/dist/assets/.claude/commands/spell-arcane-version.md +9 -0
- package/dist/assets/.claude/commands/spell-architect.md +9 -0
- package/dist/assets/.claude/commands/spell-bootstrap-business.md +9 -0
- package/dist/assets/.claude/commands/spell-brainstorm.md +9 -0
- package/dist/assets/.claude/commands/spell-bug.md +9 -0
- package/dist/assets/.claude/commands/spell-bump.md +9 -0
- package/dist/assets/.claude/commands/spell-check-drift.md +9 -0
- package/dist/assets/.claude/commands/spell-close-session.md +9 -0
- package/dist/assets/.claude/commands/spell-commit-work.md +9 -0
- package/dist/assets/.claude/commands/spell-create-pull-request.md +9 -0
- package/dist/assets/.claude/commands/spell-document.md +9 -0
- package/dist/assets/.claude/commands/spell-dotnet-expert.md +9 -0
- package/dist/assets/.claude/commands/spell-eas-ios-deploy.md +9 -0
- package/dist/assets/.claude/commands/spell-enchant.md +9 -0
- package/dist/assets/.claude/commands/spell-explain-concept.md +9 -0
- package/dist/assets/.claude/commands/spell-feedback.md +9 -0
- package/dist/assets/.claude/commands/spell-full-cycle.md +9 -0
- package/dist/assets/.claude/commands/spell-generate-bot-icons.md +9 -0
- package/dist/assets/.claude/commands/spell-implement.md +9 -0
- package/dist/assets/.claude/commands/spell-open-session.md +9 -0
- package/dist/assets/.claude/commands/spell-plan.md +9 -0
- package/dist/assets/.claude/commands/spell-present-arcane.md +9 -0
- package/dist/assets/.claude/commands/spell-product-review.md +9 -0
- package/dist/assets/.claude/commands/spell-review-batch.md +9 -0
- package/dist/assets/.claude/commands/spell-review.md +9 -0
- package/dist/assets/.claude/commands/spell-save-idea.md +9 -0
- package/dist/assets/.claude/commands/spell-scope.md +9 -0
- package/dist/assets/.claude/commands/spell-security-review.md +9 -0
- package/dist/assets/.claude/commands/spell-ship.md +9 -0
- package/dist/assets/.claude/commands/spell-status.md +9 -0
- package/dist/assets/.claude/commands/spell-suggest-feature.md +9 -0
- package/dist/assets/.claude/commands/spell-test.md +9 -0
- package/dist/assets/.claude/commands/spell-todo.md +9 -0
- package/dist/assets/.github/agents/adelaide.agent.md +44 -0
- package/dist/assets/.github/agents/alexander.agent.md +43 -0
- package/dist/assets/.github/agents/bess.agent.md +42 -0
- package/dist/assets/.github/agents/circe.agent.md +43 -0
- package/dist/assets/.github/agents/custodio.agent.md +44 -0
- package/dist/assets/.github/agents/iris.agent.md +43 -0
- package/dist/assets/.github/agents/kellar.agent.md +43 -0
- package/dist/assets/.github/agents/lafayette.agent.md +42 -0
- package/dist/assets/.github/agents/lince.agent.md +43 -0
- package/dist/assets/.github/agents/mercurio.agent.md +43 -0
- package/dist/assets/.github/agents/merlin.agent.md +44 -0
- package/dist/assets/.github/agents/prospero.agent.md +43 -0
- package/dist/assets/.github/instructions/agent-output.instructions.md +48 -0
- package/dist/assets/.github/prompts/spell-address-review.prompt.md +114 -0
- package/dist/assets/.github/prompts/spell-arcane-version.prompt.md +82 -0
- package/dist/assets/.github/prompts/spell-architect.prompt.md +116 -0
- package/dist/assets/.github/prompts/spell-bootstrap-business.prompt.md +73 -0
- package/dist/assets/.github/prompts/spell-brainstorm.prompt.md +124 -0
- package/dist/assets/.github/prompts/spell-bug.prompt.md +109 -0
- package/dist/assets/.github/prompts/spell-bump.prompt.md +73 -0
- package/dist/assets/.github/prompts/spell-check-drift.prompt.md +97 -0
- package/dist/assets/.github/prompts/spell-close-session.prompt.md +189 -0
- package/dist/assets/.github/prompts/spell-commit-work.prompt.md +211 -0
- package/dist/assets/.github/prompts/spell-create-pull-request.prompt.md +170 -0
- package/dist/assets/.github/prompts/spell-document.prompt.md +83 -0
- package/dist/assets/.github/prompts/spell-dotnet-expert.prompt.md +117 -0
- package/dist/assets/.github/prompts/spell-eas-ios-deploy.prompt.md +183 -0
- package/dist/assets/.github/prompts/spell-enchant.prompt.md +385 -0
- package/dist/assets/.github/prompts/spell-explain-concept.prompt.md +69 -0
- package/dist/assets/.github/prompts/spell-feedback.prompt.md +113 -0
- package/dist/assets/.github/prompts/spell-full-cycle.prompt.md +201 -0
- package/dist/assets/.github/prompts/spell-generate-bot-icons.prompt.md +84 -0
- package/dist/assets/.github/prompts/spell-implement.prompt.md +101 -0
- package/dist/assets/.github/prompts/spell-open-session.prompt.md +116 -0
- package/dist/assets/.github/prompts/spell-plan.prompt.md +145 -0
- package/dist/assets/.github/prompts/spell-present-arcane.prompt.md +188 -0
- package/dist/assets/.github/prompts/spell-product-review.prompt.md +97 -0
- package/dist/assets/.github/prompts/spell-review-batch.prompt.md +94 -0
- package/dist/assets/.github/prompts/spell-review.prompt.md +131 -0
- package/dist/assets/.github/prompts/spell-save-idea.prompt.md +83 -0
- package/dist/assets/.github/prompts/spell-scope.prompt.md +263 -0
- package/dist/assets/.github/prompts/spell-security-review.prompt.md +129 -0
- package/dist/assets/.github/prompts/spell-ship.prompt.md +104 -0
- package/dist/assets/.github/prompts/spell-status.prompt.md +85 -0
- package/dist/assets/.github/prompts/spell-suggest-feature.prompt.md +110 -0
- package/dist/assets/.github/prompts/spell-test.prompt.md +87 -0
- package/dist/assets/.github/prompts/spell-todo.prompt.md +126 -0
- package/dist/assets/DECISIONS.md +19 -0
- package/dist/assets/TODO.md +7 -0
- package/dist/assets/agents/architecture-lead.yaml +61 -0
- package/dist/assets/agents/collaborator.yaml +59 -0
- package/dist/assets/agents/devops.yaml +60 -0
- package/dist/assets/agents/frontend-dev.yaml +60 -0
- package/dist/assets/agents/fullstack-dev.yaml +59 -0
- package/dist/assets/agents/marketing-strategist.yaml +60 -0
- package/dist/assets/agents/mobile-dev.yaml +59 -0
- package/dist/assets/agents/operations-comms.yaml +58 -0
- package/dist/assets/agents/orchestrator.yaml +60 -0
- package/dist/assets/agents/qa-lead.yaml +60 -0
- package/dist/assets/agents/research-analyst.yaml +59 -0
- package/dist/assets/agents/security-ops.yaml +61 -0
- package/dist/assets/ai-context/system-prompt-context.md +32 -0
- package/dist/assets/journal/.gitkeep +0 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +2313 -0
- package/dist/index.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Spell — Full Cycle
|
|
3
|
+
description: End-to-end autonomous Spell Loop — chains plan, architect, implement, test, review, and ship into a single invocation with one human approval gate at merge time
|
|
4
|
+
argument-hint: "Feature description, optional work item ID, target repo (e.g., 'Add user auth to the mobile app, #507, {REPO_ORG}/{REPO_NAME}')"
|
|
5
|
+
agent: agent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Executive Summary
|
|
9
|
+
|
|
10
|
+
- This prompt chains all Spell Loop phases into a single autonomous pipeline.
|
|
11
|
+
- Includes optional PRD enchantment (spell-enchant) between Plan and Architect for quality enhancement.
|
|
12
|
+
- Only one human touchpoint: approving the PR at ship time.
|
|
13
|
+
- Delegates each phase to the appropriate specialized agent role (research, architecture, build, QA, marketing review). Resolve concrete personas from [agent-policies](../../governance/agent-policies.md) / [naming-conventions](../../governance/naming-conventions.md); if neither is present, proceed with role names directly.
|
|
14
|
+
- If any phase fails, the pipeline halts and reports the blocker — no silent failures.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
Run the complete Spell Loop end-to-end for the described feature.
|
|
19
|
+
|
|
20
|
+
Use these files for context:
|
|
21
|
+
|
|
22
|
+
- [governance/development-methodology.md](../../governance/development-methodology.md) — Spell Loop methodology and stories.json format
|
|
23
|
+
- [governance/testing-standards.md](../../governance/testing-standards.md) — Testing frameworks and coverage requirements
|
|
24
|
+
- [governance/cicd-standards.md](../../governance/cicd-standards.md) — CI/CD pipeline and deployment gates
|
|
25
|
+
- [governance/git-conventions.md](../../governance/git-conventions.md) — Branch discipline and commit format
|
|
26
|
+
- [project.md](../../project.md) — Project goals and priorities
|
|
27
|
+
- [DECISIONS.md](../../DECISIONS.md) — Existing ADRs to respect
|
|
28
|
+
- [governance/product-excellence-standards.md](../../governance/product-excellence-standards.md) — PRD Quality Scorecard for enchantment
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Required Inputs
|
|
33
|
+
|
|
34
|
+
Before proceeding, confirm you have all three:
|
|
35
|
+
|
|
36
|
+
1. **Feature description** — what to build and why. Accepted formats:
|
|
37
|
+
- Inline text in the prompt
|
|
38
|
+
- Path to a PRD file (e.g., `PRD.md`)
|
|
39
|
+
- **Tracker work item ID** (e.g., `#507`) in `external` mode — fetch it using the detected provider's CLI/API. For an ADO provider, fetch via `az boards work-item show --id {id} --org https://dev.azure.com/{ADO_ORG} --output json` and extract `System.Title`, `System.Description`, and `Microsoft.VSTS.Common.AcceptanceCriteria`; for other providers, fetch the title, description, and acceptance criteria via that provider's equivalent. If the work item has child items, fetch those too. `{ADO_ORG}` resolves from `.arcane.json` or the PRD/feature frontmatter; ask if unset.
|
|
40
|
+
2. **Tracking configuration** — required before execution:
|
|
41
|
+
- `tracking_mode: internal | external`
|
|
42
|
+
- `external_provider: ado | jira | other` (required when `tracking_mode=external`)
|
|
43
|
+
- If omitted and an ADO context is already present, default to `external` + `ado` (backward compatibility).
|
|
44
|
+
- If `tracking_mode=external` and `external_provider=ado`, an `adoWorkItemId` is required for commit/PR linkage.
|
|
45
|
+
- In ADO mode, resolve available work item types and apply process-template-aware fallback mapping from `governance/development-methodology.md` before creating/linking hierarchy items.
|
|
46
|
+
3. **Target repo** — which repository and org (e.g., `{REPO_ORG}/{REPO_NAME}`). `{REPO_ORG}`/`{REPO_NAME}` resolve from `.arcane.json` or the PRD/feature frontmatter; if not provided, infer from context or ask.
|
|
47
|
+
|
|
48
|
+
If `external_provider=jira` or `external_provider=other`, record TODO notes for provider-specific automation and continue with internal artifact flow unless explicit provider commands are supplied.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Pipeline Phases
|
|
53
|
+
|
|
54
|
+
### Phase 1 — Plan
|
|
55
|
+
|
|
56
|
+
Execute the `spell-plan` workflow:
|
|
57
|
+
|
|
58
|
+
1. Gather requirements from the feature description.
|
|
59
|
+
2. Check existing ADRs and business docs for constraints.
|
|
60
|
+
3. Produce `PRD.md` with requirements, acceptance criteria, constraints, and tracking configuration (`tracking_mode`, optional `external_provider`, optional `adoWorkItemId`).
|
|
61
|
+
4. **Gate:** Validate every requirement has at least one testable acceptance criterion. If scope is too large for one sprint, halt and recommend splitting.
|
|
62
|
+
|
|
63
|
+
Store the PRD in the working directory. Proceed automatically to Phase 1.5.
|
|
64
|
+
|
|
65
|
+
### Phase 1.5 — Enchant (Optional)
|
|
66
|
+
|
|
67
|
+
Run a quick quality audit of the PRD against the scorecard in `governance/product-excellence-standards.md`. Score each dimension as Bronze / Silver / Gold.
|
|
68
|
+
|
|
69
|
+
**Decision logic:**
|
|
70
|
+
- If the user specified `--enchant` or explicitly requested enchantment: run `spell-enchant` workflow fully.
|
|
71
|
+
- If any dimension scores Bronze: recommend enchantment, but proceed without it if the user hasn't requested it.
|
|
72
|
+
- If all dimensions score Silver or above: skip enchantment and proceed to Phase 2.
|
|
73
|
+
|
|
74
|
+
When running enchantment:
|
|
75
|
+
1. Conduct the research role's analysis (competitive analysis, UX patterns, accessibility audit).
|
|
76
|
+
2. Conduct the marketing-review role's pass (first impressions, brand alignment, onboarding).
|
|
77
|
+
3. Generate enhancement suggestions (Must-Add / Should-Add / Could-Add / Won't-Add).
|
|
78
|
+
4. Check scope budget — if enchanted scope exceeds 2× original, flag prominently.
|
|
79
|
+
5. Produce the enhanced PRD, preserving all original requirements and tagging additions with `[ENCHANTED]`.
|
|
80
|
+
6. Replace the working PRD with the enchanted version.
|
|
81
|
+
|
|
82
|
+
**Gate:** If scope budget exceeds 2× and the user hasn't pre-approved, halt and ask for confirmation before proceeding.
|
|
83
|
+
|
|
84
|
+
Proceed automatically to Phase 2.
|
|
85
|
+
|
|
86
|
+
### Phase 2 — Architect
|
|
87
|
+
|
|
88
|
+
Execute the `spell-architect` workflow:
|
|
89
|
+
|
|
90
|
+
1. Read the PRD from Phase 1.
|
|
91
|
+
2. Make architecture decisions (framework, patterns, component structure).
|
|
92
|
+
3. Produce `architecture.md` with decisions, component diagram, and testing strategy.
|
|
93
|
+
4. Produce `stories.json` with the full schema:
|
|
94
|
+
- Top-level: `feature`, `branchName`, `assignedAgent`, `trackingMode`, optional `externalProvider`, optional `adoWorkItemId`
|
|
95
|
+
- Per story: `id`, `title`, `description`, `acceptanceCriteria`, `priority`, `passes: false`, `assignedTo`, `testEvidence: null`
|
|
96
|
+
5. **Gate:** Self-validate `stories.json` schema completeness. If any required field is missing, regenerate before proceeding. Every PRD requirement must map to at least one story. No story may depend on an unresolved Open Question.
|
|
97
|
+
|
|
98
|
+
Proceed automatically to Phase 3.
|
|
99
|
+
|
|
100
|
+
### Phase 3 — Implement (Autonomous Loop)
|
|
101
|
+
|
|
102
|
+
Execute the `spell-implement` workflow:
|
|
103
|
+
|
|
104
|
+
0. **Sync workspace** — before any code changes, ensure the workspace is current:
|
|
105
|
+
```bash
|
|
106
|
+
git fetch --prune origin
|
|
107
|
+
git checkout main && git pull --ff-only
|
|
108
|
+
```
|
|
109
|
+
If `pull --ff-only` fails, halt and report — manual rebase is needed.
|
|
110
|
+
1. Create the topic branch from `stories.json.branchName` (format: `{agent}/type/description`).
|
|
111
|
+
2. Loop:
|
|
112
|
+
a. Pick the next story where `passes: false`, ordered by priority.
|
|
113
|
+
b. Implement the story — minimum code to satisfy acceptance criteria.
|
|
114
|
+
c. Write tests per `governance/testing-standards.md`.
|
|
115
|
+
d. Run tests. If passing:
|
|
116
|
+
- In `external/ado` mode, commit with `#{adoWorkItemId} type(scope): description` and agent attribution trailers (`Agent`, `Model`, `Provider`).
|
|
117
|
+
- In `internal` mode, commit with standard Conventional Commits format (no ADO prefix) plus attribution trailers.
|
|
118
|
+
e. Update `stories.json`: set `passes: true`, fill `testEvidence`.
|
|
119
|
+
f. Append learnings to `progress.txt`.
|
|
120
|
+
g. Repeat until all stories pass or a story fails 3 consecutive attempts.
|
|
121
|
+
3. **Gate:** If any story is stuck after 3 attempts, halt the pipeline and report the blocker with error details. Do not proceed to Phase 4 with failing stories.
|
|
122
|
+
|
|
123
|
+
Proceed automatically to Phase 4.
|
|
124
|
+
|
|
125
|
+
### Phase 4 — Test
|
|
126
|
+
|
|
127
|
+
Execute the `spell-test` workflow:
|
|
128
|
+
|
|
129
|
+
1. Run the full test suite (not just per-story — full regression).
|
|
130
|
+
2. Validate coverage: 80% line minimum, 95% critical path.
|
|
131
|
+
3. Map each acceptance criterion from the PRD to a specific passing test.
|
|
132
|
+
4. Update `stories.json` with consolidated test evidence.
|
|
133
|
+
5. **Gate:** If coverage is below threshold or any acceptance criterion lacks a test, loop back to Phase 3 to add missing tests. Maximum 2 coverage-fix loops before halting.
|
|
134
|
+
|
|
135
|
+
Proceed automatically to Phase 5.
|
|
136
|
+
|
|
137
|
+
### Phase 5 — Review (Adversarial)
|
|
138
|
+
|
|
139
|
+
Execute the `spell-review` workflow:
|
|
140
|
+
|
|
141
|
+
1. Review the full diff (`git diff main...HEAD`).
|
|
142
|
+
2. Check architecture compliance against `architecture.md`.
|
|
143
|
+
3. Check for OWASP Top 10 security issues.
|
|
144
|
+
4. Find a minimum of 3 issues or justify why fewer exist.
|
|
145
|
+
5. Classify findings: HIGH / MEDIUM / LOW.
|
|
146
|
+
6. **Gate:** If any HIGH severity finding exists, loop back to Phase 3 to fix it. MEDIUM and LOW findings are noted in the ship report but do not block. Maximum 2 review-fix loops before halting.
|
|
147
|
+
|
|
148
|
+
Proceed automatically to Phase 6.
|
|
149
|
+
|
|
150
|
+
### Phase 6 — Ship
|
|
151
|
+
|
|
152
|
+
Execute the `spell-ship` workflow:
|
|
153
|
+
|
|
154
|
+
1. Verify all prior phases passed (PRD, architecture, all stories, tests, review).
|
|
155
|
+
2. Run pre-deploy checklist:
|
|
156
|
+
- No merge conflicts with target branch.
|
|
157
|
+
- No secrets or credentials in the diff.
|
|
158
|
+
- DECISIONS.md updated if new ADRs were created.
|
|
159
|
+
- Documentation updated for user-facing changes.
|
|
160
|
+
3. Generate the ship report (phase status table, test evidence, review findings, recommendation).
|
|
161
|
+
4. Create the PR:
|
|
162
|
+
- `external/ado` mode: `az repos pr create --repository {repo} --source-branch {branch} --target-branch main --title "{feature}" --work-items {adoWorkItemId}`
|
|
163
|
+
- `internal` mode (or provider TODO mode): create PR without `--work-items`.
|
|
164
|
+
5. **HUMAN GATE:** Present the ship report and PR link. Wait for explicit human approval before merging.
|
|
165
|
+
6. After approval: merge via `az repos pr update --id {prId} --status completed`.
|
|
166
|
+
7. Pull merge to local, delete the topic branch.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Error Handling
|
|
171
|
+
|
|
172
|
+
- **Phase failure:** If any gate fails and exhausts its retry budget, halt immediately. Report which phase failed, what the error was, and what input is needed to unblock.
|
|
173
|
+
- **Stuck story:** After 3 failed attempts on a single story, mark it in `stories.json` with the error and halt. Do not skip stories and continue — a failing story may indicate an architecture problem.
|
|
174
|
+
- **Missing tooling:** If a required tool (test framework, SDK, CLI) is not installed, halt and report the prerequisite. Do not attempt to install system packages without confirmation.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Progress Reporting
|
|
179
|
+
|
|
180
|
+
After each phase completes, output a brief status line:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
[Phase 1/6 — Plan] COMPLETE — PRD.md generated (5 requirements, 8 acceptance criteria)
|
|
184
|
+
[Phase 2/6 — Architect] COMPLETE — 4 stories in stories.json, branch: lafayette/feat/feature-name
|
|
185
|
+
[Phase 3/6 — Implement] COMPLETE — 4/4 stories passing, 12 tests, 87% coverage
|
|
186
|
+
[Phase 4/6 — Test] COMPLETE — full regression green, 87% line / 96% critical path
|
|
187
|
+
[Phase 5/6 — Review] COMPLETE — 0 HIGH, 2 MEDIUM, 1 LOW findings
|
|
188
|
+
[Phase 6/6 — Ship] AWAITING APPROVAL — PR #77 created, ship report below
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Rules
|
|
194
|
+
|
|
195
|
+
- **One human gate only.** Everything before Phase 6 step 5 is autonomous. Do not ask for intermediate approvals unless a gate fails.
|
|
196
|
+
- **No scope creep.** Only build what the feature description specifies.
|
|
197
|
+
- **Fail fast.** If a phase cannot succeed, halt immediately rather than producing garbage for downstream phases.
|
|
198
|
+
- **Attribution required.** Every commit must carry `Agent`, `Model`, and `Provider` trailers per ADR-028/ADR-029.
|
|
199
|
+
- **Branch discipline.** All work on topic branches, never on main. Per ADR-048.
|
|
200
|
+
- **Fresh context per story.** Do not carry assumptions between stories during Phase 3.
|
|
201
|
+
- **Epic checkpointing.** When this spell is run as one epic in a multi-epic plan, recommend running `spell-commit-work` before starting the next epic.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Spell — Generate Bot Icons
|
|
3
|
+
description: Generate a bot avatar concept with an image-capable agent, then normalize it into Teams-ready color and outline icons.
|
|
4
|
+
argument-hint: Bot concept (e.g., "{AGENT_NAME} for ecommerce ops, powerful + modern, flat vector")
|
|
5
|
+
agent: agent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Executive Summary
|
|
9
|
+
|
|
10
|
+
- This spell standardizes bot icon creation for Teams deployments.
|
|
11
|
+
- It separates creative generation (image-capable agent) from deterministic packaging (local script).
|
|
12
|
+
- Output is always Teams-ready: `color.png` (192x192) + `outline.png` (32x32 transparent, white glyph).
|
|
13
|
+
- Use this **after** agent setup (the agent's identity/role is defined) and **before** packaging `manifest.json` in the Teams setup flow.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Create a high-quality avatar concept for the bot, then prepare Teams-compliant icon files.
|
|
18
|
+
|
|
19
|
+
## Inputs
|
|
20
|
+
|
|
21
|
+
- Bot role and personality (from user argument)
|
|
22
|
+
- Brand direction (if none provided): clean, modern, readable at small sizes
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
- **Validate before processing.** After the source image is saved, confirm it exists and is **square** (equal width and height) before running the build script. If the file is missing, regenerate it; if it is non-square, regenerate or crop to a 1:1 ratio. Do **not** run the build step on a missing or non-square source — fail with a clear message (e.g. `source.png is 1024x768; Teams icons require a square source`).
|
|
27
|
+
- Quick check: `python3 -c "from PIL import Image; w,h=Image.open('{TEMP_DIR}/source.png').size; print(w,h); assert w==h, 'source must be square'"` (or `file {TEMP_DIR}/source.png` to read the dimensions).
|
|
28
|
+
- The image must contain no copyrighted logos, mascots, or trademarked characters.
|
|
29
|
+
|
|
30
|
+
> **Placeholders.** `{TEMP_DIR}` resolves to a writable working directory — your OS temp dir (`os.tmpdir()` / `$TMPDIR` / `%TEMP%`) plus a `teams-app` subfolder, or a repo-local `.tmp/teams-app/`. `{REPO_ROOT}` is the consuming repository's root. Resolve from `.arcane.json` / your shell; ask if unset.
|
|
31
|
+
|
|
32
|
+
## Image Generation Requirements
|
|
33
|
+
|
|
34
|
+
Generate one **source image** with these constraints:
|
|
35
|
+
|
|
36
|
+
- Square PNG
|
|
37
|
+
- Transparent background preferred
|
|
38
|
+
- High resolution (1024x1024 recommended)
|
|
39
|
+
- Single strong subject, centered
|
|
40
|
+
- Minimal detail that survives downscaling
|
|
41
|
+
- No copyrighted logos, mascots, or trademarked characters
|
|
42
|
+
|
|
43
|
+
Save as:
|
|
44
|
+
|
|
45
|
+
- `{TEMP_DIR}/source.png`
|
|
46
|
+
|
|
47
|
+
## Post-Process (Required)
|
|
48
|
+
|
|
49
|
+
Run (the script path resolves relative to the repo root):
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python3 {REPO_ROOT}/playbooks/scripts/build-teams-icons.py \
|
|
53
|
+
--input {TEMP_DIR}/source.png \
|
|
54
|
+
--output {TEMP_DIR}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If `playbooks/scripts/build-teams-icons.py` is **missing** under the repo root, do not improvise silently — tell the user the script is expected at `{REPO_ROOT}/playbooks/scripts/build-teams-icons.py` and either restore it or fall back to producing the two sizes manually (e.g. an equivalent PIL/ImageMagick resize: 192x192 `color.png`, and a 32x32 transparent `outline.png` with a white glyph).
|
|
58
|
+
|
|
59
|
+
This creates:
|
|
60
|
+
|
|
61
|
+
- `{TEMP_DIR}/color.png` (192x192)
|
|
62
|
+
- `{TEMP_DIR}/outline.png` (32x32, transparent background, white glyph)
|
|
63
|
+
|
|
64
|
+
## Validation
|
|
65
|
+
|
|
66
|
+
Run:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
file {TEMP_DIR}/color.png
|
|
70
|
+
file {TEMP_DIR}/outline.png
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Expected:
|
|
74
|
+
|
|
75
|
+
- `color.png`: PNG image data, 192 x 192
|
|
76
|
+
- `outline.png`: PNG image data, 32 x 32
|
|
77
|
+
|
|
78
|
+
## Final Output
|
|
79
|
+
|
|
80
|
+
Report:
|
|
81
|
+
|
|
82
|
+
- Visual style chosen
|
|
83
|
+
- Paths to generated files
|
|
84
|
+
- Any readability concerns at 32x32 size
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Spell — Implement
|
|
3
|
+
description: Autonomous implementation loop — pick a story from stories.json, build it, test it, commit it, repeat until all stories pass
|
|
4
|
+
argument-hint: Path to stories.json or paste story context (optional - uses current directory stories.json by default)
|
|
5
|
+
agent: agent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Executive Summary
|
|
9
|
+
|
|
10
|
+
- This is the core autonomous loop of the Spell Loop methodology.
|
|
11
|
+
- Each iteration: pick a story → implement → run tests → commit if passing → update stories.json → loop.
|
|
12
|
+
- Uses fresh context per iteration — only stories.json, progress.txt, and git history carry forward.
|
|
13
|
+
- See [[governance/development-methodology|Development Methodology]] for full Spell Loop reference.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Run the autonomous implementation loop for the current feature.
|
|
18
|
+
|
|
19
|
+
Use these files for context:
|
|
20
|
+
|
|
21
|
+
- [governance/development-methodology.md](../../governance/development-methodology.md) — Spell Loop methodology
|
|
22
|
+
- [governance/testing-standards.md](../../governance/testing-standards.md) — Testing frameworks and coverage requirements
|
|
23
|
+
- The feature's `architecture.md` — for tech decisions and patterns
|
|
24
|
+
- The feature's `stories.json` — for the work breakdown
|
|
25
|
+
- The feature's `progress.txt` (in `features/{slug}/`, if present) — accumulated learnings from prior iterations; read it before each iteration and append new learnings as the loop proceeds
|
|
26
|
+
|
|
27
|
+
Workflow (loop until all stories pass):
|
|
28
|
+
|
|
29
|
+
0. **Sync workspace** — before any code changes, ensure the workspace is current:
|
|
30
|
+
```bash
|
|
31
|
+
git fetch --prune origin
|
|
32
|
+
git checkout main && git pull --ff-only
|
|
33
|
+
```
|
|
34
|
+
If `pull --ff-only` fails, halt and report — manual rebase is needed.
|
|
35
|
+
|
|
36
|
+
1. **Load stories.json** — locate the feature folder from the current branch:
|
|
37
|
+
```bash
|
|
38
|
+
# Derive feature folder from branch name (works for lafayette/feat/541-phase-2a or lafayette/feat/phase-2a)
|
|
39
|
+
FEATURE_FOLDER="features/$(git symbolic-ref --short HEAD | sed 's|.*/feat/||')"
|
|
40
|
+
```
|
|
41
|
+
Load `$FEATURE_FOLDER/stories.json` and `$FEATURE_FOLDER/architecture.md`. If the branch name doesn't follow the `feat/{slug}` or `feat/{id}-{slug}` pattern, look for the most recently modified `features/*/stories.json` or ask the operator for the path.
|
|
42
|
+
|
|
43
|
+
Find the next story where `"passes": false`, ordered by priority.
|
|
44
|
+
|
|
45
|
+
2. **Read context** — load only what this story needs:
|
|
46
|
+
- The story's description and acceptance criteria from stories.json
|
|
47
|
+
- Relevant sections of architecture.md
|
|
48
|
+
- Latest entries in progress.txt (if exists) for learnings from previous iterations
|
|
49
|
+
- Files that will be modified (check git status)
|
|
50
|
+
|
|
51
|
+
3. **Implement the story**:
|
|
52
|
+
- Follow the architecture decisions — do not deviate without flagging.
|
|
53
|
+
- Write the minimum code to satisfy acceptance criteria.
|
|
54
|
+
- Follow project coding conventions and patterns from existing code.
|
|
55
|
+
- Include tests per governance/testing-standards.md.
|
|
56
|
+
|
|
57
|
+
4. **Run tests**:
|
|
58
|
+
- Run the test suite for the affected area.
|
|
59
|
+
- All existing tests must still pass (no regressions).
|
|
60
|
+
- New tests must pass.
|
|
61
|
+
- Check coverage against thresholds (80% line, 95% critical path).
|
|
62
|
+
|
|
63
|
+
5. **Evaluate results**:
|
|
64
|
+
- **Tests pass:** proceed to commit.
|
|
65
|
+
- **Tests fail:** debug and fix. If stuck after 3 attempts, mark the story with the error in stories.json and move to the next story.
|
|
66
|
+
|
|
67
|
+
6. **Commit the story**:
|
|
68
|
+
- Use Conventional Commits format (see spell-commit-work).
|
|
69
|
+
- One commit per story (squash if needed).
|
|
70
|
+
- Include the story ID in the commit body.
|
|
71
|
+
|
|
72
|
+
7. **Update stories.json**:
|
|
73
|
+
- Set `"passes": true` for the completed story.
|
|
74
|
+
- Set `"testEvidence"` with coverage % and test count.
|
|
75
|
+
|
|
76
|
+
8. **Append to `$FEATURE_FOLDER/progress.txt`**:
|
|
77
|
+
```
|
|
78
|
+
## Iteration N — [STORY-ID] — [timestamp]
|
|
79
|
+
### What was done
|
|
80
|
+
- [summary of changes]
|
|
81
|
+
### What was learned
|
|
82
|
+
- [patterns, gotchas, conventions discovered]
|
|
83
|
+
### What to watch for
|
|
84
|
+
- [warnings for future iterations]
|
|
85
|
+
```
|
|
86
|
+
File lives in the feature folder, not the repo root.
|
|
87
|
+
|
|
88
|
+
9. **Loop** — go to step 1 and pick the next story.
|
|
89
|
+
|
|
90
|
+
10. **Completion** — when all stories have `"passes": true`:
|
|
91
|
+
- Summarize what was built.
|
|
92
|
+
- Report total test count and coverage.
|
|
93
|
+
- Recommend running `spell-review` for adversarial review.
|
|
94
|
+
|
|
95
|
+
Rules:
|
|
96
|
+
- **Fresh context:** do not carry assumptions from previous stories. Re-read what you need.
|
|
97
|
+
- **No scope creep:** only implement what the story specifies.
|
|
98
|
+
- **Test first when possible:** write the test, see it fail, then implement.
|
|
99
|
+
- **Commit atomically:** one story = one commit.
|
|
100
|
+
- **Never skip tests:** if there's no test framework set up, set it up as the first story.
|
|
101
|
+
- **Stuck threshold:** if a story fails 3 consecutive attempts, mark it and move on. Human intervention needed.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Spell — Open Session
|
|
3
|
+
description: Open an Arcane session in a new chat by rebuilding context, identifying highest-priority unfinished work, and proposing concrete next actions.
|
|
4
|
+
argument-hint: Optional focus area (e.g., security hardening, a specific feature, infrastructure setup)
|
|
5
|
+
agent: agent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Executive Summary
|
|
9
|
+
|
|
10
|
+
- This prompt opens a new session after chat reset by reading core docs and identifying unfinished work.
|
|
11
|
+
- It produces a state snapshot, top priorities, and concrete next actions to minimize startup friction.
|
|
12
|
+
- Use this when opening work in a new chat session to avoid re-reading full context manually.
|
|
13
|
+
- Optional focus argument narrows scope to a specific domain (security, business, infrastructure).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Open work in this repository after context reset. Treat repository documents as source of truth. See [[README]] and [[CLAUDE]] for repo orientation.
|
|
18
|
+
|
|
19
|
+
If the user provided a focus area in the prompt argument, prioritize that area. Otherwise perform a general session-opening pass.
|
|
20
|
+
|
|
21
|
+
Use these files first:
|
|
22
|
+
|
|
23
|
+
- [README.md](../../README.md)
|
|
24
|
+
- [project.md](../../project.md)
|
|
25
|
+
- [TODO.md](../../TODO.md)
|
|
26
|
+
- [DECISIONS.md](../../DECISIONS.md)
|
|
27
|
+
- [naming-conventions.md](../../naming-conventions.md)
|
|
28
|
+
- [ai-context/system-prompt-context.md](../../ai-context/system-prompt-context.md)
|
|
29
|
+
- [agents/agent-policies.md](../../agents/agent-policies.md)
|
|
30
|
+
- Most recent journal file(s) in [journal/](../../journal/)
|
|
31
|
+
- Relevant business overview(s) under [ventures/](../../ventures/)
|
|
32
|
+
|
|
33
|
+
**Handoff Detection (run before anything else):**
|
|
34
|
+
|
|
35
|
+
Check `ai-context/system-prompt-context.md` for a `## Next Session Handoff` section.
|
|
36
|
+
|
|
37
|
+
- If present and **not yet marked consumed** (no `> ✓ Consumed:` line): surface it immediately as `## Picking Up From Last Session` at the very top of your output, before all other sections. Use the `Next concrete action` field as the first item in `## Next Session Plan`. Use the `Active task`, `Active files`, and `Branch` fields to pre-populate the State Snapshot.
|
|
38
|
+
- After surfacing it, mark it consumed by appending `> ✓ Consumed: YYYY-MM-DD` (today's date) on a new line inside the block, then save the file.
|
|
39
|
+
- If the section is absent or already marked consumed: skip this step and proceed with the normal workspace scan.
|
|
40
|
+
|
|
41
|
+
**Drift Check (run before deep context gathering):**
|
|
42
|
+
|
|
43
|
+
Run the `spell-check-drift` spell first, before building the state snapshot or gathering deep context. Drift compounds the longer a session runs, so catch it early.
|
|
44
|
+
|
|
45
|
+
- If **HIGH** drift is found: list it under the `## Risks And Gaps` output section and ask the user whether to fix it before proceeding. Do not continue deep context gathering until they decide.
|
|
46
|
+
- If **MEDIUM** or **LOW** drift is found: note it and suggest deferring it until after the session-opening pass.
|
|
47
|
+
- If no drift is found: note `drift check passed` and continue.
|
|
48
|
+
|
|
49
|
+
Then produce output in this exact structure:
|
|
50
|
+
|
|
51
|
+
## Workspace Health Check
|
|
52
|
+
|
|
53
|
+
Before anything else, check:
|
|
54
|
+
|
|
55
|
+
- **Current branch:** Run `git branch --show-current` in the arcane repo. If not on `main`, run `git worktree list`:
|
|
56
|
+
- If this is a worktree-backed session, staying on the topic branch is expected (do not require switching to `main`).
|
|
57
|
+
- If not worktree-backed, warn the user and suggest switching back to `main`.
|
|
58
|
+
- **Session branch naming compliance:** Branch names must be human-readable and policy-compliant:
|
|
59
|
+
- Interactive session default: `sessions/YYYY-MM-DD-<topic-slug>` (kebab-case topic from current task/session objective).
|
|
60
|
+
- Disallow random adjective-noun generator names (example: `ideal-disco`) as session defaults.
|
|
61
|
+
- If current branch is non-compliant and no active PR depends on it, rename branch to a compliant name. If it was already pushed, migrate remote tracking (`git push -u origin <new-name>` then `git push origin --delete <old-name>`), then continue.
|
|
62
|
+
- If an active PR uses the old branch name, do not force-delete the old remote branch; flag it and continue with a follow-up rename plan.
|
|
63
|
+
- **Stale local branches:** Run `git branch --merged main` to list branches already merged that should be deleted.
|
|
64
|
+
- **Tracker configuration check (early):** resolve active tracking settings before planning. Read `.arcane.json` first (if present), then the current feature PRD frontmatter if available:
|
|
65
|
+
- `tracking_mode: internal | external`
|
|
66
|
+
- `external_provider: ado | jira | other`
|
|
67
|
+
- If missing, ask the operator to choose now. Default to `external` + `ado` only when existing ADO context already exists (backward compatibility).
|
|
68
|
+
- **Open PRs (external/ado mode only):** if tracking mode is `external` with provider `ado` and ADO MCP is available, list all open PRs across all repos in the configured repo list (resolve from `.arcane.json`; if unset, ask the operator which repos to scan). Flag PRs older than 3 days as stale, older than 7 days as overdue. Format each as a clickable markdown link: `[PR #{id} — {title}](https://dev.azure.com/{ADO_ORG}/{ADO_PROJECT}/_git/{repo}/pullrequest/{id})` — resolve `{ADO_ORG}` and `{ADO_PROJECT}` from `.arcane.json` / PRD frontmatter; ask if unset. Never list a bare `PR #NNN`.
|
|
69
|
+
- **Uncommitted changes:** Run `git status` and report any uncommitted files.
|
|
70
|
+
- **Arcane version check (two-axis):** If `.arcane.json` exists in the repo root, check both whether the repo's managed files are behind the installed CLI *and* whether the installed CLI is behind the latest published version of `arcane-cli`:
|
|
71
|
+
- Read the installed version from `.arcane.json` (field: `arcaneVersion` or `version`).
|
|
72
|
+
- Determine the version of the installed `arcane-cli` CLI (for example, `npx arcane-cli --version`, or the locally installed package version).
|
|
73
|
+
- Run `npm view arcane-cli version` to get the latest published version.
|
|
74
|
+
- **(a) Managed files behind the installed CLI** (installed CLI version is newer than the version recorded in `.arcane.json`): surface a warning: `⚠️ Managed files out of date: files at <installed> → CLI at <cli>. Run spell update to resync files.`
|
|
75
|
+
- **(b) Installed CLI behind the latest published version** (latest published is newer than the installed CLI): surface a warning: `⚠️ Arcane CLI update available: CLI at <cli> → latest <latest>. Upgrade the CLI, then run spell update.`
|
|
76
|
+
- If both axes are current, report current and continue.
|
|
77
|
+
- If no `.arcane.json` exists, skip silently.
|
|
78
|
+
|
|
79
|
+
## State Snapshot
|
|
80
|
+
|
|
81
|
+
- Short bullets by area: security, infrastructure, `{PRIMARY_VENTURE}` readiness, business readiness, and documentation maturity. Resolve `{PRIMARY_VENTURE}` from `.arcane.json` / venture frontmatter; if unset, substitute the active focus area (or omit that bullet).
|
|
82
|
+
|
|
83
|
+
## Top Unfinished Work
|
|
84
|
+
|
|
85
|
+
- Prioritized list with severity labels: Critical, High, Medium.
|
|
86
|
+
- Every item must include a file reference.
|
|
87
|
+
|
|
88
|
+
## Next Session Plan
|
|
89
|
+
|
|
90
|
+
- 3 to 5 concrete actions to execute now.
|
|
91
|
+
- Keep actions specific and immediately executable.
|
|
92
|
+
- If moving from one completed epic to the next, include an explicit checkpoint action to run `spell-commit-work` first.
|
|
93
|
+
|
|
94
|
+
## Suggested Session Name
|
|
95
|
+
|
|
96
|
+
- **Required output field.**
|
|
97
|
+
- Provide a 1–4 word, sentence-case, human-meaningful session name.
|
|
98
|
+
- If a focus/task argument is provided, generate the name deterministically from that focus (never use the generic name `Open session`).
|
|
99
|
+
- If no focus argument is provided, generate the name from the top recommended action in `## Next Session Plan`.
|
|
100
|
+
- Optional helper line: `Branch helper: sessions/YYYY-MM-DD-<kebab-case-slug>`.
|
|
101
|
+
|
|
102
|
+
## Risks And Gaps
|
|
103
|
+
|
|
104
|
+
- Contradictions, stale assumptions, missing files, or draft documents that block progress.
|
|
105
|
+
|
|
106
|
+
## Clarifications Needed
|
|
107
|
+
|
|
108
|
+
- Up to 3 short questions only if they materially change priorities.
|
|
109
|
+
|
|
110
|
+
Rules:
|
|
111
|
+
|
|
112
|
+
- Prefer facts from docs over assumptions.
|
|
113
|
+
- Keep output concise but actionable.
|
|
114
|
+
- Include clickable file paths for claims.
|
|
115
|
+
- If you find outdated statements (for example, docs that contradict the current state of the system), call them out explicitly as drift.
|
|
116
|
+
- Never return a generic session name like `Open session` when a meaningful alternative can be derived from focus or the top next action.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Spell — Plan
|
|
3
|
+
description: Generate a Product Requirements Document (PRD) from a feature description using structured planning
|
|
4
|
+
argument-hint: Feature or initiative to plan (e.g., "user authentication for a mobile app")
|
|
5
|
+
agent: agent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Executive Summary
|
|
9
|
+
|
|
10
|
+
- This prompt generates a PRD.md from a feature description or TODO item.
|
|
11
|
+
- It follows a structured analysis pattern — requirements, acceptance criteria, and constraints.
|
|
12
|
+
- Output feeds directly into `spell-architect` as the next phase of the Spell Loop.
|
|
13
|
+
- See [[governance/development-methodology|Development Methodology]] for full Spell Loop reference.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Generate a Product Requirements Document for the described feature or initiative.
|
|
18
|
+
|
|
19
|
+
Use these files for context:
|
|
20
|
+
|
|
21
|
+
- [governance/development-methodology.md](../../governance/development-methodology.md) — Spell Loop methodology
|
|
22
|
+
- [project.md](../../project.md) — Project goals and priorities
|
|
23
|
+
- [DECISIONS.md](../../DECISIONS.md) — Existing ADRs to respect
|
|
24
|
+
|
|
25
|
+
Workflow:
|
|
26
|
+
|
|
27
|
+
1. **Configure tracking mode first** — decide how this work will be tracked before requirement intake:
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
tracking_mode: internal | external
|
|
31
|
+
external_provider: ado | jira | other
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Rules:
|
|
35
|
+
- If not explicitly set and ADO context is already present (work item ID + org/project), default to `tracking_mode: external`, `external_provider: ado` for backward compatibility.
|
|
36
|
+
- If `tracking_mode=internal`, do not require an external tracker ID.
|
|
37
|
+
- If `tracking_mode=external` and `external_provider=ado`, collect org/project and resolve process template + available work item types before planning:
|
|
38
|
+
```bash
|
|
39
|
+
az devops project show --org https://dev.azure.com/{org} --project {project} --query "capabilities.processTemplate.templateName" --output tsv
|
|
40
|
+
az boards work-item-type list --org https://dev.azure.com/{org} --project {project} --output json --query "[].name"
|
|
41
|
+
```
|
|
42
|
+
Then enforce level-to-type mapping using the first available type in order:
|
|
43
|
+
- Epic-level: `Epic → Feature → User Story → Issue`
|
|
44
|
+
- Feature-level: `Feature → User Story → Issue`
|
|
45
|
+
- Story-level: `User Story → Issue → Task`
|
|
46
|
+
- Task-level: `Task → Issue`
|
|
47
|
+
- Defect-level: `Bug → Issue → Task`
|
|
48
|
+
- If `external_provider=jira` or `other`, record as TODO and continue with internal artifacts unless the operator provides explicit provider workflow steps.
|
|
49
|
+
|
|
50
|
+
2. **Gather requirements** — accept input from any of these sources:
|
|
51
|
+
|
|
52
|
+
| Source | Format | How to fetch |
|
|
53
|
+
|--------|--------|--------------|
|
|
54
|
+
| **Description in prompt** | Inline text | Use as-is |
|
|
55
|
+
| **ADO work item ID** (external/ado mode) | `#507` or `507` with org name | Run: `az boards work-item show --id {id} --org https://dev.azure.com/{org} --output json` and extract `System.Description`, `Microsoft.VSTS.Common.AcceptanceCriteria`, and `System.Title` |
|
|
56
|
+
| **File path** | Path to existing doc | Read the file |
|
|
57
|
+
|
|
58
|
+
If the input is an ADO work item ID, fetch its content first, then use it as the feature description. If it has child work items, fetch those too for additional context.
|
|
59
|
+
|
|
60
|
+
Ask clarifying questions if the feature description is ambiguous. You need to understand:
|
|
61
|
+
- What problem does this solve?
|
|
62
|
+
- Who is the user/audience?
|
|
63
|
+
- What business does this belong to?
|
|
64
|
+
- Are there existing ADRs or constraints?
|
|
65
|
+
- **If `tracking_mode=external` and `external_provider=ado`: What is the ADO work item ID?** — required before proceeding in ADO mode. Store it as `adoWorkItemId` in PRD frontmatter so it flows to `spell-architect` and `stories.json`.
|
|
66
|
+
|
|
67
|
+
3. **Research context** — check the relevant business docs in `ventures/` and any existing code repos.
|
|
68
|
+
|
|
69
|
+
4. **Generate PRD.md** with these sections:
|
|
70
|
+
```markdown
|
|
71
|
+
# PRD: [Feature Name]
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
tracking:
|
|
75
|
+
tracking_mode: [internal|external]
|
|
76
|
+
external_provider: [ado|jira|other|null]
|
|
77
|
+
adoWorkItemId: [number|null]
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Problem Statement
|
|
81
|
+
[What problem are we solving? Why now?]
|
|
82
|
+
|
|
83
|
+
## Target Users
|
|
84
|
+
[Who benefits? Which business?]
|
|
85
|
+
|
|
86
|
+
## Requirements
|
|
87
|
+
### Must Have
|
|
88
|
+
- [Requirement with acceptance criteria]
|
|
89
|
+
|
|
90
|
+
### Should Have
|
|
91
|
+
- [Requirement with acceptance criteria]
|
|
92
|
+
|
|
93
|
+
### Won't Have (this iteration)
|
|
94
|
+
- [Explicitly excluded scope]
|
|
95
|
+
|
|
96
|
+
## Constraints
|
|
97
|
+
- [Technical: frameworks, platforms, existing architecture]
|
|
98
|
+
- [Business: budget, timeline, dependencies]
|
|
99
|
+
- [Security: per threat model]
|
|
100
|
+
|
|
101
|
+
## Acceptance Criteria
|
|
102
|
+
- [ ] [Testable criterion 1]
|
|
103
|
+
- [ ] [Testable criterion 2]
|
|
104
|
+
|
|
105
|
+
## Dependencies
|
|
106
|
+
- [Other features, services, or decisions needed]
|
|
107
|
+
|
|
108
|
+
## Open Questions
|
|
109
|
+
- [Unresolved items that need human decision]
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Include an **example config snippet** when presenting the draft:
|
|
113
|
+
```yaml
|
|
114
|
+
tracking:
|
|
115
|
+
tracking_mode: external
|
|
116
|
+
external_provider: ado
|
|
117
|
+
adoWorkItemId: 541
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
5. **Validate against existing ADRs** — ensure the PRD doesn't contradict established decisions.
|
|
121
|
+
|
|
122
|
+
6. **Save to disk** — derive the feature folder from the tracking configuration and slugified feature name, then write the PRD:
|
|
123
|
+
```bash
|
|
124
|
+
# external/ado example: adoWorkItemId=541, feature name="Phase 2A" → slug="phase-2a"
|
|
125
|
+
# FEATURE_DIR="features/{adoWorkItemId}-{slug}"
|
|
126
|
+
|
|
127
|
+
# internal or non-ado external example:
|
|
128
|
+
# FEATURE_DIR="features/{slug}"
|
|
129
|
+
mkdir -p "$FEATURE_DIR"
|
|
130
|
+
# Write PRD.md to the feature folder
|
|
131
|
+
```
|
|
132
|
+
Save the generated PRD.md using:
|
|
133
|
+
- `features/{adoWorkItemId}-{slug}/PRD.md` when `tracking_mode=external` and `external_provider=ado`
|
|
134
|
+
- `features/{slug}/PRD.md` when `tracking_mode=internal` or other providers without an ADO ID
|
|
135
|
+
Confirm the resolved path to the user.
|
|
136
|
+
|
|
137
|
+
7. **Present for review** — show the PRD to the user for approval before proceeding to `spell-architect`.
|
|
138
|
+
|
|
139
|
+
8. **Provider TODO handling** — if `external_provider=jira` or `external_provider=other`, add a TODO note in PRD open questions that provider-specific automation/linking is pending.
|
|
140
|
+
|
|
141
|
+
Rules:
|
|
142
|
+
- Every requirement must have at least one testable acceptance criterion.
|
|
143
|
+
- Scope must be small enough for one sprint (1-2 weeks of agent work).
|
|
144
|
+
- If the scope is too large, recommend splitting into multiple PRDs.
|
|
145
|
+
- Flag any requirements that would need a new ADR decision.
|