ariadna 1.3.0 → 2.0.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.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/ariadna.gemspec +0 -1
  3. data/data/agents/ariadna-codebase-mapper.md +34 -722
  4. data/data/agents/ariadna-debugger.md +44 -1139
  5. data/data/agents/ariadna-executor.md +75 -396
  6. data/data/agents/ariadna-planner.md +78 -1215
  7. data/data/agents/ariadna-roadmapper.md +55 -582
  8. data/data/agents/ariadna-verifier.md +60 -702
  9. data/data/ariadna/templates/config.json +8 -33
  10. data/data/ariadna/workflows/debug.md +28 -0
  11. data/data/ariadna/workflows/execute-phase.md +31 -513
  12. data/data/ariadna/workflows/map-codebase.md +20 -319
  13. data/data/ariadna/workflows/new-milestone.md +20 -365
  14. data/data/ariadna/workflows/new-project.md +19 -880
  15. data/data/ariadna/workflows/plan-phase.md +24 -443
  16. data/data/ariadna/workflows/progress.md +20 -376
  17. data/data/ariadna/workflows/quick.md +19 -221
  18. data/data/ariadna/workflows/roadmap-ops.md +28 -0
  19. data/data/ariadna/workflows/verify-work.md +23 -560
  20. data/data/commands/ariadna/add-phase.md +11 -22
  21. data/data/commands/ariadna/debug.md +11 -143
  22. data/data/commands/ariadna/execute-phase.md +12 -30
  23. data/data/commands/ariadna/insert-phase.md +7 -14
  24. data/data/commands/ariadna/map-codebase.md +16 -49
  25. data/data/commands/ariadna/new-milestone.md +12 -25
  26. data/data/commands/ariadna/new-project.md +22 -26
  27. data/data/commands/ariadna/plan-phase.md +13 -22
  28. data/data/commands/ariadna/progress.md +16 -6
  29. data/data/commands/ariadna/quick.md +9 -11
  30. data/data/commands/ariadna/remove-phase.md +9 -12
  31. data/data/commands/ariadna/verify-work.md +14 -19
  32. data/data/skills/rails-backend/API.md +138 -0
  33. data/data/skills/rails-backend/CONTROLLERS.md +154 -0
  34. data/data/skills/rails-backend/JOBS.md +132 -0
  35. data/data/skills/rails-backend/MODELS.md +213 -0
  36. data/data/skills/rails-backend/SKILL.md +169 -0
  37. data/data/skills/rails-frontend/ASSETS.md +154 -0
  38. data/data/skills/rails-frontend/COMPONENTS.md +253 -0
  39. data/data/skills/rails-frontend/SKILL.md +187 -0
  40. data/data/skills/rails-frontend/VIEWS.md +168 -0
  41. data/data/skills/rails-performance/PROFILING.md +106 -0
  42. data/data/skills/rails-performance/SKILL.md +217 -0
  43. data/data/skills/rails-security/AUDIT.md +118 -0
  44. data/data/skills/rails-security/SKILL.md +422 -0
  45. data/data/skills/rails-testing/FIXTURES.md +78 -0
  46. data/data/skills/rails-testing/SKILL.md +160 -0
  47. data/data/skills/rails-testing/SYSTEM-TESTS.md +73 -0
  48. data/lib/ariadna/installer.rb +11 -15
  49. data/lib/ariadna/tools/cli.rb +0 -12
  50. data/lib/ariadna/tools/config_manager.rb +10 -72
  51. data/lib/ariadna/tools/frontmatter.rb +23 -1
  52. data/lib/ariadna/tools/init.rb +201 -401
  53. data/lib/ariadna/tools/model_profiles.rb +6 -14
  54. data/lib/ariadna/tools/phase_manager.rb +1 -10
  55. data/lib/ariadna/tools/state_manager.rb +170 -451
  56. data/lib/ariadna/tools/template_filler.rb +4 -12
  57. data/lib/ariadna/tools/verification.rb +21 -399
  58. data/lib/ariadna/uninstaller.rb +9 -0
  59. data/lib/ariadna/version.rb +1 -1
  60. data/lib/ariadna.rb +1 -0
  61. metadata +20 -91
  62. data/data/agents/ariadna-backend-executor.md +0 -261
  63. data/data/agents/ariadna-frontend-executor.md +0 -259
  64. data/data/agents/ariadna-integration-checker.md +0 -418
  65. data/data/agents/ariadna-phase-researcher.md +0 -469
  66. data/data/agents/ariadna-plan-checker.md +0 -622
  67. data/data/agents/ariadna-project-researcher.md +0 -618
  68. data/data/agents/ariadna-research-synthesizer.md +0 -236
  69. data/data/agents/ariadna-test-executor.md +0 -266
  70. data/data/ariadna/references/checkpoints.md +0 -772
  71. data/data/ariadna/references/continuation-format.md +0 -249
  72. data/data/ariadna/references/decimal-phase-calculation.md +0 -65
  73. data/data/ariadna/references/git-integration.md +0 -248
  74. data/data/ariadna/references/git-planning-commit.md +0 -38
  75. data/data/ariadna/references/model-profile-resolution.md +0 -32
  76. data/data/ariadna/references/model-profiles.md +0 -73
  77. data/data/ariadna/references/phase-argument-parsing.md +0 -61
  78. data/data/ariadna/references/planning-config.md +0 -194
  79. data/data/ariadna/references/questioning.md +0 -153
  80. data/data/ariadna/references/rails-conventions.md +0 -416
  81. data/data/ariadna/references/tdd.md +0 -267
  82. data/data/ariadna/references/ui-brand.md +0 -160
  83. data/data/ariadna/references/verification-patterns.md +0 -853
  84. data/data/ariadna/templates/codebase/architecture.md +0 -481
  85. data/data/ariadna/templates/codebase/concerns.md +0 -380
  86. data/data/ariadna/templates/codebase/conventions.md +0 -434
  87. data/data/ariadna/templates/codebase/integrations.md +0 -328
  88. data/data/ariadna/templates/codebase/stack.md +0 -189
  89. data/data/ariadna/templates/codebase/structure.md +0 -418
  90. data/data/ariadna/templates/codebase/testing.md +0 -606
  91. data/data/ariadna/templates/context.md +0 -283
  92. data/data/ariadna/templates/continue-here.md +0 -78
  93. data/data/ariadna/templates/debug-subagent-prompt.md +0 -91
  94. data/data/ariadna/templates/phase-prompt.md +0 -609
  95. data/data/ariadna/templates/planner-subagent-prompt.md +0 -117
  96. data/data/ariadna/templates/research-project/ARCHITECTURE.md +0 -439
  97. data/data/ariadna/templates/research-project/FEATURES.md +0 -168
  98. data/data/ariadna/templates/research-project/PITFALLS.md +0 -406
  99. data/data/ariadna/templates/research-project/STACK.md +0 -251
  100. data/data/ariadna/templates/research-project/SUMMARY.md +0 -247
  101. data/data/ariadna/templates/state.md +0 -176
  102. data/data/ariadna/templates/summary-complex.md +0 -59
  103. data/data/ariadna/templates/summary-minimal.md +0 -41
  104. data/data/ariadna/templates/summary-standard.md +0 -48
  105. data/data/ariadna/templates/user-setup.md +0 -310
  106. data/data/ariadna/workflows/add-phase.md +0 -111
  107. data/data/ariadna/workflows/add-todo.md +0 -157
  108. data/data/ariadna/workflows/audit-milestone.md +0 -241
  109. data/data/ariadna/workflows/check-todos.md +0 -176
  110. data/data/ariadna/workflows/complete-milestone.md +0 -644
  111. data/data/ariadna/workflows/diagnose-issues.md +0 -219
  112. data/data/ariadna/workflows/discovery-phase.md +0 -289
  113. data/data/ariadna/workflows/discuss-phase.md +0 -408
  114. data/data/ariadna/workflows/execute-plan.md +0 -448
  115. data/data/ariadna/workflows/help.md +0 -470
  116. data/data/ariadna/workflows/insert-phase.md +0 -129
  117. data/data/ariadna/workflows/list-phase-assumptions.md +0 -178
  118. data/data/ariadna/workflows/pause-work.md +0 -122
  119. data/data/ariadna/workflows/plan-milestone-gaps.md +0 -256
  120. data/data/ariadna/workflows/remove-phase.md +0 -154
  121. data/data/ariadna/workflows/research-phase.md +0 -74
  122. data/data/ariadna/workflows/resume-project.md +0 -306
  123. data/data/ariadna/workflows/set-profile.md +0 -80
  124. data/data/ariadna/workflows/settings.md +0 -145
  125. data/data/ariadna/workflows/transition.md +0 -493
  126. data/data/ariadna/workflows/update.md +0 -212
  127. data/data/ariadna/workflows/verify-phase.md +0 -226
  128. data/data/commands/ariadna/add-todo.md +0 -42
  129. data/data/commands/ariadna/audit-milestone.md +0 -42
  130. data/data/commands/ariadna/check-todos.md +0 -41
  131. data/data/commands/ariadna/complete-milestone.md +0 -136
  132. data/data/commands/ariadna/discuss-phase.md +0 -86
  133. data/data/commands/ariadna/help.md +0 -22
  134. data/data/commands/ariadna/list-phase-assumptions.md +0 -50
  135. data/data/commands/ariadna/pause-work.md +0 -35
  136. data/data/commands/ariadna/plan-milestone-gaps.md +0 -40
  137. data/data/commands/ariadna/reapply-patches.md +0 -110
  138. data/data/commands/ariadna/research-phase.md +0 -187
  139. data/data/commands/ariadna/resume-work.md +0 -40
  140. data/data/commands/ariadna/set-profile.md +0 -34
  141. data/data/commands/ariadna/settings.md +0 -36
  142. data/data/commands/ariadna/update.md +0 -37
  143. data/data/guides/backend.md +0 -3069
  144. data/data/guides/frontend.md +0 -1479
  145. data/data/guides/performance.md +0 -1193
  146. data/data/guides/security.md +0 -1522
  147. data/data/guides/style-guide.md +0 -1091
  148. data/data/guides/testing.md +0 -504
  149. data/data/templates.md +0 -94
