aether-colony 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/.aether/CONTEXT.md +160 -0
  2. package/.aether/QUEEN.md +84 -0
  3. package/.aether/aether-utils.sh +7749 -0
  4. package/.aether/docs/QUEEN-SYSTEM.md +211 -0
  5. package/.aether/docs/README.md +68 -0
  6. package/.aether/docs/caste-system.md +48 -0
  7. package/.aether/docs/disciplines/DISCIPLINES.md +93 -0
  8. package/.aether/docs/disciplines/coding-standards.md +197 -0
  9. package/.aether/docs/disciplines/debugging.md +207 -0
  10. package/.aether/docs/disciplines/learning.md +254 -0
  11. package/.aether/docs/disciplines/tdd.md +257 -0
  12. package/.aether/docs/disciplines/verification-loop.md +167 -0
  13. package/.aether/docs/disciplines/verification.md +116 -0
  14. package/.aether/docs/error-codes.md +268 -0
  15. package/.aether/docs/known-issues.md +233 -0
  16. package/.aether/docs/pheromones.md +205 -0
  17. package/.aether/docs/queen-commands.md +97 -0
  18. package/.aether/exchange/colony-registry.xml +11 -0
  19. package/.aether/exchange/pheromone-xml.sh +575 -0
  20. package/.aether/exchange/pheromones.xml +87 -0
  21. package/.aether/exchange/queen-wisdom.xml +14 -0
  22. package/.aether/exchange/registry-xml.sh +273 -0
  23. package/.aether/exchange/wisdom-xml.sh +319 -0
  24. package/.aether/midden/approach-changes.md +5 -0
  25. package/.aether/midden/build-failures.md +5 -0
  26. package/.aether/midden/test-failures.md +5 -0
  27. package/.aether/model-profiles.yaml +100 -0
  28. package/.aether/rules/aether-colony.md +134 -0
  29. package/.aether/schemas/aether-types.xsd +255 -0
  30. package/.aether/schemas/colony-registry.xsd +309 -0
  31. package/.aether/schemas/example-prompt-builder.xml +234 -0
  32. package/.aether/schemas/pheromone.xsd +163 -0
  33. package/.aether/schemas/prompt.xsd +416 -0
  34. package/.aether/schemas/queen-wisdom.xsd +325 -0
  35. package/.aether/schemas/worker-priming.xsd +276 -0
  36. package/.aether/templates/QUEEN.md.template +79 -0
  37. package/.aether/templates/colony-state-reset.jq.template +22 -0
  38. package/.aether/templates/colony-state.template.json +35 -0
  39. package/.aether/templates/constraints.template.json +9 -0
  40. package/.aether/templates/crowned-anthill.template.md +36 -0
  41. package/.aether/templates/handoff-build-error.template.md +30 -0
  42. package/.aether/templates/handoff-build-success.template.md +39 -0
  43. package/.aether/templates/handoff.template.md +40 -0
  44. package/.aether/templates/learning-observations.template.json +6 -0
  45. package/.aether/templates/midden.template.json +7 -0
  46. package/.aether/templates/pheromones.template.json +6 -0
  47. package/.aether/templates/session.template.json +9 -0
  48. package/.aether/utils/atomic-write.sh +219 -0
  49. package/.aether/utils/chamber-compare.sh +193 -0
  50. package/.aether/utils/chamber-utils.sh +297 -0
  51. package/.aether/utils/colorize-log.sh +132 -0
  52. package/.aether/utils/error-handler.sh +212 -0
  53. package/.aether/utils/file-lock.sh +158 -0
  54. package/.aether/utils/queen-to-md.xsl +395 -0
  55. package/.aether/utils/semantic-cli.sh +413 -0
  56. package/.aether/utils/spawn-tree.sh +428 -0
  57. package/.aether/utils/spawn-with-model.sh +56 -0
  58. package/.aether/utils/state-loader.sh +215 -0
  59. package/.aether/utils/swarm-display.sh +268 -0
  60. package/.aether/utils/watch-spawn-tree.sh +253 -0
  61. package/.aether/utils/xml-compose.sh +253 -0
  62. package/.aether/utils/xml-convert.sh +273 -0
  63. package/.aether/utils/xml-core.sh +186 -0
  64. package/.aether/utils/xml-query.sh +201 -0
  65. package/.aether/utils/xml-utils.sh +110 -0
  66. package/.aether/workers.md +765 -0
  67. package/.claude/agents/ant/aether-ambassador.md +264 -0
  68. package/.claude/agents/ant/aether-archaeologist.md +322 -0
  69. package/.claude/agents/ant/aether-auditor.md +266 -0
  70. package/.claude/agents/ant/aether-builder.md +187 -0
  71. package/.claude/agents/ant/aether-chaos.md +268 -0
  72. package/.claude/agents/ant/aether-chronicler.md +304 -0
  73. package/.claude/agents/ant/aether-gatekeeper.md +325 -0
  74. package/.claude/agents/ant/aether-includer.md +373 -0
  75. package/.claude/agents/ant/aether-keeper.md +271 -0
  76. package/.claude/agents/ant/aether-measurer.md +317 -0
  77. package/.claude/agents/ant/aether-probe.md +210 -0
  78. package/.claude/agents/ant/aether-queen.md +325 -0
  79. package/.claude/agents/ant/aether-route-setter.md +173 -0
  80. package/.claude/agents/ant/aether-sage.md +353 -0
  81. package/.claude/agents/ant/aether-scout.md +142 -0
  82. package/.claude/agents/ant/aether-surveyor-disciplines.md +416 -0
  83. package/.claude/agents/ant/aether-surveyor-nest.md +354 -0
  84. package/.claude/agents/ant/aether-surveyor-pathogens.md +288 -0
  85. package/.claude/agents/ant/aether-surveyor-provisions.md +359 -0
  86. package/.claude/agents/ant/aether-tracker.md +265 -0
  87. package/.claude/agents/ant/aether-watcher.md +244 -0
  88. package/.claude/agents/ant/aether-weaver.md +247 -0
  89. package/.claude/commands/ant/archaeology.md +341 -0
  90. package/.claude/commands/ant/build.md +1160 -0
  91. package/.claude/commands/ant/chaos.md +349 -0
  92. package/.claude/commands/ant/colonize.md +270 -0
  93. package/.claude/commands/ant/continue.md +1070 -0
  94. package/.claude/commands/ant/council.md +309 -0
  95. package/.claude/commands/ant/dream.md +265 -0
  96. package/.claude/commands/ant/entomb.md +487 -0
  97. package/.claude/commands/ant/feedback.md +78 -0
  98. package/.claude/commands/ant/flag.md +139 -0
  99. package/.claude/commands/ant/flags.md +155 -0
  100. package/.claude/commands/ant/focus.md +58 -0
  101. package/.claude/commands/ant/help.md +122 -0
  102. package/.claude/commands/ant/history.md +137 -0
  103. package/.claude/commands/ant/init.md +409 -0
  104. package/.claude/commands/ant/interpret.md +267 -0
  105. package/.claude/commands/ant/lay-eggs.md +201 -0
  106. package/.claude/commands/ant/maturity.md +102 -0
  107. package/.claude/commands/ant/memory-details.md +77 -0
  108. package/.claude/commands/ant/migrate-state.md +165 -0
  109. package/.claude/commands/ant/oracle.md +387 -0
  110. package/.claude/commands/ant/organize.md +227 -0
  111. package/.claude/commands/ant/pause-colony.md +247 -0
  112. package/.claude/commands/ant/phase.md +126 -0
  113. package/.claude/commands/ant/plan.md +544 -0
  114. package/.claude/commands/ant/redirect.md +58 -0
  115. package/.claude/commands/ant/resume-colony.md +182 -0
  116. package/.claude/commands/ant/resume.md +363 -0
  117. package/.claude/commands/ant/seal.md +306 -0
  118. package/.claude/commands/ant/status.md +272 -0
  119. package/.claude/commands/ant/swarm.md +361 -0
  120. package/.claude/commands/ant/tunnels.md +425 -0
  121. package/.claude/commands/ant/update.md +209 -0
  122. package/.claude/commands/ant/verify-castes.md +95 -0
  123. package/.claude/commands/ant/watch.md +238 -0
  124. package/.opencode/agents/aether-ambassador.md +140 -0
  125. package/.opencode/agents/aether-archaeologist.md +108 -0
  126. package/.opencode/agents/aether-auditor.md +144 -0
  127. package/.opencode/agents/aether-builder.md +184 -0
  128. package/.opencode/agents/aether-chaos.md +115 -0
  129. package/.opencode/agents/aether-chronicler.md +122 -0
  130. package/.opencode/agents/aether-gatekeeper.md +116 -0
  131. package/.opencode/agents/aether-includer.md +117 -0
  132. package/.opencode/agents/aether-keeper.md +177 -0
  133. package/.opencode/agents/aether-measurer.md +128 -0
  134. package/.opencode/agents/aether-probe.md +133 -0
  135. package/.opencode/agents/aether-queen.md +286 -0
  136. package/.opencode/agents/aether-route-setter.md +130 -0
  137. package/.opencode/agents/aether-sage.md +106 -0
  138. package/.opencode/agents/aether-scout.md +101 -0
  139. package/.opencode/agents/aether-surveyor-disciplines.md +386 -0
  140. package/.opencode/agents/aether-surveyor-nest.md +324 -0
  141. package/.opencode/agents/aether-surveyor-pathogens.md +259 -0
  142. package/.opencode/agents/aether-surveyor-provisions.md +329 -0
  143. package/.opencode/agents/aether-tracker.md +137 -0
  144. package/.opencode/agents/aether-watcher.md +174 -0
  145. package/.opencode/agents/aether-weaver.md +130 -0
  146. package/.opencode/commands/ant/archaeology.md +338 -0
  147. package/.opencode/commands/ant/build.md +1200 -0
  148. package/.opencode/commands/ant/chaos.md +346 -0
  149. package/.opencode/commands/ant/colonize.md +202 -0
  150. package/.opencode/commands/ant/continue.md +938 -0
  151. package/.opencode/commands/ant/council.md +305 -0
  152. package/.opencode/commands/ant/dream.md +262 -0
  153. package/.opencode/commands/ant/entomb.md +367 -0
  154. package/.opencode/commands/ant/feedback.md +80 -0
  155. package/.opencode/commands/ant/flag.md +137 -0
  156. package/.opencode/commands/ant/flags.md +153 -0
  157. package/.opencode/commands/ant/focus.md +56 -0
  158. package/.opencode/commands/ant/help.md +124 -0
  159. package/.opencode/commands/ant/history.md +127 -0
  160. package/.opencode/commands/ant/init.md +337 -0
  161. package/.opencode/commands/ant/interpret.md +256 -0
  162. package/.opencode/commands/ant/lay-eggs.md +141 -0
  163. package/.opencode/commands/ant/maturity.md +92 -0
  164. package/.opencode/commands/ant/memory-details.md +77 -0
  165. package/.opencode/commands/ant/migrate-state.md +153 -0
  166. package/.opencode/commands/ant/oracle.md +338 -0
  167. package/.opencode/commands/ant/organize.md +224 -0
  168. package/.opencode/commands/ant/pause-colony.md +220 -0
  169. package/.opencode/commands/ant/phase.md +123 -0
  170. package/.opencode/commands/ant/plan.md +531 -0
  171. package/.opencode/commands/ant/redirect.md +67 -0
  172. package/.opencode/commands/ant/resume-colony.md +178 -0
  173. package/.opencode/commands/ant/resume.md +363 -0
  174. package/.opencode/commands/ant/seal.md +247 -0
  175. package/.opencode/commands/ant/status.md +272 -0
  176. package/.opencode/commands/ant/swarm.md +357 -0
  177. package/.opencode/commands/ant/tunnels.md +406 -0
  178. package/.opencode/commands/ant/update.md +191 -0
  179. package/.opencode/commands/ant/verify-castes.md +85 -0
  180. package/.opencode/commands/ant/watch.md +220 -0
  181. package/.opencode/opencode.json +3 -0
  182. package/CHANGELOG.md +325 -0
  183. package/DISCLAIMER.md +74 -0
  184. package/LICENSE +21 -0
  185. package/README.md +258 -0
  186. package/bin/cli.js +2436 -0
  187. package/bin/generate-commands.sh +291 -0
  188. package/bin/lib/caste-colors.js +57 -0
  189. package/bin/lib/colors.js +76 -0
  190. package/bin/lib/errors.js +255 -0
  191. package/bin/lib/event-types.js +190 -0
  192. package/bin/lib/file-lock.js +695 -0
  193. package/bin/lib/init.js +454 -0
  194. package/bin/lib/logger.js +242 -0
  195. package/bin/lib/model-profiles.js +445 -0
  196. package/bin/lib/model-verify.js +288 -0
  197. package/bin/lib/nestmate-loader.js +130 -0
  198. package/bin/lib/proxy-health.js +253 -0
  199. package/bin/lib/spawn-logger.js +266 -0
  200. package/bin/lib/state-guard.js +602 -0
  201. package/bin/lib/state-sync.js +516 -0
  202. package/bin/lib/telemetry.js +441 -0
  203. package/bin/lib/update-transaction.js +1454 -0
  204. package/bin/npx-install.js +178 -0
  205. package/bin/sync-to-runtime.sh +6 -0
  206. package/bin/validate-package.sh +88 -0
  207. package/package.json +70 -0
