aether-colony 5.0.0 → 5.2.1

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 (317) hide show
  1. package/.aether/aether-utils.sh +3226 -3345
  2. package/.aether/agents-claude/aether-ambassador.md +265 -0
  3. package/.aether/agents-claude/aether-archaeologist.md +327 -0
  4. package/.aether/agents-claude/aether-architect.md +236 -0
  5. package/.aether/agents-claude/aether-auditor.md +271 -0
  6. package/.aether/agents-claude/aether-builder.md +224 -0
  7. package/.aether/agents-claude/aether-chaos.md +269 -0
  8. package/.aether/agents-claude/aether-chronicler.md +305 -0
  9. package/.aether/agents-claude/aether-gatekeeper.md +330 -0
  10. package/.aether/agents-claude/aether-includer.md +374 -0
  11. package/.aether/agents-claude/aether-keeper.md +272 -0
  12. package/.aether/agents-claude/aether-measurer.md +322 -0
  13. package/.aether/agents-claude/aether-oracle.md +237 -0
  14. package/.aether/agents-claude/aether-probe.md +211 -0
  15. package/.aether/agents-claude/aether-queen.md +330 -0
  16. package/.aether/agents-claude/aether-route-setter.md +178 -0
  17. package/.aether/agents-claude/aether-sage.md +418 -0
  18. package/.aether/agents-claude/aether-scout.md +179 -0
  19. package/.aether/agents-claude/aether-surveyor-disciplines.md +417 -0
  20. package/.aether/agents-claude/aether-surveyor-nest.md +355 -0
  21. package/.aether/agents-claude/aether-surveyor-pathogens.md +289 -0
  22. package/.aether/agents-claude/aether-surveyor-provisions.md +360 -0
  23. package/.aether/agents-claude/aether-tracker.md +270 -0
  24. package/.aether/agents-claude/aether-watcher.md +280 -0
  25. package/.aether/agents-claude/aether-weaver.md +248 -0
  26. package/.aether/commands/archaeology.yaml +653 -0
  27. package/.aether/commands/build.yaml +1221 -0
  28. package/.aether/commands/chaos.yaml +653 -0
  29. package/.aether/commands/colonize.yaml +442 -0
  30. package/.aether/commands/continue.yaml +1484 -0
  31. package/.aether/commands/council.yaml +509 -0
  32. package/.aether/commands/data-clean.yaml +80 -0
  33. package/.aether/commands/dream.yaml +275 -0
  34. package/.aether/commands/entomb.yaml +863 -0
  35. package/.aether/commands/export-signals.yaml +64 -0
  36. package/.aether/commands/feedback.yaml +158 -0
  37. package/.aether/commands/flag.yaml +160 -0
  38. package/.aether/commands/flags.yaml +177 -0
  39. package/.aether/commands/focus.yaml +112 -0
  40. package/.aether/commands/help.yaml +167 -0
  41. package/.aether/commands/history.yaml +137 -0
  42. package/.aether/commands/import-signals.yaml +79 -0
  43. package/.aether/commands/init.yaml +502 -0
  44. package/.aether/commands/insert-phase.yaml +102 -0
  45. package/.aether/commands/interpret.yaml +285 -0
  46. package/.aether/commands/lay-eggs.yaml +224 -0
  47. package/.aether/commands/maturity.yaml +122 -0
  48. package/.aether/commands/memory-details.yaml +74 -0
  49. package/.aether/commands/migrate-state.yaml +174 -0
  50. package/.aether/commands/oracle.yaml +1224 -0
  51. package/.aether/commands/organize.yaml +446 -0
  52. package/.aether/commands/patrol.yaml +621 -0
  53. package/.aether/commands/pause-colony.yaml +424 -0
  54. package/.aether/commands/phase.yaml +124 -0
  55. package/.aether/commands/pheromones.yaml +153 -0
  56. package/.aether/commands/plan.yaml +1364 -0
  57. package/.aether/commands/preferences.yaml +63 -0
  58. package/.aether/commands/quick.yaml +104 -0
  59. package/.aether/commands/redirect.yaml +123 -0
  60. package/.aether/commands/resume-colony.yaml +375 -0
  61. package/.aether/commands/resume.yaml +407 -0
  62. package/.aether/commands/run.yaml +229 -0
  63. package/.aether/commands/seal.yaml +1214 -0
  64. package/.aether/commands/skill-create.yaml +337 -0
  65. package/.aether/commands/status.yaml +408 -0
  66. package/.aether/commands/swarm.yaml +352 -0
  67. package/.aether/commands/tunnels.yaml +814 -0
  68. package/.aether/commands/update.yaml +131 -0
  69. package/.aether/commands/verify-castes.yaml +159 -0
  70. package/.aether/commands/watch.yaml +454 -0
  71. package/.aether/docs/INCIDENT_TEMPLATE.md +32 -0
  72. package/.aether/docs/QUEEN-SYSTEM.md +11 -11
  73. package/.aether/docs/README.md +32 -2
  74. package/.aether/docs/command-playbooks/README.md +23 -0
  75. package/.aether/docs/command-playbooks/build-complete.md +349 -0
  76. package/.aether/docs/command-playbooks/build-context.md +282 -0
  77. package/.aether/docs/command-playbooks/build-full.md +1683 -0
  78. package/.aether/docs/command-playbooks/build-prep.md +284 -0
  79. package/.aether/docs/command-playbooks/build-verify.md +405 -0
  80. package/.aether/docs/command-playbooks/build-wave.md +749 -0
  81. package/.aether/docs/command-playbooks/continue-advance.md +524 -0
  82. package/.aether/docs/command-playbooks/continue-finalize.md +447 -0
  83. package/.aether/docs/command-playbooks/continue-full.md +1725 -0
  84. package/.aether/docs/command-playbooks/continue-gates.md +686 -0
  85. package/.aether/docs/command-playbooks/continue-verify.md +407 -0
  86. package/.aether/docs/context-continuity.md +84 -0
  87. package/.aether/docs/disciplines/DISCIPLINES.md +9 -7
  88. package/.aether/docs/error-codes.md +1 -1
  89. package/.aether/docs/known-issues.md +34 -173
  90. package/.aether/docs/pheromones.md +86 -6
  91. package/.aether/docs/plans/pheromone-display-plan.md +257 -0
  92. package/.aether/docs/queen-commands.md +10 -9
  93. package/.aether/docs/source-of-truth-map.md +132 -0
  94. package/.aether/docs/xml-utilities.md +47 -0
  95. package/.aether/rules/aether-colony.md +23 -13
  96. package/.aether/scripts/incident-test-add.sh +47 -0
  97. package/.aether/scripts/weekly-audit.sh +79 -0
  98. package/.aether/skills/.index.json +649 -0
  99. package/.aether/skills/colony/.manifest.json +16 -0
  100. package/.aether/skills/colony/build-discipline/SKILL.md +78 -0
  101. package/.aether/skills/colony/colony-interaction/SKILL.md +56 -0
  102. package/.aether/skills/colony/colony-lifecycle/SKILL.md +77 -0
  103. package/.aether/skills/colony/colony-visuals/SKILL.md +112 -0
  104. package/.aether/skills/colony/context-management/SKILL.md +80 -0
  105. package/.aether/skills/colony/error-presentation/SKILL.md +99 -0
  106. package/.aether/skills/colony/pheromone-protocol/SKILL.md +79 -0
  107. package/.aether/skills/colony/pheromone-visibility/SKILL.md +81 -0
  108. package/.aether/skills/colony/state-safety/SKILL.md +84 -0
  109. package/.aether/skills/colony/worker-priming/SKILL.md +82 -0
  110. package/.aether/skills/domain/.manifest.json +24 -0
  111. package/.aether/skills/domain/README.md +33 -0
  112. package/.aether/skills/domain/django/SKILL.md +49 -0
  113. package/.aether/skills/domain/docker/SKILL.md +52 -0
  114. package/.aether/skills/domain/golang/SKILL.md +52 -0
  115. package/.aether/skills/domain/graphql/SKILL.md +51 -0
  116. package/.aether/skills/domain/html-css/SKILL.md +48 -0
  117. package/.aether/skills/domain/nextjs/SKILL.md +45 -0
  118. package/.aether/skills/domain/nodejs/SKILL.md +53 -0
  119. package/.aether/skills/domain/postgresql/SKILL.md +53 -0
  120. package/.aether/skills/domain/prisma/SKILL.md +59 -0
  121. package/.aether/skills/domain/python/SKILL.md +50 -0
  122. package/.aether/skills/domain/rails/SKILL.md +52 -0
  123. package/.aether/skills/domain/react/SKILL.md +45 -0
  124. package/.aether/skills/domain/rest-api/SKILL.md +58 -0
  125. package/.aether/skills/domain/svelte/SKILL.md +47 -0
  126. package/.aether/skills/domain/tailwind/SKILL.md +45 -0
  127. package/.aether/skills/domain/testing/SKILL.md +53 -0
  128. package/.aether/skills/domain/typescript/SKILL.md +58 -0
  129. package/.aether/skills/domain/vue/SKILL.md +49 -0
  130. package/.aether/templates/QUEEN.md.template +23 -41
  131. package/.aether/templates/colony-state-reset.jq.template +1 -0
  132. package/.aether/templates/colony-state.template.json +4 -0
  133. package/.aether/templates/learning-observations.template.json +6 -0
  134. package/.aether/templates/midden.template.json +13 -0
  135. package/.aether/templates/pheromones.template.json +6 -0
  136. package/.aether/templates/session.template.json +9 -0
  137. package/.aether/utils/atomic-write.sh +63 -17
  138. package/.aether/utils/chamber-utils.sh +145 -2
  139. package/.aether/utils/council.sh +425 -0
  140. package/.aether/utils/emoji-audit.sh +166 -0
  141. package/.aether/utils/error-handler.sh +21 -7
  142. package/.aether/utils/file-lock.sh +182 -27
  143. package/.aether/utils/flag.sh +278 -0
  144. package/.aether/utils/hive.sh +572 -0
  145. package/.aether/utils/immune.sh +508 -0
  146. package/.aether/utils/learning.sh +1928 -0
  147. package/.aether/utils/midden.sh +520 -0
  148. package/.aether/utils/oracle/oracle.md +168 -0
  149. package/.aether/utils/oracle/oracle.sh +1023 -0
  150. package/.aether/utils/pheromone.sh +2029 -0
  151. package/.aether/utils/queen.sh +1710 -0
  152. package/.aether/utils/scan.sh +860 -0
  153. package/.aether/utils/semantic-cli.sh +10 -8
  154. package/.aether/utils/session.sh +816 -0
  155. package/.aether/utils/skills.sh +509 -0
  156. package/.aether/utils/spawn-tree.sh +103 -271
  157. package/.aether/utils/spawn.sh +260 -0
  158. package/.aether/utils/state-api.sh +389 -0
  159. package/.aether/utils/state-loader.sh +8 -6
  160. package/.aether/utils/suggest.sh +611 -0
  161. package/.aether/utils/swarm-display.sh +10 -1
  162. package/.aether/utils/swarm.sh +1004 -0
  163. package/.aether/utils/watch-spawn-tree.sh +11 -2
  164. package/.aether/utils/xml-compose.sh +2 -2
  165. package/.aether/utils/xml-convert.sh +9 -5
  166. package/.aether/utils/xml-core.sh +5 -9
  167. package/.aether/utils/xml-query.sh +4 -4
  168. package/.aether/workers.md +86 -67
  169. package/.claude/agents/ant/aether-ambassador.md +2 -1
  170. package/.claude/agents/ant/aether-archaeologist.md +6 -1
  171. package/.claude/agents/ant/aether-architect.md +236 -0
  172. package/.claude/agents/ant/aether-auditor.md +6 -1
  173. package/.claude/agents/ant/aether-builder.md +38 -1
  174. package/.claude/agents/ant/aether-chaos.md +2 -1
  175. package/.claude/agents/ant/aether-chronicler.md +1 -0
  176. package/.claude/agents/ant/aether-gatekeeper.md +6 -1
  177. package/.claude/agents/ant/aether-includer.md +1 -0
  178. package/.claude/agents/ant/aether-keeper.md +1 -0
  179. package/.claude/agents/ant/aether-measurer.md +6 -1
  180. package/.claude/agents/ant/aether-oracle.md +237 -0
  181. package/.claude/agents/ant/aether-probe.md +2 -1
  182. package/.claude/agents/ant/aether-queen.md +6 -1
  183. package/.claude/agents/ant/aether-route-setter.md +6 -1
  184. package/.claude/agents/ant/aether-sage.md +68 -3
  185. package/.claude/agents/ant/aether-scout.md +38 -1
  186. package/.claude/agents/ant/aether-surveyor-disciplines.md +2 -1
  187. package/.claude/agents/ant/aether-surveyor-nest.md +2 -1
  188. package/.claude/agents/ant/aether-surveyor-pathogens.md +2 -1
  189. package/.claude/agents/ant/aether-surveyor-provisions.md +2 -1
  190. package/.claude/agents/ant/aether-tracker.md +6 -1
  191. package/.claude/agents/ant/aether-watcher.md +37 -1
  192. package/.claude/agents/ant/aether-weaver.md +2 -1
  193. package/.claude/commands/ant/archaeology.md +1 -8
  194. package/.claude/commands/ant/build.md +43 -1159
  195. package/.claude/commands/ant/chaos.md +1 -14
  196. package/.claude/commands/ant/colonize.md +3 -14
  197. package/.claude/commands/ant/continue.md +40 -1026
  198. package/.claude/commands/ant/council.md +213 -15
  199. package/.claude/commands/ant/data-clean.md +81 -0
  200. package/.claude/commands/ant/dream.md +12 -9
  201. package/.claude/commands/ant/entomb.md +62 -87
  202. package/.claude/commands/ant/export-signals.md +57 -0
  203. package/.claude/commands/ant/feedback.md +18 -0
  204. package/.claude/commands/ant/flag.md +12 -0
  205. package/.claude/commands/ant/flags.md +22 -8
  206. package/.claude/commands/ant/focus.md +18 -0
  207. package/.claude/commands/ant/help.md +40 -8
  208. package/.claude/commands/ant/history.md +3 -0
  209. package/.claude/commands/ant/import-signals.md +71 -0
  210. package/.claude/commands/ant/init.md +349 -191
  211. package/.claude/commands/ant/insert-phase.md +105 -0
  212. package/.claude/commands/ant/interpret.md +11 -0
  213. package/.claude/commands/ant/lay-eggs.md +167 -158
  214. package/.claude/commands/ant/maturity.md +22 -11
  215. package/.claude/commands/ant/memory-details.md +77 -0
  216. package/.claude/commands/ant/migrate-state.md +6 -0
  217. package/.claude/commands/ant/oracle.md +317 -62
  218. package/.claude/commands/ant/organize.md +10 -5
  219. package/.claude/commands/ant/patrol.md +620 -0
  220. package/.claude/commands/ant/pause-colony.md +8 -22
  221. package/.claude/commands/ant/phase.md +26 -37
  222. package/.claude/commands/ant/pheromones.md +156 -0
  223. package/.claude/commands/ant/plan.md +199 -50
  224. package/.claude/commands/ant/preferences.md +65 -0
  225. package/.claude/commands/ant/quick.md +100 -0
  226. package/.claude/commands/ant/redirect.md +18 -0
  227. package/.claude/commands/ant/resume-colony.md +37 -22
  228. package/.claude/commands/ant/resume.md +60 -7
  229. package/.claude/commands/ant/run.md +231 -0
  230. package/.claude/commands/ant/seal.md +506 -78
  231. package/.claude/commands/ant/skill-create.md +286 -0
  232. package/.claude/commands/ant/status.md +171 -1
  233. package/.claude/commands/ant/swarm.md +11 -23
  234. package/.claude/commands/ant/tunnels.md +1 -0
  235. package/.claude/commands/ant/update.md +58 -135
  236. package/.claude/commands/ant/verify-castes.md +90 -42
  237. package/.claude/commands/ant/watch.md +1 -0
  238. package/.opencode/agents/aether-ambassador.md +1 -1
  239. package/.opencode/agents/aether-architect.md +133 -0
  240. package/.opencode/agents/aether-builder.md +3 -3
  241. package/.opencode/agents/aether-oracle.md +137 -0
  242. package/.opencode/agents/aether-queen.md +1 -1
  243. package/.opencode/agents/aether-route-setter.md +1 -1
  244. package/.opencode/agents/aether-scout.md +1 -1
  245. package/.opencode/agents/aether-surveyor-disciplines.md +6 -1
  246. package/.opencode/agents/aether-surveyor-nest.md +6 -1
  247. package/.opencode/agents/aether-surveyor-pathogens.md +6 -1
  248. package/.opencode/agents/aether-surveyor-provisions.md +6 -1
  249. package/.opencode/agents/aether-tracker.md +1 -1
  250. package/.opencode/agents/aether-watcher.md +1 -1
  251. package/.opencode/agents/aether-weaver.md +1 -1
  252. package/.opencode/commands/ant/archaeology.md +7 -14
  253. package/.opencode/commands/ant/build.md +54 -88
  254. package/.opencode/commands/ant/chaos.md +7 -24
  255. package/.opencode/commands/ant/colonize.md +10 -17
  256. package/.opencode/commands/ant/continue.md +595 -66
  257. package/.opencode/commands/ant/council.md +150 -18
  258. package/.opencode/commands/ant/data-clean.md +77 -0
  259. package/.opencode/commands/ant/dream.md +15 -17
  260. package/.opencode/commands/ant/entomb.md +28 -18
  261. package/.opencode/commands/ant/export-signals.md +54 -0
  262. package/.opencode/commands/ant/feedback.md +24 -5
  263. package/.opencode/commands/ant/flag.md +16 -4
  264. package/.opencode/commands/ant/flags.md +24 -10
  265. package/.opencode/commands/ant/focus.md +22 -5
  266. package/.opencode/commands/ant/help.md +41 -8
  267. package/.opencode/commands/ant/history.md +9 -0
  268. package/.opencode/commands/ant/import-signals.md +68 -0
  269. package/.opencode/commands/ant/init.md +396 -154
  270. package/.opencode/commands/ant/insert-phase.md +111 -0
  271. package/.opencode/commands/ant/interpret.md +16 -0
  272. package/.opencode/commands/ant/lay-eggs.md +184 -112
  273. package/.opencode/commands/ant/maturity.md +18 -2
  274. package/.opencode/commands/ant/memory-details.md +83 -0
  275. package/.opencode/commands/ant/migrate-state.md +12 -0
  276. package/.opencode/commands/ant/oracle.md +322 -67
  277. package/.opencode/commands/ant/organize.md +14 -12
  278. package/.opencode/commands/ant/patrol.md +626 -0
  279. package/.opencode/commands/ant/pause-colony.md +12 -29
  280. package/.opencode/commands/ant/phase.md +30 -40
  281. package/.opencode/commands/ant/pheromones.md +162 -0
  282. package/.opencode/commands/ant/plan.md +210 -57
  283. package/.opencode/commands/ant/preferences.md +71 -0
  284. package/.opencode/commands/ant/quick.md +91 -0
  285. package/.opencode/commands/ant/redirect.md +22 -5
  286. package/.opencode/commands/ant/resume-colony.md +41 -29
  287. package/.opencode/commands/ant/resume.md +80 -20
  288. package/.opencode/commands/ant/run.md +237 -0
  289. package/.opencode/commands/ant/seal.md +230 -25
  290. package/.opencode/commands/ant/skill-create.md +63 -0
  291. package/.opencode/commands/ant/status.md +125 -30
  292. package/.opencode/commands/ant/swarm.md +3 -345
  293. package/.opencode/commands/ant/tunnels.md +3 -9
  294. package/.opencode/commands/ant/update.md +63 -127
  295. package/.opencode/commands/ant/verify-castes.md +96 -42
  296. package/.opencode/commands/ant/watch.md +7 -0
  297. package/CHANGELOG.md +368 -1
  298. package/README.md +195 -324
  299. package/bin/cli.js +236 -429
  300. package/bin/generate-commands.js +186 -0
  301. package/bin/generate-commands.sh +128 -89
  302. package/bin/lib/spawn-logger.js +0 -15
  303. package/bin/lib/update-transaction.js +285 -35
  304. package/bin/npx-install.js +178 -0
  305. package/bin/validate-package.sh +85 -3
  306. package/package.json +16 -4
  307. package/.aether/CONTEXT.md +0 -160
  308. package/.aether/docs/QUEEN.md +0 -84
  309. package/.aether/exchange/colony-registry.xml +0 -11
  310. package/.aether/exchange/pheromones.xml +0 -87
  311. package/.aether/exchange/queen-wisdom.xml +0 -14
  312. package/.aether/model-profiles.yaml +0 -100
  313. package/.aether/utils/spawn-with-model.sh +0 -56
  314. package/bin/lib/model-profiles.js +0 -445
  315. package/bin/lib/model-verify.js +0 -288
  316. package/bin/lib/proxy-health.js +0 -253
  317. package/bin/lib/telemetry.js +0 -441
