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.
- checksums.yaml +4 -4
- data/ariadna.gemspec +0 -1
- data/data/agents/ariadna-codebase-mapper.md +34 -722
- data/data/agents/ariadna-debugger.md +44 -1139
- data/data/agents/ariadna-executor.md +75 -396
- data/data/agents/ariadna-planner.md +78 -1215
- data/data/agents/ariadna-roadmapper.md +55 -582
- data/data/agents/ariadna-verifier.md +60 -702
- data/data/ariadna/templates/config.json +8 -33
- data/data/ariadna/workflows/debug.md +28 -0
- data/data/ariadna/workflows/execute-phase.md +31 -513
- data/data/ariadna/workflows/map-codebase.md +20 -319
- data/data/ariadna/workflows/new-milestone.md +20 -365
- data/data/ariadna/workflows/new-project.md +19 -880
- data/data/ariadna/workflows/plan-phase.md +24 -443
- data/data/ariadna/workflows/progress.md +20 -376
- data/data/ariadna/workflows/quick.md +19 -221
- data/data/ariadna/workflows/roadmap-ops.md +28 -0
- data/data/ariadna/workflows/verify-work.md +23 -560
- data/data/commands/ariadna/add-phase.md +11 -22
- data/data/commands/ariadna/debug.md +11 -143
- data/data/commands/ariadna/execute-phase.md +12 -30
- data/data/commands/ariadna/insert-phase.md +7 -14
- data/data/commands/ariadna/map-codebase.md +16 -49
- data/data/commands/ariadna/new-milestone.md +12 -25
- data/data/commands/ariadna/new-project.md +22 -26
- data/data/commands/ariadna/plan-phase.md +13 -22
- data/data/commands/ariadna/progress.md +16 -6
- data/data/commands/ariadna/quick.md +9 -11
- data/data/commands/ariadna/remove-phase.md +9 -12
- data/data/commands/ariadna/verify-work.md +14 -19
- data/data/skills/rails-backend/API.md +138 -0
- data/data/skills/rails-backend/CONTROLLERS.md +154 -0
- data/data/skills/rails-backend/JOBS.md +132 -0
- data/data/skills/rails-backend/MODELS.md +213 -0
- data/data/skills/rails-backend/SKILL.md +169 -0
- data/data/skills/rails-frontend/ASSETS.md +154 -0
- data/data/skills/rails-frontend/COMPONENTS.md +253 -0
- data/data/skills/rails-frontend/SKILL.md +187 -0
- data/data/skills/rails-frontend/VIEWS.md +168 -0
- data/data/skills/rails-performance/PROFILING.md +106 -0
- data/data/skills/rails-performance/SKILL.md +217 -0
- data/data/skills/rails-security/AUDIT.md +118 -0
- data/data/skills/rails-security/SKILL.md +422 -0
- data/data/skills/rails-testing/FIXTURES.md +78 -0
- data/data/skills/rails-testing/SKILL.md +160 -0
- data/data/skills/rails-testing/SYSTEM-TESTS.md +73 -0
- data/lib/ariadna/installer.rb +11 -15
- data/lib/ariadna/tools/cli.rb +0 -12
- data/lib/ariadna/tools/config_manager.rb +10 -72
- data/lib/ariadna/tools/frontmatter.rb +23 -1
- data/lib/ariadna/tools/init.rb +201 -401
- data/lib/ariadna/tools/model_profiles.rb +6 -14
- data/lib/ariadna/tools/phase_manager.rb +1 -10
- data/lib/ariadna/tools/state_manager.rb +170 -451
- data/lib/ariadna/tools/template_filler.rb +4 -12
- data/lib/ariadna/tools/verification.rb +21 -399
- data/lib/ariadna/uninstaller.rb +9 -0
- data/lib/ariadna/version.rb +1 -1
- data/lib/ariadna.rb +1 -0
- metadata +20 -91
- data/data/agents/ariadna-backend-executor.md +0 -261
- data/data/agents/ariadna-frontend-executor.md +0 -259
- data/data/agents/ariadna-integration-checker.md +0 -418
- data/data/agents/ariadna-phase-researcher.md +0 -469
- data/data/agents/ariadna-plan-checker.md +0 -622
- data/data/agents/ariadna-project-researcher.md +0 -618
- data/data/agents/ariadna-research-synthesizer.md +0 -236
- data/data/agents/ariadna-test-executor.md +0 -266
- data/data/ariadna/references/checkpoints.md +0 -772
- data/data/ariadna/references/continuation-format.md +0 -249
- data/data/ariadna/references/decimal-phase-calculation.md +0 -65
- data/data/ariadna/references/git-integration.md +0 -248
- data/data/ariadna/references/git-planning-commit.md +0 -38
- data/data/ariadna/references/model-profile-resolution.md +0 -32
- data/data/ariadna/references/model-profiles.md +0 -73
- data/data/ariadna/references/phase-argument-parsing.md +0 -61
- data/data/ariadna/references/planning-config.md +0 -194
- data/data/ariadna/references/questioning.md +0 -153
- data/data/ariadna/references/rails-conventions.md +0 -416
- data/data/ariadna/references/tdd.md +0 -267
- data/data/ariadna/references/ui-brand.md +0 -160
- data/data/ariadna/references/verification-patterns.md +0 -853
- data/data/ariadna/templates/codebase/architecture.md +0 -481
- data/data/ariadna/templates/codebase/concerns.md +0 -380
- data/data/ariadna/templates/codebase/conventions.md +0 -434
- data/data/ariadna/templates/codebase/integrations.md +0 -328
- data/data/ariadna/templates/codebase/stack.md +0 -189
- data/data/ariadna/templates/codebase/structure.md +0 -418
- data/data/ariadna/templates/codebase/testing.md +0 -606
- data/data/ariadna/templates/context.md +0 -283
- data/data/ariadna/templates/continue-here.md +0 -78
- data/data/ariadna/templates/debug-subagent-prompt.md +0 -91
- data/data/ariadna/templates/phase-prompt.md +0 -609
- data/data/ariadna/templates/planner-subagent-prompt.md +0 -117
- data/data/ariadna/templates/research-project/ARCHITECTURE.md +0 -439
- data/data/ariadna/templates/research-project/FEATURES.md +0 -168
- data/data/ariadna/templates/research-project/PITFALLS.md +0 -406
- data/data/ariadna/templates/research-project/STACK.md +0 -251
- data/data/ariadna/templates/research-project/SUMMARY.md +0 -247
- data/data/ariadna/templates/state.md +0 -176
- data/data/ariadna/templates/summary-complex.md +0 -59
- data/data/ariadna/templates/summary-minimal.md +0 -41
- data/data/ariadna/templates/summary-standard.md +0 -48
- data/data/ariadna/templates/user-setup.md +0 -310
- data/data/ariadna/workflows/add-phase.md +0 -111
- data/data/ariadna/workflows/add-todo.md +0 -157
- data/data/ariadna/workflows/audit-milestone.md +0 -241
- data/data/ariadna/workflows/check-todos.md +0 -176
- data/data/ariadna/workflows/complete-milestone.md +0 -644
- data/data/ariadna/workflows/diagnose-issues.md +0 -219
- data/data/ariadna/workflows/discovery-phase.md +0 -289
- data/data/ariadna/workflows/discuss-phase.md +0 -408
- data/data/ariadna/workflows/execute-plan.md +0 -448
- data/data/ariadna/workflows/help.md +0 -470
- data/data/ariadna/workflows/insert-phase.md +0 -129
- data/data/ariadna/workflows/list-phase-assumptions.md +0 -178
- data/data/ariadna/workflows/pause-work.md +0 -122
- data/data/ariadna/workflows/plan-milestone-gaps.md +0 -256
- data/data/ariadna/workflows/remove-phase.md +0 -154
- data/data/ariadna/workflows/research-phase.md +0 -74
- data/data/ariadna/workflows/resume-project.md +0 -306
- data/data/ariadna/workflows/set-profile.md +0 -80
- data/data/ariadna/workflows/settings.md +0 -145
- data/data/ariadna/workflows/transition.md +0 -493
- data/data/ariadna/workflows/update.md +0 -212
- data/data/ariadna/workflows/verify-phase.md +0 -226
- data/data/commands/ariadna/add-todo.md +0 -42
- data/data/commands/ariadna/audit-milestone.md +0 -42
- data/data/commands/ariadna/check-todos.md +0 -41
- data/data/commands/ariadna/complete-milestone.md +0 -136
- data/data/commands/ariadna/discuss-phase.md +0 -86
- data/data/commands/ariadna/help.md +0 -22
- data/data/commands/ariadna/list-phase-assumptions.md +0 -50
- data/data/commands/ariadna/pause-work.md +0 -35
- data/data/commands/ariadna/plan-milestone-gaps.md +0 -40
- data/data/commands/ariadna/reapply-patches.md +0 -110
- data/data/commands/ariadna/research-phase.md +0 -187
- data/data/commands/ariadna/resume-work.md +0 -40
- data/data/commands/ariadna/set-profile.md +0 -34
- data/data/commands/ariadna/settings.md +0 -36
- data/data/commands/ariadna/update.md +0 -37
- data/data/guides/backend.md +0 -3069
- data/data/guides/frontend.md +0 -1479
- data/data/guides/performance.md +0 -1193
- data/data/guides/security.md +0 -1522
- data/data/guides/style-guide.md +0 -1091
- data/data/guides/testing.md +0 -504
- data/data/templates.md +0 -94
|
@@ -1,451 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
6
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
430
|
-
-
|
|
431
|
-
- /
|
|
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
|
-
|
|
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
|
-
|
|
437
|
-
-
|
|
438
|
-
-
|
|
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
|