ariadna 1.3.1 → 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 (148) 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. metadata +20 -91
  61. data/data/agents/ariadna-backend-executor.md +0 -261
  62. data/data/agents/ariadna-frontend-executor.md +0 -259
  63. data/data/agents/ariadna-integration-checker.md +0 -418
  64. data/data/agents/ariadna-phase-researcher.md +0 -469
  65. data/data/agents/ariadna-plan-checker.md +0 -622
  66. data/data/agents/ariadna-project-researcher.md +0 -618
  67. data/data/agents/ariadna-research-synthesizer.md +0 -236
  68. data/data/agents/ariadna-test-executor.md +0 -266
  69. data/data/ariadna/references/checkpoints.md +0 -772
  70. data/data/ariadna/references/continuation-format.md +0 -249
  71. data/data/ariadna/references/decimal-phase-calculation.md +0 -65
  72. data/data/ariadna/references/git-integration.md +0 -248
  73. data/data/ariadna/references/git-planning-commit.md +0 -38
  74. data/data/ariadna/references/model-profile-resolution.md +0 -32
  75. data/data/ariadna/references/model-profiles.md +0 -73
  76. data/data/ariadna/references/phase-argument-parsing.md +0 -61
  77. data/data/ariadna/references/planning-config.md +0 -194
  78. data/data/ariadna/references/questioning.md +0 -153
  79. data/data/ariadna/references/rails-conventions.md +0 -416
  80. data/data/ariadna/references/tdd.md +0 -267
  81. data/data/ariadna/references/ui-brand.md +0 -160
  82. data/data/ariadna/references/verification-patterns.md +0 -853
  83. data/data/ariadna/templates/codebase/architecture.md +0 -481
  84. data/data/ariadna/templates/codebase/concerns.md +0 -380
  85. data/data/ariadna/templates/codebase/conventions.md +0 -434
  86. data/data/ariadna/templates/codebase/integrations.md +0 -328
  87. data/data/ariadna/templates/codebase/stack.md +0 -189
  88. data/data/ariadna/templates/codebase/structure.md +0 -418
  89. data/data/ariadna/templates/codebase/testing.md +0 -606
  90. data/data/ariadna/templates/context.md +0 -283
  91. data/data/ariadna/templates/continue-here.md +0 -78
  92. data/data/ariadna/templates/debug-subagent-prompt.md +0 -91
  93. data/data/ariadna/templates/phase-prompt.md +0 -609
  94. data/data/ariadna/templates/planner-subagent-prompt.md +0 -117
  95. data/data/ariadna/templates/research-project/ARCHITECTURE.md +0 -439
  96. data/data/ariadna/templates/research-project/FEATURES.md +0 -168
  97. data/data/ariadna/templates/research-project/PITFALLS.md +0 -406
  98. data/data/ariadna/templates/research-project/STACK.md +0 -251
  99. data/data/ariadna/templates/research-project/SUMMARY.md +0 -247
  100. data/data/ariadna/templates/state.md +0 -176
  101. data/data/ariadna/templates/summary-complex.md +0 -59
  102. data/data/ariadna/templates/summary-minimal.md +0 -41
  103. data/data/ariadna/templates/summary-standard.md +0 -48
  104. data/data/ariadna/templates/user-setup.md +0 -310
  105. data/data/ariadna/workflows/add-phase.md +0 -111
  106. data/data/ariadna/workflows/add-todo.md +0 -157
  107. data/data/ariadna/workflows/audit-milestone.md +0 -241
  108. data/data/ariadna/workflows/check-todos.md +0 -176
  109. data/data/ariadna/workflows/complete-milestone.md +0 -644
  110. data/data/ariadna/workflows/diagnose-issues.md +0 -219
  111. data/data/ariadna/workflows/discovery-phase.md +0 -289
  112. data/data/ariadna/workflows/discuss-phase.md +0 -408
  113. data/data/ariadna/workflows/execute-plan.md +0 -448
  114. data/data/ariadna/workflows/help.md +0 -470
  115. data/data/ariadna/workflows/insert-phase.md +0 -129
  116. data/data/ariadna/workflows/list-phase-assumptions.md +0 -178
  117. data/data/ariadna/workflows/pause-work.md +0 -122
  118. data/data/ariadna/workflows/plan-milestone-gaps.md +0 -256
  119. data/data/ariadna/workflows/remove-phase.md +0 -154
  120. data/data/ariadna/workflows/research-phase.md +0 -74
  121. data/data/ariadna/workflows/resume-project.md +0 -306
  122. data/data/ariadna/workflows/set-profile.md +0 -80
  123. data/data/ariadna/workflows/settings.md +0 -145
  124. data/data/ariadna/workflows/transition.md +0 -493
  125. data/data/ariadna/workflows/update.md +0 -212
  126. data/data/ariadna/workflows/verify-phase.md +0 -226
  127. data/data/commands/ariadna/add-todo.md +0 -42
  128. data/data/commands/ariadna/audit-milestone.md +0 -42
  129. data/data/commands/ariadna/check-todos.md +0 -41
  130. data/data/commands/ariadna/complete-milestone.md +0 -136
  131. data/data/commands/ariadna/discuss-phase.md +0 -86
  132. data/data/commands/ariadna/help.md +0 -22
  133. data/data/commands/ariadna/list-phase-assumptions.md +0 -50
  134. data/data/commands/ariadna/pause-work.md +0 -35
  135. data/data/commands/ariadna/plan-milestone-gaps.md +0 -40
  136. data/data/commands/ariadna/reapply-patches.md +0 -110
  137. data/data/commands/ariadna/research-phase.md +0 -187
  138. data/data/commands/ariadna/resume-work.md +0 -40
  139. data/data/commands/ariadna/set-profile.md +0 -34
  140. data/data/commands/ariadna/settings.md +0 -36
  141. data/data/commands/ariadna/update.md +0 -37
  142. data/data/guides/backend.md +0 -3069
  143. data/data/guides/frontend.md +0 -1479
  144. data/data/guides/performance.md +0 -1193
  145. data/data/guides/security.md +0 -1522
  146. data/data/guides/style-guide.md +0 -1091
  147. data/data/guides/testing.md +0 -504
  148. data/data/templates.md +0 -94