@@ -3,8 +3,17 @@
3
3
  # Usage: bash watch-spawn-tree.sh [data_dir]
4
4
 
5
5
  DATA_DIR="${1:-.aether/data}"
6
- SPAWN_FILE="$DATA_DIR/spawn-tree.txt"
7
- VIEW_STATE_FILE="$DATA_DIR/view-state.json"
6
+ # Resolve COLONY_DATA_DIR for per-colony files (standalone script)
7
+ COLONY_DATA_DIR="${COLONY_DATA_DIR:-$DATA_DIR}"
8
+ if [[ -f "$DATA_DIR/COLONY_STATE.json" ]]; then
9
+ _cn=$(jq -r '.colony_name // empty' "$DATA_DIR/COLONY_STATE.json" 2>/dev/null)
10
+ if [[ -n "$_cn" ]]; then
11
+ _cn_safe=$(echo "$_cn" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
12
+ [[ -n "$_cn_safe" ]] && COLONY_DATA_DIR="$DATA_DIR/colonies/$_cn_safe"
13
+ fi
14
+ fi
15
+ SPAWN_FILE="$COLONY_DATA_DIR/spawn-tree.txt"
16
+ VIEW_STATE_FILE="$COLONY_DATA_DIR/view-state.json"
8
17
 
9
18
  # ANSI colors
10
19
  YELLOW='\033[33m'
@@ -113,12 +113,12 @@ xml-compose() {
113
113
  echo "$composed" > "$output_xml"
114
114
  local escaped_output
115
115
  escaped_output=$(echo "$output_xml" | jq -Rs '.[:-1]')
116
- xml_json_ok "{\"composed\":true,\"output\":$escaped_output,\"sources_resolved\":\"auto\"}"
116
+ xml_json_ok "$(jq -n --argjson output "$escaped_output" '{composed: true, output: $output, sources_resolved: "auto"}')"
117
117
  else
118
118
  # Output to stdout wrapped in JSON
119
119
  local escaped_composed
120
120
  escaped_composed=$(echo "$composed" | jq -Rs '.')
121
- xml_json_ok "{\"composed\":true,\"xml\":$escaped_composed,\"sources_resolved\":\"auto\"}"
121
+ xml_json_ok "$(jq -n --argjson xml "$escaped_composed" '{composed: true, xml: $xml, sources_resolved: "auto"}')"
122
122
  fi
123
123
  return 0
124
124
  fi
@@ -103,7 +103,7 @@ xml-to-json() {
103
103
  fi
104
104
  local escaped_json
105
105
  escaped_json=$(echo "$json_output" | jq -Rs '.')
106
- xml_json_ok "{\"format\":\"object\",\"json\":$escaped_json}"
106
+ xml_json_ok "$(jq -n --argjson json "$escaped_json" '{format: "object", json: $json}')"
107
107
  return 0
108
108
  fi
109
109
  fi
@@ -147,7 +147,9 @@ XSLT
147
147
  xml_json_err "CONVERSION_ERROR" "XSLT conversion failed"
148
148
  return 1
149
149
  }
150
- xml_json_ok "{\"format\":\"object\",\"json\":$(echo "$json_result" | jq -Rs '.')}"
150
+ local xslt_escaped_json
151
+ xslt_escaped_json=$(echo "$json_result" | jq -Rs '.')
152
+ xml_json_ok "$(jq -n --argjson json "$xslt_escaped_json" '{format: "object", json: $json}')"
151
153
  return 0
152
154
  fi
153
155
 
@@ -158,7 +160,9 @@ XSLT
158
160
  xml_json_err "CONVERSION_ERROR" "xmlstarlet conversion failed"
159
161
  return 1
160
162
  }
161
- xml_json_ok "{\"format\":\"object\",\"json\":$(echo "$json_result" | jq -Rs '.')}"
163
+ local xmlstar_escaped_json
164
+ xmlstar_escaped_json=$(echo "$json_result" | jq -Rs '.')
165
+ xml_json_ok "$(jq -n --argjson json "$xmlstar_escaped_json" '{format: "object", json: $json}')"
162
166
  return 0
163
167
  fi
164
168
 
@@ -216,7 +220,7 @@ json-to-xml() {
216
220
  # Escape the XML for JSON output
217
221
  local escaped_xml
218
222
  escaped_xml=$(echo "$xml_output" | jq -Rs '.')
219
- xml_json_ok "{\"xml\":$escaped_xml}"
223
+ xml_json_ok "$(jq -n --argjson xml "$escaped_xml" '{xml: $xml}')"
220
224
  }
221
225
 
222
226
  # ============================================================================
@@ -259,7 +263,7 @@ xml-merge() {
259
263
 
260
264
  local escaped_output
261
265
  escaped_output=$(echo "$output_file" | jq -Rs '.[:-1]')
262
- xml_json_ok "{\"merged\":true,\"output\":$escaped_output,\"sources_resolved\":$resolved_count}"
266
+ xml_json_ok "$(jq -n --argjson output "$escaped_output" --argjson sources_resolved "$resolved_count" '{merged: true, output: $output, sources_resolved: $sources_resolved}')"
263
267
  return 0
264
268
  fi
265
269
 
@@ -89,10 +89,8 @@ xml-validate() {
89
89
  xml_json_ok '{"valid":true,"errors":[]}'
90
90
  return 0
91
91
  } || {
92
- # Escape errors for JSON
93
- local escaped_errors
94
- escaped_errors=$(echo "$errors" | sed 's/\\/\\\\/g; s/"/\\"/g; s/\t/\\t/g' | tr '\n' ' ')
95
- xml_json_ok "{\"valid\":false,\"errors\":[\"$escaped_errors\"]}"
92
+ # Escape errors for JSON using jq
93
+ xml_json_ok "$(jq -n --arg errors "$errors" '{valid: false, errors: [$errors]}')"
96
94
  return 0
97
95
  }
98
96
  }
@@ -144,12 +142,10 @@ xml-format() {
144
142
 
145
143
  if [[ -n "$output_file" ]]; then
146
144
  echo "$formatted" > "$output_file"
147
- xml_json_ok "{\"formatted\":true,\"path\":\"$output_file\"}"
145
+ xml_json_ok "$(jq -n --arg path "$output_file" '{formatted: true, path: $path}')"
148
146
  else
149
- # Escape for JSON
150
- local escaped
151
- escaped=$(echo "$formatted" | sed 's/\\/\\\\/g; s/"/\\"/g' | tr '\n' ' ')
152
- xml_json_ok "{\"formatted\":true,\"output\":\"$escaped\"}"
147
+ # Escape for JSON using jq
148
+ xml_json_ok "$(jq -n --arg output "$formatted" '{formatted: true, output: $output}')"
153
149
  fi
154
150
  }
155
151
 
@@ -112,9 +112,9 @@ xml-query-attr() {
112
112
  fi
113
113
  done
114
114
  json_array="$json_array]"
115
- xml_json_ok "{\"attribute\":\"$attr_name\",\"values\":$json_array}"
115
+ xml_json_ok "$(jq -n --arg attribute "$attr_name" --argjson values "$json_array" '{attribute: $attribute, values: $values}')"
116
116
  else
117
- xml_json_ok "{\"attribute\":\"$attr_name\",\"values\":[]}"
117
+ xml_json_ok "$(jq -n --arg attribute "$attr_name" '{attribute: $attribute, values: []}')"
118
118
  fi
119
119
  }
120
120
 
@@ -160,9 +160,9 @@ xml-query-text() {
160
160
  fi
161
161
  done
162
162
  json_array="$json_array]"
163
- xml_json_ok "{\"element\":\"$element_name\",\"text\":$json_array}"
163
+ xml_json_ok "$(jq -n --arg element "$element_name" --argjson text "$json_array" '{element: $element, text: $text}')"
164
164
  else
165
- xml_json_ok "{\"element\":\"$element_name\",\"text\":[]}"
165
+ xml_json_ok "$(jq -n --arg element "$element_name" '{element: $element, text: []}')"
166
166
  fi
167
167
  }
168
168
 
@@ -23,6 +23,7 @@ Each caste has characteristic communication styles that should inform activity l
23
23
  | Scout | Curious | Discovery-focused | "Discovered pattern in utils..." |
24
24
  | Colonizer | Exploratory | Mapping-focused | "Charting dependency structure..." |
25
25
  | Architect | Systematic | Pattern-focused | "Designing service layer..." |
26
+ | Oracle | Insightful | Research-focused | "Researching authentication patterns..." |
26
27
  | Prime | Coordinating | Orchestration-focused | "Dispatching specialists..." |
27
28
 
28
29
  ### Named Logging Protocol
@@ -50,42 +51,21 @@ bash .aether/aether-utils.sh spawn-complete "Hammer-42" "completed" "auth module
50
51
 
51
52
  ---
52
53
 
53
- ## Model Selection (Session-Level)
54
+ ## Model Selection
54
55
 
55
- Aether can work with different AI models through a LiteLLM proxy, but **model selection happens at the session level**, not per-worker.
56
+ Model routing is handled natively by Claude Code through agent frontmatter `model:` fields.
57
+ Each agent definition in `.claude/agents/ant/*.md` specifies its model slot (opus, sonnet, or inherit).
58
+ Claude Code resolves these slots via environment variables in `~/.claude/settings.json`.
56
59
 
57
- ### How It Works
60
+ **Slot mapping (in `~/.claude/settings.json`):**
61
+ - `ANTHROPIC_DEFAULT_OPUS_MODEL` -> opus slot
62
+ - `ANTHROPIC_DEFAULT_SONNET_MODEL` -> sonnet slot
63
+ - `ANTHROPIC_DEFAULT_HAIKU_MODEL` -> haiku slot
58
64
 
59
- Claude Code's Task tool does not support passing environment variables to spawned workers. All workers inherit the parent session's model configuration.
60
-
61
- ### To Use a Specific Model
62
-
63
- ```bash
64
- # 1. Start LiteLLM proxy (if using)
65
- cd ~/repos/litellm-proxy && docker-compose up -d
66
-
67
- # 2. Set environment variables before starting Claude Code:
68
- export ANTHROPIC_BASE_URL=http://localhost:4000
69
- export ANTHROPIC_AUTH_TOKEN=sk-litellm-local
70
- export ANTHROPIC_MODEL=kimi-k2.5 # or glm-5, minimax-2.5
71
-
72
- # 3. Start Claude Code
73
- claude
74
- ```
75
-
76
- ### Available Models (via LiteLLM)
77
-
78
- | Model | Best For | Provider |
79
- |-------|----------|----------|
80
- | glm-5 | Complex reasoning, architecture, planning | Z_AI |
81
- | kimi-k2.5 | Fast coding, implementation | Moonshot |
82
- | minimax-2.5 | Validation, research, exploration | MiniMax |
83
-
84
- ### Historical Note
85
-
86
- A model-per-caste routing system was designed and implemented (archived in `.aether/archive/model-routing/`) but cannot function due to Claude Code Task tool limitations. The archive is preserved for future use if the platform adds environment variable support for subagents.
87
-
88
- See: `git show model-routing-v1-archived` for the complete configuration.
65
+ > **Historical note:** A model-per-caste routing system using environment variable injection
66
+ > at spawn time was previously built and archived (see `.aether/archive/model-routing/`).
67
+ > That approach could not function due to Claude Code Task tool limitations (env vars
68
+ > are not passed to subagents). The current approach uses agent frontmatter natively.
89
69
 
90
70
  ---
91
71
 
@@ -308,8 +288,8 @@ Only spawn if you encounter genuine surprise:
308
288
 
309
289
  **Step 1: Check if you can spawn**
310
290
  ```bash
311
- # Check spawn allowance at your depth
312
- result=$(bash .aether/aether-utils.sh spawn-can-spawn {your_depth})
291
+ # Check spawn allowance at your depth (hard-enforced on deny)
292
+ result=$(bash .aether/aether-utils.sh spawn-can-spawn {your_depth} --enforce)
313
293
  # Returns: {"can_spawn": true/false, "depth": N, "max_spawns": N, "current_total": N}
314
294
  ```
315
295
 
@@ -415,10 +395,10 @@ Next Steps / Recommendations: {required}
415
395
  🔨 **Purpose:** Implement code, execute commands, and manipulate files to achieve concrete outcomes. The colony's hands -- when tasks need doing, you make them happen.
416
396
 
417
397
  **Model Context:**
418
- - Assigned model: kimi-k2.5
419
- - Strengths: Code generation, refactoring, multimodal capabilities
420
- - Best for: Implementation tasks, code writing, visual coding from screenshots
421
- - Benchmark: 76.8% SWE-Bench Verified, 256K context
398
+ - Assigned model: glm-5-turbo
399
+ - Strengths: Code generation, deterministic output, agent-friendly
400
+ - Best for: Implementation tasks, code writing, agent loops
401
+ - Note: All workers use glm-5-turbo for reliable termination in agent workflows
422
402
 
423
403
  **When to use:** Code implementation, file manipulation, command execution
424
404
 
@@ -472,10 +452,9 @@ Fix count: {N}/3
472
452
  👁️ **Purpose:** Validate implementation, run tests, and ensure quality. The colony's guardian -- when work is done, you verify it's correct and complete. Also handles security audits, performance analysis, and test coverage.
473
453
 
474
454
  **Model Context:**
475
- - Assigned model: kimi-k2.5
476
- - Strengths: Validation, testing, visual regression testing
477
- - Best for: Verification, test coverage analysis, multimodal checks (screenshots)
478
- - Context window: 256K tokens, multimodal capable
455
+ - Assigned model: glm-5-turbo
456
+ - Strengths: Validation, testing, deterministic output
457
+ - Best for: Verification, test coverage analysis, quality gates
479
458
 
480
459
  **When to use:** Quality review, testing, validation, security/performance audits, phase completion approval
481
460
 
@@ -581,10 +560,9 @@ Recommendation: {specific fix or investigation needed}
581
560
  🔍 **Purpose:** Gather information, search documentation, and retrieve context. The colony's researcher -- when the colony needs to know, you venture forth to find answers.
582
561
 
583
562
  **Model Context:**
584
- - Assigned model: kimi-k2.5
585
- - Strengths: Parallel exploration via agent swarm (up to 100 sub-agents), broad research
563
+ - Assigned model: glm-5-turbo
564
+ - Strengths: Research, information gathering, deterministic output
586
565
  - Best for: Documentation lookup, pattern discovery, wide exploration
587
- - Benchmark: Can coordinate 1,500 simultaneous tool calls
588
566
 
589
567
  **When to use:** Research questions, documentation lookup, finding information, learning new domains
590
568
 
@@ -601,13 +579,14 @@ Recommendation: {specific fix or investigation needed}
601
579
 
602
580
  ## Colonizer
603
581
 
582
+ > Note: Colonizer is a virtual caste -- surveyor agents assume this role during /ant:colonize.
583
+
604
584
  🗺️ **Purpose:** Explore and index codebase structure. Build semantic understanding, detect patterns, and map dependencies. The colony's explorer -- when new territory is encountered, you venture forth to understand the landscape.
605
585
 
606
586
  **Model Context:**
607
- - Assigned model: kimi-k2.5
608
- - Strengths: Visual coding, environment setup, can turn screenshots into functional code
609
- - Best for: Codebase mapping, dependency analysis, UI/prototype generation
610
- - Multimodal: Can process visual inputs alongside text
587
+ - Assigned model: glm-5-turbo
588
+ - Strengths: Codebase exploration, environment setup
589
+ - Best for: Codebase mapping, dependency analysis, pattern detection
611
590
 
612
591
  **When to use:** Codebase exploration, structure mapping, dependency analysis, pattern detection
613
592
 
@@ -621,27 +600,50 @@ Recommendation: {specific fix or investigation needed}
621
600
 
622
601
  ---
623
602
 
624
- ## Architect (Merged into Keeper)
603
+ ## Architect
625
604
 
626
- > **Note:** As of Phase 25, Architect capabilities are absorbed by the Keeper agent as "Architecture Mode". Workers named with Architect patterns still resolve to the 🏛️🐜 caste emoji. See `.opencode/agents/aether-keeper.md` for the merged definition.
605
+ 🏛️ **Purpose:** Design system architecture, create design documents, and translate research into implementation approaches. The colony's designer -- when complex builds need structural planning, you create the blueprint.
627
606
 
628
- 🏛️ **Purpose:** Synthesize knowledge, extract patterns, and coordinate documentation. The colony's wisdom -- when the colony learns, you organize and preserve that knowledge.
607
+ **Model Slot:** opus
629
608
 
630
- **Model Context:**
631
- - Assigned model: glm-5
632
- - Strengths: Long-context synthesis, pattern extraction, complex documentation
633
- - Best for: Synthesizing knowledge, coordinating docs, pattern recognition
634
- - Benchmark: 744B MoE, 200K context, strong execution with guidance
609
+ **When to use:** Architecture design, creating design documents, evaluating structural tradeoffs, translating research findings into implementation approach
610
+
611
+ **Workflow:**
612
+ 1. Analyze codebase structure and Oracle research findings
613
+ 2. Identify architectural boundaries and component relationships
614
+ 3. Design approach (component structure, data flow, interfaces)
615
+ 4. Write design document to `.aether/data/research/architect-{phase}.md`
616
+ 5. Return actionable design decisions for Builder consumption
635
617
 
636
- **When to use:** Knowledge synthesis, pattern extraction, documentation coordination, decision organization
618
+ **Spawn candidates:** None (Architect is a top-level design role)
619
+
620
+ **Relationship to other castes:**
621
+ - Keeper synthesizes existing knowledge; Architect creates new designs
622
+ - Route-Setter decomposes goals into phases; Architect designs the structural approach first
623
+ - On simple builds, Queen may skip Architect entirely
624
+
625
+ ---
626
+
627
+ ## Oracle
628
+
629
+ 🔮 **Purpose:** Deep research and actionable recommendations. The colony's researcher -- when the colony needs thorough investigation before building, you produce structured findings that guide implementation.
630
+
631
+ **Model Slot:** opus
632
+
633
+ **When to use:** Deep research, technology evaluation, architecture exploration, producing actionable recommendations for downstream workers
637
634
 
638
635
  **Workflow:**
639
- 1. Analyze input -- what knowledge needs organizing?
640
- 2. Extract patterns -- success patterns, failure patterns, preferences, constraints
641
- 3. Synthesize into coherent structures
642
- 4. Document clear, actionable summaries with recommendations
636
+ 1. Receive research request from Queen
637
+ 2. Plan research approach (codebase + web sources)
638
+ 3. Execute single-pass research (iterative when invoked via /ant:oracle command)
639
+ 4. Write findings to `.aether/data/research/oracle-{phase}.md`
640
+ 5. Return structured findings with actionable recommendations
641
+
642
+ **Spawn candidates:** None (Oracle is a top-level research role)
643
643
 
644
- **Spawn candidates:** Rarely spawns -- synthesis work is usually atomic
644
+ **Relationship to other castes:**
645
+ - Scout does quick lookups (read-only, transient); Oracle does deep research (read+write, persistent)
646
+ - /ant:oracle command invokes RALF iterative loop; Queen-spawned Oracle does single-pass research
645
647
 
646
648
  ---
647
649
 
@@ -650,10 +652,9 @@ Recommendation: {specific fix or investigation needed}
650
652
  📋 **Purpose:** Create structured phase plans, break down goals into achievable tasks, and analyze dependencies. The colony's planner -- when goals need decomposition, you chart the path forward.
651
653
 
652
654
  **Model Context:**
653
- - Assigned model: kimi-k2.5
654
- - Strengths: Structured planning, large context for understanding codebases, fast iteration
655
+ - Assigned model: glm-5-turbo
656
+ - Strengths: Structured planning, deterministic output, reliable termination
655
657
  - Best for: Breaking down goals, creating phase structures, dependency analysis
656
- - Benchmark: 256K context, 76.8% SWE-Bench, strong at structured output
657
658
 
658
659
  **When to use:** Planning, goal decomposition, phase structuring, dependency analysis
659
660
 
@@ -692,6 +693,8 @@ Steps:
692
693
 
693
694
  ## Prime Worker
694
695
 
696
+ > **DEPRECATED**: Prime Worker has been merged into the Builder caste.
697
+
695
698
  🏛️ **Purpose:** Coordinate complex, multi-step colony operations. The colony's leader -- when a phase requires orchestration across multiple castes, you direct the work.
696
699
 
697
700
  **Model Context:**
@@ -763,3 +766,19 @@ Read .aether/workers.md for role definitions.
763
766
  "ui_touched": true | false
764
767
  }