@@ -0,0 +1,406 @@
1
+ ---
2
+ name: ant:tunnels
3
+ description: "🕳️🐜🕳️ Explore tunnels (browse archived colonies, compare chambers)"
4
+ ---
5
+
6
+ You are the **Queen**. Browse the colony history.
7
+
8
+ ## Instructions
9
+
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
+ ### Argument Handling
17
+
18
+ - No arguments: Show chamber list (Step 4)
19
+ - One argument: Show single chamber detail (Step 3)
20
+ - Two arguments: Compare two chambers (Step 5)
21
+ - More than two: "Too many arguments. Use: /ant:tunnels [chamber1] [chamber2]"
22
+
23
+ ### Step 1: Check for Chambers Directory
24
+
25
+ Check if `.aether/chambers/` exists.
26
+
27
+ If not:
28
+ ```
29
+ 🕳️ ═══════════════════════════════════════════════════
30
+ T U N N E L S (Colony History)
31
+ ══════════════════════════════════════════════════ 🕳️
32
+
33
+ No chambers found.
34
+
35
+ Archive colonies with /ant:entomb to build the tunnel network.
36
+ ```
37
+ Stop here.
38
+
39
+ ### Step 2: List All Chambers
40
+
41
+ Run: `bash .aether/aether-utils.sh chamber-list`
42
+
43
+ Parse JSON result into array of chambers.
44
+
45
+ If no chambers (empty array):
46
+ ```
47
+ 🕳️ ═══════════════════════════════════════════════════
48
+ T U N N E L S (Colony History)
49
+ ══════════════════════════════════════════════════ 🕳️
50
+
51
+ Chambers: 0 colonies archived
52
+
53
+ The tunnel network is empty.
54
+ Archive colonies with /ant:entomb to preserve history.
55
+ ```
56
+ Stop here.
57
+
58
+ ### Step 3: Handle Detail View (if argument provided)
59
+
60
+ If `$normalized_args` is not empty:
61
+ - Treat it as chamber name
62
+ - Check if `.aether/chambers/{arguments}/` exists
63
+ - If not found:
64
+ ```
65
+ Chamber not found: {arguments}
66
+
67
+ Run /ant:tunnels to see available chambers.
68
+ ```
69
+ Stop here.
70
+
71
+ - If found, read manifest.json and display detailed view:
72
+ ```
73
+ 🕳️ ═══════════════════════════════════════════════════
74
+ C H A M B E R D E T A I L S
75
+ ══════════════════════════════════════════════════ 🕳️
76
+
77
+ 📦 {chamber_name}
78
+
79
+ 👑 Goal:
80
+ {goal}
81
+
82
+ 🏆 Milestone: {milestone} ({version})
83
+ 📍 Progress: {phases_completed} of {total_phases} phases
84
+ 📅 Entombed: {entombed_at}
85
+
86
+ {If decisions exist:}
87
+ 🧠 Decisions Preserved:
88
+ {N} architectural decisions recorded
89
+ {End if}
90
+
91
+ {If learnings exist:}
92
+ 💡 Learnings Preserved:
93
+ {N} validated learnings recorded
94
+ {End if}
95
+
96
+ 📁 Files:
97
+ - COLONY_STATE.json (verified: {hash_status})
98
+ - manifest.json
99
+
100
+ Run /ant:tunnels to return to chamber list.
101
+ ```
102
+
103
+ To get the counts and hash status:
104
+ - Run `bash .aether/aether-utils.sh chamber-verify .aether/chambers/{chamber_name}`
105
+ - If verified: hash_status = "✅"
106
+ - If not verified: hash_status = "⚠️ hash mismatch"
107
+ - If error: hash_status = "⚠️ error"
108
+
109
+ Check if `colony-archive.xml` exists in the chamber:
110
+
111
+ ```bash
112
+ chamber_has_xml=false
113
+ [[ -f ".aether/chambers/{chamber_name}/colony-archive.xml" ]] && chamber_has_xml=true
114
+ ```
115
+
116
+ **If `colony-archive.xml` exists**, add import option to the detail view footer:
117
+ ```
118
+ 📁 Files:
119
+ - COLONY_STATE.json (verified: {hash_status})
120
+ - manifest.json
121
+ - colony-archive.xml (XML Archive)
122
+
123
+ Actions:
124
+ 1. Import signals from this colony into current colony
125
+ 2. Return to chamber list
126
+
127
+ Select an action (1/2)
128
+ ```
129
+
130
+ Use AskUserQuestion with two options.
131
+
132
+ If option 1 selected: proceed to Step 6 (Import Signals from Chamber).
133
+ If option 2 selected: return to chamber list (run /ant:tunnels).
134
+
135
+ **If `colony-archive.xml` does NOT exist**, show existing footer unchanged:
136
+ ```
137
+ Run /ant:tunnels to return to chamber list.
138
+ ```
139
+
140
+ Stop here.
141
+
142
+ ### Step 5: Chamber Comparison Mode (Two Arguments)
143
+
144
+ If two arguments provided (chamber names separated by space):
145
+ - Treat as: `/ant:tunnels <chamber_a> <chamber_b>`
146
+ - Run comparison: `bash .aether/utils/chamber-compare.sh compare <chamber_a> <chamber_b>`
147
+
148
+ If either chamber not found:
149
+ ```
150
+ Chamber not found: {chamber_name}
151
+
152
+ Available chambers:
153
+ {list from chamber-list}
154
+ ```
155
+ Stop here.
156
+
157
+ Display comparison header:
158
+ ```
159
+ 🕳️ ═══════════════════════════════════════════════════
160
+ C H A M B E R C O M P A R I S O N
161
+ ══════════════════════════════════════════════════ 🕳️
162
+
163
+ 📦 {chamber_a} vs 📦 {chamber_b}
164
+ ```
165
+
166
+ Display side-by-side comparison:
167
+ ```
168
+ ┌─────────────────────┬─────────────────────┐
169
+ │ {chamber_a} │ {chamber_b} │
170
+ ├─────────────────────┼─────────────────────┤
171
+ │ 👑 {goal_a} │ 👑 {goal_b} │
172
+ │ │ │
173
+ │ 🏆 {milestone_a} │ 🏆 {milestone_b} │
174
+ │ {version_a} │ {version_b} │
175
+ │ │ │
176
+ │ 📍 {phases_a} done │ 📍 {phases_b} done │
177
+ │ of {total_a} │ of {total_b} │
178
+ │ │ │
179
+ │ 🧠 {decisions_a} │ 🧠 {decisions_b} │
180
+ │ decisions │ decisions │
181
+ │ │ │
182
+ │ 💡 {learnings_a} │ 💡 {learnings_b} │
183
+ │ learnings │ learnings │
184
+ │ │ │
185
+ │ 📅 {date_a} │ 📅 {date_b} │
186
+ └─────────────────────┴─────────────────────┘
187
+ ```
188
+
189
+ Display growth metrics:
190
+ ```
191
+ 📈 Growth Between Chambers:
192
+ Phases: +{phases_diff} ({phases_a} → {phases_b})
193
+ Decisions: +{decisions_diff} new
194
+ Learnings: +{learnings_diff} new
195
+ Time: {time_between} days apart
196
+ ```
197
+
198
+ If phases_diff > 0: show "📈 Colony grew"
199
+ If phases_diff < 0: show "📉 Colony reduced (unusual)"
200
+ If same_milestone: show "🏆 Same milestone reached"
201
+ If milestone changed: show "🏆 Milestone advanced: {milestone_a} → {milestone_b}"
202
+
203
+ Display pheromone trail diff (new decisions/learnings in B):
204
+ ```bash
205
+ bash .aether/utils/chamber-compare.sh diff <chamber_a> <chamber_b>
206
+ ```
207
+
208
+ Parse result and show:
209
+ ```
210
+ 🧠 New Decisions in {chamber_b}:
211
+ {N} new architectural decisions
212
+ {if N <= 5, list them; else show first 3 + "...and {N-3} more"}
213
+
214
+ 💡 New Learnings in {chamber_b}:
215
+ {N} new validated learnings
216
+ {if N <= 5, list them; else show first 3 + "...and {N-3} more"}
217
+ ```
218
+
219
+ Display knowledge preservation:
220
+ ```
221
+ 📚 Knowledge Preservation:
222
+ {preserved_decisions} decisions carried forward
223
+ {preserved_learnings} learnings carried forward
224
+ ```
225
+
226
+ Footer:
227
+ ```
228
+ Run /ant:tunnels to see all chambers
229
+ Run /ant:tunnels <chamber> to view single chamber details
230
+ ```
231
+
232
+ Stop here.
233
+
234
+ ### Step 4: Display Chamber List (default view)
235
+
236
+ ```
237
+ 🕳️ ═══════════════════════════════════════════════════
238
+ T U N N E L S (Colony History)
239
+ ══════════════════════════════════════════════════ 🕳️
240
+
241
+ Chambers: {count} colonies archived
242
+
243
+ {For each chamber in sorted list:}
244
+ 📦 {chamber_name}
245
+ 👑 {goal (truncated to 50 chars)}
246
+ 🏆 {milestone} ({version})
247
+ 📍 {phases_completed} phases | 📅 {date}
248
+
249
+ {End for}
250
+
251
+ Run /ant:tunnels <chamber_name> to view details
252
+ ```
253
+
254
+ **Formatting details:**
255
+ - Sort by entombed_at descending (newest first) - already sorted by chamber-list
256
+ - Truncate goal to 50 characters with "..." if longer
257
+ - Format date as YYYY-MM-DD from ISO timestamp (extract first 10 chars of entombed_at)
258
+ - Show chamber count at top
259
+
260
+ **Edge cases:**
261
+ - Malformed manifest: show "⚠️ Invalid manifest" for that chamber and skip it
262
+ - Missing COLONY_STATE.json: show "⚠️ Incomplete chamber" for that chamber
263
+ - Very long chamber list: display all (no pagination for now)
264
+
265
+ ### Step 6: Import Signals from Chamber
266
+
267
+ When user selects "Import signals" from Step 3:
268
+
269
+ **Step 6.1: Check XML tools**
270
+ ```bash
271
+ if command -v xmllint >/dev/null 2>&1; then
272
+ xmllint_available=true
273
+ else
274
+ xmllint_available=false
275
+ fi
276
+ ```
277
+
278
+ If xmllint not available:
279
+ ```
280
+ Import requires xmllint. Install it first:
281
+ macOS: xcode-select --install
282
+ Linux: apt-get install libxml2-utils
283
+ ```
284
+ Stop here (return to chamber list).
285
+
286
+ **Step 6.2: Extract source colony name**
287
+ ```bash
288
+ chamber_xml=".aether/chambers/{chamber_name}/colony-archive.xml"
289
+ # Extract colony_id from the archive root element
290
+ source_colony=$(xmllint --xpath "string(/*/@colony_id)" "$chamber_xml" 2>/dev/null)
291
+ [[ -z "$source_colony" ]] && source_colony="{chamber_name}"
292
+ ```
293
+
294
+ **Step 6.3: Extract pheromone section and show import preview**
295
+
296
+ The combined `colony-archive.xml` contains pheromones, wisdom, and registry sections. Extract the pheromone section to a temp file before counting or importing. This prevents over-counting signals from wisdom/registry sections and ensures `pheromone-import-xml` receives the format it expects (`<pheromones>` as root element).
297
+
298
+ ```bash
299
+ # Extract the <pheromones> section from the combined archive into a standalone temp file
300
+ import_tmp_dir=$(mktemp -d)
301
+ import_tmp_pheromones="$import_tmp_dir/pheromones-extracted.xml"
302
+
303
+ # Use xmllint to extract the pheromones element (with its namespace)
304
+ xmllint --xpath "//*[local-name()='pheromones']" "$chamber_xml" > "$import_tmp_pheromones" 2>/dev/null
305
+
306
+ # Add XML declaration to make it a standalone well-formed document
307
+ if [[ -s "$import_tmp_pheromones" ]]; then
308
+ # Portable approach: prepend declaration via temp file (avoids macOS/Linux sed -i differences)
309
+ { echo '<?xml version="1.0" encoding="UTF-8"?>'; cat "$import_tmp_pheromones"; } > "$import_tmp_dir/tmp_decl.xml"
310
+ mv "$import_tmp_dir/tmp_decl.xml" "$import_tmp_pheromones"
311
+ fi
312
+
313
+ # Count pheromone signals in extracted pheromone-only XML
314
+ # Scoped to pheromone section only — no over-counting from wisdom/registry sections
315
+ pheromone_count=$(xmllint --xpath "count(//*[local-name()='signal'])" "$import_tmp_pheromones" 2>/dev/null || echo "unknown")
316
+ ```
317
+
318
+ Display:
319
+ ```
320
+ IMPORT FROM COLONY: {source_colony}
321
+
322
+ Source: .aether/chambers/{chamber_name}/colony-archive.xml
323
+ Signals available: ~{pheromone_count} pheromone signals
324
+
325
+ Import behavior:
326
+ - Signals tagged with prefix "{source_colony}:" to identify origin
327
+ - Additive merge — your current signals are never overwritten
328
+ - On conflict, your current colony wins
329
+
330
+ Import these signals? (yes/no)
331
+ ```
332
+
333
+ Use AskUserQuestion with yes/no options.
334
+
335
+ If no: "Import cancelled." Clean up: `rm -rf "$import_tmp_dir"`. Return to chamber list.
336
+
337
+ **Step 6.4: Perform import**
338
+
339
+ Pass the extracted pheromone-only temp file (NOT the combined `colony-archive.xml`) to `pheromone-import-xml`, along with `$source_colony` as the second argument. This ensures:
340
+ 1. `pheromone-import-xml` receives XML with `<pheromones>` as root element (the format it expects)
341
+ 2. The prefix-tagging logic prepends `${source_colony}:` to each imported signal's ID before the merge
342
+
343
+ ```bash
344
+ # Import the EXTRACTED pheromone-only XML (NOT the combined colony-archive.xml)
345
+ # $import_tmp_pheromones has <pheromones> as root — the format pheromone-import-xml expects
346
+ # Second argument triggers prefix-tagging — imported signal IDs become "{source_colony}:original_id"
347
+ import_result=$(bash .aether/aether-utils.sh pheromone-import-xml "$import_tmp_pheromones" "$source_colony" 2>&1)
348
+ import_ok=$(echo "$import_result" | jq -r '.ok // false' 2>/dev/null)
349
+
350
+ if [[ "$import_ok" == "true" ]]; then
351
+ imported_count=$(echo "$import_result" | jq -r '.result.signal_count // 0' 2>/dev/null)
352
+ else
353
+ imported_count=0
354
+ import_error=$(echo "$import_result" | jq -r '.error // "Unknown error"' 2>/dev/null)
355
+ fi
356
+
357
+ # Clean up temp files
358
+ rm -rf "$import_tmp_dir"
359
+ ```
360
+
361
+ **Step 6.5: Display result**
362
+
363
+ If import succeeded:
364
+ ```
365
+ SIGNALS IMPORTED
366
+
367
+ Source: {source_colony}
368
+ Imported: {imported_count} pheromone signals
369
+ Tagged with: "{source_colony}:" prefix
370
+
371
+ Your colony now carries wisdom from {source_colony}.
372
+ Run /ant:status to see current colony state.
373
+ ```
374
+
375
+ If import failed:
376
+ ```
377
+ Import failed: {import_error}
378
+
379
+ The archive may be malformed. Check:
380
+ .aether/chambers/{chamber_name}/colony-archive.xml
381
+ ```
382
+
383
+ ## Implementation Notes
384
+
385
+ The `chamber-list` utility returns JSON in this format:
386
+ ```json
387
+ {
388
+ "ok": true,
389
+ "result": [
390
+ {
391
+ "name": "add-user-auth-20260214-153022",
392
+ "goal": "Add user authentication",
393
+ "milestone": "Sealed Chambers",
394
+ "phases_completed": 5,
395
+ "entombed_at": "2026-02-14T15:30:22Z"
396
+ }
397
+ ]
398
+ }
399
+ ```
400
+
401
+ Parse with jq: `jq -r '.result[] | "\(.name)|\(.goal)|\(.milestone)|\(.phases_completed)|\(.entombed_at)"'`
402
+
403
+ For detail view, read manifest.json directly:
404
+ ```bash
405
+ jq -r '.goal, .milestone, .version, .phases_completed, .total_phases, .entombed_at, (.decisions | length), (.learnings | length)' .aether/chambers/{name}/manifest.json
406
+ ```
@@ -0,0 +1,191 @@
1
+ ---
2
+ name: ant:update
3
+ description: "🔄🐜📦🐜🔄 Update system files from the global Aether hub"
4
+ ---
5
+
6
+ You are the **Queen Ant Colony**. Update this repo's Aether system files from the global distribution hub.
7
+
8
+ ## Instructions
9
+
10
+ ### Step 1: Check Hub Availability
11
+
12
+ Use the Read tool to read `~/.aether/version.json` (expand `~` to the user's home directory).
13
+
14
+ If the file does not exist, output:
15
+
16
+ ```
17
+ No Aether distribution hub found at ~/.aether/
18
+
19
+ To set up the hub, run:
20
+ npx aether-colony install
21
+ — or —
22
+ aether install
23
+
24
+ The hub provides system file updates across all your Aether repos.
25
+ ```
26
+
27
+ Stop here. Do not proceed.
28
+
29
+ Read the `version` field — this is the **available version**.
30
+
31
+ ### Step 2: Check Pending State and Current Version
32
+
33
+ First, check for a pending sentinel using the Bash tool:
34
+
35
+ ```bash
36
+ test -f .aether/.update-pending && echo "PENDING" || echo "CLEAN"
37
+ ```
38
+
39
+ If output is "PENDING":
40
+ - Output: `Detected incomplete update, re-syncing...`
41
+ - Run using the Bash tool: `rm -f .aether/.update-pending`
42
+ - Skip the version comparison entirely — proceed directly to Step 3.
43
+
44
+ If output is "CLEAN":
45
+
46
+ Use the Read tool to read `.aether/version.json`.
47
+
48
+ If the file does not exist, set current version to "unknown".
49
+ Otherwise, read the `version` field — this is the **current version**.
50
+
51
+ If current version equals available version, output:
52
+
53
+ ```
54
+ Already up to date (v{version}).
55
+
56
+ System files and commands match the global hub.
57
+ Colony data (.aether/data/) is always untouched by updates.
58
+ ```
59
+
60
+ Stop here. Do not proceed.
61
+
62
+ ### Step 3: Sync System Files from Hub
63
+
64
+ The hub stores all system files at `~/.aether/system/`.
65
+
66
+ Run ONE bash command that syncs everything:
67
+
68
+ ```bash
69
+ mkdir -p .aether/docs .aether/utils .aether/templates .aether/schemas .aether/exchange && \
70
+ cp -f ~/.aether/system/aether-utils.sh .aether/ && \
71
+ cp -f ~/.aether/system/workers.md .aether/ 2>/dev/null || true && \
72
+ cp -f ~/.aether/system/CONTEXT.md .aether/ 2>/dev/null || true && \
73
+ cp -f ~/.aether/system/model-profiles.yaml .aether/ 2>/dev/null || true && \
74
+ cp -Rf ~/.aether/system/docs/* .aether/docs/ 2>/dev/null || true && \
75
+ cp -Rf ~/.aether/system/utils/* .aether/utils/ 2>/dev/null || true && \
76
+ cp -Rf ~/.aether/system/templates/* .aether/templates/ 2>/dev/null || true && \
77
+ cp -Rf ~/.aether/system/schemas/* .aether/schemas/ 2>/dev/null || true && \
78
+ cp -Rf ~/.aether/system/exchange/* .aether/exchange/ 2>/dev/null || true && \
79
+ chmod +x .aether/aether-utils.sh && \
80
+ echo "System files synced"
81
+ ```
82
+
83
+ Colony data (`.aether/data/`) is never touched.
84
+
85
+ If any sync step fails, output:
86
+ ```
87
+ Update couldn't finish — some files didn't copy. Run /ant:update again to retry.
88
+ ```
89
+
90
+ ### Step 3.5: Sync Rules to .claude/rules/
91
+
92
+ Rules files teach Claude Code about the colony system. Sync them from the hub:
93
+
94
+ ```bash
95
+ # Sync rules if hub has them
96
+ if [ -d ~/.aether/system/rules ]; then
97
+ mkdir -p .claude/rules
98
+ cp -Rf ~/.aether/system/rules/* .claude/rules/ 2>/dev/null || true
99
+ echo "Rules synced"
100
+ fi
101
+ ```
102
+
103
+ ### Step 4: Sync Commands (with orphan cleanup)
104
+
105
+ Sync command files from the hub to this repo **and remove stale files** that no longer exist in the hub. This prevents renamed or deleted commands from accumulating as orphans.
106
+
107
+ For each directory pair, run using the Bash tool:
108
+
109
+ ```bash
110
+ # Sync Claude commands
111
+ mkdir -p .claude/commands/ant
112
+ cp -R ~/.aether/system/commands/claude/* .claude/commands/ant/ 2>/dev/null
113
+ # Remove orphans: files in dest that aren't in hub
114
+ comm -23 \
115
+ <(cd .claude/commands/ant && find . -type f ! -name '.*' | sort) \
116
+ <(cd ~/.aether/system/commands/claude && find . -type f ! -name '.*' | sort) \
117
+ | while read f; do rm ".claude/commands/ant/$f" && echo " removed stale: .claude/commands/ant/$f"; done
118
+ echo "claude: done"
119
+
120
+ # Sync OpenCode commands
121
+ mkdir -p .opencode/commands/ant
122
+ cp -R ~/.aether/system/commands/opencode/* .opencode/commands/ant/ 2>/dev/null
123
+ comm -23 \
124
+ <(cd .opencode/commands/ant && find . -type f ! -name '.*' | sort) \
125
+ <(cd ~/.aether/system/commands/opencode && find . -type f ! -name '.*' | sort) \
126
+ | while read f; do rm ".opencode/commands/ant/$f" && echo " removed stale: .opencode/commands/ant/$f"; done
127
+ echo "opencode: done"
128
+
129
+ # Sync agents
130
+ mkdir -p .opencode/agents
131
+ cp -R ~/.aether/system/agents/* .opencode/agents/ 2>/dev/null
132
+ comm -23 \
133
+ <(cd .opencode/agents && find . -type f ! -name '.*' | sort) \
134
+ <(cd ~/.aether/system/agents && find . -type f ! -name '.*' | sort) \
135
+ | while read f; do rm ".opencode/agents/$f" && echo " removed stale: .opencode/agents/$f"; done
136
+ echo "agents: done"
137
+ ```
138
+
139
+ Report any removed stale files in the summary.
140
+
141
+ ### Step 5: Register and Version Stamp
142
+
143
+ Run using the Bash tool:
144
+ ```
145
+ bash .aether/aether-utils.sh registry-add "$(pwd)" "{available_version}"
146
+ ```
147
+
148
+ Substitute `{available_version}` with the version from Step 1.
149
+
150
+ Then use the Write tool to write `.aether/version.json`:
151
+ ```json
152
+ {
153
+ "version": "{available_version}",
154
+ "updated_at": "{ISO-8601 timestamp}"
155
+ }
156
+ ```
157
+
158
+ Then delete any leftover pending sentinel (update is now complete) using the Bash tool:
159
+ ```bash
160
+ rm -f .aether/.update-pending
161
+ ```
162
+
163
+ ### Step 6: Display Summary
164
+
165
+ Output:
166
+
167
+ ```
168
+ 🔄🐜📦🐜🔄 ═══════════════════════════════════════════════════
169
+ A E T H E R U P D A T E
170
+ ═══════════════════════════════════════════════════ 🔄🐜📦🐜🔄
171
+
172
+ Updated: v{current_version} -> v{available_version}
173
+
174
+ System files: {N} updated
175
+ Commands: synced from hub
176
+ Agents: synced from hub
177
+ {if stale files were removed:}
178
+ Stale files removed: {count}
179
+ {list each removed file}
180
+ {end if}
181
+
182
+ Colony data (.aether/data/) untouched.
183
+ Repo registered in ~/.aether/registry.json.
184
+ ```
185
+
186
+ ### CLI Equivalents
187
+
188
+ The CLI version (`aether update`) performs the same sync-with-cleanup and also supports:
189
+
190
+ - `--dry-run` — Preview what would change without modifying any files
191
+ - `--force` — Stash uncommitted changes in managed files and proceed with the update
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: ant:verify-castes
3
+ description: "Verify colony caste assignments and system status"
4
+ ---
5
+
6
+ You are the **Queen**. Display the caste assignments and system status.
7
+
8
+ ## Step 1: Show Caste Assignments
9
+
10
+ Display the colony caste structure:
11
+
12
+ ```
13
+ Aether Colony Caste System
14
+ ═══════════════════════════════════════════
15
+
16
+ CASTE ASSIGNMENTS
17
+ ─────────────────
18
+ 👑 Prime - Colony coordination and strategic planning
19
+ 🏺 Archaeologist - Git history analysis and pattern excavation
20
+ 🏛️ Architect - System design and documentation
21
+ 🔮 Oracle - Deep research and foresight
22
+ 🗺️ Route Setter - Task decomposition and planning
23
+ 🔨 Builder - Implementation and coding
24
+ 👁️ Watcher - Verification and testing
25
+ 🔍 Scout - Research and exploration
26
+ 🎲 Chaos - Edge case testing and resilience probing
27
+ 🧭 Colonizer - Environment setup and exploration
28
+
29
+ ───────────────────────────────────────────
30
+ ```
31
+
32
+ ## Step 2: Check System Status
33
+
34
+ Run using Bash tool: `bash .aether/aether-utils.sh version-check 2>/dev/null || echo "Utils available"`
35
+
36
+ Check LiteLLM proxy status:
37
+ ```bash
38
+ curl -s http://localhost:4000/health 2>/dev/null | grep -q "healthy" && echo "✓ Proxy healthy" || echo "⚠ Proxy not running"
39
+ ```
40
+
41
+ ## Step 3: Show Current Session Info
42
+
43
+ ```
44
+ SESSION INFORMATION
45
+ ───────────────────
46
+ All workers in this session use the same model configuration.
47
+ To change models, restart Claude Code with different settings:
48
+
49
+ export ANTHROPIC_BASE_URL=http://localhost:4000
50
+ export ANTHROPIC_AUTH_TOKEN=sk-litellm-local
51
+ export ANTHROPIC_MODEL=<model-name>
52
+ claude
53
+
54
+ Available models (via LiteLLM proxy):
55
+ • glm-5 - Complex reasoning, architecture, planning
56
+ • kimi-k2.5 - Fast coding, implementation
57
+ • minimax-2.5 - Validation, research, exploration
58
+ ```
59
+
60
+ ## Step 4: Summary
61
+
62
+ ```
63
+ ═══════════════════════════════════════════
64
+ System Status
65
+ ═══════════════════════════════════════════
66
+ Utils: ✓ Operational
67
+ Proxy: {status from Step 2}
68
+ Castes: 10 defined
69
+
70
+ Note: Model-per-caste routing was attempted but is not
71
+ possible with Claude Code's Task tool (no env var support).
72
+ See archived config: .aether/archive/model-routing/
73
+ Tag: model-routing-v1-archived
74
+ ```
75
+
76
+ ## Historical Note
77
+
78
+ A model-per-caste system was designed and implemented but cannot
79
+ function due to Claude Code Task tool limitations. The complete
80
+ configuration is archived in `.aether/archive/model-routing/`.
81
+
82
+ To view the archived configuration:
83
+ ```bash
84
+ git show model-routing-v1-archived
85
+ ```