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,448 +0,0 @@
1
- <purpose>
2
- Execute a phase prompt (PLAN.md) and create the outcome summary (SUMMARY.md).
3
- </purpose>
4
-
5
- <required_reading>
6
- Read STATE.md before any operation to load project context.
7
- Read config.json for planning behavior settings.
8
-
9
- @~/.claude/ariadna/references/git-integration.md
10
- </required_reading>
11
-
12
- <process>
13
-
14
- <step name="init_context" priority="first">
15
- Load execution context (uses `init execute-phase` for full context, including file contents):
16
-
17
- ```bash
18
- INIT=$(ariadna-tools init execute-phase "${PHASE}" --include state,config)
19
- ```
20
-
21
- Extract from init JSON: `executor_model`, `commit_docs`, `phase_dir`, `phase_number`, `plans`, `summaries`, `incomplete_plans`.
22
-
23
- **File contents (from --include):** `state_content`, `config_content`. Access with:
24
- ```bash
25
- STATE_CONTENT=$(echo "$INIT" | jq -r '.state_content // empty')
26
- CONFIG_CONTENT=$(echo "$INIT" | jq -r '.config_content // empty')
27
- ```
28
-
29
- If `.ariadna_planning/` missing: error.
30
- </step>
31
-
32
- <step name="identify_plan">
33
- ```bash
34
- # Use plans/summaries from INIT JSON, or list files
35
- ls .ariadna_planning/phases/XX-name/*-PLAN.md 2>/dev/null | sort
36
- ls .ariadna_planning/phases/XX-name/*-SUMMARY.md 2>/dev/null | sort
37
- ```
38
-
39
- Find first PLAN without matching SUMMARY. Decimal phases supported (`01.1-hotfix/`):
40
-
41
- ```bash
42
- PHASE=$(echo "$PLAN_PATH" | grep -oE '[0-9]+(\.[0-9]+)?-[0-9]+')
43
- # config_content already loaded via --include config in init_context
44
- ```
45
-
46
- <if mode="yolo">
47
- Auto-approve: `⚡ Execute {phase}-{plan}-PLAN.md [Plan X of Y for Phase Z]` → parse_segments.
48
- </if>
49
-
50
- <if mode="interactive" OR="custom with gates.execute_next_plan true">
51
- Present plan identification, wait for confirmation.
52
- </if>
53
- </step>
54
-
55
- <step name="record_start_time">
56
- ```bash
57
- PLAN_START_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
58
- PLAN_START_EPOCH=$(date +%s)
59
- ```
60
- </step>
61
-
62
- <step name="parse_segments">
63
- ```bash
64
- grep -n "type=\"checkpoint" .ariadna_planning/phases/XX-name/{phase}-{plan}-PLAN.md
65
- ```
66
-
67
- **Routing by checkpoint type:**
68
-
69
- | Checkpoints | Pattern | Execution |
70
- |-------------|---------|-----------|
71
- | None | A (autonomous) | Single subagent: full plan + SUMMARY + commit |
72
- | Verify-only | B (segmented) | Segments between checkpoints. After none/human-verify → SUBAGENT. After decision/human-action → MAIN |
73
- | Decision | C (main) | Execute entirely in main context |
74
-
75
- **Pattern A:** init_agent_tracking → spawn Task(subagent_type="ariadna-executor", model=executor_model) with prompt: execute plan at [path], autonomous, all tasks + SUMMARY + commit, follow deviation/auth rules, report: plan name, tasks, SUMMARY path, commit hash → track agent_id → wait → update tracking → report.
76
-
77
- **Pattern B:** Execute segment-by-segment. Autonomous segments: spawn subagent for assigned tasks only (no SUMMARY/commit). Checkpoints: main context. After all segments: aggregate, create SUMMARY, commit. See segment_execution.
78
-
79
- **Pattern C:** Execute in main using standard flow (step name="execute").
80
-
81
- Fresh context per subagent preserves peak quality. Main context stays lean.
82
- </step>
83
-
84
- <step name="init_agent_tracking">
85
- ```bash
86
- if [ ! -f .ariadna_planning/agent-history.json ]; then
87
- echo '{"version":"1.0","max_entries":50,"entries":[]}' > .ariadna_planning/agent-history.json
88
- fi
89
- rm -f .ariadna_planning/current-agent-id.txt
90
- if [ -f .ariadna_planning/current-agent-id.txt ]; then
91
- INTERRUPTED_ID=$(cat .ariadna_planning/current-agent-id.txt)
92
- echo "Found interrupted agent: $INTERRUPTED_ID"
93
- fi
94
- ```
95
-
96
- If interrupted: ask user to resume (Task `resume` parameter) or start fresh.
97
-
98
- **Tracking protocol:** On spawn: write agent_id to `current-agent-id.txt`, append to agent-history.json: `{"agent_id":"[id]","task_description":"[desc]","phase":"[phase]","plan":"[plan]","segment":[num|null],"timestamp":"[ISO]","status":"spawned","completion_timestamp":null}`. On completion: status → "completed", set completion_timestamp, delete current-agent-id.txt. Prune: if entries > max_entries, remove oldest "completed" (never "spawned").
99
-
100
- Run for Pattern A/B before spawning. Pattern C: skip.
101
- </step>
102
-
103
- <step name="segment_execution">
104
- Pattern B only (verify-only checkpoints). Skip for A/C.
105
-
106
- 1. Parse segment map: checkpoint locations and types
107
- 2. Per segment:
108
- - Subagent route: spawn ariadna-executor for assigned tasks only. Prompt: task range, plan path, read full plan for context, execute assigned tasks, track deviations, NO SUMMARY/commit. Track via agent protocol.
109
- - Main route: execute tasks using standard flow (step name="execute")
110
- 3. After ALL segments: aggregate files/deviations/decisions → create SUMMARY.md → commit → self-check:
111
- - Verify key-files.created exist on disk with `[ -f ]`
112
- - Check `git log --oneline --all --grep="{phase}-{plan}"` returns ≥1 commit
113
- - Append `## Self-Check: PASSED` or `## Self-Check: FAILED` to SUMMARY
114
-
115
- **Known Claude Code bug (classifyHandoffIfNeeded):** If any segment agent reports "failed" with `classifyHandoffIfNeeded is not defined`, this is a Claude Code runtime bug — not a real failure. Run spot-checks; if they pass, treat as successful.
116
-
117
-
118
-
119
-
120
- </step>
121
-
122
- <step name="load_prompt">
123
- ```bash
124
- cat .ariadna_planning/phases/XX-name/{phase}-{plan}-PLAN.md
125
- ```
126
- This IS the execution instructions. Follow exactly. If plan references CONTEXT.md: honor user's vision throughout.
127
- </step>
128
-
129
- <step name="previous_phase_check">
130
- ```bash
131
- ls .ariadna_planning/phases/*/SUMMARY.md 2>/dev/null | sort -r | head -2 | tail -1
132
- ```
133
- If previous SUMMARY has unresolved "Issues Encountered" or "Next Phase Readiness" blockers: AskUserQuestion(header="Previous Issues", options: "Proceed anyway" | "Address first" | "Review previous").
134
- </step>
135
-
136
- <step name="execute">
137
- Deviations are normal — handle via rules below.
138
-
139
- 1. Read @context files from prompt
140
- 2. Per task:
141
- - `type="auto"`: if `tdd="true"` → TDD execution. Implement with deviation rules + auth gates. Verify done criteria. Commit (see task_commit). Track hash for Summary.
142
- - `type="checkpoint:*"`: STOP → checkpoint_protocol → wait for user → continue only after confirmation.
143
- 3. Run `<verification>` checks
144
- 4. Confirm `<success_criteria>` met
145
- 5. Document deviations in Summary
146
- </step>
147
-
148
- <authentication_gates>
149
-
150
- ## Authentication Gates
151
-
152
- Auth errors during execution are NOT failures — they're expected interaction points.
153
-
154
- **Indicators:** "Not authenticated", "Unauthorized", 401/403, "Please run {tool} login", "Set {ENV_VAR}"
155
-
156
- **Protocol:**
157
- 1. Recognize auth gate (not a bug)
158
- 2. STOP task execution
159
- 3. Create dynamic checkpoint:human-action with exact auth steps
160
- 4. Wait for user to authenticate
161
- 5. Verify credentials work
162
- 6. Retry original task
163
- 7. Continue normally
164
-
165
- **Example:** `kamal deploy` → "SSH connection refused" → checkpoint asking user to configure SSH key access → verify with `ssh root@server-ip exit` → retry deploy → continue
166
-
167
- **In Summary:** Document as normal flow under "## Authentication Gates", not as deviations.
168
-
169
- </authentication_gates>
170
-
171
- <deviation_rules>
172
-
173
- ## Deviation Rules
174
-
175
- You WILL discover unplanned work. Apply automatically, track all for Summary.
176
-
177
- | Rule | Trigger | Action | Permission |
178
- |------|---------|--------|------------|
179
- | **1: Bug** | Broken behavior, errors, wrong queries, type errors, security vulns, race conditions, leaks | Fix → test → verify → track `[Rule 1 - Bug]` | Auto |
180
- | **2: Missing Critical** | Missing essentials: error handling, validation, auth, CSRF/CORS, rate limiting, indexes, logging | Add → test → verify → track `[Rule 2 - Missing Critical]` | Auto |
181
- | **3: Blocking** | Prevents completion: missing deps, wrong types, broken imports, missing env/config/files, circular deps | Fix blocker → verify proceeds → track `[Rule 3 - Blocking]` | Auto |
182
- | **4: Architectural** | Structural change: new DB table, schema change, new service, switching libs, breaking API, new infra | STOP → present decision (below) → track `[Rule 4 - Architectural]` | Ask user |
183
-
184
- **Rule 4 format:**
185
- ```
186
- ⚠️ Architectural Decision Needed
187
-
188
- Current task: [task name]
189
- Discovery: [what prompted this]
190
- Proposed change: [modification]
191
- Why needed: [rationale]
192
- Impact: [what this affects]
193
- Alternatives: [other approaches]
194
-
195
- Proceed with proposed change? (yes / different approach / defer)
196
- ```
197
-
198
- **Priority:** Rule 4 (STOP) > Rules 1-3 (auto) > unsure → Rule 4
199
- **Edge cases:** missing validation → R2 | null crash → R1 | new table → R4 | new column → R1/2
200
- **Heuristic:** Affects correctness/security/completion? → R1-3. Maybe? → R4.
201
-
202
- </deviation_rules>
203
-
204
- <deviation_documentation>
205
-
206
- ## Documenting Deviations
207
-
208
- Summary MUST include deviations section. None? → `## Deviations from Plan\n\nNone - plan executed exactly as written.`
209
-
210
- Per deviation: **[Rule N - Category] Title** — Found during: Task X | Issue | Fix | Files modified | Verification | Commit hash
211
-
212
- End with: **Total deviations:** N auto-fixed (breakdown). **Impact:** assessment.
213
-
214
- </deviation_documentation>
215
-
216
- <tdd_plan_execution>
217
- ## TDD Execution
218
-
219
- For `type: tdd` plans — RED-GREEN-REFACTOR:
220
-
221
- 1. **Infrastructure** (first TDD plan only): detect project, install framework, config, verify empty suite
222
- 2. **RED:** Read `<behavior>` → failing test(s) → run (MUST fail) → commit: `test({phase}-{plan}): add failing test for [feature]`
223
- 3. **GREEN:** Read `<implementation>` → minimal code → run (MUST pass) → commit: `feat({phase}-{plan}): implement [feature]`
224
- 4. **REFACTOR:** Clean up → tests MUST pass → commit: `refactor({phase}-{plan}): clean up [feature]`
225
-
226
- Errors: RED doesn't fail → investigate test/existing feature. GREEN doesn't pass → debug, iterate. REFACTOR breaks → undo.
227
-
228
- See `~/.claude/ariadna/references/tdd.md` for structure.
229
- </tdd_plan_execution>
230
-
231
- <task_commit>
232
- ## Task Commit Protocol
233
-
234
- After each task (verification passed, done criteria met), commit immediately.
235
-
236
- **1. Check:** `git status --short`
237
-
238
- **2. Stage individually** (NEVER `git add .` or `git add -A`):
239
- ```bash
240
- git add app/controllers/sessions_controller.rb
241
- git add app/models/user.rb
242
- ```
243
-
244
- **3. Commit type:**
245
-
246
- | Type | When | Example |
247
- |------|------|---------|
248
- | `feat` | New functionality | feat(08-02): create user registration endpoint |
249
- | `fix` | Bug fix | fix(08-02): correct email validation regex |
250
- | `test` | Test-only (TDD RED) | test(08-02): add failing test for password hashing |
251
- | `refactor` | No behavior change (TDD REFACTOR) | refactor(08-02): extract validation to helper |
252
- | `perf` | Performance | perf(08-02): add database index |
253
- | `docs` | Documentation | docs(08-02): add API docs |
254
- | `style` | Formatting | style(08-02): format auth module |
255
- | `chore` | Config/deps | chore(08-02): add bcrypt dependency |
256
-
257
- **4. Format:** `{type}({phase}-{plan}): {description}` with bullet points for key changes.
258
-
259
- **5. Record hash:**
260
- ```bash
261
- TASK_COMMIT=$(git rev-parse --short HEAD)
262
- TASK_COMMITS+=("Task ${TASK_NUM}: ${TASK_COMMIT}")
263
- ```
264
-
265
- </task_commit>
266
-
267
- <step name="checkpoint_protocol">
268
- On `type="checkpoint:*"`: automate everything possible first. Checkpoints are for verification/decisions only.
269
-
270
- Display: `CHECKPOINT: [Type]` box → Progress {X}/{Y} → Task name → type-specific content → `YOUR ACTION: [signal]`
271
-
272
- | Type | Content | Resume signal |
273
- |------|---------|---------------|
274
- | human-verify (90%) | What was built + verification steps (commands/URLs) | "approved" or describe issues |
275
- | decision (9%) | Decision needed + context + options with pros/cons | "Select: option-id" |
276
- | human-action (1%) | What was automated + ONE manual step + verification plan | "done" |
277
-
278
- After response: verify if specified. Pass → continue. Fail → inform, wait. WAIT for user — do NOT hallucinate completion.
279
-
280
- See ~/.claude/ariadna/references/checkpoints.md for details.
281
- </step>
282
-
283
- <step name="checkpoint_return_for_orchestrator">
284
- When spawned via Task and hitting checkpoint: return structured state (cannot interact with user directly).
285
-
286
- **Required return:** 1) Completed Tasks table (hashes + files) 2) Current Task (what's blocking) 3) Checkpoint Details (user-facing content) 4) Awaiting (what's needed from user)
287
-
288
- Orchestrator parses → presents to user → spawns fresh continuation with your completed tasks state. You will NOT be resumed. In main context: use checkpoint_protocol above.
289
- </step>
290
-
291
- <step name="verification_failure_gate">
292
- If verification fails: STOP. Present: "Verification failed for Task [X]: [name]. Expected: [criteria]. Actual: [result]." Options: Retry | Skip (mark incomplete) | Stop (investigate). If skipped → SUMMARY "Issues Encountered".
293
- </step>
294
-
295
- <step name="record_completion_time">
296
- ```bash
297
- PLAN_END_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
298
- PLAN_END_EPOCH=$(date +%s)
299
-
300
- DURATION_SEC=$(( PLAN_END_EPOCH - PLAN_START_EPOCH ))
301
- DURATION_MIN=$(( DURATION_SEC / 60 ))
302
-
303
- if [[ $DURATION_MIN -ge 60 ]]; then
304
- HRS=$(( DURATION_MIN / 60 ))
305
- MIN=$(( DURATION_MIN % 60 ))
306
- DURATION="${HRS}h ${MIN}m"
307
- else
308
- DURATION="${DURATION_MIN} min"
309
- fi
310
- ```
311
- </step>
312
-
313
- <step name="generate_user_setup">
314
- ```bash
315
- grep -A 50 "^user_setup:" .ariadna_planning/phases/XX-name/{phase}-{plan}-PLAN.md | head -50
316
- ```
317
-
318
- If user_setup exists: create `{phase}-USER-SETUP.md` using template `~/.claude/ariadna/templates/user-setup.md`. Per service: env vars table, account setup checklist, dashboard config, local dev notes, verification commands. Status "Incomplete". Set `USER_SETUP_CREATED=true`. If empty/missing: skip.
319
- </step>
320
-
321
- <step name="create_summary">
322
- Create `{phase}-{plan}-SUMMARY.md` at `.ariadna_planning/phases/XX-name/`. Use `~/.claude/ariadna/templates/summary.md`.
323
-
324
- **Frontmatter:** phase, plan, subsystem, tags | requires/provides/affects | tech-stack.added/patterns | key-files.created/modified | key-decisions | requirements_covered | duration ($DURATION), completed ($PLAN_END_TIME date).
325
-
326
- **Requirements traceability:** Cross-reference plan tasks against `requirements_content` (from INIT, or read `.ariadna_planning/REQUIREMENTS.md`). For each requirement mapped to this phase that was implemented by tasks in this plan, populate the `requirements_covered` frontmatter:
327
- ```yaml
328
- requirements_covered:
329
- - id: "AUTH-01"
330
- description: "User can sign up with email and password"
331
- evidence: "SessionsController#create + User model with has_secure_password"
332
- ```
333
- Use the actual REQ-ID and description from REQUIREMENTS.md. Evidence should reference the specific file/class/method that implements the requirement. Omit the `requirements_covered` field entirely if no REQUIREMENTS.md exists or no requirements map to this plan.
334
-
335
- Also populate the `## Requirements Covered` markdown section (after Accomplishments) with the same data in table format.
336
-
337
- Title: `# Phase [X] Plan [Y]: [Name] Summary`
338
-
339
- One-liner SUBSTANTIVE: "JWT auth with refresh rotation using jose library" not "Authentication implemented"
340
-
341
- Include: duration, start/end times, task count, file count.
342
-
343
- Next: more plans → "Ready for {next-plan}" | last → "Phase complete, ready for transition".
344
- </step>
345
-
346
- <step name="update_current_position">
347
- Update STATE.md using ariadna-tools:
348
-
349
- ```bash
350
- # Advance plan counter (handles last-plan edge case)
351
- ariadna-tools state advance-plan
352
-
353
- # Recalculate progress bar from disk state
354
- ariadna-tools state update-progress
355
-
356
- # Record execution metrics
357
- ariadna-tools state record-metric \
358
- --phase "${PHASE}" --plan "${PLAN}" --duration "${DURATION}" \
359
- --tasks "${TASK_COUNT}" --files "${FILE_COUNT}"
360
- ```
361
- </step>
362
-
363
- <step name="extract_decisions_and_issues">
364
- From SUMMARY: Extract decisions and add to STATE.md:
365
-
366
- ```bash
367
- # Add each decision from SUMMARY key-decisions
368
- ariadna-tools state add-decision \
369
- --phase "${PHASE}" --summary "${DECISION_TEXT}" --rationale "${RATIONALE}"
370
-
371
- # Add blockers if any found
372
- ariadna-tools state add-blocker "Blocker description"
373
- ```
374
- </step>
375
-
376
- <step name="update_session_continuity">
377
- Update session info using ariadna-tools:
378
-
379
- ```bash
380
- ariadna-tools state record-session \
381
- --stopped-at "Completed ${PHASE}-${PLAN}-PLAN.md" \
382
- --resume-file "None"
383
- ```
384
-
385
- Keep STATE.md under 150 lines.
386
- </step>
387
-
388
- <step name="issues_review_gate">
389
- If SUMMARY "Issues Encountered" ≠ "None": yolo → log and continue. Interactive → present issues, wait for acknowledgment.
390
- </step>
391
-
392
- <step name="update_roadmap">
393
- More plans → update plan count, keep "In progress". Last plan → mark phase "Complete", add date.
394
- </step>
395
-
396
- <step name="git_commit_metadata">
397
- Task code already committed per-task. Commit plan metadata:
398
-
399
- ```bash
400
- ariadna-tools commit "docs({phase}-{plan}): complete [plan-name] plan" --files .ariadna_planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .ariadna_planning/STATE.md .ariadna_planning/ROADMAP.md
401
- ```
402
- </step>
403
-
404
- <step name="update_codebase_map">
405
- If .ariadna_planning/codebase/ doesn't exist: skip.
406
-
407
- ```bash
408
- FIRST_TASK=$(git log --oneline --grep="feat({phase}-{plan}):" --grep="fix({phase}-{plan}):" --grep="test({phase}-{plan}):" --reverse | head -1 | cut -d' ' -f1)
409
- git diff --name-only ${FIRST_TASK}^..HEAD 2>/dev/null
410
- ```
411
-
412
- Update only structural changes: new src/ dir → STRUCTURE.md | deps → STACK.md | file pattern → CONVENTIONS.md | API client → INTEGRATIONS.md | config → STACK.md | renamed → update paths. Skip code-only/bugfix/content changes.
413
-
414
- ```bash
415
- ariadna-tools commit "" --files .ariadna_planning/codebase/*.md --amend
416
- ```
417
- </step>
418
-
419
- <step name="offer_next">
420
- If `USER_SETUP_CREATED=true`: display `⚠️ USER SETUP REQUIRED` with path + env/config tasks at TOP.
421
-
422
- ```bash
423
- ls -1 .ariadna_planning/phases/[current-phase-dir]/*-PLAN.md 2>/dev/null | wc -l
424
- ls -1 .ariadna_planning/phases/[current-phase-dir]/*-SUMMARY.md 2>/dev/null | wc -l
425
- ```
426
-
427
- | Condition | Route | Action |
428
- |-----------|-------|--------|
429
- | summaries < plans | **A: More plans** | Find next PLAN without SUMMARY. Yolo: auto-continue. Interactive: show next plan, suggest `/ariadna:execute-phase {phase}` + `/ariadna:verify-work`. STOP here. |
430
- | summaries = plans, current < highest phase | **B: Phase done** | Show completion, suggest `/ariadna:plan-phase {Z+1}` + `/ariadna:verify-work {Z}` + `/ariadna:discuss-phase {Z+1}` |
431
- | summaries = plans, current = highest phase | **C: Milestone done** | Show banner, suggest `/ariadna:complete-milestone` + `/ariadna:verify-work` + `/ariadna:add-phase` |
432
-
433
- All routes: `/clear` first for fresh context.
434
- </step>
435
-
436
- </process>
437
-
438
- <success_criteria>
439
-
440
- - All tasks from PLAN.md completed
441
- - All verifications pass
442
- - USER-SETUP.md generated if user_setup in frontmatter
443
- - SUMMARY.md created with substantive content
444
- - STATE.md updated (position, decisions, issues, session)
445
- - ROADMAP.md updated
446
- - If codebase map exists: map updated with execution changes (or skipped if no significant changes)
447
- - If USER-SETUP.md created: prominently surfaced in completion output
448
- </success_criteria>