@@ -1,35 +1,10 @@
1
1
  {
2
- "mode": "interactive",
3
- "depth": "standard",
4
- "workflow": {
5
- "research": true,
6
- "plan_check": true,
7
- "verifier": true
8
- },
9
- "planning": {
10
- "commit_docs": true,
11
- "search_gitignored": false
12
- },
13
- "parallelization": {
14
- "enabled": true,
15
- "plan_level": true,
16
- "task_level": false,
17
- "skip_checkpoints": true,
18
- "max_concurrent_agents": 3,
19
- "min_plans_for_parallel": 2
20
- },
21
- "gates": {
22
- "confirm_project": true,
23
- "confirm_phases": true,
24
- "confirm_roadmap": true,
25
- "confirm_breakdown": true,
26
- "confirm_plan": true,
27
- "execute_next_plan": true,
28
- "issues_review": true,
29
- "confirm_transition": true
30
- },
31
- "safety": {
32
- "always_confirm_destructive": true,
33
- "always_confirm_external_services": true
34
- }
2
+ "model_profile": "balanced",
3
+ "verifier": true,
4
+ "branching_strategy": "none",
5
+ "phase_branch_template": "ariadna/phase-{phase}-{slug}",
6
+ "milestone_branch_template": "ariadna/{milestone}-{slug}",
7
+ "commit_docs": true,
8
+ "search_gitignored": false,
9
+ "parallelization": true
35
10
  }
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: debug
3
+ description: Systematically diagnose UAT gaps by spawning parallel debug agents — one per gap — to find root causes before planning fixes.
4
+ ---
5
+
6
+ ## Goal
7
+ Turn UAT symptoms into diagnosed root causes. Parse gaps from a phase's UAT.md, spawn one debug agent per gap in parallel, collect root causes with evidence, then update UAT.md with `root_cause`, `artifacts`, `missing`, and `debug_session` fields so `plan-phase --gaps` can create targeted fixes.
8
+
9
+ ## Context Loading
10
+ ```bash
11
+ INIT=$(ariadna-tools init debug "$PHASE")
12
+ ```
13
+ Read the phase UAT.md from `.ariadna_planning/phases/{phase-dir}/{phase}-UAT.md`. Extract the "Gaps" section (YAML) — each gap has `truth`, `severity`, `test`, `reason`. Also read the matching "Tests" entries for full context. If no UAT.md or no failed gaps exist, error and exit.
14
+
15
+ ## Constraints
16
+ - Diagnose only — do NOT apply fixes; that is `plan-phase --gaps`'s job
17
+ - Spawn all debug agents in a single message (true parallel execution via `run_in_background=true`)
18
+ - Each agent writes its own `DEBUG-{slug}.md` to `.ariadna_planning/debug/`; orchestrator only receives root cause + file paths
19
+ - If an agent returns `## INVESTIGATION INCONCLUSIVE`, mark gap as "needs manual review" and continue with remaining gaps
20
+ - After all agents complete, update UAT.md gaps in place and commit with `docs({phase}): add root causes from diagnosis`
21
+
22
+ ## Success Criteria
23
+ - Every failed gap in UAT.md has `root_cause`, `artifacts`, and `missing` fields populated
24
+ - UAT.md frontmatter `status` updated to `diagnosed` and committed
25
+ - Debug sessions saved to `.ariadna_planning/debug/` for reference
26
+
27
+ ## On Completion
28
+ Display a root-cause table (gap truth → root cause → files involved). Return to the verify-work orchestrator automatically — do NOT offer manual next steps; verify-work routes to `plan-phase --gaps`.
@@ -1,518 +1,36 @@
1
- <purpose>
2
- Execute all plans in a phase using wave-based parallel execution. Orchestrator stays lean — delegates plan execution to subagents.
3
- </purpose>
4
-
5
- <core_principle>
6
- Orchestrator coordinates, not executes. Each subagent loads the full execute-plan context. Orchestrator: discover plans → analyze deps → group waves → spawn agents → handle checkpoints → collect results.
7
- </core_principle>
8
-
9
- <required_reading>
10
- Read STATE.md before any operation to load project context.
11
- </required_reading>
12
-
13
- <process>
14
-
15
- <step name="initialize" priority="first">
16
- Load all context in one call:
17
-
18
- ```bash
19
- INIT=$(ariadna-tools init execute-phase "${PHASE_ARG}")
20
- ```
21
-
22
- Parse JSON for: `executor_model`, `verifier_model`, `commit_docs`, `parallelization`, `branching_strategy`, `branch_name`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `plans`, `incomplete_plans`, `plan_count`, `incomplete_count`, `team_execution`, `execution_mode`, `backend_executor_model`, `frontend_executor_model`, `test_executor_model`, `state_exists`, `roadmap_exists`.
23
-
24
- **If `phase_found` is false:** Error — phase directory not found.
25
- **If `plan_count` is 0:** Error — no plans found in phase.
26
- **If `state_exists` is false but `.ariadna_planning/` exists:** Offer reconstruct or continue.
27
-
28
- When `parallelization` is false, plans within a wave execute sequentially.
29
- </step>
30
-
31
- <step name="handle_branching">
32
- Check `branching_strategy` from init:
33
-
34
- **"none":** Skip, continue on current branch.
35
-
36
- **"phase" or "milestone":** Use pre-computed `branch_name` from init:
37
- ```bash
38
- git checkout -b "$BRANCH_NAME" 2>/dev/null || git checkout "$BRANCH_NAME"
39
- ```
40
-
41
- All subsequent commits go to this branch. User handles merging.
42
- </step>
43
-
44
- <step name="validate_phase">
45
- From init JSON: `phase_dir`, `plan_count`, `incomplete_count`.
46
-
47
- Report: "Found {plan_count} plans in {phase_dir} ({incomplete_count} incomplete)"
48
- </step>
49
-
50
- <step name="discover_and_group_plans">
51
- Load plan inventory with wave grouping in one call:
52
-
53
- ```bash
54
- PLAN_INDEX=$(ariadna-tools phase-plan-index "${PHASE_NUMBER}")
55
- ```
56
-
57
- Parse JSON for: `plans[]` (each with `file`, `phase`, `plan`, `wave`, `type`, `completed`, `domain`, `depends_on`, `files_modified`, `autonomous`, `objective`, `task_count`), `count`, `domains`, `domain_count`, `multi_domain`, `recommend_team`.
58
-
59
- **Filtering:** Skip plans where `has_summary: true`. If `--gaps-only`: also skip non-gap_closure plans. If all filtered: "No matching incomplete plans" → exit.
60
-
61
- Report:
62
- ```
63
- ## Execution Plan
64
-
65
- **Phase {X}: {Name}** — {total_plans} plans across {wave_count} waves
66
-
67
- | Wave | Plans | What it builds |
68
- |------|-------|----------------|
69
- | 1 | 01-01, 01-02 | {from plan objectives, 3-8 words} |
70
- | 2 | 01-03 | ... |
71
- ```
72
- </step>
73
-
74
- <step name="decide_execution_mode">
75
- **Determine execution mode:**
76
-
77
- 1. If `--team` flag → team execution
78
- 2. If `--no-team` flag → wave execution
79
- 3. If `team_execution` from init is `true` → team execution
80
- 4. If `team_execution` from init is `false` → wave execution
81
- 5. If `team_execution` is `"auto"` → check plan index:
82
- - Parse `multi_domain` and `recommend_team` from PLAN_INDEX
83
- - If `recommend_team` is true (3+ plans, 2+ non-general domains) → team execution
84
- - Otherwise → wave execution
85
-
86
- Report:
87
- ```
88
- **Execution mode:** {Team | Wave}
89
- {If auto: "Auto-detected: {plan_count} plans across {domains}"}
90
- ```
91
-
92
- If team mode: proceed to `team_execution` step.
93
- If wave mode: proceed to `execute_waves` step.
94
- </step>
95
-
96
- <step name="execute_waves">
97
- Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`, sequential if `false`.
98
-
99
- **For each wave:**
100
-
101
- 1. **Describe what's being built (BEFORE spawning):**
102
-
103
- Read each plan's `<objective>`. Extract what's being built and why.
104
-
105
- ```
106
- ---
107
- ## Wave {N}
108
-
109
- **{Plan ID}: {Plan Name}**
110
- {2-3 sentences: what this builds, technical approach, why it matters}
111
-
112
- Spawning {count} agent(s)...
113
- ---
114
- ```
115
-
116
- - Bad: "Executing terrain generation plan"
117
- - Good: "Procedural terrain generator using Perlin noise — creates height maps, biome zones, and collision meshes. Required before vehicle physics can interact with ground."
118
-
119
- 2. **Spawn executor agents:**
120
-
121
- Pass paths only — executors read files themselves with their fresh 200k context.
122
- This keeps orchestrator context lean (~10-15%).
123
-
124
- **Domain routing:** Read `domain` from each plan's frontmatter to determine which executor to spawn:
125
-
126
- ```bash
127
- DOMAIN=$(ariadna-tools frontmatter get "{phase_dir}/{plan_file}" --field domain)
128
- DOMAIN_GUIDE=$(ariadna-tools frontmatter get "{phase_dir}/{plan_file}" --field domain_guide)
129
- ```
130
-
131
- | Domain | Executor Agent | Guide |
132
- |--------|---------------|-------|
133
- | `backend` | `ariadna-backend-executor` | `@~/.claude/guides/backend.md` |
134
- | `frontend` | `ariadna-frontend-executor` | `@~/.claude/guides/frontend.md` |
135
- | `testing` | `ariadna-test-executor` | `@~/.claude/guides/testing.md` |
136
- | `general` or unset | `ariadna-executor` | (none) |
137
-
138
- ```
139
- Task(
140
- subagent_type="{executor_agent}",
141
- model="{executor_model}",
142
- prompt="
143
- <objective>
144
- Execute plan {plan_number} of phase {phase_number}-{phase_name}.
145
- Commit each task atomically. Create SUMMARY.md. Update STATE.md.
146
- </objective>
147
-
148
- <execution_context>
149
- @~/.claude/ariadna/workflows/execute-plan.md
150
- @~/.claude/ariadna/templates/summary.md
151
- @~/.claude/ariadna/references/checkpoints.md
152
- @~/.claude/ariadna/references/tdd.md
153
- {If domain_guide is set:}
154
- @~/.claude/guides/{domain_guide}
155
- </execution_context>
156
-
157
- <files_to_read>
158
- Read these files at execution start using the Read tool:
159
- - Plan: {phase_dir}/{plan_file}
160
- - State: .ariadna_planning/STATE.md
161
- - Config: .ariadna_planning/config.json (if exists)
162
- </files_to_read>
163
-
164
- <success_criteria>
165
- - [ ] All tasks executed
166
- - [ ] Each task committed individually
167
- - [ ] SUMMARY.md created in plan directory
168
- - [ ] STATE.md updated with position and decisions
169
- </success_criteria>
170
- "
171
- )
172
- ```
173
-
174
- 3. **Wait for all agents in wave to complete.**
175
-
176
- 4. **Report completion — spot-check claims first:**
177
-
178
- For each SUMMARY.md:
179
- - Verify first 2 files from `key-files.created` exist on disk
180
- - Check `git log --oneline --all --grep="{phase}-{plan}"` returns ≥1 commit
181
- - Check for `## Self-Check: FAILED` marker
182
-
183
- If ANY spot-check fails: report which plan failed, route to failure handler — ask "Retry plan?" or "Continue with remaining waves?"
184
-
185
- If pass:
186
- ```
187
- ---
188
- ## Wave {N} Complete
189
-
190
- **{Plan ID}: {Plan Name}**
191
- {What was built — from SUMMARY.md}
192
- {Notable deviations, if any}
193
-
194
- {If more waves: what this enables for next wave}
195
- ---
196
- ```
197
-
198
- - Bad: "Wave 2 complete. Proceeding to Wave 3."
199
- - Good: "Terrain system complete — 3 biome types, height-based texturing, physics collision meshes. Vehicle physics (Wave 3) can now reference ground surfaces."
200
-
201
- 5. **Handle failures:**
202
-
203
- **Known Claude Code bug (classifyHandoffIfNeeded):** If an agent reports "failed" with error containing `classifyHandoffIfNeeded is not defined`, this is a Claude Code runtime bug — not an Ariadna or agent issue. The error fires in the completion handler AFTER all tool calls finish. In this case: run the same spot-checks as step 4 (SUMMARY.md exists, git commits present, no Self-Check: FAILED). If spot-checks PASS → treat as **successful**. If spot-checks FAIL → treat as real failure below.
204
-
205
- For real failures: report which plan failed → ask "Continue?" or "Stop?" → if continue, dependent plans may also fail. If stop, partial completion report.
206
-
207
- 6. **Execute checkpoint plans between waves** — see `<checkpoint_handling>`.
208
-
209
- 7. **Proceed to next wave.**
210
- </step>
211
-
212
- <step name="team_execution">
213
- **Alternative to `execute_waves`.** Used when `team_execution` config is `true` OR `--team` flag is passed.
214
-
215
- **Decision gate:** Check config and flags:
216
- ```bash
217
- TEAM_MODE=$(ariadna-tools config get execution.team 2>/dev/null || echo "false")
218
- ```
219
- If `TEAM_MODE` is `true` OR `--team` flag present → use team execution. Otherwise → use wave-based `execute_waves` (default).
220
-
221
- **Team execution flow:**
222
-
223
- 1. **Create team:**
224
- ```
225
- TeamCreate(team_name="phase-{N}-execution", description="Executing phase {N}")
226
- ```
227
-
228
- 2. **Create tasks from plans:** One `TaskCreate` per incomplete plan:
229
- ```
230
- TaskCreate(
231
- subject="Execute plan {plan_id}: {objective}",
232
- description="Execute {phase_dir}/{plan_file}. Domain: {domain}. Files: {files_modified}.",
233
- activeForm="Executing plan {plan_id}"
234
- )
235
- ```
236
- Set up dependencies using `addBlockedBy` matching plan `depends_on` fields.
237
-
238
- 3. **Spawn domain executor agents:** One agent per unique domain in the plans:
239
- ```
240
- Task(
241
- team_name="phase-{N}-execution",
242
- name="{domain}-executor",
243
- subagent_type="ariadna-{domain}-executor",
244
- model="{executor_model}",
245
- prompt="
246
- You are a {domain} executor on team phase-{N}-execution.
247
-
248
- <protocol>
249
- 1. Check TaskList for tasks assigned to you
250
- 2. Claim unblocked tasks via TaskUpdate(status='in_progress')
251
- 3. Read the plan file, execute all tasks, create SUMMARY.md
252
- 4. Mark task completed via TaskUpdate(status='completed')
253
- 5. Check TaskList for next available task
254
- 6. When no tasks remain, send message to team lead
255
- </protocol>
256
-
257
- <execution_context>
258
- @~/.claude/ariadna/workflows/execute-plan.md
259
- @~/.claude/ariadna/templates/summary.md
260
- @~/.claude/guides/{domain_guide}
261
- </execution_context>
262
- "
263
- )
264
- ```
265
- For `general` domain, use `ariadna-executor` as the subagent_type.
266
-
267
- 4. **Assign tasks:** `TaskUpdate(owner="{domain}-executor")` for each task based on plan domain.
268
-
269
- 5. **Monitor progress:** Orchestrator monitors via `TaskList`. When agents complete tasks:
270
- - Newly unblocked tasks become available for assignment
271
- - Assign unblocked tasks to idle agents of the matching domain
272
- - Cross-domain handoffs: if a frontend task depends on a backend task, the frontend executor can read the backend SUMMARY.md for context
273
-
274
- **Progress reporting (on each task completion message from an agent):**
275
- Check `TaskList` and display:
276
- ```
277
- ## Team Progress
278
- | Agent | Status | Current Task | Completed |
279
- |-------------------|---------|-------------|-----------|
280
- | backend-executor | working | Plan 03-01 | 1/3 |
281
- | frontend-executor | idle | waiting | 0/2 |
282
- | test-executor | working | Plan 03-03 | 0/1 |
283
- ```
284
-
285
- 6. **Handle checkpoints:** Same as wave-based — agent sends message to orchestrator, orchestrator presents checkpoint to user, spawns continuation agent.
286
-
287
- 7. **Shutdown team:** When all tasks are complete:
288
- ```
289
- SendMessage(type="shutdown_request", recipient="{domain}-executor")
290
- ```
291
- for each spawned agent. After all agents shut down:
292
- ```
293
- TeamDelete()
294
- ```
295
-
296
- **Conflict prevention:** File ownership is enforced by `files_modified` frontmatter — the planner ensures no overlap between concurrent plans assigned to different agents.
297
-
298
- **STATE.md serialization:** Agents do NOT update STATE.md in team mode.
299
- The orchestrator reads each SUMMARY.md after all tasks complete and
300
- updates STATE.md sequentially. This prevents concurrent write corruption.
301
- </step>
302
-
303
- <step name="checkpoint_handling">
304
- Plans with `autonomous: false` require user interaction.
305
-
306
- **Flow:**
307
-
308
- 1. Spawn agent for checkpoint plan
309
- 2. Agent runs until checkpoint task or auth gate → returns structured state
310
- 3. Agent return includes: completed tasks table, current task + blocker, checkpoint type/details, what's awaited
311
- 4. **Present to user:**
312
- ```
313
- ## Checkpoint: [Type]
314
-
315
- **Plan:** 03-03 Dashboard Layout
316
- **Progress:** 2/3 tasks complete
317
-
318
- [Checkpoint Details from agent return]
319
- [Awaiting section from agent return]
320
- ```
321
- 5. User responds: "approved"/"done" | issue description | decision selection
322
- 6. **Spawn continuation agent (NOT resume)** using continuation-prompt.md template:
323
- - `{completed_tasks_table}`: From checkpoint return
324
- - `{resume_task_number}` + `{resume_task_name}`: Current task
325
- - `{user_response}`: What user provided
326
- - `{resume_instructions}`: Based on checkpoint type
327
- 7. Continuation agent verifies previous commits, continues from resume point
328
- 8. Repeat until plan completes or user stops
329
-
330
- **Why fresh agent, not resume:** Resume relies on internal serialization that breaks with parallel tool calls. Fresh agents with explicit state are more reliable.
331
-
332
- **Checkpoints in parallel waves:** Agent pauses and returns while other parallel agents may complete. Present checkpoint, spawn continuation, wait for all before next wave.
333
- </step>
334
-
335
- <step name="aggregate_results">
336
- After all waves (or after all team tasks complete):
337
-
338
- **Team mode state aggregation (if team execution was used):**
339
-
340
- For each completed task's SUMMARY.md, in plan order:
341
- ```bash
342
- ariadna-tools state advance-plan
343
- ariadna-tools state record-metric \
344
- --phase "${PHASE}" --plan "${PLAN}" --duration "${DURATION}" \
345
- --tasks "${TASK_COUNT}" --files "${FILE_COUNT}"
346
- ```
347
- This runs sequentially from the orchestrator to prevent concurrent writes.
348
-
349
- **Aggregate requirements coverage:** Parse `requirements_covered` from all SUMMARY.md frontmatter in this phase. Cross-check against `requirements_content` (from INIT or re-read REQUIREMENTS.md) for requirements mapped to this phase. Flag uncovered requirements. Show coverage count.
350
-
351
- If covered requirements exist, update REQUIREMENTS.md traceability table: set status to "Complete" for each covered REQ-ID, with evidence from the SUMMARY frontmatter.
352
-
353
- ```markdown
354
- ## Phase {X}: {Name} Execution Complete
355
-
356
- **Waves:** {N} | **Plans:** {M}/{total} complete
357
- **Requirements:** {covered}/{total_for_phase} covered
358
-
359
- | Wave | Plans | Status |
360
- |------|-------|--------|
361
- | 1 | plan-01, plan-02 | ✓ Complete |
362
- | CP | plan-03 | ✓ Verified |
363
- | 2 | plan-04 | ✓ Complete |
364
-
365
- ### Plan Details
366
- 1. **03-01**: [one-liner from SUMMARY.md]
367
- 2. **03-02**: [one-liner from SUMMARY.md]
368
-
369
- ### Requirements Coverage
370
- | REQ-ID | Requirement | Evidence |
371
- |--------|-------------|----------|
372
- | {id} | {description} | {evidence from SUMMARY} |
373
- | {id} | {description} | ⚠ Not covered |
374
-
375
- [Omit section if no REQUIREMENTS.md or no requirements for this phase]
376
-
377
- ### Issues Encountered
378
- [Aggregate from SUMMARYs, or "None"]
379
- ```
380
- </step>
381
-
382
- <step name="verify_phase_goal">
383
- Verify phase achieved its GOAL, not just completed tasks.
384
-
385
- ```
386
- Task(
387
- prompt="Verify phase {phase_number} goal achievement.
388
- Phase directory: {phase_dir}
389
- Phase goal: {goal from ROADMAP.md}
390
- Check must_haves against actual codebase. Create VERIFICATION.md.",
391
- subagent_type="ariadna-verifier",
392
- model="{verifier_model}"
393
- )
394
- ```
395
-
396
- Read status:
397
- ```bash
398
- grep "^status:" "$PHASE_DIR"/*-VERIFICATION.md | cut -d: -f2 | tr -d ' '
399
- ```
400
-
401
- | Status | Action |
402
- |--------|--------|
403
- | `passed` | → user_acceptance |
404
- | `human_needed` | Present items for human testing, get approval or feedback → user_acceptance |
405
- | `gaps_found` | Present gap summary, offer `/ariadna:plan-phase {phase} --gaps` |
406
-
407
- **If human_needed:**
408
- ```
409
- ## ✓ Phase {X}: {Name} — Human Verification Required
410
-
411
- All automated checks passed. {N} items need human testing:
412
-
413
- {From VERIFICATION.md human_verification section}
414
-
415
- "approved" → continue | Report issues → gap closure
416
- ```
417
-
418
- **If gaps_found:**
419
- ```
420
- ## ⚠ Phase {X}: {Name} — Gaps Found
421
-
422
- **Score:** {N}/{M} must-haves verified
423
- **Report:** {phase_dir}/{phase}-VERIFICATION.md
424
-
425
- ### What's Missing
426
- {Gap summaries from VERIFICATION.md}
427
-
428
1
  ---
429
- ## ▶ Next Up
430
-
431
- `/ariadna:plan-phase {X} --gaps`
432
-
433
- <sub>`/clear` first → fresh context window</sub>
434
-
435
- Also: `cat {phase_dir}/{phase}-VERIFICATION.md` — full report
436
- Also: `/ariadna:verify-work {X}` — manual testing first
437
- ```
438
-
439
- Gap closure cycle: `/ariadna:plan-phase {X} --gaps` reads VERIFICATION.md → creates gap plans with `gap_closure: true` → user runs `/ariadna:execute-phase {X} --gaps-only` → verifier re-runs.
440
- </step>
441
-
442
- <step name="user_acceptance">
443
- **Trigger:** After verifier returns `passed` (or `human_needed` items are approved by user).
444
-
445
- **Skip if:** `--no-review` flag, or ALL plans in this phase have `domain: backend` or `domain: testing` only (no user-facing deliverables).
446
-
447
- **Otherwise:** Show a lightweight acceptance gate. Gather one-liners from each SUMMARY.md + key decisions Claude made during execution:
448
-
449
- ```
450
- questions: [
451
- {
452
- header: "Acceptance",
453
- question: "Phase {X}: {Name} — verified and passing.\n\nWhat was built:\n- {one-liner from SUMMARY 1}\n- {one-liner from SUMMARY 2}\n\nKey decisions made:\n- {decision 1 from SUMMARY}\n- {decision 2 from SUMMARY}\n\nDoes the direction look right?",
454
- multiSelect: false,
455
- options: [
456
- { label: "Looks good", description: "Mark phase complete and continue" },
457
- { label: "Test first", description: "Run /ariadna:verify-work before marking complete" },
458
- { label: "Issues", description: "Record blocker and suggest gap closure" }
459
- ]
460
- }
461
- ]
462
- ```
463
-
464
- - **"Looks good":** Proceed to `update_roadmap`.
465
- - **"Test first":** Display: `Run /ariadna:verify-work {X} to test, then re-run /ariadna:execute-phase {X} to continue.` Exit without marking phase complete.
466
- - **"Issues":** Ask user to describe the issue. Record as blocker in STATE.md via `ariadna-tools state add-blocker "{issue}"`. Display: `Blocker recorded. Run /ariadna:plan-phase {X} --gaps to create fix plans.` Exit without marking phase complete.
467
- </step>
2
+ name: execute-phase
3
+ description: Execute all plans in a phase using wave-based ordering, producing SUMMARY.md and atomic commits per task
4
+ ---
468
5
 