@@ -1,451 +1,32 @@
1
- <purpose>
2
- Create executable phase prompts (PLAN.md files) for a roadmap phase. Default flow: Context (inline if needed) -> Plan -> Verify -> Done. Orchestrates ariadna-planner and ariadna-plan-checker agents. Research skipped by default (Rails conventions pre-loaded); use --research to force research for non-standard integrations.
3
- </purpose>
1
+ ---
2
+ name: plan-phase
3
+ description: Create detailed PLAN.md execution files for a roadmap phase, with inline research and self-checking
4
+ ---
4
5
 
5
- <required_reading>
6
- Read all files referenced by the invoking prompt's execution_context before starting.
7
-
8
- @~/.claude/ariadna/references/ui-brand.md
9
- @~/.claude/ariadna/references/rails-conventions.md
10
- </required_reading>
11
-
12
- <process>
13
-
14
- ## 1. Initialize
15
-
16
- Load all context in one call (include file contents to avoid redundant reads):
17
-
18
- ```bash
19
- INIT=$(ariadna-tools init plan-phase "$PHASE" --include state,roadmap,requirements,context,research,verification,uat)
20
- ```
21
-
22
- Parse JSON for: `researcher_model`, `planner_model`, `checker_model`, `research_enabled`, `plan_checker_enabled`, `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `plan_count`, `planning_exists`, `roadmap_exists`.
23
-
24
- **File contents (from --include):** `state_content`, `roadmap_content`, `requirements_content`, `context_content`, `research_content`, `verification_content`, `uat_content`. These are null if files don't exist.
25
-
26
- **If `planning_exists` is false:** Error — run `/ariadna:new-project` first.
27
-
28
- ## 2. Parse and Normalize Arguments
29
-
30
- Extract from $ARGUMENTS: phase number (integer or decimal like `2.1`), flags (`--research`, `--skip-research`, `--gaps`, `--skip-verify`, `--skip-context`, `--skip-approval`).
31
-
32
- **If no phase number:** Detect next unplanned phase from roadmap.
33
-
34
- **If `phase_found` is false:** Validate phase exists in ROADMAP.md. If valid, create the directory using `phase_slug` and `padded_phase` from init:
35
- ```bash
36
- mkdir -p ".ariadna_planning/phases/${padded_phase}-${phase_slug}"
37
- ```
38
-
39
- **Existing artifacts from init:** `has_research`, `has_plans`, `plan_count`.
40
-
41
- ## 3. Validate Phase
42
-
43
- ```bash
44
- PHASE_INFO=$(ariadna-tools roadmap get-phase "${PHASE}")
45
- ```
46
-
47
- **If `found` is false:** Error with available phases. **If `found` is true:** Extract `phase_number`, `phase_name`, `goal` from JSON.
48
-
49
- ## 4. Inline Context Gathering (Replaces discuss-phase)
50
-
51
- Use `context_content` from init JSON (already loaded via `--include context`).
52
-
53
- **If `context_content` is not null:** Display: `Using phase context from: ${PHASE_DIR}/*-CONTEXT.md` and skip to step 5.
54
-
55
- **If `context_content` is null AND no `--skip-context` flag:**
56
-
57
- Analyze the phase goal from `roadmap_content` and determine if there are implementation decisions the user should weigh in on.
58
-
59
- **Categorize the phase — determines context behavior:**
60
-
61
- - **Category A** (infrastructure, setup, config, standard CRUD, testing, migrations, background jobs) → Skip context entirely. Display: `Context: Skipped (infrastructure/standard phase)`. Continue to step 5.
62
- - **Category B** (user-facing features, UI/UX decisions, user workflows, multiple valid approaches) → Show context question below.
63
-
64
- **Category B only — offer inline clarification.** Identify 2-3 specific gray areas from the phase goal (e.g., "unclear: how should password reset flow work?" or "multiple options: modal vs. inline form for editing"). Include them in the question text:
65
-
66
- ```
67
- questions: [
68
- {
69
- header: "Context",
70
- question: "Phase {X}: {Name} has gray areas:\n- {gray_area_1}\n- {gray_area_2}\n- {gray_area_3}\nWant to clarify before planning?",
71
- multiSelect: false,
72
- options: [
73
- { label: "Quick discussion (Recommended)", description: "Clarify these decisions inline — prevents plan mismatches" },
74
- { label: "Plan directly", description: "Planner will make reasonable choices, you review the plan" },
75
- { label: "Full discussion", description: "Run /ariadna:discuss-phase for detailed context gathering" }
76
- ]
77
- }
78
- ]
79
- ```
80
-
81
- - **"Quick discussion":** Identify 2-3 key gray areas and ask focused AskUserQuestion for each. Write a lightweight CONTEXT.md to the phase directory. Then continue to step 5.
82
- - **"Plan directly":** Continue to step 5. Planner will use its judgment for ambiguous areas.
83
- - **"Full discussion":** Exit and tell user to run `/ariadna:discuss-phase {X}` first, then return.
84
-
85
- **CRITICAL:** Use `context_content` from INIT — pass to planner and checker agents.
86
-
87
- ## 5. Handle Research
88
-
89
- **Default: Skip research.** Rails conventions are pre-loaded via `rails-conventions.md`.
90
-
91
- **Skip if:** `--gaps` flag, or `research_enabled` is false (default) without `--research` override.
92
-
93
- **If `has_research` is true (from init) AND no `--research` flag:** Use existing, skip to step 6.
94
-
95
- **If `--research` flag explicitly passed:**
96
-
97
- Display banner:
98
- ```
99
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
100
- Ariadna ► RESEARCHING PHASE {X}
101
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
102
-
103
- ◆ Spawning researcher...
104
- ```
105
-
106
- ### Spawn ariadna-phase-researcher
107
-
108
- ```bash
109
- PHASE_DESC=$(ariadna-tools roadmap get-phase "${PHASE}" | jq -r '.section')
110
- # Use requirements_content from INIT (already loaded via --include requirements)
111
- REQUIREMENTS=$(echo "$INIT" | jq -r '.requirements_content // empty' | grep -A100 "## Requirements" | head -50)
112
- STATE_SNAP=$(ariadna-tools state-snapshot)
113
- # Extract decisions from state-snapshot JSON: jq '.decisions[] | "\(.phase): \(.summary) - \(.rationale)"'
114
- ```
115
-
116
- Research prompt:
117
-
118
- ```markdown
119
- <objective>
120
- Research how to implement Phase {phase_number}: {phase_name}
121
- Answer: "What do I need to know to PLAN this phase well?"
122
- </objective>
123
-
124
- <phase_context>
125
- IMPORTANT: If CONTEXT.md exists below, it contains user decisions from /ariadna:discuss-phase.
126
- - **Decisions** = Locked — research THESE deeply, no alternatives
127
- - **Claude's Discretion** = Freedom areas — research options, recommend
128
- - **Deferred Ideas** = Out of scope — ignore
129
-
130
- {context_content}
131
- </phase_context>
132
-
133
- <additional_context>
134
- **Phase description:** {phase_description}
135
- **Requirements:** {requirements}
136
- **Prior decisions:** {decisions}
137
- </additional_context>
138
-
139
- <output>
140
- Write to: {phase_dir}/{phase}-RESEARCH.md
141
- </output>
142
- ```
143
-
144
- ```
145
- Task(
146
- prompt="First, read ~/.claude/agents/ariadna-phase-researcher.md for your role and instructions.\n\n" + research_prompt,
147
- subagent_type="general-purpose",
148
- model="{researcher_model}",
149
- description="Research Phase {phase}"
150
- )
151
- ```
152
-
153
- ### Handle Researcher Return
154
-
155
- - **`## RESEARCH COMPLETE`:** Display confirmation, continue to step 6
156
- - **`## RESEARCH BLOCKED`:** Display blocker, offer: 1) Provide context, 2) Skip research, 3) Abort
157
-
158
- ## 6. Check Existing Plans
159
-
160
- ```bash
161
- ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null
162
- ```
163
-
164
- **If exists:** Offer: 1) Add more plans, 2) View existing, 3) Replan from scratch.
165
-
166
- ## 7. Use Context Files from INIT
167
-
168
- All file contents are already loaded via `--include` in step 1 (`@` syntax doesn't work across Task() boundaries):
169
-
170
- ```bash
171
- # Extract from INIT JSON (no need to re-read files)
172
- STATE_CONTENT=$(echo "$INIT" | jq -r '.state_content // empty')
173
- ROADMAP_CONTENT=$(echo "$INIT" | jq -r '.roadmap_content // empty')
174
- REQUIREMENTS_CONTENT=$(echo "$INIT" | jq -r '.requirements_content // empty')
175
- RESEARCH_CONTENT=$(echo "$INIT" | jq -r '.research_content // empty')
176
- VERIFICATION_CONTENT=$(echo "$INIT" | jq -r '.verification_content // empty')
177
- UAT_CONTENT=$(echo "$INIT" | jq -r '.uat_content // empty')
178
- CONTEXT_CONTENT=$(echo "$INIT" | jq -r '.context_content // empty')
179
- ```
180
-
181
- ## 8. Spawn ariadna-planner Agent
182
-
183
- Display banner:
184
- ```
185
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
186
- Ariadna ► PLANNING PHASE {X}
187
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
188
-
189
- ◆ Spawning planner...
190
- ```
191
-
192
- Planner prompt:
193
-
194
- ```markdown
195
- <planning_context>
196
- **Phase:** {phase_number}
197
- **Mode:** {standard | gap_closure}
198
-
199
- **Project State:** {state_content}
200
- **Roadmap:** {roadmap_content}
201
- **Requirements:** {requirements_content}
202
-
203
- **Phase Context:**
204
- IMPORTANT: If context exists below, it contains USER DECISIONS from /ariadna:discuss-phase.
205
- - **Decisions** = LOCKED — honor exactly, do not revisit
206
- - **Claude's Discretion** = Freedom — make implementation choices
207
- - **Deferred Ideas** = Out of scope — do NOT include
208
-
209
- {context_content}
210
-
211
- **Research:** {research_content}
212
- **Gap Closure (if --gaps):** {verification_content} {uat_content}
213
- </planning_context>
214
-
215
- <rails_context>
216
- Use Rails conventions from your required reading (rails-conventions.md) for:
217
- - Standard task decomposition patterns (model → migration+model+tests, controller → routes+controller+views+tests)
218
- - Known domain detection (skip discovery for standard Rails work)
219
- - Architecture patterns (MVC, concerns, service objects)
220
- - Common pitfall prevention (N+1, mass assignment, fat controllers)
221
- </rails_context>
222
-
223
- <downstream_consumer>
224
- Output consumed by /ariadna:execute-phase. Plans need:
225
- - Frontmatter (wave, depends_on, files_modified, autonomous)
226
- - Tasks in XML format
227
- - Verification criteria
228
- - must_haves for goal-backward verification
229
- </downstream_consumer>
230
-
231
- <quality_gate>
232
- - [ ] PLAN.md files created in phase directory
233
- - [ ] Each plan has valid frontmatter
234
- - [ ] Tasks are specific and actionable
235
- - [ ] Dependencies correctly identified
236
- - [ ] Waves assigned for parallel execution
237
- - [ ] must_haves derived from phase goal
238
- </quality_gate>
239
- ```
240
-
241
- ```
242
- Task(
243
- prompt="First, read ~/.claude/agents/ariadna-planner.md for your role and instructions.\n\n" + filled_prompt,
244
- subagent_type="general-purpose",
245
- model="{planner_model}",
246
- description="Plan Phase {phase}"
247
- )
248
- ```
249
-
250
- ## 9. Handle Planner Return
251
-
252
- - **`## PLANNING COMPLETE`:** Display plan count. If `--skip-verify` or `plan_checker_enabled` is false (from init): skip to step 13 (approval gate). Otherwise: step 10.
253
- - **`## CHECKPOINT REACHED`:** Present to user, get response, spawn continuation (step 12)
254
- - **`## PLANNING INCONCLUSIVE`:** Show attempts, offer: Add context / Retry / Manual
255
-
256
- ## 10. Spawn ariadna-plan-checker Agent
257
-
258
- Display banner:
259
- ```
260
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
261
- Ariadna ► VERIFYING PLANS
262
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
263
-
264
- ◆ Spawning plan checker...
265
- ```
6
+ ## Goal
7
+ Produce a set of PLAN.md files that `execute-phase` can run directly. Plans must have valid frontmatter (wave, domain, depends_on, files_modified) and tasks specific enough that an executor can work autonomously.
266
8
 
9
+ ## Context Loading
267
10
  ```bash
268
- PLANS_CONTENT=$(cat "${PHASE_DIR}"/*-PLAN.md 2>/dev/null)
269
- ```
270
-
271
- Checker prompt:
272
-
273
- ```markdown
274
- <verification_context>
275
- **Phase:** {phase_number}
276
- **Phase Goal:** {goal from ROADMAP}
277
-
278
- **Plans to verify:** {plans_content}
279
- **Requirements:** {requirements_content}
280
-
281
- **Phase Context:**
282
- IMPORTANT: Plans MUST honor user decisions. Flag as issue if plans contradict.
283
- - **Decisions** = LOCKED — plans must implement exactly
284
- - **Claude's Discretion** = Freedom areas — plans can choose approach
285
- - **Deferred Ideas** = Out of scope — plans must NOT include
286
-
287
- {context_content}
288
- </verification_context>
289
-
290
- <expected_output>
291
- - ## VERIFICATION PASSED — all checks pass
292
- - ## ISSUES FOUND — structured issue list with severity (minor/major/blocker)
293
- </expected_output>
294
- ```
295
-
296
- ```
297
- Task(
298
- prompt=checker_prompt,
299
- subagent_type="ariadna-plan-checker",
300
- model="{checker_model}",
301
- description="Verify Phase {phase} plans"
302
- )
303
- ```
304
-
305
- ## 11. Handle Checker Return
306
-
307
- - **`## VERIFICATION PASSED`:** Display confirmation, proceed to step 13 (approval gate).
308
- - **`## ISSUES FOUND`:** Classify issues and proceed to step 12.
309
-
310
- ## 12. Handle Checker Issues (Inline Fix, No Revision Loop)
311
-
312
- **Classify each issue by severity:**
313
-
314
- ### Minor Issues (orchestrator fixes inline)
315
- Issues the orchestrator can fix directly with the Edit tool — no agent re-spawn needed:
316
- - Missing requirement mapping in frontmatter
317
- - Dependency ordering errors (wrong wave number)
318
- - Missing `<verify>` or `<done>` elements in tasks
319
- - Frontmatter field corrections
320
- - must_haves adjustments
321
-
322
- **For minor issues:** Fix the PLAN.md files directly using the Edit tool:
323
- ```
324
- Read the PLAN.md file, apply the fix, write it back.
325
- ```
326
-
327
- Display: `Fixed {N} minor issue(s) inline.`
328
-
329
- ### Major Issues (present to user)
330
- Issues that require architectural decisions or significant plan restructuring:
331
- - Missing requirements with no clear task mapping
332
- - Incorrect decomposition (tasks too large or wrong scope)
333
- - Contradictions with user decisions from CONTEXT.md
334
- - Scope creep (tasks implementing deferred ideas)
335
-
336
- **For major issues:** Present to user with AskUserQuestion:
337
- ```
338
- questions: [
339
- {
340
- header: "Plan Issues",
341
- question: "The plan checker found {N} issue(s) that need your input. How to proceed?",
342
- multiSelect: false,
343
- options: [
344
- { label: "Accept as-is", description: "Proceed despite issues" },
345
- { label: "Re-plan", description: "Spawn planner again with issue context" },
346
- { label: "Fix manually", description: "I'll edit the PLAN.md files myself" }
347
- ]
348
- }
349
- ]
350
- ```
351
-
352
- - **"Accept as-is":** Proceed to step 13 (approval gate).
353
- - **"Re-plan":** Spawn planner in revision mode (single attempt, not a loop):
354
-
355
- ```
356
- Task(
357
- prompt="First, read ~/.claude/agents/ariadna-planner.md for your role and instructions.\n\n" + revision_prompt_with_issues,
358
- subagent_type="general-purpose",
359
- model="{planner_model}",
360
- description="Revise Phase {phase} plans"
361
- )
362
- ```
363
-
364
- After planner returns, proceed to step 13 (approval gate, no re-check loop).
365
-
366
- - **"Fix manually":** Display file paths and exit.
367
-
368
- ## 13. User Plan Approval Gate
369
-
370
- **Skip if:** `--skip-approval` flag, `--gaps` mode (gap closures already user-directed), or `requirements_content` is null (no REQUIREMENTS.md).
371
-
372
- **Otherwise:** Cross-reference each requirement mapped to this phase (from `requirements_content`) against the plans' `must_haves.truths` (from plan frontmatter). Present a single `AskUserQuestion`:
373
-
11
+ INIT=$(ariadna-tools init plan-phase "${PHASE_ARG}" --include state,roadmap,requirements,context,research,verification)
374
12
  ```
375
- questions: [
376
- {
377
- header: "Plan Review",
378
- question: "Phase {X}: {Name} — {N} plan(s) covering these requirements:\n\n| REQ-ID | Requirement | Covered By |\n|--------|-------------|------------|\n| {id} | {description} | Plan {plan_number}: {what_it_builds} |\n| {id} | {description} | ⚠ Not covered |\n\nApprove plans for execution?",
379
- multiSelect: false,
380
- options: [
381
- { label: "Approve", description: "Plans look good, proceed to execution" },
382
- { label: "Review details", description: "Show full plan files before deciding" },
383
- { label: "Adjust", description: "Give feedback for a single re-plan attempt" }
384
- ]
385
- }
386
- ]
387
- ```
388
-
389
- - **"Approve":** Proceed to step 14.
390
- - **"Review details":** Display full content of each PLAN.md file in the phase directory. Then re-ask the same question (Approve / Adjust only).
391
- - **"Adjust":** Ask user for feedback with a follow-up AskUserQuestion (freeform). Spawn planner in revision mode with user feedback (single attempt, no loop). Then proceed to step 14.
392
-
393
- ## 14. Present Final Status
394
-
395
- Route to `<offer_next>`.
396
-
397
- </process>
398
-
399
- <offer_next>
400
- Output this markdown directly (not as a code block):
401
-
402
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
403
- Ariadna ► PHASE {X} PLANNED ✓
404
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
405
-
406
- **Phase {X}: {Name}** — {N} plan(s) in {M} wave(s)
407
-
408
- | Wave | Plans | What it builds |
409
- |------|-------|----------------|
410
- | 1 | 01, 02 | [objectives] |
411
- | 2 | 03 | [objective] |
412
-
413
- Context: {Gathered inline | Used existing | Skipped}
414
- Research: {Completed | Used existing | Skipped (Rails conventions loaded)}
415
- Verification: {Passed | Passed with fixes | Skipped}
416
-
417
- ───────────────────────────────────────────────────────────────
418
-
419
- ## ▶ Next Up
420
-
421
- **Execute Phase {X}** — run all {N} plans
422
-
423
- /ariadna:execute-phase {X}
424
-
425
- <sub>/clear first → fresh context window</sub>
13
+ Returns: `phase_dir`, `phase_number`, `phase_name`, `planner_model`, `checker_model`, `has_plans`, `plan_count`, `state_content`, `roadmap_content`, `requirements_content`, `context_content`, `research_content`, `verification_content`.
426
14
 
427
- ───────────────────────────────────────────────────────────────
15
+ Also read: `@~/.claude/skills/rails-backend/SKILL.md` — loaded into every planner prompt for convention-aware decomposition.
428
16
 
429
- **Also available:**
430
- - cat .ariadna_planning/phases/{phase-dir}/*-PLAN.mdreview plans
431
- - /ariadna:plan-phase {X} --research re-research first
17
+ ## Constraints
18
+ - Spawn `ariadna-planner` agent; planner handles inline research AND self-checking (no separate research phase by default Rails conventions cover standard work; use `--research` only for non-standard integrations)
19
+ - Load Rails Skills (`@~/.claude/skills/rails-backend/SKILL.md`) in every planner prompt so domain detection and task decomposition follow Rails patterns
20
+ - Planner must self-check: valid frontmatter on every plan, wave ordering consistent with `depends_on`, no scope creep from deferred items in `context_content`
21
+ - Minor checker issues (wrong wave number, missing `<verify>` tags, frontmatter typos) fixed inline by orchestrator with Edit tool — no re-spawn
22
+ - Major issues (contradicts user decisions, missing requirement coverage, wrong decomposition) presented to user before proceeding
23
+ - `--gaps` mode reads `verification_content` and creates `gap_closure: true` plans only; skip context gathering and research
432
24
 
433
- ───────────────────────────────────────────────────────────────
434
- </offer_next>
25
+ ## Success Criteria
26
+ - PLAN.md files exist in `phase_dir` with valid frontmatter: `phase`, `plan`, `wave`, `domain`, `depends_on`
27
+ - Each plan's `must_haves` derived from the phase goal in ROADMAP.md (not from task list)
28
+ - Requirements from `requirements_content` mapped to plans (or flagged as uncovered)
435
29
 
436
- <success_criteria>
437
- - [ ] .ariadna_planning/ directory validated
438
- - [ ] Phase validated against roadmap
439
- - [ ] Phase directory created if needed
440
- - [ ] Context handled: existing CONTEXT.md used, inline gathering offered, or skipped
441
- - [ ] Research skipped by default (Rails conventions in context), or completed if --research flag
442
- - [ ] Existing plans checked
443
- - [ ] ariadna-planner spawned with rails-conventions + any CONTEXT.md + RESEARCH.md
444
- - [ ] Plans created (PLANNING COMPLETE or CHECKPOINT handled)
445
- - [ ] ariadna-plan-checker spawned (unless --skip-verify)
446
- - [ ] Minor checker issues fixed inline by orchestrator (no revision loop)
447
- - [ ] Major checker issues presented to user for decision
448
- - [ ] User approved plans (or --skip-approval / --gaps flag used / no REQUIREMENTS.md)
449
- - [ ] User sees status between agent spawns
450
- - [ ] User knows next steps
451
- </success_criteria>
30
+ ## On Completion
31
+ - Update `memory/progress.md` with plan count, waves, and any key decisions locked during context gathering
32
+ - Display next step: `/ariadna:execute-phase {N}` with a `/clear` reminder