aether-colony 3.1.4 → 3.1.15
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.
- package/.claude/commands/ant/archaeology.md +12 -0
- package/.claude/commands/ant/build.md +382 -319
- package/.claude/commands/ant/chaos.md +23 -1
- package/.claude/commands/ant/colonize.md +147 -87
- package/.claude/commands/ant/continue.md +213 -23
- package/.claude/commands/ant/council.md +22 -0
- package/.claude/commands/ant/dream.md +18 -0
- package/.claude/commands/ant/entomb.md +178 -6
- package/.claude/commands/ant/init.md +87 -13
- package/.claude/commands/ant/lay-eggs.md +45 -5
- package/.claude/commands/ant/oracle.md +82 -9
- package/.claude/commands/ant/organize.md +2 -2
- package/.claude/commands/ant/pause-colony.md +86 -28
- package/.claude/commands/ant/phase.md +26 -0
- package/.claude/commands/ant/plan.md +204 -111
- package/.claude/commands/ant/resume-colony.md +23 -1
- package/.claude/commands/ant/resume.md +159 -0
- package/.claude/commands/ant/seal.md +177 -3
- package/.claude/commands/ant/swarm.md +78 -97
- package/.claude/commands/ant/verify-castes.md +7 -7
- package/.claude/commands/ant/watch.md +17 -0
- package/.opencode/agents/aether-ambassador.md +97 -0
- package/.opencode/agents/aether-archaeologist.md +91 -0
- package/.opencode/agents/aether-architect.md +66 -0
- package/.opencode/agents/aether-auditor.md +111 -0
- package/.opencode/agents/aether-builder.md +28 -10
- package/.opencode/agents/aether-chaos.md +98 -0
- package/.opencode/agents/aether-chronicler.md +80 -0
- package/.opencode/agents/aether-gatekeeper.md +107 -0
- package/.opencode/agents/aether-guardian.md +107 -0
- package/.opencode/agents/aether-includer.md +108 -0
- package/.opencode/agents/aether-keeper.md +106 -0
- package/.opencode/agents/aether-measurer.md +119 -0
- package/.opencode/agents/aether-probe.md +91 -0
- package/.opencode/agents/aether-queen.md +72 -19
- package/.opencode/agents/aether-route-setter.md +85 -0
- package/.opencode/agents/aether-sage.md +98 -0
- package/.opencode/agents/aether-scout.md +33 -15
- package/.opencode/agents/aether-surveyor-disciplines.md +334 -0
- package/.opencode/agents/aether-surveyor-nest.md +272 -0
- package/.opencode/agents/aether-surveyor-pathogens.md +209 -0
- package/.opencode/agents/aether-surveyor-provisions.md +277 -0
- package/.opencode/agents/aether-tracker.md +91 -0
- package/.opencode/agents/aether-watcher.md +30 -12
- package/.opencode/agents/aether-weaver.md +87 -0
- package/.opencode/agents/workers.md +1034 -0
- package/.opencode/commands/ant/archaeology.md +44 -26
- package/.opencode/commands/ant/build.md +327 -295
- package/.opencode/commands/ant/chaos.md +32 -4
- package/.opencode/commands/ant/colonize.md +119 -93
- package/.opencode/commands/ant/continue.md +98 -10
- package/.opencode/commands/ant/council.md +28 -0
- package/.opencode/commands/ant/dream.md +24 -0
- package/.opencode/commands/ant/entomb.md +73 -1
- package/.opencode/commands/ant/feedback.md +8 -2
- package/.opencode/commands/ant/flag.md +9 -3
- package/.opencode/commands/ant/flags.md +8 -2
- package/.opencode/commands/ant/focus.md +8 -2
- package/.opencode/commands/ant/help.md +12 -0
- package/.opencode/commands/ant/init.md +49 -4
- package/.opencode/commands/ant/lay-eggs.md +30 -2
- package/.opencode/commands/ant/oracle.md +39 -7
- package/.opencode/commands/ant/organize.md +9 -3
- package/.opencode/commands/ant/pause-colony.md +54 -1
- package/.opencode/commands/ant/phase.md +36 -4
- package/.opencode/commands/ant/plan.md +225 -117
- package/.opencode/commands/ant/redirect.md +8 -2
- package/.opencode/commands/ant/resume-colony.md +51 -26
- package/.opencode/commands/ant/seal.md +76 -0
- package/.opencode/commands/ant/status.md +50 -20
- package/.opencode/commands/ant/swarm.md +108 -104
- package/.opencode/commands/ant/tunnels.md +107 -2
- package/CHANGELOG.md +21 -0
- package/README.md +199 -86
- package/bin/cli.js +142 -25
- package/bin/generate-commands.sh +100 -16
- package/bin/lib/caste-colors.js +5 -5
- package/bin/lib/errors.js +16 -0
- package/bin/lib/file-lock.js +279 -44
- package/bin/lib/state-sync.js +206 -23
- package/bin/lib/update-transaction.js +206 -24
- package/bin/sync-to-runtime.sh +129 -0
- package/package.json +2 -2
- package/runtime/CONTEXT.md +160 -0
- package/runtime/aether-utils.sh +1421 -55
- package/runtime/docs/AETHER-2.0-IMPLEMENTATION-PLAN.md +1343 -0
- package/runtime/docs/AETHER-PHEROMONE-SYSTEM-MASTER-SPEC.md +2642 -0
- package/runtime/docs/PHEROMONE-INJECTION.md +240 -0
- package/runtime/docs/PHEROMONE-INTEGRATION.md +192 -0
- package/runtime/docs/PHEROMONE-SYSTEM-DESIGN.md +426 -0
- package/runtime/docs/README.md +94 -0
- package/runtime/docs/VISUAL-OUTPUT-SPEC.md +219 -0
- package/runtime/docs/biological-reference.md +272 -0
- package/runtime/docs/codebase-review.md +399 -0
- package/runtime/docs/command-sync.md +164 -0
- package/runtime/docs/implementation-learnings.md +89 -0
- package/runtime/docs/known-issues.md +217 -0
- package/runtime/docs/namespace.md +148 -0
- package/runtime/docs/planning-discipline.md +159 -0
- package/runtime/lib/queen-utils.sh +729 -0
- package/runtime/model-profiles.yaml +100 -0
- package/runtime/recover.sh +136 -0
- package/runtime/templates/QUEEN.md.template +79 -0
- package/runtime/utils/atomic-write.sh +5 -5
- package/runtime/utils/chamber-utils.sh +6 -3
- package/runtime/utils/error-handler.sh +200 -0
- package/runtime/utils/queen-to-md.xsl +395 -0
- package/runtime/utils/spawn-tree.sh +428 -0
- package/runtime/utils/spawn-with-model.sh +56 -0
- package/runtime/utils/state-loader.sh +215 -0
- package/runtime/utils/swarm-display.sh +5 -5
- package/runtime/utils/watch-spawn-tree.sh +90 -22
- package/runtime/utils/xml-compose.sh +247 -0
- package/runtime/utils/xml-core.sh +186 -0
- package/runtime/utils/xml-utils.sh +2161 -0
- package/runtime/verification-loop.md +1 -1
- package/runtime/workers-new-castes.md +516 -0
- package/runtime/workers.md +20 -8
- package/.aether/visualizations/anthill-stages/brood-stable.txt +0 -26
- package/.aether/visualizations/anthill-stages/crowned-anthill.txt +0 -30
- package/.aether/visualizations/anthill-stages/first-mound.txt +0 -18
- package/.aether/visualizations/anthill-stages/open-chambers.txt +0 -24
- package/.aether/visualizations/anthill-stages/sealed-chambers.txt +0 -28
- package/.aether/visualizations/anthill-stages/ventilated-nest.txt +0 -27
|
@@ -3,11 +3,33 @@ name: ant:plan
|
|
|
3
3
|
description: "📊🐜🗺️🐜📊 Show project plan or generate project-specific phases"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are the **Queen**. Orchestrate
|
|
6
|
+
You are the **Queen**. Orchestrate research and planning until 80% confidence (maximum 4 iterations).
|
|
7
7
|
|
|
8
8
|
## Instructions
|
|
9
9
|
|
|
10
|
-
### Step
|
|
10
|
+
### Step -1: Normalize Arguments
|
|
11
|
+
|
|
12
|
+
Run: `normalized_args=$(bash .aether/aether-utils.sh normalize-args "$@")`
|
|
13
|
+
|
|
14
|
+
This ensures arguments work correctly in both Claude Code and OpenCode. Use `$normalized_args` throughout this command.
|
|
15
|
+
|
|
16
|
+
Parse `$normalized_args`:
|
|
17
|
+
- If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
|
|
18
|
+
- Otherwise: set `visual_mode = true`
|
|
19
|
+
|
|
20
|
+
### Step 0: Initialize Visual Mode (if enabled)
|
|
21
|
+
|
|
22
|
+
If `visual_mode` is true:
|
|
23
|
+
```bash
|
|
24
|
+
# Generate session ID
|
|
25
|
+
plan_id="plan-$(date +%s)"
|
|
26
|
+
|
|
27
|
+
# Initialize swarm display
|
|
28
|
+
bash .aether/aether-utils.sh swarm-display-init "$plan_id"
|
|
29
|
+
bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "excavating" "Generating colony plan" "Colony" '{"read":0,"grep":0,"edit":0,"bash":0}' 0 "fungus_garden" 0
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Step 0.5: Version Check (Non-blocking)
|
|
11
33
|
|
|
12
34
|
Run using the Bash tool: `bash .aether/aether-utils.sh version-check 2>/dev/null || true`
|
|
13
35
|
|
|
@@ -32,18 +54,35 @@ No colony initialized. Run /ant:init "<goal>" first.
|
|
|
32
54
|
```
|
|
33
55
|
Stop here.
|
|
34
56
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
57
|
+
### Step 1.5: Load State and Show Resumption Context
|
|
58
|
+
|
|
59
|
+
Run using Bash tool: `bash .aether/aether-utils.sh load-state`
|
|
60
|
+
|
|
61
|
+
If successful and goal is not null:
|
|
62
|
+
1. Extract current_phase from state
|
|
63
|
+
2. Get phase name from plan.phases[current_phase - 1].name (or "(unnamed)")
|
|
64
|
+
3. Display brief resumption context:
|
|
65
|
+
```
|
|
66
|
+
🔄 Resuming: Phase X - Name
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
If .aether/HANDOFF.md exists (detected in load-state output):
|
|
70
|
+
- Display "Resuming from paused session"
|
|
71
|
+
- Read .aether/HANDOFF.md for additional context
|
|
72
|
+
- Remove .aether/HANDOFF.md after display (cleanup)
|
|
73
|
+
|
|
74
|
+
Run: `bash .aether/aether-utils.sh unload-state` to release lock.
|
|
75
|
+
|
|
76
|
+
**Error handling:**
|
|
77
|
+
- If E_FILE_NOT_FOUND: "No colony initialized. Run /ant:init first." and stop
|
|
78
|
+
- If validation error: Display error details with recovery suggestion and stop
|
|
79
|
+
- For other errors: Display generic error and suggest /ant:status for diagnostics
|
|
41
80
|
|
|
42
81
|
### Step 2: Check Existing Plan
|
|
43
82
|
|
|
44
83
|
If `plan.phases` has entries (non-empty array), skip to **Step 6** (Display Plan).
|
|
45
84
|
|
|
46
|
-
Parse `$
|
|
85
|
+
Parse `$normalized_args`:
|
|
47
86
|
- If contains `--accept`: Set `force_accept = true` (accept current plan regardless of confidence)
|
|
48
87
|
- Otherwise: `force_accept = false`
|
|
49
88
|
|
|
@@ -59,7 +98,7 @@ AETHER COLONY :: PLANNING
|
|
|
59
98
|
State: PLANNING
|
|
60
99
|
Phase: 0/0 (generating plan)
|
|
61
100
|
Confidence: 0%
|
|
62
|
-
Iteration: 0/
|
|
101
|
+
Iteration: 0/4
|
|
63
102
|
|
|
64
103
|
Active Workers:
|
|
65
104
|
[Research] Starting...
|
|
@@ -76,9 +115,9 @@ Progress
|
|
|
76
115
|
|
|
77
116
|
[ ] 0%
|
|
78
117
|
|
|
79
|
-
Target:
|
|
118
|
+
Target: 80% confidence
|
|
80
119
|
|
|
81
|
-
Iteration: 0/
|
|
120
|
+
Iteration: 0/4
|
|
82
121
|
Gaps: (analyzing...)
|
|
83
122
|
```
|
|
84
123
|
|
|
@@ -87,76 +126,162 @@ Log start:
|
|
|
87
126
|
bash .aether/aether-utils.sh activity-log "PLAN_START" "queen" "Iterative planning loop initiated for goal"
|
|
88
127
|
```
|
|
89
128
|
|
|
90
|
-
### Step
|
|
129
|
+
### Step 3.5: Load Territory Survey
|
|
130
|
+
|
|
131
|
+
Check if territory survey exists before research:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
ls .aether/data/survey/*.md 2>/dev/null
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**If survey exists:**
|
|
138
|
+
1. **Always read PATHOGENS.md first** — understand known concerns before planning
|
|
139
|
+
2. Read other relevant docs based on goal keywords:
|
|
140
|
+
|
|
141
|
+
| Goal Contains | Additional Documents |
|
|
142
|
+
|---------------|---------------------|
|
|
143
|
+
| UI, frontend, component, page | DISCIPLINES.md, CHAMBERS.md |
|
|
144
|
+
| API, backend, endpoint | BLUEPRINT.md, DISCIPLINES.md |
|
|
145
|
+
| database, schema, model | BLUEPRINT.md, PROVISIONS.md |
|
|
146
|
+
| test, spec | SENTINEL-PROTOCOLS.md, DISCIPLINES.md |
|
|
147
|
+
| integration, external | TRAILS.md, PROVISIONS.md |
|
|
148
|
+
| refactor, cleanup | PATHOGENS.md, BLUEPRINT.md |
|
|
149
|
+
|
|
150
|
+
**Inject survey context into scout and planner prompts:**
|
|
151
|
+
- Include key patterns from DISCIPLINES.md
|
|
152
|
+
- Reference architecture from BLUEPRINT.md
|
|
153
|
+
- Note tech stack from PROVISIONS.md
|
|
154
|
+
- Flag concerns from PATHOGENS.md
|
|
155
|
+
|
|
156
|
+
**Display:**
|
|
157
|
+
```
|
|
158
|
+
🗺️ Territory survey loaded — incorporating context into planning
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**If no survey:** Continue without survey context (scouts will do fresh exploration)
|
|
162
|
+
|
|
163
|
+
### Step 4: Research and Planning Loop
|
|
91
164
|
|
|
92
165
|
Initialize tracking:
|
|
93
166
|
- `iteration = 0`
|
|
94
167
|
- `confidence = 0`
|
|
95
168
|
- `gaps = []` (list of knowledge gaps)
|
|
96
|
-
- `stuck_counts = {}` (gap_id -> count of iterations without progress)
|
|
97
169
|
- `plan_draft = null`
|
|
98
170
|
- `last_confidence = 0`
|
|
99
171
|
- `stall_count = 0` (consecutive iterations with < 5% improvement)
|
|
100
172
|
|
|
101
|
-
**Loop (max
|
|
173
|
+
**Loop (max 4 iterations, 2 agents per iteration: 1 scout + 1 planner):**
|
|
102
174
|
|
|
103
175
|
```
|
|
104
|
-
while iteration <
|
|
176
|
+
while iteration < 4 AND confidence < 80:
|
|
105
177
|
iteration += 1
|
|
106
178
|
|
|
107
|
-
# ===
|
|
179
|
+
# === AUTO-BREAK CHECKS (no user prompt needed) ===
|
|
180
|
+
if iteration > 1:
|
|
181
|
+
if confidence >= 80:
|
|
182
|
+
Log: "Confidence threshold reached ({confidence}%), finalizing plan"
|
|
183
|
+
break
|
|
184
|
+
if stall_count >= 2:
|
|
185
|
+
Log: "Planning stalled at {confidence}%, finalizing current plan"
|
|
186
|
+
break
|
|
187
|
+
|
|
188
|
+
# === RESEARCH PHASE (always runs — 1 scout per iteration) ===
|
|
189
|
+
|
|
190
|
+
if iteration == 1:
|
|
191
|
+
|
|
192
|
+
# Broad exploration on first pass
|
|
193
|
+
Spawn Research Scout via Task tool with subagent_type="general-purpose":
|
|
194
|
+
|
|
195
|
+
"""
|
|
196
|
+
You are a Scout Ant in the Aether Colony.
|
|
197
|
+
|
|
198
|
+
--- MISSION ---
|
|
199
|
+
Research the codebase to understand what exists and how it works.
|
|
200
|
+
|
|
201
|
+
Goal: "{goal}"
|
|
202
|
+
Iteration: {iteration}/4
|
|
203
|
+
|
|
204
|
+
--- EXPLORATION AREAS ---
|
|
205
|
+
Cover ALL of these in a single pass:
|
|
206
|
+
1. Core architecture, entry points, and main modules
|
|
207
|
+
2. Business logic and domain models
|
|
208
|
+
3. Testing patterns and quality practices
|
|
209
|
+
4. Configuration, dependencies, and infrastructure
|
|
210
|
+
5. Edge cases, error handling, and validation
|
|
211
|
+
|
|
212
|
+
--- TOOLS ---
|
|
213
|
+
Use: Glob, Grep, Read, WebSearch, WebFetch
|
|
214
|
+
Do NOT use: Task, Write, Edit
|
|
215
|
+
|
|
216
|
+
--- OUTPUT CONSTRAINTS ---
|
|
217
|
+
Maximum 5 findings (prioritize by impact on the goal).
|
|
218
|
+
Maximum 2 sentences per finding.
|
|
219
|
+
Maximum 3 knowledge gaps identified.
|
|
220
|
+
|
|
221
|
+
--- OUTPUT FORMAT ---
|
|
222
|
+
Return JSON:
|
|
223
|
+
{
|
|
224
|
+
"findings": [
|
|
225
|
+
{"area": "...", "discovery": "...", "source": "file or search"}
|
|
226
|
+
],
|
|
227
|
+
"gaps_remaining": [
|
|
228
|
+
{"id": "gap_N", "description": "..."}
|
|
229
|
+
],
|
|
230
|
+
"overall_knowledge_confidence": 0-100
|
|
231
|
+
}
|
|
232
|
+
"""
|
|
108
233
|
|
|
109
|
-
|
|
234
|
+
else:
|
|
110
235
|
|
|
111
|
-
|
|
112
|
-
|
|
236
|
+
# Gap-focused research on subsequent passes
|
|
237
|
+
Spawn Gap-Focused Scout via Task tool with subagent_type="general-purpose":
|
|
113
238
|
|
|
114
|
-
|
|
115
|
-
|
|
239
|
+
"""
|
|
240
|
+
You are a Scout Ant in the Aether Colony (gap-focused research).
|
|
116
241
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
{if gaps is not empty:}
|
|
121
|
-
--- SPECIFIC GAPS TO INVESTIGATE ---
|
|
122
|
-
Focus ONLY on these gaps:
|
|
123
|
-
{for each gap in gaps:}
|
|
124
|
-
- {gap.id}: {gap.description}
|
|
125
|
-
{end for}
|
|
126
|
-
{else:}
|
|
127
|
-
--- INITIAL EXPLORATION ---
|
|
128
|
-
This is iteration 1. Explore:
|
|
129
|
-
1. Codebase structure (Glob for key files)
|
|
130
|
-
2. Existing patterns and conventions
|
|
131
|
-
3. Dependencies and tech stack
|
|
132
|
-
4. Any existing tests or docs
|
|
133
|
-
{end if}
|
|
242
|
+
--- MISSION ---
|
|
243
|
+
Investigate ONLY these specific knowledge gaps. Do not explore broadly.
|
|
134
244
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
Do NOT use: Task, Write, Edit
|
|
245
|
+
Goal: "{goal}"
|
|
246
|
+
Iteration: {iteration}/4
|
|
138
247
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
],
|
|
148
|
-
"gaps_resolved": ["gap_1", "gap_2"],
|
|
149
|
-
"overall_knowledge_confidence": 0-100
|
|
150
|
-
}
|
|
151
|
-
"""
|
|
248
|
+
--- GAPS TO INVESTIGATE ---
|
|
249
|
+
{for each gap in gaps:}
|
|
250
|
+
- {gap.id}: {gap.description}
|
|
251
|
+
{end for}
|
|
252
|
+
|
|
253
|
+
--- TOOLS ---
|
|
254
|
+
Use: Glob, Grep, Read, WebSearch, WebFetch
|
|
255
|
+
Do NOT use: Task, Write, Edit
|
|
152
256
|
|
|
153
|
-
|
|
257
|
+
--- OUTPUT CONSTRAINTS ---
|
|
258
|
+
Maximum 3 findings (one per gap investigated).
|
|
259
|
+
Maximum 2 sentences per finding.
|
|
260
|
+
Only report gaps that are STILL unresolved after your research.
|
|
154
261
|
|
|
155
|
-
|
|
262
|
+
--- OUTPUT FORMAT ---
|
|
263
|
+
Return JSON:
|
|
264
|
+
{
|
|
265
|
+
"findings": [
|
|
266
|
+
{"area": "...", "discovery": "...", "source": "file or search"}
|
|
267
|
+
],
|
|
268
|
+
"gaps_remaining": [
|
|
269
|
+
{"id": "gap_N", "description": "..."}
|
|
270
|
+
],
|
|
271
|
+
"gaps_resolved": ["gap_1", "gap_2"],
|
|
272
|
+
"overall_knowledge_confidence": 0-100
|
|
273
|
+
}
|
|
274
|
+
"""
|
|
156
275
|
|
|
157
|
-
#
|
|
276
|
+
# Wait for scout to complete.
|
|
277
|
+
# Update gaps list from scout results.
|
|
158
278
|
|
|
159
|
-
|
|
279
|
+
Log: `bash .aether/aether-utils.sh activity-log "RESEARCH" "scout" "Iteration {iteration}: {scout.findings.length} findings, {scout.gaps_remaining.length} gaps"`
|
|
280
|
+
|
|
281
|
+
# === PLANNING PHASE (always runs — 1 planner per iteration) ===
|
|
282
|
+
|
|
283
|
+
Spawn Planning Ant (Route-Setter) via Task tool with subagent_type="general-purpose":
|
|
284
|
+
# NOTE: Claude Code uses aether-route-setter; OpenCode uses general-purpose with role injection
|
|
160
285
|
|
|
161
286
|
"""
|
|
162
287
|
You are a Route-Setter Ant in the Aether Colony.
|
|
@@ -165,7 +290,7 @@ while iteration < 50 AND confidence < 95:
|
|
|
165
290
|
Create or refine a project plan based on research findings.
|
|
166
291
|
|
|
167
292
|
Goal: "{goal}"
|
|
168
|
-
Iteration: {iteration}/
|
|
293
|
+
Iteration: {iteration}/4
|
|
169
294
|
|
|
170
295
|
--- PLANNING DISCIPLINE ---
|
|
171
296
|
Read .aether/planning.md for full reference.
|
|
@@ -202,7 +327,10 @@ while iteration < 50 AND confidence < 95:
|
|
|
202
327
|
This enables TRUE EMERGENCE - different approaches based on context.
|
|
203
328
|
|
|
204
329
|
--- RESEARCH FINDINGS ---
|
|
205
|
-
{
|
|
330
|
+
{scout.findings formatted — compact, max 5 items}
|
|
331
|
+
|
|
332
|
+
Remaining Gaps:
|
|
333
|
+
{gaps formatted — compact, max 3 items}
|
|
206
334
|
|
|
207
335
|
--- CURRENT PLAN DRAFT ---
|
|
208
336
|
{if plan_draft:}
|
|
@@ -211,18 +339,19 @@ while iteration < 50 AND confidence < 95:
|
|
|
211
339
|
No plan yet. Create initial draft.
|
|
212
340
|
{end if}
|
|
213
341
|
|
|
214
|
-
--- REMAINING GAPS ---
|
|
215
|
-
{gaps_remaining}
|
|
216
|
-
|
|
217
342
|
--- INSTRUCTIONS ---
|
|
218
343
|
1. If no plan exists, create 3-6 phases with concrete tasks
|
|
219
|
-
2.
|
|
220
|
-
3.
|
|
221
|
-
4.
|
|
222
|
-
5. Explain what changed from last iteration
|
|
344
|
+
2. If plan exists, refine based on NEW information only
|
|
345
|
+
3. Rate confidence across 5 dimensions
|
|
346
|
+
4. Keep response concise — no verbose explanations
|
|
223
347
|
|
|
224
348
|
Do NOT assign castes to tasks - describe the work only.
|
|
225
349
|
|
|
350
|
+
--- OUTPUT CONSTRAINTS ---
|
|
351
|
+
Maximum 6 phases. Maximum 4 tasks per phase.
|
|
352
|
+
Maximum 2 sentence description per task.
|
|
353
|
+
Confidence dimensions as single numbers, not paragraphs.
|
|
354
|
+
|
|
226
355
|
--- OUTPUT FORMAT ---
|
|
227
356
|
Return JSON:
|
|
228
357
|
{
|
|
@@ -254,7 +383,7 @@ while iteration < 50 AND confidence < 95:
|
|
|
254
383
|
"effort": 0-100,
|
|
255
384
|
"overall": 0-100
|
|
256
385
|
},
|
|
257
|
-
"delta_reasoning": "
|
|
386
|
+
"delta_reasoning": "One sentence: what changed from last iteration",
|
|
258
387
|
"unresolved_gaps": ["...", "..."]
|
|
259
388
|
}
|
|
260
389
|
"""
|
|
@@ -268,64 +397,33 @@ while iteration < 50 AND confidence < 95:
|
|
|
268
397
|
Update `.aether/data/watch-status.txt` with current state.
|
|
269
398
|
Update `.aether/data/watch-progress.txt` with progress bar.
|
|
270
399
|
|
|
271
|
-
# ===
|
|
400
|
+
# === STALL TRACKING ===
|
|
272
401
|
|
|
273
|
-
# Check 1: Gap stuck detection
|
|
274
|
-
for each gap in gaps:
|
|
275
|
-
if gap was in previous iteration's gaps:
|
|
276
|
-
stuck_counts[gap.id] += 1
|
|
277
|
-
if stuck_counts[gap.id] >= 3:
|
|
278
|
-
mark gap as "needs_human_input"
|
|
279
|
-
remove from active gaps
|
|
280
|
-
|
|
281
|
-
# Check 2: Stall detection
|
|
282
402
|
delta = confidence - last_confidence
|
|
283
403
|
if delta < 5:
|
|
284
404
|
stall_count += 1
|
|
285
405
|
else:
|
|
286
406
|
stall_count = 0
|
|
287
407
|
|
|
288
|
-
if stall_count >= 3 AND iteration > 5:
|
|
289
|
-
# Stalled - ask user
|
|
290
|
-
Display current plan and confidence
|
|
291
|
-
Ask: "Planning has stalled at {confidence}%. Options:"
|
|
292
|
-
1. Continue iterating (may not improve)
|
|
293
|
-
2. Accept current plan
|
|
294
|
-
3. Provide guidance on: {gaps marked needs_human_input}
|
|
295
|
-
|
|
296
|
-
if user chooses "accept" OR force_accept:
|
|
297
|
-
break loop
|
|
298
|
-
if user provides guidance:
|
|
299
|
-
add guidance to gaps as FOCUS constraint
|
|
300
|
-
reset stall_count
|
|
301
|
-
|
|
302
|
-
# Check 3: Diminishing returns
|
|
303
|
-
if delta < 2 AND iteration > 10:
|
|
304
|
-
Display: "Approaching local maximum at {confidence}%."
|
|
305
|
-
Ask: "Continue or accept current plan?"
|
|
306
|
-
if user accepts:
|
|
307
|
-
break loop
|
|
308
|
-
|
|
309
408
|
last_confidence = confidence
|
|
310
409
|
```
|
|
311
410
|
|
|
312
|
-
**After loop exits:**
|
|
411
|
+
**After loop exits (auto-finalize, no user prompt needed):**
|
|
313
412
|
|
|
314
|
-
If `iteration == 50` and `confidence < 95`:
|
|
315
413
|
```
|
|
316
|
-
Planning
|
|
414
|
+
Planning complete after {iteration} iteration(s).
|
|
317
415
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
{
|
|
321
|
-
|
|
322
|
-
Recommendation: {proceed if confidence > 70, else get human input}
|
|
416
|
+
Confidence: {confidence}%
|
|
417
|
+
{if gaps remain:}
|
|
418
|
+
Note: {gaps.length} knowledge gap(s) deferred — these can be resolved during builds.
|
|
419
|
+
{end if}
|
|
323
420
|
```
|
|
324
|
-
|
|
421
|
+
|
|
422
|
+
Proceed directly to Step 5. No user confirmation needed — the plan auto-finalizes.
|
|
325
423
|
|
|
326
424
|
### Step 5: Finalize Plan
|
|
327
425
|
|
|
328
|
-
Once
|
|
426
|
+
Once loop exits (confidence >= 80, max iterations reached, or stall detected):
|
|
329
427
|
|
|
330
428
|
Read current COLONY_STATE.json, then update:
|
|
331
429
|
- Set `plan.phases` to the final phases array
|
|
@@ -351,6 +449,12 @@ Ready to build.
|
|
|
351
449
|
|
|
352
450
|
### Step 6: Display Plan
|
|
353
451
|
|
|
452
|
+
**If visual_mode is true, render final swarm display:**
|
|
453
|
+
```bash
|
|
454
|
+
bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "completed" "Plan generated" "Colony" '{"read":8,"grep":4,"edit":2,"bash":1}' 100 "fungus_garden" 100
|
|
455
|
+
bash .aether/aether-utils.sh swarm-display-render "$plan_id"
|
|
456
|
+
```
|
|
457
|
+
|
|
354
458
|
Read `plan.phases` from COLONY_STATE.json and display:
|
|
355
459
|
|
|
356
460
|
```
|
|
@@ -406,18 +510,22 @@ Each dimension rated 0-100%:
|
|
|
406
510
|
|
|
407
511
|
**Overall** = weighted average (knowledge 25%, requirements 25%, risks 20%, dependencies 15%, effort 15%)
|
|
408
512
|
|
|
409
|
-
**Target:
|
|
513
|
+
**Target: 80%** - Sufficient confidence for autonomous execution. Higher confidence is achieved during builds as gaps are resolved.
|
|
410
514
|
|
|
411
515
|
---
|
|
412
516
|
|
|
413
|
-
##
|
|
517
|
+
## Auto-Termination Safeguards
|
|
518
|
+
|
|
519
|
+
The planning loop terminates automatically without requiring user input:
|
|
520
|
+
|
|
521
|
+
1. **Confidence Threshold**: Loop exits when overall confidence reaches 80%
|
|
414
522
|
|
|
415
|
-
|
|
523
|
+
2. **Hard Iteration Cap**: Maximum 4 iterations (8 subagents total: 1 scout + 1 planner per iteration)
|
|
416
524
|
|
|
417
|
-
|
|
525
|
+
3. **Stall Detection**: If confidence improves < 5% for 2 consecutive iterations, auto-finalize current plan
|
|
418
526
|
|
|
419
|
-
|
|
527
|
+
4. **Single Scout Research**: One researcher per iteration (broad on iteration 1, gap-focused on 2+) — no parallel Alpha/Beta or synthesis agent
|
|
420
528
|
|
|
421
|
-
|
|
529
|
+
5. **Compressed Output**: Subagents limited to 5 findings max, 2-sentence summaries, compact JSON
|
|
422
530
|
|
|
423
|
-
|
|
531
|
+
6. **Escape Hatch**: `/ant:plan --accept` accepts current plan regardless of confidence
|
|
@@ -7,11 +7,17 @@ You are the **Queen**. Add an AVOID constraint.
|
|
|
7
7
|
|
|
8
8
|
## Instructions
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
### Step -1: Normalize Arguments
|
|
11
|
+
|
|
12
|
+
Run: `normalized_args=$(bash .aether/aether-utils.sh normalize-args "$@")`
|
|
13
|
+
|
|
14
|
+
This ensures arguments work correctly in both Claude Code and OpenCode. Use `$normalized_args` throughout this command.
|
|
15
|
+
|
|
16
|
+
The pattern to avoid is: `$normalized_args`
|
|
11
17
|
|
|
12
18
|
### Step 1: Validate
|
|
13
19
|
|
|
14
|
-
If `$
|
|
20
|
+
If `$normalized_args` empty -> show usage: `/ant:redirect <pattern to avoid>`, stop.
|
|
15
21
|
If content > 500 chars -> "Redirect content too long (max 500 chars)", stop.
|
|
16
22
|
|
|
17
23
|
### Step 2: Read + Update Constraints
|
|
@@ -7,27 +7,45 @@ You are the **Queen Ant Colony**. Restore state from a paused session.
|
|
|
7
7
|
|
|
8
8
|
## Instructions
|
|
9
9
|
|
|
10
|
-
### Step
|
|
10
|
+
### Step -1: Normalize Arguments
|
|
11
11
|
|
|
12
|
-
Run
|
|
12
|
+
Run: `normalized_args=$(bash .aether/aether-utils.sh normalize-args "$@")`
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
This ensures arguments work correctly in both Claude Code and OpenCode. Use `$normalized_args` throughout this command.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Parse `$normalized_args`:
|
|
17
|
+
- If contains `--no-visual`: set `visual_mode = false` (visual is ON by default)
|
|
18
|
+
- Otherwise: set `visual_mode = true`
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
- `.aether/HANDOFF.md`
|
|
20
|
-
- `.aether/data/COLONY_STATE.json`
|
|
20
|
+
### Step 0: Initialize Visual Mode (if enabled)
|
|
21
21
|
|
|
22
|
-
If `
|
|
22
|
+
If `visual_mode` is true:
|
|
23
|
+
```bash
|
|
24
|
+
# Generate session ID
|
|
25
|
+
resume_id="resume-$(date +%s)"
|
|
23
26
|
|
|
27
|
+
# Initialize swarm display
|
|
28
|
+
bash .aether/aether-utils.sh swarm-display-init "$resume_id"
|
|
29
|
+
bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "excavating" "Resuming colony" "Colony" '{"read":0,"grep":0,"edit":0,"bash":0}' 0 "fungus_garden" 0
|
|
24
30
|
```
|
|
25
|
-
No colony state found. Either:
|
|
26
|
-
/ant:init "<goal>" Start a new colony
|
|
27
|
-
Check .aether/HANDOFF.md for manual recovery
|
|
28
|
-
```
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
### Step 0.5: Version Check (Non-blocking)
|
|
33
|
+
|
|
34
|
+
Run using the Bash tool: `bash .aether/aether-utils.sh version-check 2>/dev/null || true`
|
|
35
|
+
|
|
36
|
+
If the command succeeds and the JSON result contains a non-empty string, display it as a one-line notice. Proceed regardless of outcome.
|
|
37
|
+
|
|
38
|
+
### Step 1: Load State and Validate
|
|
39
|
+
|
|
40
|
+
Run using Bash tool: `bash .aether/aether-utils.sh load-state`
|
|
41
|
+
|
|
42
|
+
If successful:
|
|
43
|
+
1. Parse state from result
|
|
44
|
+
2. If goal is null: Show "No colony state found..." message and stop
|
|
45
|
+
3. Check if paused flag is true - if not, note "Colony was not paused, but resuming anyway"
|
|
46
|
+
4. Extract all state fields for display
|
|
47
|
+
|
|
48
|
+
Keep state loaded (don't unload yet) - we'll need it for the full display.
|
|
31
49
|
|
|
32
50
|
### Step 2: Compute Active Signals
|
|
33
51
|
|
|
@@ -51,7 +69,7 @@ Output header:
|
|
|
51
69
|
═══════════════════════════════════════════════════ 🚦➡️🐜💨💨
|
|
52
70
|
```
|
|
53
71
|
|
|
54
|
-
Read the HANDOFF.md for context about what was happening, then display:
|
|
72
|
+
Read the .aether/HANDOFF.md for context about what was happening, then display:
|
|
55
73
|
|
|
56
74
|
```
|
|
57
75
|
+=====================================================+
|
|
@@ -71,33 +89,40 @@ ACTIVE PHEROMONES
|
|
|
71
89
|
|
|
72
90
|
If no active signals: (no active pheromones)
|
|
73
91
|
|
|
74
|
-
WORKERS
|
|
75
|
-
|
|
76
|
-
If ALL workers have "idle" status, display:
|
|
77
|
-
All 6 workers idle -- colony ready
|
|
78
|
-
|
|
79
|
-
Otherwise, group by status with caste name:
|
|
80
|
-
Active:
|
|
81
|
-
builder: currently executing
|
|
82
|
-
Idle:
|
|
83
|
-
colonizer route-setter watcher scout architect
|
|
84
|
-
|
|
85
92
|
PHASE PROGRESS
|
|
86
93
|
Phase <id>: <name> [<status>]
|
|
87
94
|
(list all phases from plan.phases)
|
|
88
95
|
|
|
89
96
|
CONTEXT FROM HANDOFF
|
|
90
|
-
<summarize what was happening from HANDOFF.md>
|
|
97
|
+
<summarize what was happening from .aether/HANDOFF.md>
|
|
91
98
|
|
|
92
99
|
NEXT ACTIONS
|
|
93
100
|
```
|
|
94
101
|
|
|
102
|
+
**If visual_mode is true, render final swarm display:**
|
|
103
|
+
```bash
|
|
104
|
+
bash .aether/aether-utils.sh swarm-display-update "Queen" "prime" "completed" "Colony resumed" "Colony" '{"read":3,"grep":0,"edit":2,"bash":1}' 100 "fungus_garden" 100
|
|
105
|
+
bash .aether/aether-utils.sh swarm-display-render "$resume_id"
|
|
106
|
+
```
|
|
107
|
+
|
|
95
108
|
Route to next action based on state:
|
|
96
109
|
- If state is `READY` and there's a pending phase -> suggest `/ant:build <phase>`
|
|
97
110
|
- If state is `EXECUTING` -> note that a build was interrupted, suggest restarting with `/ant:build <phase>`
|
|
98
111
|
- If state is `PLANNING` -> note that planning was interrupted, suggest `/ant:plan`
|
|
99
112
|
- Otherwise -> suggest `/ant:status` for full overview
|
|
100
113
|
|
|
114
|
+
### Step 6: Clear Paused State and Cleanup
|
|
115
|
+
|
|
116
|
+
Use Write tool to update COLONY_STATE.json:
|
|
117
|
+
- Remove or set to false: `"paused": false`
|
|
118
|
+
- Remove: `"paused_at"` field
|
|
119
|
+
- Update last_updated timestamp
|
|
120
|
+
- Add event: `{timestamp, type: "colony_resumed", worker: "resume", details: "Session resumed"}`
|
|
121
|
+
|
|
122
|
+
Use Bash tool to remove HANDOFF.md: `rm -f .aether/HANDOFF.md`
|
|
123
|
+
|
|
124
|
+
Run: `bash .aether/aether-utils.sh unload-state` to release lock.
|
|
125
|
+
|
|
101
126
|
---
|
|
102
127
|
|
|
103
128
|
## Auto-Recovery Pattern Reference
|