arcane-cli 0.14.0 → 0.15.1

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.
Files changed (66) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +253 -253
  3. package/dist/assets/.arcane/agents/agent-policies-template.md +414 -414
  4. package/dist/assets/.arcane/governance/agent-policies.md +414 -414
  5. package/dist/assets/.arcane/governance/agent-work-queue-model.md +61 -61
  6. package/dist/assets/.arcane/governance/cicd-standards.md +227 -227
  7. package/dist/assets/.arcane/governance/development-methodology.md +384 -384
  8. package/dist/assets/.arcane/governance/git-conventions.md +759 -759
  9. package/dist/assets/.arcane/governance/naming-conventions.md +142 -142
  10. package/dist/assets/.arcane/governance/new-business-setup.md +182 -182
  11. package/dist/assets/.arcane/governance/portable-bootstrap.md +101 -101
  12. package/dist/assets/.arcane/governance/product-excellence-standards.md +211 -211
  13. package/dist/assets/.arcane/governance/testing-standards.md +158 -158
  14. package/dist/assets/.arcane/governance/universal-agent-rules.md +108 -108
  15. package/dist/assets/.arcane/image-prompts/adelaide-image-prompt.md +140 -140
  16. package/dist/assets/.arcane/image-prompts/alexander-image-prompt.md +138 -138
  17. package/dist/assets/.arcane/image-prompts/bess-image-prompt.md +139 -139
  18. package/dist/assets/.arcane/image-prompts/circe-image-prompt.md +143 -143
  19. package/dist/assets/.arcane/image-prompts/custodio-image-prompt.md +140 -140
  20. package/dist/assets/.arcane/image-prompts/iris-image-prompt.md +139 -139
  21. package/dist/assets/.arcane/image-prompts/kellar-image-prompt.md +141 -141
  22. package/dist/assets/.arcane/image-prompts/lafayette-image-prompt.md +140 -140
  23. package/dist/assets/.arcane/image-prompts/lince-image-prompt.md +142 -142
  24. package/dist/assets/.arcane/image-prompts/mercurio-image-prompt.md +140 -140
  25. package/dist/assets/.arcane/image-prompts/merlin-image-prompt.md +139 -139
  26. package/dist/assets/.arcane/image-prompts/prospero-image-prompt.md +141 -141
  27. package/dist/assets/.arcane.json +5 -0
  28. package/dist/assets/.claude/commands/spell-enchant.md +9 -9
  29. package/dist/assets/.github/agents/adelaide.agent.md +44 -44
  30. package/dist/assets/.github/agents/alexander.agent.md +43 -43
  31. package/dist/assets/.github/agents/bess.agent.md +42 -42
  32. package/dist/assets/.github/agents/circe.agent.md +43 -43
  33. package/dist/assets/.github/agents/custodio.agent.md +44 -44
  34. package/dist/assets/.github/agents/iris.agent.md +43 -43
  35. package/dist/assets/.github/agents/kellar.agent.md +43 -43
  36. package/dist/assets/.github/agents/lafayette.agent.md +42 -42
  37. package/dist/assets/.github/agents/lince.agent.md +43 -43
  38. package/dist/assets/.github/agents/mercurio.agent.md +43 -43
  39. package/dist/assets/.github/agents/merlin.agent.md +44 -44
  40. package/dist/assets/.github/agents/prospero.agent.md +43 -43
  41. package/dist/assets/.github/prompts/spell-close-session.prompt.md +17 -5
  42. package/dist/assets/.github/prompts/spell-commit-work.prompt.md +24 -6
  43. package/dist/assets/.github/prompts/spell-create-pull-request.prompt.md +12 -3
  44. package/dist/assets/.github/prompts/spell-enchant.prompt.md +385 -385
  45. package/dist/assets/.github/prompts/spell-feedback.prompt.md +113 -113
  46. package/dist/assets/.github/prompts/spell-full-cycle.prompt.md +202 -201
  47. package/dist/assets/.github/prompts/spell-implement.prompt.md +101 -101
  48. package/dist/assets/.github/prompts/spell-open-session.prompt.md +20 -5
  49. package/dist/assets/.github/prompts/spell-scope.prompt.md +263 -263
  50. package/dist/assets/agents/architecture-lead.yaml +61 -61
  51. package/dist/assets/agents/collaborator.yaml +59 -59
  52. package/dist/assets/agents/devops.yaml +60 -60
  53. package/dist/assets/agents/frontend-dev.yaml +60 -60
  54. package/dist/assets/agents/fullstack-dev.yaml +59 -59
  55. package/dist/assets/agents/marketing-strategist.yaml +60 -60
  56. package/dist/assets/agents/mobile-dev.yaml +59 -59
  57. package/dist/assets/agents/operations-comms.yaml +58 -58
  58. package/dist/assets/agents/orchestrator.yaml +60 -60
  59. package/dist/assets/agents/qa-lead.yaml +60 -60
  60. package/dist/assets/agents/research-analyst.yaml +59 -59
  61. package/dist/assets/agents/security-ops.yaml +61 -61
  62. package/dist/index.js +346 -9
  63. package/dist/index.js.map +1 -1
  64. package/package.json +72 -72
  65. package/dist/assets/.claude/commands/spell-eas-ios-deploy.md +0 -9
  66. package/dist/assets/.github/prompts/spell-eas-ios-deploy.prompt.md +0 -183
