aether-colony 5.3.1 → 5.3.3

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 (165) hide show
  1. package/.aether/aether-utils.sh +181 -5
  2. package/.aether/commands/build.yaml +35 -0
  3. package/.aether/commands/entomb.yaml +1 -1
  4. package/.aether/commands/init.yaml +29 -12
  5. package/.aether/commands/oracle.yaml +70 -0
  6. package/.aether/commands/patrol.yaml +2 -2
  7. package/.aether/commands/run.yaml +3 -3
  8. package/.aether/commands/swarm.yaml +1 -1
  9. package/.aether/docs/command-playbooks/build-complete.md +41 -8
  10. package/.aether/docs/command-playbooks/build-full.md +7 -7
  11. package/.aether/docs/command-playbooks/build-prep.md +1 -1
  12. package/.aether/docs/command-playbooks/continue-advance.md +33 -0
  13. package/.aether/docs/command-playbooks/continue-finalize.md +15 -1
  14. package/.aether/docs/command-playbooks/continue-full.md +15 -1
  15. package/.aether/docs/source-of-truth-map.md +10 -10
  16. package/.aether/docs/structural-learning-stack.md +283 -0
  17. package/.aether/utils/consolidation-seal.sh +196 -0
  18. package/.aether/utils/consolidation.sh +127 -0
  19. package/.aether/utils/curation-ants/archivist.sh +97 -0
  20. package/.aether/utils/curation-ants/critic.sh +214 -0
  21. package/.aether/utils/curation-ants/herald.sh +102 -0
  22. package/.aether/utils/curation-ants/janitor.sh +121 -0
  23. package/.aether/utils/curation-ants/librarian.sh +99 -0
  24. package/.aether/utils/curation-ants/nurse.sh +153 -0
  25. package/.aether/utils/curation-ants/orchestrator.sh +181 -0
  26. package/.aether/utils/curation-ants/scribe.sh +164 -0
  27. package/.aether/utils/curation-ants/sentinel.sh +119 -0
  28. package/.aether/utils/event-bus.sh +301 -0
  29. package/.aether/utils/graph.sh +559 -0
  30. package/.aether/utils/instinct-store.sh +401 -0
  31. package/.aether/utils/learning.sh +79 -7
  32. package/.aether/utils/session.sh +13 -0
  33. package/.aether/utils/state-api.sh +1 -1
  34. package/.aether/utils/trust-scoring.sh +347 -0
  35. package/.aether/utils/worktree.sh +97 -0
  36. package/.claude/commands/ant/entomb.md +1 -1
  37. package/.claude/commands/ant/init.md +29 -12
  38. package/.claude/commands/ant/oracle.md +35 -0
  39. package/.claude/commands/ant/patrol.md +2 -2
  40. package/.claude/commands/ant/run.md +3 -3
  41. package/.claude/commands/ant/swarm.md +1 -1
  42. package/.opencode/commands/ant/build.md +35 -0
  43. package/.opencode/commands/ant/init.md +29 -12
  44. package/.opencode/commands/ant/oracle.md +35 -0
  45. package/.opencode/commands/ant/patrol.md +2 -2
  46. package/.opencode/commands/ant/run.md +3 -3
  47. package/CHANGELOG.md +83 -0
  48. package/README.md +34 -37
  49. package/bin/lib/update-transaction.js +8 -3
  50. package/bin/npx-entry.js +0 -0
  51. package/package.json +1 -1
  52. package/.aether/agents/aether-ambassador.md +0 -140
  53. package/.aether/agents/aether-archaeologist.md +0 -108
  54. package/.aether/agents/aether-architect.md +0 -133
  55. package/.aether/agents/aether-auditor.md +0 -144
  56. package/.aether/agents/aether-builder.md +0 -184
  57. package/.aether/agents/aether-chaos.md +0 -115
  58. package/.aether/agents/aether-chronicler.md +0 -122
  59. package/.aether/agents/aether-gatekeeper.md +0 -116
  60. package/.aether/agents/aether-includer.md +0 -117
  61. package/.aether/agents/aether-keeper.md +0 -177
  62. package/.aether/agents/aether-measurer.md +0 -128
  63. package/.aether/agents/aether-oracle.md +0 -137
  64. package/.aether/agents/aether-probe.md +0 -133
  65. package/.aether/agents/aether-queen.md +0 -286
  66. package/.aether/agents/aether-route-setter.md +0 -130
  67. package/.aether/agents/aether-sage.md +0 -106
  68. package/.aether/agents/aether-scout.md +0 -101
  69. package/.aether/agents/aether-surveyor-disciplines.md +0 -391
  70. package/.aether/agents/aether-surveyor-nest.md +0 -329
  71. package/.aether/agents/aether-surveyor-pathogens.md +0 -264
  72. package/.aether/agents/aether-surveyor-provisions.md +0 -334
  73. package/.aether/agents/aether-tracker.md +0 -137
  74. package/.aether/agents/aether-watcher.md +0 -174
  75. package/.aether/agents/aether-weaver.md +0 -130
  76. package/.aether/commands/claude/archaeology.md +0 -334
  77. package/.aether/commands/claude/build.md +0 -65
  78. package/.aether/commands/claude/chaos.md +0 -336
  79. package/.aether/commands/claude/colonize.md +0 -259
  80. package/.aether/commands/claude/continue.md +0 -60
  81. package/.aether/commands/claude/council.md +0 -507
  82. package/.aether/commands/claude/data-clean.md +0 -81
  83. package/.aether/commands/claude/dream.md +0 -268
  84. package/.aether/commands/claude/entomb.md +0 -498
  85. package/.aether/commands/claude/export-signals.md +0 -57
  86. package/.aether/commands/claude/feedback.md +0 -96
  87. package/.aether/commands/claude/flag.md +0 -151
  88. package/.aether/commands/claude/flags.md +0 -169
  89. package/.aether/commands/claude/focus.md +0 -76
  90. package/.aether/commands/claude/help.md +0 -154
  91. package/.aether/commands/claude/history.md +0 -140
  92. package/.aether/commands/claude/import-signals.md +0 -71
  93. package/.aether/commands/claude/init.md +0 -505
  94. package/.aether/commands/claude/insert-phase.md +0 -105
  95. package/.aether/commands/claude/interpret.md +0 -278
  96. package/.aether/commands/claude/lay-eggs.md +0 -210
  97. package/.aether/commands/claude/maturity.md +0 -113
  98. package/.aether/commands/claude/memory-details.md +0 -77
  99. package/.aether/commands/claude/migrate-state.md +0 -171
  100. package/.aether/commands/claude/oracle.md +0 -642
  101. package/.aether/commands/claude/organize.md +0 -232
  102. package/.aether/commands/claude/patrol.md +0 -620
  103. package/.aether/commands/claude/pause-colony.md +0 -233
  104. package/.aether/commands/claude/phase.md +0 -115
  105. package/.aether/commands/claude/pheromones.md +0 -156
  106. package/.aether/commands/claude/plan.md +0 -693
  107. package/.aether/commands/claude/preferences.md +0 -65
  108. package/.aether/commands/claude/quick.md +0 -100
  109. package/.aether/commands/claude/redirect.md +0 -76
  110. package/.aether/commands/claude/resume-colony.md +0 -197
  111. package/.aether/commands/claude/resume.md +0 -388
  112. package/.aether/commands/claude/run.md +0 -231
  113. package/.aether/commands/claude/seal.md +0 -774
  114. package/.aether/commands/claude/skill-create.md +0 -286
  115. package/.aether/commands/claude/status.md +0 -410
  116. package/.aether/commands/claude/swarm.md +0 -349
  117. package/.aether/commands/claude/tunnels.md +0 -426
  118. package/.aether/commands/claude/update.md +0 -132
  119. package/.aether/commands/claude/verify-castes.md +0 -143
  120. package/.aether/commands/claude/watch.md +0 -239
  121. package/.aether/commands/opencode/archaeology.md +0 -331
  122. package/.aether/commands/opencode/build.md +0 -1168
  123. package/.aether/commands/opencode/chaos.md +0 -329
  124. package/.aether/commands/opencode/colonize.md +0 -195
  125. package/.aether/commands/opencode/continue.md +0 -1436
  126. package/.aether/commands/opencode/council.md +0 -437
  127. package/.aether/commands/opencode/data-clean.md +0 -77
  128. package/.aether/commands/opencode/dream.md +0 -260
  129. package/.aether/commands/opencode/entomb.md +0 -377
  130. package/.aether/commands/opencode/export-signals.md +0 -54
  131. package/.aether/commands/opencode/feedback.md +0 -99
  132. package/.aether/commands/opencode/flag.md +0 -149
  133. package/.aether/commands/opencode/flags.md +0 -167
  134. package/.aether/commands/opencode/focus.md +0 -73
  135. package/.aether/commands/opencode/help.md +0 -157
  136. package/.aether/commands/opencode/history.md +0 -136
  137. package/.aether/commands/opencode/import-signals.md +0 -68
  138. package/.aether/commands/opencode/init.md +0 -518
  139. package/.aether/commands/opencode/insert-phase.md +0 -111
  140. package/.aether/commands/opencode/interpret.md +0 -272
  141. package/.aether/commands/opencode/lay-eggs.md +0 -213
  142. package/.aether/commands/opencode/maturity.md +0 -108
  143. package/.aether/commands/opencode/memory-details.md +0 -83
  144. package/.aether/commands/opencode/migrate-state.md +0 -165
  145. package/.aether/commands/opencode/oracle.md +0 -593
  146. package/.aether/commands/opencode/organize.md +0 -226
  147. package/.aether/commands/opencode/patrol.md +0 -626
  148. package/.aether/commands/opencode/pause-colony.md +0 -203
  149. package/.aether/commands/opencode/phase.md +0 -113
  150. package/.aether/commands/opencode/pheromones.md +0 -162
  151. package/.aether/commands/opencode/plan.md +0 -684
  152. package/.aether/commands/opencode/preferences.md +0 -71
  153. package/.aether/commands/opencode/quick.md +0 -91
  154. package/.aether/commands/opencode/redirect.md +0 -84
  155. package/.aether/commands/opencode/resume-colony.md +0 -190
  156. package/.aether/commands/opencode/resume.md +0 -394
  157. package/.aether/commands/opencode/run.md +0 -237
  158. package/.aether/commands/opencode/seal.md +0 -452
  159. package/.aether/commands/opencode/skill-create.md +0 -63
  160. package/.aether/commands/opencode/status.md +0 -307
  161. package/.aether/commands/opencode/swarm.md +0 -15
  162. package/.aether/commands/opencode/tunnels.md +0 -400
  163. package/.aether/commands/opencode/update.md +0 -127
  164. package/.aether/commands/opencode/verify-castes.md +0 -139
  165. package/.aether/commands/opencode/watch.md +0 -227