469
- <step name="update_roadmap">
470
- Mark phase complete in ROADMAP.md (date, status).
6
+ ## Goal
7
+ Execute every plan in a phase by spawning executor subagents, respecting wave dependencies, and producing committed deliverables. Orchestrator coordinates; subagents do the work.
471
8
 
9
+ ## Context Loading
472
10
  ```bash
473
- ariadna-tools commit "docs(phase-{X}): complete phase execution" --files .ariadna_planning/ROADMAP.md .ariadna_planning/STATE.md .ariadna_planning/phases/{phase_dir}/*-VERIFICATION.md .ariadna_planning/REQUIREMENTS.md
474
- ```
475
- </step>
476
-
477
- <step name="offer_next">
478
-
479
- **If more phases:**
480
- ```
481
- ## Next Up
482
-
483
- **Phase {X+1}: {Name}** — {Goal}
484
-
485
- `/ariadna:plan-phase {X+1}`
486
-
487
- <sub>`/clear` first for fresh context</sub>
488
- ```
489
-
490
- **If milestone complete:**
491
- ```
492
- MILESTONE COMPLETE!
493
-
494
- All {N} phases executed.
495
-
496
- `/ariadna:complete-milestone`
11
+ INIT=$(ariadna-tools init execute-phase "${PHASE_ARG}")
497
12
  ```