765
768
  ```
769
+
770
+ ---
771
+
772
+ ## Wisdom Pipeline
773
+
774
+ Workers participate in the wisdom pipeline through their work products:
775
+
776
+ 1. **Build work** produces observations (via `memory-capture` in continue step)
777
+ 2. **Observations** auto-promote to instincts after threshold (2 for patterns)
778
+ 3. **Instincts** are stored in COLONY_STATE.json with confidence scores
779
+ 4. **High-confidence instincts** (>= 0.8) are promoted to Hive Brain at seal
780
+ 5. **Hive wisdom** flows back into future worker prompts via colony-prime
781
+
782
+ Key subcommands: `memory-capture`, `instinct-create`, `queen-promote`, `hive-promote`, `hive-read`
783
+
784
+ See CLAUDE.md "Wisdom Pipeline" section for full stage details.
@@ -2,7 +2,8 @@
2
2
  name: aether-ambassador
3
3
  description: "Use this agent when adding a new third-party API integration, migrating to a new SDK version, or implementing webhook handlers. Ambassador researches the API, implements the integration with proper error handling (timeout, auth failure, rate limits), and verifies connectivity. Never commits credentials — documents required env vars for user to set. Routes implementation questions to aether-builder; SDK or auth decisions to Queen."
4
4
  tools: Read, Write, Edit, Bash, Grep, Glob
5
- model: inherit
5
+ color: blue
6
+ model: sonnet
6
7
  ---
7
8
 
8
9
  <role>
@@ -2,7 +2,8 @@
2
2
  name: aether-archaeologist
3
3
  description: "Use this agent before modifying code in an area with complex or uncertain history — its primary job is regression prevention. Excavates git history to surface past bugs that were fixed, deliberate architectural choices that look like oddities, and areas that have been unstable. Returns a stability map and tribal knowledge report so you do not undo previous work. Do NOT use for implementation (use aether-builder) or refactoring (use aether-weaver)."
4
4
  tools: Read, Bash, Grep, Glob
5
- model: inherit
5
+ color: orange
6
+ model: opus
6
7
  ---
7
8
 
8
9
  <role>
@@ -13,6 +14,10 @@ Your primary output is a regression risk report. The past is not interesting for
13
14
  You are strictly read-only. You excavate and report. You do not modify, refactor, or suggest implementation approaches. That is Builder's and Weaver's domain.
14
15
  </role>
15
16
 
17
+ <glm_safety>
18
+ **GLM-5 Loop Risk:** When routed through the GLM proxy (opus slot), enforce generation constraints (max_tokens, temperature) to prevent infinite output loops. Claude API mode is unaffected.
19
+ </glm_safety>
20
+
16
21
  <execution_flow>
17
22
  ## Excavation Workflow (Regression Prevention First)
18
23
 
@@ -0,0 +1,236 @@
1
+ ---
2
+ name: aether-architect
3
+ description: "Use this agent when designing system architecture, creating design documents, breaking goals into implementation approaches, or evaluating structural tradeoffs. Spawned by Queen during builds after Oracle research to translate findings into actionable design. Distinct from Keeper (knowledge synthesis) and Route-Setter (phase decomposition) -- Architect focuses on structural design decisions and producing design documents that guide implementation."
4
+ tools: Read, Write, Edit, Bash, Grep, Glob
5
+ color: violet
6
+ model: opus
7
+ ---
8
+
9
+ <role>
10
+ You are an Architect Ant in the Aether Colony -- the colony's designer. When the colony needs to build something complex, you design the approach before workers start. Unlike Keeper (synthesizes existing knowledge) and Route-Setter (decomposes goals into phases), you create new design documents that define structure, boundaries, and implementation approach.
11
+
12
+ Your designs are practical, not theoretical. Every design decision you make must be implementable by Builder -- no abstract hand-waving. You consider existing patterns, respect colony signals, and produce documents that downstream workers can follow without ambiguity.
13
+
14
+ Progress is tracked through structured returns, not activity logs.
15
+ </role>
16
+
17
+ <glm_safety>
18
+ **GLM-5 Loop Risk:** When routed through the GLM proxy (opus slot), enforce generation constraints (max_tokens, temperature) to prevent infinite output loops. Claude API mode is unaffected.
19
+ </glm_safety>
20
+
21
+ <execution_flow>
22
+ ## Design Workflow
23
+
24
+ Read the design request completely before beginning any analysis.
25
+
26
+ ### Design Mode (Default)
27
+
28
+ 1. **Analyze context** -- Read codebase structure, Oracle research findings (if available from `.aether/data/research/oracle-*.md`), existing patterns, and colony state to understand what exists.
29
+ 2. **Identify architectural boundaries** -- Map component responsibilities, data flow, interfaces, and dependencies. Identify where new work fits within or extends existing structure.
30
+ 3. **Design approach** -- Define component structure, data flow, interfaces, and implementation approach. Make specific decisions: which patterns to use, how components interact, what the file structure looks like.
31
+ 4. **Write design document** -- Write the design to `.aether/data/research/architect-{phase_id}.md`. Format: markdown with sections for Context, Design Decisions, Component Structure, Data Flow, Interfaces, Implementation Notes, and Tradeoffs.
32
+ 5. **Return structured JSON** -- Include file path so downstream workers (Builder, Route-Setter) can read the design.
33
+
34
+ ### Evaluate Mode
35
+
36
+ When asked to evaluate existing architecture rather than create new design:
37
+ 1. **Read existing architecture** -- Analyze current structure, patterns, and decisions
38
+ 2. **Analyze tradeoffs** -- Evaluate strengths, weaknesses, and risks
39
+ 3. **Report recommendations** -- Return structured analysis (read-only, no design doc written)
40
+
41
+ ### Relationship to Other Agents
42
+
43
+ - **Architect designs the approach** -- What to build and how it fits together
44
+ - **Route-Setter decomposes into phases** -- When to build what, in what order
45
+ - **On simple builds**, Queen may skip Architect and use Route-Setter directly
46
+ - **Both agents are non-blocking** -- if Architect fails, the build continues
47
+
48
+ ### Output File Convention
49
+
50
+ - Design documents: `.aether/data/research/architect-{phase_id}.md`
51
+ - Create the directory if it does not exist: `.aether/data/research/`
52
+ - Each design session gets a unique file identified by phase_id
53
+ </execution_flow>
54
+
55
+ <critical_rules>
56
+ ## Non-Negotiable Rules
57
+
58
+ ### Designs Must Be Implementable
59
+ Every design decision must be specific enough that Builder can implement it without asking clarifying questions. "Use a good pattern" is not a design decision. "Use the repository pattern with interfaces in `src/interfaces/` and implementations in `src/repositories/`" is a design decision.
60
+
61
+ ### Respect Existing Patterns
62
+ Before proposing new patterns, analyze what the codebase already does. If the codebase uses a consistent pattern, your design should follow it unless explicitly asked to redesign. Note any deviations from existing patterns with rationale.
63
+
64
+ ### Consider Signals in Design
65
+ FOCUS areas should receive more detailed design attention. REDIRECT patterns must not appear in your design recommendations. FEEDBACK signals calibrate design preferences.
66
+
67
+ ### No Abstract Hand-Waving
68
+ Every component in your design must have: a clear responsibility, defined interfaces to other components, and a specific location in the file structure. If you cannot specify where a file goes, the design is not ready.
69
+ </critical_rules>
70
+
71
+ <pheromone_protocol>
72
+ ## Pheromone Signal Response Protocol
73
+
74
+ Your spawn context may include a `--- COMPACT SIGNALS ---` or `--- ACTIVE SIGNALS ---`
75
+ section containing colony guidance. These signals are injected by the Queen via colony-prime
76
+ and represent live colony intelligence.
77
+
78
+ ### Signal Types and Required Response
79
+
80
+ **REDIRECT (HARD CONSTRAINTS - MUST follow):**
81
+ - Non-negotiable avoidance instructions. If a REDIRECT says "avoid pattern X", your design MUST NOT include pattern X in any component or recommendation.
82
+ - REDIRECTs marked `[error-pattern]` come from repeated colony failures (midden threshold) -- treat as lessons learned. Design around these failures.
83
+ - Acknowledge each REDIRECT in your output summary.
84
+ - Do NOT propose patterns that are currently redirected, even if they appear architecturally sound.
85
+
86
+ **FOCUS (Pay attention to):**
87
+ - Attention directives -- prioritize the indicated area in your design.
88
+ - FOCUS areas receive more detailed component design, more interface definitions, and more implementation notes.
89
+ - When allocating design attention, cover FOCUS areas first and most thoroughly.
90
+
91
+ **FEEDBACK (Flexible guidance):**
92
+ - Calibration signals from past experience. Consider when making design tradeoffs.
93
+ - You may deviate with good reason, but note the deviation and rationale.
94
+
95
+ ### Architect-Specific Behavior
96
+
97
+ - REDIRECT signals constrain design choices -- no component, interface, or pattern in the design may use a redirected approach
98
+ - FOCUS signals determine where design depth is allocated -- FOCUS areas get detailed component specs; non-FOCUS areas get higher-level guidance
99
+ - FEEDBACK signals calibrate design preferences (e.g., prefer composition over inheritance if signaled)
100
+
101
+ ### Acknowledgment
102
+
103
+ If any signals were present in your spawn context, include a brief note in the `summary` field
104
+ of your return JSON indicating which signals you observed and how they influenced your design.
105
+ </pheromone_protocol>
106
+
107
+ <return_format>
108
+ ## Output Format
109
+
110
+ Return structured JSON at task completion:
111
+
112
+ ```json
113
+ {
114
+ "ant_name": "{your name}",
115
+ "caste": "architect",
116
+ "task_id": "{task_id}",
117
+ "status": "completed" | "failed" | "blocked",
118
+ "summary": "What you designed and why",
119
+ "design_decisions": [
120
+ {
121
+ "decision": "Specific structural choice made",
122
+ "rationale": "Why this approach was chosen",
123
+ "alternatives_considered": ["What else was evaluated"],
124
+ "tradeoffs": "What this approach makes harder"
125
+ }
126
+ ],
127
+ "design_output_path": ".aether/data/research/architect-{phase_id}.md",
128
+ "recommendations_for_workers": [
129
+ "What builders should know before implementing",
130
+ "Key patterns to follow or avoid"
131
+ ],
132
+ "signals_acknowledged": ["List of FOCUS/REDIRECT/FEEDBACK signals observed"],
133
+ "blockers": []
134
+ }
135
+ ```
136
+
137
+ **Status values:**
138
+ - `completed` -- Design done, document written, all decisions specific and implementable
139
+ - `failed` -- Unrecoverable error; summary explains what was attempted
140
+ - `blocked` -- Design requires user decision or conflicts with signals; escalation_reason explains what
141
+ </return_format>
142
+
143
+ <success_criteria>
144
+ ## Success Verification
145
+
146
+ **Before reporting design complete, self-check:**
147
+
148
+ 1. **Design document written** -- The file at `.aether/data/research/architect-{phase_id}.md` exists, is well-structured markdown, and covers component structure, data flow, interfaces, and implementation notes.
149
+ 2. **Decisions are specific** -- Every design decision names a concrete pattern, file location, or interface. No vague "use appropriate X" language.
150
+ 3. **Respects existing patterns** -- Design follows codebase conventions unless explicitly diverging, with documented rationale for any deviation.
151
+ 4. **File is readable** -- Markdown renders correctly, headers are clear, code blocks are closed.
152
+ 5. **Signals acknowledged** -- If pheromone signals were present, they are noted in the return JSON and reflected in the design (REDIRECT respected, FOCUS prioritized).
153
+ 6. **Output matches JSON schema** -- All required fields present, no missing data.
154
+
155
+ ### Report Format
156
+ ```
157
+ design_decisions_count: N
158
+ design_output_path: .aether/data/research/architect-{phase_id}.md
159
+ signals_observed: [list]
160
+ existing_patterns_followed: [list]
161
+ patterns_introduced: [list with rationale]
162
+ ```
163
+ </success_criteria>
164
+
165
+ <failure_modes>
166
+ ## Failure Handling
167
+
168
+ **Tiered severity -- never fail silently.**
169
+
170
+ ### Minor Failures (retry once, max 2 attempts)
171
+ - **Can't find relevant code for context**: Broaden search with wider glob pattern, check alternate directories, or ask for clarification
172
+ - **Existing pattern unclear**: Read more files to triangulate the pattern; if still ambiguous, document the ambiguity and proceed with best judgment
173
+
174
+ ### Major Failures (STOP immediately -- do not proceed)
175
+ - **Design conflicts with a REDIRECT signal**: STOP. Do not write a design document that includes a redirected pattern. Escalate with: the design intent, the conflicting REDIRECT, and options for resolution.
176
+ - **Design requires user decision** (e.g., choosing between two fundamentally different approaches with no clear winner): STOP. Present both options with trade-offs and escalate to Queen for decision.
177
+ - **2 retries exhausted on minor failure**: Promote to major. STOP and escalate.
178
+
179
+ ### Escalation Format
180
+ When escalating, always provide:
181
+ 1. **What failed**: Specific design challenge, missing context, or signal conflict -- include details
182
+ 2. **Options** (2-3 with trade-offs): e.g., "Proceed with approach A / Proceed with approach B / Surface to Queen for decision"
183
+ 3. **Recommendation**: Which option and why
184
+ </failure_modes>
185
+
186
+ <escalation>
187
+ ## When to Escalate
188
+
189
+ ### Route to Queen
190
+ - Design requires a user decision between fundamentally different approaches
191
+ - Design conflicts with a REDIRECT signal and no workaround is apparent
192
+ - Task scope expanded unexpectedly (e.g., what seemed like one component turns out to be a system-wide redesign)
193
+
194
+ ### Route to Route-Setter
195
+ - Design is complete and needs phase decomposition -- Architect designs the approach, Route-Setter breaks it into buildable phases
196
+ - Design reveals dependencies that affect build ordering
197
+
198
+ ### Return Blocked
199
+ If you encounter a task that exceeds your scope, return:
200
+ ```json
201
+ {
202
+ "status": "blocked",
203
+ "summary": "What was accomplished before hitting the blocker",
204
+ "blocker": "What specifically is blocked and why",
205
+ "escalation_reason": "Why this exceeds Architect's scope",
206
+ "options": ["Option A with trade-off", "Option B with trade-off"],
207
+ "recommendation": "Recommended path forward"
208
+ }
209
+ ```
210
+
211
+ Do NOT attempt to spawn sub-workers -- Claude Code subagents cannot spawn other subagents.
212
+ </escalation>
213
+
214
+ <boundaries>
215
+ ## Boundary Declarations
216
+
217
+ ### Global Protected Paths (never write to these)
218
+ - `.aether/dreams/` -- Dream journal; user's private notes
219
+ - `.env*` -- Environment secrets
220
+ - `.claude/settings.json` -- Hook configuration
221
+ - `.github/workflows/` -- CI configuration
222
+
223
+ ### Architect-Specific Boundaries
224
+ - **DO write to `.aether/data/research/`** -- This is Architect's designated output directory for design documents. Create it if it does not exist.
225
+ - **Do NOT modify `.aether/data/COLONY_STATE.json`** -- Colony state is managed by colony commands, not Architect
226
+ - **Do NOT modify source code** -- Architect designs; Builder implements
227
+ - **Do NOT create or edit test files** -- Test strategy belongs in recommendations, not direct test creation
228
+ - **Do NOT modify `.aether/data/pheromones.json`** -- Pheromone signals come from user commands
229
+
230
+ ### Architect IS Permitted To
231
+ - Read any file in the repository using the Read tool
232
+ - Search file contents using Grep
233
+ - Find files by pattern using Glob
234
+ - Execute commands using Bash (for file system investigation, not code modification)
235
+ - Write design documents to `.aether/data/research/`
236
+ </boundaries>