@@ -1,684 +0,0 @@
1
- <!-- Generated from .aether/commands/plan.yaml - DO NOT EDIT DIRECTLY -->
2
- ---
3
- name: ant:plan
4
- description: "📊🐜🗺️🐜📊 Show project plan or generate project-specific phases"
5
- ---
6
-
7
- ### Step -1: Normalize Arguments
8
-
9
- Run: `normalized_args=$(bash .aether/aether-utils.sh normalize-args "$@")`
10
-
11
- This ensures arguments work correctly in both Claude Code and OpenCode. Use `$normalized_args` throughout this command.
12
-
13
-
14
- You are the **Queen**. Orchestrate research and planning until the selected confidence target is reached within the selected iteration budget.
15
-
16
- ## Instructions
17
-
18
- Parse `$normalized_args`:
19
- - If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
20
- - Otherwise: set `visual_mode = true`
21
-
22
- ### Step 1: Read State
23
-
24
- Read `.aether/data/COLONY_STATE.json`.
25
-
26
- **Auto-upgrade old state:**
27
- If `version` field is missing, "1.0", or "2.0":
28
- 1. Preserve: `goal`, `state`, `current_phase`, `plan.phases`
29
- 2. Write upgraded v3.0 state (same structure as /ant:init but preserving data)
30
- 3. Output: `State auto-upgraded to v3.0`
31
- 4. Continue with command.
32
-
33
- Extract: `goal`, `milestone`, `plan.phases`
34
-
35
- **Validate:** If `goal: null`:
36
- ```
37
- No colony initialized. Run /ant:init "<goal>" first.
38
- ```
39
- Stop here.
40
-
41
- If `milestone` == `"Crowned Anthill"`:
42
- ```
43
- This colony has been sealed. Start a new colony with /ant:init "new goal".
44
- ```
45
- Stop here.
46
-
47
- ### Step 1.5: Load State and Show Resumption Context
48
-
49
- Run using Bash tool: `bash .aether/aether-utils.sh load-state`
50
-
51
- If successful and goal is not null:
52
- 1. Extract current_phase from state
53
- 2. Get phase name from plan.phases[current_phase - 1].name (or "(unnamed)")
54
- 3. Display brief resumption context:
55
- ```
56
- 🔄 Resuming: Phase X - Name
57
- ```
58
-
59
- If .aether/HANDOFF.md exists (detected in load-state output):
60
- - Display "Resuming from paused session"
61
- - Read .aether/HANDOFF.md for additional context
62
- - Remove .aether/HANDOFF.md after display (cleanup)
63
-
64
- Run: `bash .aether/aether-utils.sh unload-state` to release lock.
65
-
66
- **Error handling:**
67
- - If E_FILE_NOT_FOUND: "No colony initialized. Run /ant:init first." and stop
68
- - If validation error: Display error details with recovery suggestion and stop
69
- - For other errors: Display generic error and suggest /ant:status for diagnostics
70
-
71
- ### Step 2: Check Existing Plan
72
-
73
- If `plan.phases` has entries (non-empty array), skip to **Step 6** (Display Plan).
74
-
75
- Parse `$normalized_args`:
76
- - If contains `--accept`: Set `force_accept = true` (accept current plan regardless of confidence)
77
- - Otherwise: `force_accept = false`
78
-
79
- Select planning depth (prompt user if not explicitly provided):
80
- - Presets:
81
- - `fast`: `target_confidence = 80`, `max_iterations = 4`
82
- - `balanced`: `target_confidence = 90`, `max_iterations = 6`
83
- - `deep`: `target_confidence = 95`, `max_iterations = 8`
84
- - `exhaustive`: `target_confidence = 99`, `max_iterations = 12`
85
- - Preset selectors:
86
- - `--fast`, `--balanced`, `--deep`, `--exhaustive`
87
- - `--quality fast|balanced|deep|exhaustive`
88
- - CLI overrides:
89
- - `--target <70-99>` to set `target_confidence`
90
- - `--max-iterations <2-12>` to set `max_iterations`
91
- - If no preset/overrides are provided, ask:
92
- `Planning depth? 1) Fast 2) Balanced 3) Deep (recommended) 4) Exhaustive`
93
- - Map user choice to a preset, default to `deep` on unclear input.
94
- - If overrides are out of range, clamp to valid ranges and continue.
95
-
96
- ### Step 2.5: Load Compact Context Capsule
97
-
98
- Run using the Bash tool with description "Loading compact planning context...":
99
- ```bash
100
- bash .aether/aether-utils.sh context-capsule --compact --json 2>/dev/null
101
- ```
102
-
103
- If JSON is valid and `.ok == true`, extract `.result.prompt_section` into `context_capsule_prompt`.
104
- If command fails or returns invalid JSON, set `context_capsule_prompt = ""` and continue.
105
-
106
- ### Step 3: Initialize Planning State
107
-
108
- Update watch files for tmux visibility:
109
-
110
- Write `.aether/data/watch-status.txt`:
111
- ```
112
- AETHER COLONY :: PLANNING
113
- ==========================
114
-
115
- State: PLANNING
116
- Phase: 0/0 (generating plan)
117
- Confidence: 0%
118
- Iteration: 0/{max_iterations}
119
-
120
- Active Workers:
121
- [Research] Starting...
122
- [Planning] Waiting...
123
-
124
- Last Activity:
125
- Planning loop initiated
126
- ```
127
-
128
- Write `.aether/data/watch-progress.txt`:
129
- ```
130
- Progress
131
- ========
132
-
133
- [ ] 0%
134
-
135
- Target: {target_confidence}% confidence
136
-
137
- Iteration: 0/{max_iterations}
138
- Gaps: (analyzing...)
139
- ```
140
-
141
- ### Step 3.5: Load Territory Survey
142
-
143
- Check if territory survey exists before research:
144
-
145
- ```bash
146
- ls .aether/data/survey/*.md 2>/dev/null
147
- ```
148
-
149
- **If survey exists:**
150
- 1. **Always read PATHOGENS.md first** — understand known concerns before planning
151
- 2. Read other relevant docs based on goal keywords:
152
-
153
- | Goal Contains | Additional Documents |
154
- |---------------|---------------------|
155
- | UI, frontend, component, page | DISCIPLINES.md, CHAMBERS.md |
156
- | API, backend, endpoint | BLUEPRINT.md, DISCIPLINES.md |
157
- | database, schema, model | BLUEPRINT.md, PROVISIONS.md |
158
- | test, spec | SENTINEL-PROTOCOLS.md, DISCIPLINES.md |
159
- | integration, external | TRAILS.md, PROVISIONS.md |
160
- | refactor, cleanup | PATHOGENS.md, BLUEPRINT.md |
161
-
162
- **Inject survey context into scout and planner prompts:**
163
- - Include key patterns from DISCIPLINES.md
164
- - Reference architecture from BLUEPRINT.md
165
- - Note tech stack from PROVISIONS.md
166
- - Flag concerns from PATHOGENS.md
167
-
168
- **Display:**
169
- ```
170
- 🗺️ Territory survey loaded — incorporating context into planning
171
- ```
172
-
173
- **If no survey:** Continue without survey context (scouts will do fresh exploration)
174
-
175
- ### Step 3.6: Phase Domain Research
176
-
177
- Investigate domain knowledge for each phase before the planning loop begins. This runs every time `/ant:plan` generates a new plan -- no skip flag.
178
-
179
- **1. Retrieve hive wisdom for research priming:**
180
-
181
- ```bash
182
- hive_context=$(bash .aether/aether-utils.sh hive-read --limit 5 --format text 2>/dev/null)
183
- ```
184
-
185
- Parse the JSON result to extract `.result.text` as `hive_text`. If command fails or returns empty, set `hive_text = ""`.
186
-
187
- **2. Clean any previous research for this phase:**
188
-
189
- ```bash
190
- research_dir=".aether/data/phase-research"
191
- mkdir -p "$research_dir"
192
- rm -f "$research_dir/phase-{phase_number}-research.md"
193
- ```
194
-
195
- Re-running /ant:plan always re-researches from scratch.
196
-
197
- **3. Spawn Research Scout** via Task tool with `subagent_type="aether-scout"`:
198
-
199
- FALLBACK: If "Agent type not found", use general-purpose and inject role: "You are a Scout Ant performing Phase Domain Research."
200
-
201
- ```
202
- You are a Scout Ant performing Phase Domain Research.
203
-
204
- --- MISSION ---
205
- Investigate the domain knowledge needed for Phase {phase_number}: {phase_name}
206
- Goal: "{goal}"
207
- Phase description: "{phase_description}"
208
-
209
- {context_capsule_prompt}
210
-
211
- --- PRE-EXISTING COLONY WISDOM ---
212
- {hive_text}
213
-
214
- --- RESEARCH AREAS ---
215
- 1. Key patterns in the existing codebase relevant to this phase
216
- 2. External library/API documentation if the phase involves external tools
217
- 3. Common gotchas and pitfalls in this domain
218
- 4. Recommended implementation approach based on findings
219
-
220
- --- SCOPE CONSTRAINTS ---
221
- - Maximum 5 key patterns
222
- - Maximum 3 gotchas
223
- - Maximum 1 recommended approach paragraph
224
- - Total output under 3000 words
225
- - Prioritize actionable guidance over exhaustive documentation
226
- - Check hive wisdom above first -- do not re-discover known patterns
227
-
228
- --- TOOLS ---
229
- Use: Glob, Grep, Read, WebSearch, WebFetch
230
- Do NOT use: Task, Write, Edit
231
-
232
- --- OUTPUT FORMAT ---
233
- Return JSON:
234
- {
235
- "hive_wisdom_used": ["list of hive entries that were relevant"],
236
- "key_patterns": [
237
- {"pattern": "description", "source": "file path or URL", "relevance": "why it matters for this phase"}
238
- ],
239
- "external_context": [
240
- {"topic": "what", "finding": "description", "source": "URL or doc reference"}
241
- ],
242
- "gotchas": [
243
- {"issue": "what can go wrong", "prevention": "how to avoid it", "source": "evidence"}
244
- ],
245
- "recommended_approach": "synthesis paragraph",
246
- "files_to_study": ["path1", "path2"]
247
- }
248
- ```
249
-
250
- **4. Wait for scout to complete** (blocking -- direct Task return).
251
-
252
- **5. Parse scout JSON output and write RESEARCH.md to disk.** The Queen (plan.md orchestrator) writes the file -- scout is read-only. Write to: `.aether/data/phase-research/phase-{phase_number}-research.md`
253
-
254
- RESEARCH.md format (6 fixed sections):
255
-
256
- ```markdown
257
- # Phase {N} Research: {Phase Name}
258
-
259
- **Generated:** {ISO-8601 timestamp}
260
- **Phase:** {N} - {Phase Name}
261
- **Research scope:** {brief summary of what was investigated}
262
-
263
- ## Hive Wisdom (Pre-existing Knowledge)
264
- {Format hive_wisdom_used entries, or "No relevant hive wisdom found" if empty}
265
-
266
- ## Key Patterns
267
- {Format each key_patterns entry as: **{pattern}:** {relevance} (Source: {source})}
268
-
269
- ## External Context
270
- {Format each external_context entry as: **{topic}:** {finding} (Source: {source})}
271
- {If empty: "No external research needed for this phase"}
272
-
273
- ## Gotchas
274
- {Format each gotchas entry as: **{issue}:** {prevention} (Source: {source})}
275
-
276
- ## Recommended Approach
277
- {recommended_approach text}
278
-
279
- ## Files to Study
280
- {Format as bullet list of file paths}
281
- ```
282
-
283
- **6. Store research findings** in a variable `research_findings_summary` for injection into the Route-Setter prompt in Step 4. This is a compact summary (not the full RESEARCH.md):
284
-
285
- ```
286
- Key Patterns: {bullet list of pattern names}
287
- Gotchas: {bullet list of gotcha titles}
288
- Recommended: {recommended_approach, first sentence only}
289
- Files: {comma-separated file paths}
290
- ```
291
-
292
- **7. Display completion:**
293
-
294
- ```
295
- Research complete: phase-{phase_number}-research.md ({word_count} words)
296
- ```
297
-
298
- ### Step 4: Research and Planning Loop
299
-
300
- Initialize tracking:
301
- - `iteration = 0`
302
- - `confidence = 0`
303
- - `gaps = []` (list of knowledge gaps)
304
- - `plan_draft = null`
305
- - `last_confidence = 0`
306
- - `stall_count = 0` (consecutive iterations with < 5% improvement)
307
-
308
- **Loop (max {max_iterations} iterations, 2 agents per iteration: 1 scout + 1 planner):**
309
-
310
- ```
311
- while iteration < max_iterations AND confidence < target_confidence:
312
- iteration += 1
313
-
314
- # === AUTO-BREAK CHECKS (no user prompt needed) ===
315
- if iteration > 1:
316
- if confidence >= target_confidence:
317
- Log: "Confidence threshold reached ({confidence}%), finalizing plan"
318
- break
319
- if stall_count >= 2:
320
- Log: "Planning stalled at {confidence}%, finalizing current plan"
321
- break
322
-
323
- # === RESEARCH PHASE (always runs — 1 scout per iteration) ===
324
-
325
- if iteration == 1:
326
-
327
- # Broad exploration on first pass
328
- Spawn Research Scout via Task tool with subagent_type="aether-scout":
329
-
330
- """
331
- You are a Scout Ant in the Aether Colony.
332
-
333
- --- MISSION ---
334
- Research the codebase to understand what exists and how it works.
335
-
336
- Goal: "{goal}"
337
- Iteration: {iteration}/{max_iterations}
338
-
339
- {context_capsule_prompt}
340
-
341
- --- EXPLORATION AREAS ---
342
- Cover ALL of these in a single pass:
343
- 1. Core architecture, entry points, and main modules
344
- 2. Business logic and domain models
345
- 3. Testing patterns and quality practices
346
- 4. Configuration, dependencies, and infrastructure
347
- 5. Edge cases, error handling, and validation
348
-
349
- --- TOOLS ---
350
- Use: Glob, Grep, Read, WebSearch, WebFetch
351
- Do NOT use: Task, Write, Edit
352
-
353
- --- OUTPUT CONSTRAINTS ---
354
- Maximum 5 findings (prioritize by impact on the goal).
355
- Maximum 2 sentences per finding.
356
- Maximum 3 knowledge gaps identified.
357
-
358
- --- OUTPUT FORMAT ---
359
- Return JSON:
360
- {
361
- "findings": [
362
- {"area": "...", "discovery": "...", "source": "file or search"}
363
- ],
364
- "gaps_remaining": [
365
- {"id": "gap_N", "description": "..."}
366
- ],
367
- "overall_knowledge_confidence": 0-100
368
- }
369
- """
370
-
371
- else:
372
-
373
- # Gap-focused research on subsequent passes
374
- Spawn Gap-Focused Scout via Task tool with subagent_type="aether-scout":
375
-
376
- """
377
- You are a Scout Ant in the Aether Colony (gap-focused research).
378
-
379
- --- MISSION ---
380
- Investigate ONLY these specific knowledge gaps. Do not explore broadly.
381
-
382
- Goal: "{goal}"
383
- Iteration: {iteration}/{max_iterations}
384
-
385
- {context_capsule_prompt}
386
-
387
- --- GAPS TO INVESTIGATE ---
388
- {for each gap in gaps:}
389
- - {gap.id}: {gap.description}
390
- {end for}
391
-
392
- --- TOOLS ---
393
- Use: Glob, Grep, Read, WebSearch, WebFetch
394
- Do NOT use: Task, Write, Edit
395
-
396
- --- OUTPUT CONSTRAINTS ---
397
- Maximum 3 findings (one per gap investigated).
398
- Maximum 2 sentences per finding.
399
- Only report gaps that are STILL unresolved after your research.
400
-
401
- --- OUTPUT FORMAT ---
402
- Return JSON:
403
- {
404
- "findings": [
405
- {"area": "...", "discovery": "...", "source": "file or search"}
406
- ],
407
- "gaps_remaining": [
408
- {"id": "gap_N", "description": "..."}
409
- ],
410
- "gaps_resolved": ["gap_1", "gap_2"],
411
- "overall_knowledge_confidence": 0-100
412
- }
413
- """
414
-
415
- # Wait for scout to complete.
416
- # Update gaps list from scout results.
417
-
418
- # === PLANNING PHASE (always runs — 1 planner per iteration) ===
419
-
420
- Spawn Planning Ant (Route-Setter) via Task tool with subagent_type="aether-route-setter":
421
- # NOTE: Claude Code uses aether-route-setter; OpenCode now uses same specialist agent
422
-
423
- """
424
- You are a Route-Setter Ant in the Aether Colony.
425
-
426
- --- MISSION ---
427
- Create or refine a project plan based on research findings.
428
-
429
- Goal: "{goal}"
430
- Iteration: {iteration}/{max_iterations}
431
-
432
- {context_capsule_prompt}
433
-
434
- --- PLANNING DISCIPLINE ---
435
- Read .aether/planning.md for full reference.
436
-
437
- Key rules:
438
- - Bite-sized tasks (2-5 minutes each) - one action per task
439
- - Goal-oriented - describe WHAT to achieve, not HOW
440
- - Constraints define boundaries, not implementation
441
- - Hints point toward patterns, not solutions
442
- - Success criteria are testable outcomes
443
-
444
- Task format (GOAL-ORIENTED):
445
- ```
446
- Task N.1: {goal description}
447
- Goal: What to achieve (not how)
448
- Constraints:
449
- - Boundaries and requirements
450
- - Integration points
451
- Hints:
452
- - Pointer to existing patterns (optional)
453
- - Relevant files to reference (optional)
454
- Success Criteria:
455
- - Testable outcome 1
456
- - Testable outcome 2
457
- ```
458
-
459
- DO NOT include:
460
- - Exact code to write
461
- - Specific function names (unless critical API)
462
- - Implementation details
463
- - Line-by-line instructions
464
-
465
- Workers discover implementations by reading existing code and patterns.
466
- This enables TRUE EMERGENCE - different approaches based on context.
467
-
468
- --- RESEARCH FINDINGS ---
469
- {scout.findings formatted — compact, max 5 items}
470
-
471
- --- PHASE DOMAIN RESEARCH (from Step 3.6) ---
472
- {research_findings_summary if available, otherwise omit this section}
473
-
474
- Remaining Gaps:
475
- {gaps formatted — compact, max 3 items}
476
-
477
- --- CURRENT PLAN DRAFT ---
478
- {if plan_draft:}
479
- {plan_draft}
480
- {else:}
481
- No plan yet. Create initial draft.
482
- {end if}
483
-
484
- --- INSTRUCTIONS ---
485
- 1. If no plan exists, create 3-6 phases with concrete tasks
486
- 2. If plan exists, refine based on NEW information only
487
- 3. Rate confidence across 5 dimensions
488
- 4. Keep response concise — no verbose explanations
489
-
490
- Do NOT assign castes to tasks - describe the work only.
491
-
492
- --- OUTPUT CONSTRAINTS ---
493
- Maximum 6 phases. Maximum 4 tasks per phase.
494
- Maximum 2 sentence description per task.
495
- Confidence dimensions as single numbers, not paragraphs.
496
-
497
- --- OUTPUT FORMAT ---
498
- Return JSON:
499
- {
500
- "plan": {
501
- "phases": [
502
- {
503
- "id": 1,
504
- "name": "...",
505
- "description": "...",
506
- "tasks": [
507
- {
508
- "id": "1.1",
509
- "goal": "What to achieve (not how)",
510
- "constraints": ["boundary 1", "boundary 2"],
511
- "hints": ["optional pointer to pattern"],
512
- "success_criteria": ["testable outcome 1", "testable outcome 2"],
513
- "depends_on": []
514
- }
515
- ],
516
- "success_criteria": ["...", "..."]
517
- }
518
- ]
519
- },
520
- "confidence": {
521
- "knowledge": 0-100,
522
- "requirements": 0-100,
523
- "risks": 0-100,
524
- "dependencies": 0-100,
525
- "effort": 0-100,
526
- "overall": 0-100
527
- },
528
- "delta_reasoning": "One sentence: what changed from last iteration",
529
- "unresolved_gaps": ["...", "..."]
530
- }
531
- """
532
-
533
- Parse planning results. Update plan_draft and confidence.
534
-
535
- # === UPDATE WATCH FILES ===
536
-
537
- Update `.aether/data/watch-status.txt` with current state.
538
- Update `.aether/data/watch-progress.txt` with progress bar.
539
-
540
- # === STALL TRACKING ===
541
-
542
- delta = confidence - last_confidence
543
- if delta < 5:
544
- stall_count += 1
545
- else:
546
- stall_count = 0
547
-
548
- last_confidence = confidence
549
- ```
550
-
551
- **After loop exits (auto-finalize, no user prompt needed):**
552
-
553
- ```
554
- Planning complete after {iteration} iteration(s).
555
-
556
- Confidence: {confidence}%
557
- {if gaps remain:}
558
- Note: {gaps.length} knowledge gap(s) deferred — these can be resolved during builds.
559
- {end if}
560
- ```
561
-
562
- Proceed directly to Step 5. No user confirmation needed — the plan auto-finalizes.
563
-
564
- ### Step 5: Finalize Plan
565
-
566
- Once loop exits (confidence >= {target_confidence}, max iterations reached, or stall detected):
567
-
568
- Read current COLONY_STATE.json, then update:
569
- - Set `plan.phases` to the final phases array
570
- - Set `plan.generated_at` to ISO-8601 timestamp
571
- - Set `state` to `"READY"`
572
- - Append event: `"<timestamp>|plan_generated|plan|Generated {N} phases with {confidence}% confidence"`
573
-
574
- Write COLONY_STATE.json.
575
-
576
- **Verify the write** — read back and confirm the plan persisted:
577
- ```bash
578
- verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
579
- verify_timestamp=$(jq -r '.plan.generated_at' .aether/data/COLONY_STATE.json)
580
- verify_state=$(jq -r '.state' .aether/data/COLONY_STATE.json)
581
- if [[ "$verify_phases" -lt 1 || "$verify_timestamp" == "null" || "$verify_state" != "READY" ]]; then
582
- echo "ERROR: Plan write verification failed (phases=$verify_phases, generated_at=$verify_timestamp, state=$verify_state)"
583
- echo "Attempting retry write..."
584
- bash .aether/aether-utils.sh state-write "$(jq --argjson phases "$(echo '$PLAN_JSON' | jq '.plan.phases')" --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" '.plan.phases = $phases | .plan.generated_at = $ts | .state = "READY"' .aether/data/COLONY_STATE.json)"
585
- verify_phases=$(jq '.plan.phases | length' .aether/data/COLONY_STATE.json)
586
- if [[ "$verify_phases" -lt 1 ]]; then
587
- echo "FATAL: Retry write also failed. Plan was not persisted."
588
- echo "Re-run /ant:plan to regenerate."
589
- stop
590
- fi
591
- fi
592
- echo "Plan verified: $verify_phases phases, generated_at=$verify_timestamp, state=$verify_state"
593
- ```
594
-
595
- Log plan completion: `bash .aether/aether-utils.sh activity-log "PLAN_COMPLETE" "queen" "Plan finalized with {confidence}% confidence"`
596
-
597
- Update watch-status.txt:
598
- ```
599
- AETHER COLONY :: READY
600
- =======================
601
-
602
- State: READY
603
- Plan: {N} phases generated
604
- Confidence: {confidence}%
605
-
606
- Ready to build.
607
- ```
608
-
609
- ### Step 6: Display Plan
610
-
611
- Read `plan.phases` from COLONY_STATE.json and display:
612
-
613
- ```
614
- 📊🐜🗺️🐜📊 ═══════════════════════════════════════════════════
615
- C O L O N Y P L A N
616
- ═══════════════════════════════════════════════════ 📊🐜🗺️🐜📊
617
-
618
- 👑 Goal: {goal}
619
-
620
- {if plan was just generated:}
621
- 📊 Confidence: {confidence}%
622
- 🔄 Iterations: {iteration}
623
- {end if}
624
-
625
- ─────────────────────────────────────────────────────
626
-
627
- 📍 Phase {id}: {name} [{STATUS}]
628
- {description}
629
-
630
- 🐜 Tasks:
631
- {status_icon} {id}: {description}
632
-
633
- ✅ Success Criteria:
634
- • {criterion}
635
-
636
- ─────────────────────────────────────────────────────
637
- (repeat for each phase)
638
-
639
- 🐜 Next Steps:
640
- {Calculate first_incomplete_phase: iterate through phases, find first where status != 'completed'. Default to 1 if all complete or no phases. Look up its name from plan.phases[id].name.}
641
- /ant:build {first_incomplete_phase} 🔨 Phase {first_incomplete_phase}: {phase_name}
642
- /ant:focus "<area>" 🎯 Focus colony attention
643
- /ant:status 📊 View colony status
644
-
645
- 💾 Plan persisted — safe to /clear before building
646
- ```
647
-
648
- Status icons: pending = `[ ]`, in_progress = `[~]`, completed = `[✓]`
649
-
650
- ---
651
-
652
- ## Confidence Scoring Reference
653
-
654
- Each dimension rated 0-100%:
655
-
656
- | Dimension | What It Measures |
657
- |-----------|------------------|
658
- | Knowledge | Understanding of codebase structure, patterns, tech stack |
659
- | Requirements | Clarity of success criteria and acceptance conditions |
660
- | Risks | Identification of potential blockers and failure modes |
661
- | Dependencies | Understanding of what affects what, ordering constraints |
662
- | Effort | Ability to estimate relative complexity of tasks |
663
-
664
- **Overall** = weighted average (knowledge 25%, requirements 25%, risks 20%, dependencies 15%, effort 15%)
665
-
666
- **Target:** Use the selected planning depth target. Higher targets trade latency for stronger up-front plan quality.
667
-
668
- ---
669
-
670
- ## Auto-Termination Safeguards
671
-
672
- The planning loop terminates automatically without requiring user input:
673
-
674
- 1. **Confidence Threshold**: Loop exits when overall confidence reaches `{target_confidence}%`
675
-
676
- 2. **Hard Iteration Cap**: Maximum `{max_iterations}` iterations (2 subagents per iteration: 1 scout + 1 planner)
677
-
678
- 3. **Stall Detection**: If confidence improves < 5% for 2 consecutive iterations, auto-finalize current plan
679
-
680
- 4. **Single Scout Research**: One researcher per iteration (broad on iteration 1, gap-focused on 2+) — no parallel Alpha/Beta or synthesis agent
681
-
682
- 5. **Compressed Output**: Subagents limited to 5 findings max, 2-sentence summaries, compact JSON
683
-
684
- 6. **Escape Hatch**: `/ant:plan --accept` accepts current plan regardless of confidence