498
- </step>
499
-
500
- </process>
501
-
502
- <context_efficiency>
503
- Orchestrator: ~10-15% context. Subagents: fresh 200k each. No polling (Task blocks). No context bleed.
504
- </context_efficiency>
505
-
506
- <failure_handling>
507
- - **classifyHandoffIfNeeded false failure:** Agent reports "failed" but error is `classifyHandoffIfNeeded is not defined` → Claude Code bug, not Ariadna. Spot-check (SUMMARY exists, commits present) if pass, treat as success
508
- - **Agent fails mid-plan:** Missing SUMMARY.md report, ask user how to proceed
509
- - **Dependency chain breaks:** Wave 1 fails Wave 2 dependents likely fail → user chooses attempt or skip
510
- - **All agents in wave fail:** Systemic issue stop, report for investigation
511
- - **Checkpoint unresolvable:** "Skip this plan?" or "Abort phase execution?" → record partial progress in STATE.md
512
- </failure_handling>
513
-
514
- <resumption>
515
- Re-run `/ariadna:execute-phase {phase}` discover_plans finds completed SUMMARYs → skips them → resumes from first incomplete plan → continues wave execution.
516
-
517
- STATE.md tracks: last completed plan, current wave, pending checkpoints.
518
- </resumption>
13
+ Returns: `phase_dir`, `phase_number`, `phase_name`, `plans[]` (each with `wave`, `domain`, `depends_on`, `has_summary`), `executor_model`, `verifier_model`, `parallelization`, `branching_strategy`, `branch_name`.
14
+
15
+ Also read: `.ariadna_planning/STATE.md` for current project position.
16
+
17
+ ## Constraints
18
+ - Orchestrator stays lean (~10-15% context) pass paths only, subagents read files themselves
19
+ - Wave ordering is strict: all wave N plans complete before wave N+1 begins
20
+ - Skip plans where `has_summary: true` (already done); resumption is automatic
21
+ - Route executor agent by `domain` frontmatter: `backend` → `ariadna-backend-executor`, `frontend` → `ariadna-frontend-executor`, `testing` → `ariadna-test-executor`, `general`/unset → `ariadna-executor`
22
+ - Load the matching Rails Skills (`@~/.claude/skills/rails-{domain}/SKILL.md`) in each executor prompt
23
+ - Each task must be committed atomically; executor creates SUMMARY.md in plan directory
24
+ - Plans with `autonomous: false` require a checkpoint pause before continuing
25
+ - If agent returns `classifyHandoffIfNeeded` error: spot-check SUMMARY.md + git commits — if present, treat as success
26
+
27
+ ## Success Criteria
28
+ - Every plan in the phase has a SUMMARY.md
29
+ - `git log` shows at least one commit per plan
30
+ - No `## Self-Check: FAILED` markers in any SUMMARY.md
31
+
32
+ ## On Completion
33
+ - Spawn `ariadna-verifier` to check phase goal achievement (not just task completion)
34
+ - Update `memory/progress.md` with phase status and any decisions made
35
+ - Record session summary: mark phase complete in ROADMAP.md, commit STATE.md
36
+ - If verifier finds gaps: offer `/ariadna:plan-phase {N} --gaps` for closure