@@ -1,113 +1,113 @@
1
- ---
2
- name: Spell — Feedback
3
- description: Collect structured feedback on AI-assistance quality and workflow friction, and append it to FEEDBACK.md for continuous improvement.
4
- argument-hint: Optional focus area — e.g., "spell-implement loop", "review quality", "session handoff"
5
- agent: agent
6
- ---
7
-
8
- ## Executive Summary
9
-
10
- - This spell captures post-session feedback on how well the spells and AI assistance worked.
11
- - It structures the feedback into actionable improvement items and appends them to `FEEDBACK.md` at the repo root.
12
- - Use it after any session where assistance felt notably effective or notably off — the record feeds `spell-enchant`.
13
-
14
- ---
15
-
16
- Collect and record feedback to improve the Arcane workflow.
17
-
18
- The user's input describes what to give feedback on. If no argument is provided, ask one question: _"What part of the workflow or AI assistance do you want to give feedback on?"_ and wait.
19
-
20
- ## Step 1 — Identify Scope
21
-
22
- From the input and recent context, determine:
23
-
24
- - **Target** — which spell, agent, or general experience is being rated.
25
- - **Session context** — the recent task/feature (check `TODO.md`, `DECISIONS.md`, latest `journal/` entry).
26
- - **Type** — output quality, workflow friction, or tooling/setup.
27
-
28
- Do not ask for anything you can infer from the conversation.
29
-
30
- ## Step 2 — Prompt for Structured Feedback
31
-
32
- Ask all of this at once (not one at a time):
33
-
34
- ```
35
- ## Feedback Form
36
-
37
- **Target:** [spell/agent/experience]
38
- **Session:** [topic or "general"]
39
-
40
- 1. Overall quality (1–5): how effective was the assistance?
41
- 2. Friction points: what slowed you down or felt wrong?
42
- 3. What worked well: what should stay exactly as-is?
43
- 4. Suggested improvement: the single change that would help most?
44
- 5. Would you use this again? (yes / yes-with-changes / no)
45
- ```
46
-
47
- If the user already covered some fields in their input, skip those and confirm what you inferred.
48
-
49
- ## Step 3 — Synthesize
50
-
51
- Extract:
52
-
53
- - **Improvement items** — specific, imperative, with a clear done-state ("Add…", "Fix…", "Remove…").
54
- - **Positive signals** — patterns to preserve.
55
- - **Blockers** — anything that prevented task completion (surface these under Friction Points).
56
-
57
- Mark an item **substantial** (TODO-worthy) if any apply: it requires editing a spell/governance/agent file, it blocked task completion, or it recurs across sessions. Trivial one-off nits stay in `FEEDBACK.md` only.
58
-
59
- ## Step 4 — Show Proposal
60
-
61
- ```
62
- ## Feedback Summary
63
-
64
- **Target:** [...] **Date:** [YYYY-MM-DD] **Rating:** [N/5] **Would use again:** [yes / yes-with-changes / no]
65
-
66
- **Friction:** [...]
67
- **Worked well:** [...]
68
- **Improvement items:**
69
- - [ ] [item] [SUBSTANTIAL if TODO-worthy]
70
-
71
- Append to FEEDBACK.md? (yes / edit / skip)
72
- ```
73
-
74
- If the rating is ≤ 2, prepend a `⚠️ LOW RATING` line to this proposal so it is visible before the append decision — do not bury it.
75
-
76
- ## Step 5 — Apply (after approval)
77
-
78
- 1. Read `FEEDBACK.md` at the repo root (create with a `# Feedback Log` header if missing).
79
- 2. **Append** this block — never overwrite existing entries:
80
-
81
- ```markdown
82
- ---
83
-
84
- ## Feedback — [Target] ([YYYY-MM-DD])
85
-
86
- **Session:** [topic or "general"]
87
- **Rating:** [N/5] **Would use again:** [yes / yes-with-changes / no]
88
- **Submitted by:** [git config user.name if available, else "developer"]
89
-
90
- ### Friction Points
91
- - [point — include any blockers]
92
-
93
- ### What Worked
94
- - [strength]
95
-
96
- ### Improvement Items
97
- - [ ] [item]
98
-
99
- ### Raw Notes
100
- > [verbatim user input if useful]
101
- ```
102
-
103
- 3. For each item marked **substantial** in Step 3, offer to add it to `TODO.md` as a `[feedback]`-tagged item. If the user accepts, hand off to [`spell-todo`](spell-todo.prompt.md) rather than editing `TODO.md` directly — it picks the right section and avoids duplicates.
104
- 4. Do NOT commit — leave that to `spell-commit-work`.
105
- 5. Confirm what was appended and where, then point the user to [`spell-enchant`](spell-enchant.prompt.md) if the feedback suggests a spell or PRD is ready to be lifted to the next quality tier.
106
-
107
- ## Rules
108
-
109
- - Never overwrite existing feedback — always append.
110
- - Keep improvement items specific and actionable — no vague "improve quality".
111
- - If overall quality is ≤ 2, flag it with `⚠️ LOW RATING` in the Step 4 proposal (before the append decision) and offer `spell-todo` to capture a concrete fix.
112
- - After approval, write immediately — no further questions.
113
- - Never include secrets or tokens.
1
+ ---
2
+ name: Spell — Feedback
3
+ description: Collect structured feedback on AI-assistance quality and workflow friction, and append it to FEEDBACK.md for continuous improvement.
4
+ argument-hint: Optional focus area — e.g., "spell-implement loop", "review quality", "session handoff"
5
+ agent: agent
6
+ ---
7
+
8
+ ## Executive Summary
9
+
10
+ - This spell captures post-session feedback on how well the spells and AI assistance worked.
11
+ - It structures the feedback into actionable improvement items and appends them to `FEEDBACK.md` at the repo root.
12
+ - Use it after any session where assistance felt notably effective or notably off — the record feeds `spell-enchant`.
13
+
14
+ ---
15
+
16
+ Collect and record feedback to improve the Arcane workflow.
17
+
18
+ The user's input describes what to give feedback on. If no argument is provided, ask one question: _"What part of the workflow or AI assistance do you want to give feedback on?"_ and wait.
19
+
20
+ ## Step 1 — Identify Scope
21
+
22
+ From the input and recent context, determine:
23
+
24
+ - **Target** — which spell, agent, or general experience is being rated.
25
+ - **Session context** — the recent task/feature (check `TODO.md`, `DECISIONS.md`, latest `journal/` entry).
26
+ - **Type** — output quality, workflow friction, or tooling/setup.
27
+
28
+ Do not ask for anything you can infer from the conversation.
29
+
30
+ ## Step 2 — Prompt for Structured Feedback
31
+
32
+ Ask all of this at once (not one at a time):
33
+
34
+ ```
35
+ ## Feedback Form
36
+
37
+ **Target:** [spell/agent/experience]
38
+ **Session:** [topic or "general"]
39
+
40
+ 1. Overall quality (1–5): how effective was the assistance?
41
+ 2. Friction points: what slowed you down or felt wrong?
42
+ 3. What worked well: what should stay exactly as-is?
43
+ 4. Suggested improvement: the single change that would help most?
44
+ 5. Would you use this again? (yes / yes-with-changes / no)
45
+ ```
46
+
47
+ If the user already covered some fields in their input, skip those and confirm what you inferred.
48
+
49
+ ## Step 3 — Synthesize
50
+
51
+ Extract:
52
+
53
+ - **Improvement items** — specific, imperative, with a clear done-state ("Add…", "Fix…", "Remove…").
54
+ - **Positive signals** — patterns to preserve.
55
+ - **Blockers** — anything that prevented task completion (surface these under Friction Points).
56
+
57
+ Mark an item **substantial** (TODO-worthy) if any apply: it requires editing a spell/governance/agent file, it blocked task completion, or it recurs across sessions. Trivial one-off nits stay in `FEEDBACK.md` only.
58
+
59
+ ## Step 4 — Show Proposal
60
+
61
+ ```
62
+ ## Feedback Summary
63
+
64
+ **Target:** [...] **Date:** [YYYY-MM-DD] **Rating:** [N/5] **Would use again:** [yes / yes-with-changes / no]
65
+
66
+ **Friction:** [...]
67
+ **Worked well:** [...]
68
+ **Improvement items:**
69
+ - [ ] [item] [SUBSTANTIAL if TODO-worthy]
70
+
71
+ Append to FEEDBACK.md? (yes / edit / skip)
72
+ ```
73
+
74
+ If the rating is ≤ 2, prepend a `⚠️ LOW RATING` line to this proposal so it is visible before the append decision — do not bury it.
75
+
76
+ ## Step 5 — Apply (after approval)
77
+
78
+ 1. Read `FEEDBACK.md` at the repo root (create with a `# Feedback Log` header if missing).
79
+ 2. **Append** this block — never overwrite existing entries:
80
+
81
+ ```markdown
82
+ ---
83
+
84
+ ## Feedback — [Target] ([YYYY-MM-DD])
85
+
86
+ **Session:** [topic or "general"]
87
+ **Rating:** [N/5] **Would use again:** [yes / yes-with-changes / no]
88
+ **Submitted by:** [git config user.name if available, else "developer"]
89
+
90
+ ### Friction Points
91
+ - [point — include any blockers]
92
+
93
+ ### What Worked
94
+ - [strength]
95
+
96
+ ### Improvement Items
97
+ - [ ] [item]
98
+
99
+ ### Raw Notes
100
+ > [verbatim user input if useful]
101
+ ```
102
+
103
+ 3. For each item marked **substantial** in Step 3, offer to add it to `TODO.md` as a `[feedback]`-tagged item. If the user accepts, hand off to [`spell-todo`](spell-todo.prompt.md) rather than editing `TODO.md` directly — it picks the right section and avoids duplicates.
104
+ 4. Do NOT commit — leave that to `spell-commit-work`.
105
+ 5. Confirm what was appended and where, then point the user to [`spell-enchant`](spell-enchant.prompt.md) if the feedback suggests a spell or PRD is ready to be lifted to the next quality tier.
106
+
107
+ ## Rules
108
+
109
+ - Never overwrite existing feedback — always append.
110
+ - Keep improvement items specific and actionable — no vague "improve quality".
111
+ - If overall quality is ≤ 2, flag it with `⚠️ LOW RATING` in the Step 4 proposal (before the append decision) and offer `spell-todo` to capture a concrete fix.
112
+ - After approval, write immediately — no further questions.
113
+ - Never include secrets or tokens.
@@ -1,201 +1,202 @@
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.
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 bound to the exact PR ID and head SHA. This is separate from every earlier commit approval.
165
+ 6. **AUTHORITY GATE:** Resolve loader-validated effective power and `exec_allowed`. Below Magus or missing/invalid authority must visibly downgrade to human completion; do not invoke merge/auto-complete. Interactive Magus+ requires the separate approval from step 5; autonomous Magus+ may self-merge within approved scope.
166
+ 7. Only after both applicable gates pass: merge via the detected provider using the approved PR ID/head SHA and allowed merge strategy.
167
+ 8. Pull merge to local, delete the topic branch.
168
+
169
+ ---
170
+
171
+ ## Error Handling
172
+
173
+ - **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.
174
+ - **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.
175
+ - **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.
176
+
177
+ ---
178
+
179
+ ## Progress Reporting
180
+
181
+ After each phase completes, output a brief status line:
182
+
183
+ ```
184
+ [Phase 1/6 — Plan] COMPLETE — PRD.md generated (5 requirements, 8 acceptance criteria)
185
+ [Phase 2/6 — Architect] COMPLETE — 4 stories in stories.json, branch: lafayette/feat/feature-name
186
+ [Phase 3/6 — Implement] COMPLETE — 4/4 stories passing, 12 tests, 87% coverage
187
+ [Phase 4/6 — Test] COMPLETE — full regression green, 87% line / 96% critical path
188
+ [Phase 5/6 — Review] COMPLETE — 0 HIGH, 2 MEDIUM, 1 LOW findings
189
+ [Phase 6/6 — Ship] AWAITING APPROVAL — PR #77 created, ship report below
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Rules
195
+
196
+ - **One human gate only.** Everything before Phase 6 step 5 is autonomous. Do not ask for intermediate approvals unless a gate fails.
197
+ - **No scope creep.** Only build what the feature description specifies.
198
+ - **Fail fast.** If a phase cannot succeed, halt immediately rather than producing garbage for downstream phases.
199
+ - **Attribution required.** Every commit must carry `Agent`, `Model`, and `Provider` trailers per ADR-028/ADR-029.
200
+ - **Branch discipline.** All work on topic branches, never on main. Per ADR-048.
201
+ - **Fresh context per story.** Do not carry assumptions between stories during Phase 3.
202
+ - **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.