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
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: prisma
3
+ description: Use when the project uses Prisma ORM for database access
4
+ type: domain
5
+ domains: [database, orm, schema]
6
+ agent_roles: [builder]
7
+ detect_files: ["schema.prisma"]
8
+ detect_packages: ["@prisma/client"]
9
+ priority: normal
10
+ version: "1.0"
11
+ ---
12
+
13
+ # Prisma Best Practices
14
+
15
+ ## Schema Definition
16
+
17
+ Define your data model in `schema.prisma` using clear, singular model names (`User`, not `Users`). Prisma generates the table names. Use `@id` with `@default(autoincrement())` or `@default(uuid())` for primary keys.
18
+
19
+ Add `@map` and `@@map` annotations when table or column names must differ from model names (e.g., mapping to an existing database). Use `@relation` explicitly for clarity, even when Prisma could infer it.
20
+
21
+ Define enums in the schema for fields with a fixed set of values. This provides type safety across the application.
22
+
23
+ ## Migrations
24
+
25
+ Run `prisma migrate dev` in development to create and apply migrations. Run `prisma migrate deploy` in production -- it never prompts or resets. Never run `migrate dev` in production.
26
+
27
+ Review generated migration SQL before applying. Prisma generates migrations in `prisma/migrations/` -- each is a timestamped directory with a SQL file. Edit the SQL if you need data transformations alongside schema changes, but annotate why.
28
+
29
+ ## Client Usage
30
+
31
+ Generate the client with `prisma generate` after schema changes. Import `PrismaClient` and create a single instance -- reuse it across your application. In serverless environments, store the client in a global variable to avoid connection exhaustion.
32
+
33
+ ```
34
+ // Correct: single instance
35
+ const prisma = new PrismaClient();
36
+ export default prisma;
37
+ ```
38
+
39
+ ## Querying
40
+
41
+ Use `select` to fetch only the fields you need -- avoid loading entire records when you need two columns. Use `include` for relations, but be deliberate about depth. Nested includes can generate expensive joins.
42
+
43
+ Use `findUnique` when querying by unique fields (id, email) and `findFirst`/`findMany` for non-unique queries. Prefer `findUniqueOrThrow` when the record must exist.
44
+
45
+ ## Performance Gotchas
46
+
47
+ Avoid N+1 queries by using `include` in a single query rather than looping and querying per item. Use `createMany` for bulk inserts instead of looping `create` calls.
48
+
49
+ For large datasets, use cursor-based pagination: `findMany({ take: 20, skip: 1, cursor: { id: lastId } })`. Offset pagination degrades on large tables.
50
+
51
+ Raw queries via `$queryRaw` are available when Prisma's query builder is insufficient, but use parameterized templates (`Prisma.sql`) to prevent injection.
52
+
53
+ ## Type Safety
54
+
55
+ Prisma generates TypeScript types from your schema. Use `Prisma.UserCreateInput`, `Prisma.UserWhereInput`, etc. for type-safe function parameters. Never bypass these types with `any` -- they catch schema mismatches at compile time.
56
+
57
+ ## Seeding
58
+
59
+ Define seed scripts in `prisma/seed.ts` and register them in `package.json` under `prisma.seed`. Use `upsert` in seeds to make them idempotent -- running the seed twice should not create duplicates.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: python
3
+ description: Use when the project uses Python for backend, scripting, or data work
4
+ type: domain
5
+ domains: [backend, scripting, data]
6
+ agent_roles: [builder]
7
+ detect_files: ["*.py", "requirements.txt", "pyproject.toml"]
8
+ priority: normal
9
+ version: "1.0"
10
+ ---
11
+
12
+ # Python Best Practices
13
+
14
+ ## Project Setup
15
+
16
+ Use virtual environments for every project -- never install packages globally. Prefer `pyproject.toml` over `setup.py` for project configuration. Pin dependency versions in `requirements.txt` or use a lock file via `pip-tools`, `poetry`, or `uv`.
17
+
18
+ Structure packages with `__init__.py` files. Use `src/` layout for libraries to prevent accidental imports from the project root.
19
+
20
+ ## Code Style
21
+
22
+ Follow PEP 8. Use a formatter (black, ruff format) and linter (ruff, flake8) -- do not manually enforce style. Type hints are strongly encouraged for function signatures and return values. Use `mypy` or `pyright` for type checking.
23
+
24
+ Use f-strings for string formatting, not `%` or `.format()`. They are faster and more readable.
25
+
26
+ ## Error Handling
27
+
28
+ Catch specific exceptions, never bare `except:`. This swallows `KeyboardInterrupt` and `SystemExit`, making the program impossible to stop. Always `except SomeError as e:` and log or re-raise.
29
+
30
+ Use context managers (`with` statements) for resource management: files, database connections, locks. They guarantee cleanup even when exceptions occur.
31
+
32
+ ## Functions and Classes
33
+
34
+ Keep functions focused and short. Use keyword arguments for functions with more than 3 parameters to avoid positional ambiguity. Provide default values where sensible.
35
+
36
+ Prefer composition over deep inheritance hierarchies. Dataclasses (`@dataclass`) or named tuples for simple data containers -- avoid dictionaries when the shape is known.
37
+
38
+ ## Common Gotchas
39
+
40
+ Mutable default arguments are shared across calls: `def f(items=[])` is a bug. Use `def f(items=None): items = items or []` instead.
41
+
42
+ String concatenation in loops is O(n^2). Use `"".join(parts)` or list comprehensions. List comprehensions are preferred over `map`/`filter` for readability.
43
+
44
+ ## Testing
45
+
46
+ Use `pytest` over `unittest`. Write test files with `test_` prefix. Use fixtures for setup/teardown. Parametrize tests with `@pytest.mark.parametrize` to cover multiple cases without duplicating test code.
47
+
48
+ ## Performance
49
+
50
+ Profile before optimizing -- use `cProfile` or `py-spy`. For CPU-bound work, consider `multiprocessing` (the GIL prevents true threading for CPU tasks). For I/O-bound work, use `asyncio` or `concurrent.futures.ThreadPoolExecutor`.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: rails
3
+ description: Use when the project uses Ruby on Rails for web development
4
+ type: domain
5
+ domains: [backend, ruby, web]
6
+ agent_roles: [builder]
7
+ detect_files: ["Gemfile", "config/routes.rb"]
8
+ priority: normal
9
+ version: "1.0"
10
+ ---
11
+
12
+ # Ruby on Rails Best Practices
13
+
14
+ ## Convention Over Configuration
15
+
16
+ Follow Rails conventions strictly. Name models singular (`User`), controllers plural (`UsersController`), tables plural (`users`). Place files where Rails expects them. Fighting conventions creates maintenance headaches.
17
+
18
+ Use Rails generators for scaffolding, then customize. They set up the correct file structure, naming, and test stubs.
19
+
20
+ ## Models
21
+
22
+ Keep models focused. Move business logic into service objects or concerns when a model exceeds 200 lines. Use Active Record validations for data integrity and callbacks sparingly -- callbacks that trigger side effects (emails, API calls) are better handled in service objects.
23
+
24
+ Use scopes for reusable query patterns: `scope :active, -> { where(active: true) }`. Chain scopes for composable queries.
25
+
26
+ ## Controllers
27
+
28
+ Keep controllers thin. A controller action should: authenticate, authorize, call a service, and render a response. Complex logic belongs in service objects (`app/services/`), not controllers.
29
+
30
+ Use strong parameters (`params.require(:user).permit(:name, :email)`) for every create/update action. Never trust user input.
31
+
32
+ ## Database
33
+
34
+ Write migrations for every schema change -- never modify the database manually. Use `change` methods in migrations for reversibility. Add database-level constraints (NOT NULL, unique indexes, foreign keys) alongside Active Record validations.
35
+
36
+ Watch for N+1 queries. Use `includes()` for eager loading associations. The `bullet` gem detects N+1 queries in development.
37
+
38
+ ## Testing
39
+
40
+ Write request specs over controller specs -- they test the full stack including routing and middleware. Use `FactoryBot` for test data, not fixtures (fixtures become stale and hard to maintain).
41
+
42
+ Test the happy path and the most important failure modes. Use `let` and `before` blocks in RSpec for DRY test setup, but do not over-abstract -- tests should be readable as documentation.
43
+
44
+ ## Security
45
+
46
+ Never store secrets in source code. Use Rails encrypted credentials (`rails credentials:edit`) or environment variables. Keep `secret_key_base` secure -- it signs session cookies.
47
+
48
+ Sanitize user-generated HTML output. Rails escapes by default in ERB, but `raw` and `html_safe` bypass this -- use them only with trusted content.
49
+
50
+ ## Performance
51
+
52
+ Cache aggressively with fragment caching and Russian doll caching. Use background jobs (Sidekiq, GoodJob) for anything that takes more than a few hundred milliseconds -- email delivery, API calls, report generation.
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: react
3
+ description: Use when the project uses React for building user interfaces
4
+ type: domain
5
+ domains: [frontend, components, ui]
6
+ agent_roles: [builder]
7
+ detect_files: ["*.jsx", "*.tsx"]
8
+ detect_packages: ["react"]
9
+ priority: normal
10
+ version: "1.0"
11
+ ---
12
+
13
+ # React Best Practices
14
+
15
+ ## Component Design
16
+
17
+ Prefer function components with hooks over class components. Keep components small and focused on a single responsibility. If a component file exceeds 200 lines, it likely needs splitting.
18
+
19
+ Extract custom hooks when you find yourself reusing stateful logic across components. Name hooks with the `use` prefix and keep them in a dedicated `hooks/` directory.
20
+
21
+ ## State Management
22
+
23
+ Use `useState` for local UI state, `useReducer` for complex state transitions, and context for cross-cutting concerns like themes or auth. Avoid putting everything in global state -- most state is local.
24
+
25
+ Lift state up only when two sibling components need the same data. If prop drilling goes deeper than 2-3 levels, consider context or composition patterns instead.
26
+
27
+ ## Performance Gotchas
28
+
29
+ Wrap expensive computations in `useMemo` and callback references in `useCallback`, but only when you measure an actual performance problem. Premature memoization adds complexity without benefit.
30
+
31
+ Never create new objects or arrays inline as props -- this triggers unnecessary re-renders. Define defaults outside the component body.
32
+
33
+ Avoid anonymous functions in `useEffect` dependency arrays. Extract effect logic into named functions for clarity and stable references.
34
+
35
+ ## Keys and Lists
36
+
37
+ Always use stable, unique identifiers as keys in lists -- never array indices (unless the list is static and will never reorder). Bad keys cause subtle bugs with component state getting mixed up between items.
38
+
39
+ ## Error Boundaries
40
+
41
+ Wrap major UI sections in error boundaries. A crash in a sidebar widget should not take down the entire page. Use `react-error-boundary` or build your own class component for this.
42
+
43
+ ## File Organization
44
+
45
+ Group by feature, not by type. Colocate a component with its tests, styles, and hooks rather than having separate `components/`, `styles/`, and `tests/` trees. This makes features self-contained and easy to move or delete.
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: rest-api
3
+ description: Use when the project designs or consumes RESTful HTTP APIs
4
+ type: domain
5
+ domains: [api, http, design]
6
+ agent_roles: [builder]
7
+ detect_files: ["openapi.*", "swagger.*"]
8
+ priority: normal
9
+ version: "1.0"
10
+ ---
11
+
12
+ # REST API Best Practices
13
+
14
+ ## Resource Design
15
+
16
+ Use nouns for endpoints, not verbs: `/users` not `/getUsers`. Let HTTP methods convey the action: `GET` (read), `POST` (create), `PUT` (full replace), `PATCH` (partial update), `DELETE` (remove).
17
+
18
+ Use plural nouns for collections (`/users`), singular identifiers for items (`/users/123`). Nest resources for clear ownership: `/users/123/orders` for orders belonging to user 123. Avoid nesting deeper than two levels -- flatten with query parameters instead.
19
+
20
+ ## HTTP Status Codes
21
+
22
+ Return the correct status code -- clients depend on it for error handling:
23
+ - `200` for successful GET/PUT/PATCH
24
+ - `201` for successful POST (resource created)
25
+ - `204` for successful DELETE (no content)
26
+ - `400` for bad request (validation errors)
27
+ - `401` for unauthenticated
28
+ - `403` for unauthorized (authenticated but not allowed)
29
+ - `404` for not found
30
+ - `409` for conflict (duplicate, version mismatch)
31
+ - `422` for unprocessable entity (valid JSON, invalid semantics)
32
+ - `500` for server errors (never expose internals)
33
+
34
+ ## Request and Response Format
35
+
36
+ Use JSON for request and response bodies. Use `camelCase` for JSON field names (JavaScript convention) or `snake_case` (Python convention) -- be consistent within the API, never mix.
37
+
38
+ Return consistent error responses: `{"error": "message", "code": "VALIDATION_FAILED", "details": [...]}`. Clients should be able to parse errors programmatically, not just read human messages.
39
+
40
+ ## Pagination
41
+
42
+ Always paginate collection endpoints. Use cursor-based pagination (`?cursor=abc123&limit=20`) for large or frequently changing datasets. Include pagination metadata in the response: `total`, `next_cursor`, `has_more`.
43
+
44
+ ## Versioning
45
+
46
+ Version your API from day one: `/api/v1/users`. Use URL-based versioning for simplicity. Header-based versioning (`Accept: application/vnd.api.v1+json`) is cleaner but harder to test and debug.
47
+
48
+ ## Authentication
49
+
50
+ Use bearer tokens (JWT or opaque) in the `Authorization` header. Never pass tokens in URL query parameters -- they appear in logs and browser history. Use short-lived access tokens with refresh tokens for longer sessions.
51
+
52
+ ## Documentation
53
+
54
+ Maintain an OpenAPI specification (`openapi.yaml`). Generate it from code annotations or write it manually, but keep it in sync with the implementation. Stale API docs are worse than no docs -- they create false confidence.
55
+
56
+ ## Rate Limiting
57
+
58
+ Implement rate limiting on all public endpoints. Return `429 Too Many Requests` with `Retry-After` header. Use sliding window counters, not fixed windows, to prevent burst abuse at window boundaries.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: svelte
3
+ description: Use when the project uses Svelte or SvelteKit for building reactive UIs
4
+ type: domain
5
+ domains: [frontend, components, ui]
6
+ agent_roles: [builder]
7
+ detect_files: ["*.svelte", "svelte.config.*"]
8
+ detect_packages: ["svelte"]
9
+ priority: normal
10
+ version: "1.0"
11
+ ---
12
+
13
+ # Svelte Best Practices
14
+
15
+ ## Reactivity Model
16
+
17
+ Svelte uses compile-time reactivity. Variables declared at the top level of a component are reactive automatically -- assignments trigger re-renders. Use `$:` for derived values and reactive statements. Remember that only assignments trigger reactivity: `array.push(item)` does NOT trigger updates -- use `array = [...array, item]` instead.
18
+
19
+ ## Component Structure
20
+
21
+ Keep components focused on one concern. A Svelte component file should ideally contain its own script, markup, and styles. Use `<script>` at the top, markup in the middle, and `<style>` at the bottom.
22
+
23
+ ## Stores
24
+
25
+ Use writable stores for shared state across components. Subscribe with the `$store` syntax in components for automatic subscription cleanup. For derived data, use `derived()` stores rather than computing values in each component.
26
+
27
+ Keep stores in a `stores/` directory. Export store creation functions rather than store instances when stores need initialization parameters.
28
+
29
+ ## Props and Events
30
+
31
+ Declare props with `export let propName`. Provide default values for optional props. Use `createEventDispatcher()` for component events, and forward DOM events with `on:click` without a handler.
32
+
33
+ Use two-way binding (`bind:value`) sparingly -- it makes data flow harder to trace. Prefer explicit prop + event patterns for complex components.
34
+
35
+ ## SvelteKit Specifics
36
+
37
+ SvelteKit uses file-based routing in `src/routes/`. Page components are `+page.svelte`, layouts are `+layout.svelte`, and server-side logic lives in `+page.server.ts` or `+server.ts`.
38
+
39
+ Load data with `load` functions in `+page.ts` (universal) or `+page.server.ts` (server-only). Use form actions for mutations rather than custom API endpoints.
40
+
41
+ ## Styling
42
+
43
+ Svelte styles are scoped by default -- styles in `<style>` only affect the current component. Use `:global()` modifier cautiously when you need to reach outside component boundaries.
44
+
45
+ ## Performance
46
+
47
+ Svelte compiles away the framework, so bundles are naturally small. Use `{#key}` blocks to force re-creation of components when data changes identity. Use `{#each}` with keyed items for efficient list updates. Lazy-load heavy components with dynamic imports.
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: tailwind
3
+ description: Use when the project uses Tailwind CSS for utility-first styling
4
+ type: domain
5
+ domains: [css, frontend, styling]
6
+ agent_roles: [builder]
7
+ detect_files: ["tailwind.config.*"]
8
+ detect_packages: ["tailwindcss"]
9
+ priority: normal
10
+ version: "1.0"
11
+ ---
12
+
13
+ # Tailwind CSS Best Practices
14
+
15
+ ## Utility-First Approach
16
+
17
+ Apply styles directly with utility classes rather than writing custom CSS. Resist the urge to create `.btn` or `.card` classes -- use component abstractions in your framework instead (React components, Vue components, partials). Custom CSS should be the exception, not the default.
18
+
19
+ ## Class Organization
20
+
21
+ Order classes consistently: layout (flex, grid, position) first, then sizing (w, h, p, m), then typography (text, font), then visual (bg, border, shadow), then states (hover, focus). Use Prettier with `prettier-plugin-tailwindcss` to automate class sorting.
22
+
23
+ When a class list gets long (10+ utilities), extract it into a component rather than using `@apply`. The `@apply` directive defeats the purpose of utility-first and creates hidden CSS that is harder to maintain.
24
+
25
+ ## Responsive Design
26
+
27
+ Tailwind is mobile-first. Write base styles for mobile, then add responsive modifiers: `sm:`, `md:`, `lg:`, `xl:`. Never start with desktop styles and subtract.
28
+
29
+ Test responsive behavior at each breakpoint. Use the browser's device toolbar, not just resizing the window.
30
+
31
+ ## Customization
32
+
33
+ Extend the theme in `tailwind.config.js` rather than using arbitrary values. If you find yourself writing `bg-[#1a2b3c]` more than once, add it to your theme colors. Arbitrary values signal missing design tokens.
34
+
35
+ Use CSS variables for dynamic values (dark mode, user themes): define variables in your CSS, reference them in the Tailwind config with `var(--color-primary)`.
36
+
37
+ ## Common Gotchas
38
+
39
+ Tailwind purges unused classes in production. Dynamic class names assembled with string concatenation will be purged because the scanner cannot detect them. Always use complete class names: write `text-red-500` not `text-${color}-500`. Use the `safelist` config option for truly dynamic classes.
40
+
41
+ Avoid `!important` modifiers (`!text-red-500`) -- they indicate specificity fights that usually mean structural issues. Fix the cascade instead.
42
+
43
+ ## Dark Mode
44
+
45
+ Use the `dark:` variant with the `class` strategy for manual control, or `media` strategy for OS-level preference. Be consistent across the project -- mixing strategies causes unpredictable behavior.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: testing
3
+ description: Use when the project needs automated testing with Jest, Vitest, pytest, or similar frameworks
4
+ type: domain
5
+ domains: [testing, quality, tdd]
6
+ agent_roles: [builder]
7
+ detect_files: ["*.test.*", "*.spec.*"]
8
+ detect_packages: ["jest", "vitest", "pytest"]
9
+ priority: normal
10
+ version: "1.0"
11
+ ---
12
+
13
+ # Testing Best Practices
14
+
15
+ ## Test Structure
16
+
17
+ Follow the Arrange-Act-Assert pattern: set up the conditions, perform the action, check the result. Each test should verify one behavior. If a test name contains "and", it probably tests two things -- split it.
18
+
19
+ Name tests to describe behavior, not implementation: "returns empty array when no items match filter" not "test filterItems function". Good test names serve as documentation.
20
+
21
+ ## Test-Driven Development
22
+
23
+ Write the test before the implementation. Start with the simplest failing test, write minimal code to make it pass, then refactor. This cycle (Red-Green-Refactor) prevents over-engineering and ensures every line of production code is covered.
24
+
25
+ When fixing bugs, write a test that reproduces the bug first. Then fix the code. The test proves the bug existed and prevents regression.
26
+
27
+ ## What to Test
28
+
29
+ Test behavior, not implementation. Test public interfaces, not private methods. If you refactor internals without changing behavior, tests should still pass. Tests that break during refactoring are testing the wrong thing.
30
+
31
+ Focus coverage on: business logic, data transformations, error handling paths, edge cases (empty inputs, boundary values, null/undefined). Skip testing: framework boilerplate, simple getters/setters, third-party library behavior.
32
+
33
+ ## Mocking
34
+
35
+ Mock external dependencies (APIs, databases, file system), not your own code. Over-mocking creates tests that pass even when the real system is broken. Use the lightest mock possible -- spy on a method rather than replacing an entire module.
36
+
37
+ Reset mocks between tests to prevent state leakage. In Jest/Vitest, use `beforeEach(() => { vi.clearAllMocks() })`. In pytest, fixtures handle cleanup automatically.
38
+
39
+ ## Test Performance
40
+
41
+ Fast tests get run often. Slow tests get skipped. Keep unit tests under 100ms each. Isolate slow integration tests into a separate suite that runs less frequently.
42
+
43
+ Avoid `sleep` or timeouts in tests. Use fake timers (`vi.useFakeTimers()`) for time-dependent code. Wait for conditions with polling utilities, not fixed delays.
44
+
45
+ ## Test Organization
46
+
47
+ Colocate tests with source files (`Button.tsx` next to `Button.test.tsx`) or use a parallel `__tests__/` directory. Be consistent across the project.
48
+
49
+ Use `describe` blocks to group related tests. Use `it` or `test` for individual cases. Setup shared across a `describe` block goes in `beforeEach`, not duplicated in each test.
50
+
51
+ ## Continuous Integration
52
+
53
+ Tests must pass before merging. Run the full suite in CI on every pull request. Fail the build on test failures -- never merge with known failures. Aim for meaningful coverage (80%+) over line-count metrics.
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: typescript
3
+ description: Use when the project uses TypeScript for type-safe JavaScript development
4
+ type: domain
5
+ domains: [typing, language, safety]
6
+ agent_roles: [builder]
7
+ detect_files: ["tsconfig.json", "*.ts"]
8
+ priority: normal
9
+ version: "1.0"
10
+ ---
11
+
12
+ # TypeScript Best Practices
13
+
14
+ ## Configuration
15
+
16
+ Enable strict mode in `tsconfig.json` (`"strict": true`). This turns on `strictNullChecks`, `noImplicitAny`, `strictFunctionTypes`, and other checks that catch real bugs. Loosening strict mode after the fact is easy; adding it to an existing loose codebase is painful.
17
+
18
+ Set `"noUncheckedIndexedAccess": true` to make array and object index access return `T | undefined` instead of `T`. This catches a class of runtime errors where you assume an index exists.
19
+
20
+ ## Type Design
21
+
22
+ Prefer `interface` for object shapes that may be extended. Use `type` for unions, intersections, and computed types. Both work for most cases, but `interface` gives better error messages and supports declaration merging.
23
+
24
+ Make impossible states unrepresentable. Use discriminated unions instead of optional fields:
25
+
26
+ ```typescript
27
+ // Avoid: what does it mean when both are undefined?
28
+ type Result = { data?: Data; error?: Error };
29
+
30
+ // Prefer: exactly one state at a time
31
+ type Result = { status: "ok"; data: Data } | { status: "error"; error: Error };
32
+ ```
33
+
34
+ ## Avoid These Patterns
35
+
36
+ Never use `any` -- use `unknown` when the type is truly unknown, then narrow it with type guards. Every `any` disables type checking for everything it touches.
37
+
38
+ Avoid type assertions (`as Type`) unless you genuinely know more than the compiler. Prefer type guards (`if ('kind' in obj)`) that the compiler can verify.
39
+
40
+ Do not use `!` (non-null assertion) to silence nullable warnings. Fix the logic so the compiler can see the value is defined, or handle the null case.
41
+
42
+ ## Generics
43
+
44
+ Use generics to make functions and types reusable without losing type information. Name generic parameters descriptively when the context is not obvious: `TItem` over `T` when there are multiple type parameters.
45
+
46
+ Constrain generics with `extends` to ensure minimum capability: `<T extends { id: string }>` guarantees `T` has an `id` field.
47
+
48
+ ## Utility Types
49
+
50
+ Use built-in utility types: `Partial<T>` for optional fields, `Required<T>` for mandatory, `Pick<T, K>` to select fields, `Omit<T, K>` to exclude, `Record<K, V>` for dictionaries. These are clearer than manual type construction.
51
+
52
+ ## Enums
53
+
54
+ Prefer `as const` objects or string literal unions over `enum`. Enums generate runtime code and have subtle behavior differences between string and numeric variants. `as const` objects are pure types with zero runtime cost.
55
+
56
+ ## Error Handling
57
+
58
+ Type your error shapes. Define error types and use them in `Result` patterns. Catch blocks receive `unknown` in strict mode -- narrow before accessing properties.
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: vue
3
+ description: Use when the project uses Vue.js for building reactive user interfaces
4
+ type: domain
5
+ domains: [frontend, components, ui]
6
+ agent_roles: [builder]
7
+ detect_files: ["*.vue", "vue.config.*"]
8
+ detect_packages: ["vue"]
9
+ priority: normal
10
+ version: "1.0"
11
+ ---
12
+
13
+ # Vue Best Practices
14
+
15
+ ## Composition API
16
+
17
+ Prefer the Composition API (`<script setup>`) over the Options API for new code. It provides better TypeScript support, more flexible logic reuse through composables, and cleaner component organization. Check which API the existing codebase uses before introducing the other.
18
+
19
+ ## Reactivity System
20
+
21
+ Use `ref()` for primitives and `reactive()` for objects. Remember that `reactive()` loses reactivity when destructured -- use `toRefs()` if you need to destructure. Always access `ref` values with `.value` in script, but not in templates.
22
+
23
+ Avoid replacing an entire `reactive()` object -- mutate its properties instead. Replacing the reference breaks reactivity tracking.
24
+
25
+ ## Composables
26
+
27
+ Extract reusable logic into composables (functions prefixed with `use`). A composable returns reactive state and methods. Keep composables in a `composables/` directory and each in its own file.
28
+
29
+ Composables must be called at the top level of `setup()` or `<script setup>`, never inside conditionals or loops.
30
+
31
+ ## Component Communication
32
+
33
+ Props down, events up. Use `defineProps()` and `defineEmits()` in `<script setup>`. For deeply nested communication, use `provide/inject` rather than prop drilling.
34
+
35
+ Never mutate props directly. If a child needs to modify parent data, emit an event.
36
+
37
+ ## Performance
38
+
39
+ Use `v-show` instead of `v-if` for elements that toggle frequently -- `v-show` keeps the DOM node and just toggles CSS display. Use `v-if` for conditional blocks that rarely change.
40
+
41
+ Add `key` attributes on `v-for` lists using stable unique identifiers, never indices for dynamic lists.
42
+
43
+ Lazy-load route components with dynamic imports: `() => import('./views/Heavy.vue')`.
44
+
45
+ ## Template Discipline
46
+
47
+ Keep templates declarative. Complex logic belongs in computed properties, not inline expressions. If a template expression has more than one ternary or logical operator, extract it to a computed.
48
+
49
+ Use scoped styles (`<style scoped>`) to prevent CSS leaking between components. Use `:deep()` only when you genuinely need to style child component internals.
@@ -1,79 +1,61 @@
1
- # QUEEN.md Colony Wisdom
1
+ # QUEEN.md -- Colony Wisdom
2
2
 
3
3
  > Last evolved: {TIMESTAMP}
4
- > Colonies contributed: 0
5
- > Wisdom version: 1.0.0
4
+ > Wisdom version: 2.0.0
6
5
 
7
6
  ---
8
7
 
9
- ## 📜 Philosophies
8
+ ## User Preferences
10
9
 
11
- Core beliefs that guide all colony work. These are validated through repeated successful application across multiple colonies.
10
+ Communication style, expertise level, and decision-making patterns observed from the user (the Queen). These shape how the colony communicates and what it prioritizes. User decisions are the most important wisdom.
12
11
 
13
- *No philosophies recorded yet. Philosophies are promoted from PHILOSOPHY pheromones after 5+ validations.*
12
+ *No user preferences recorded yet.*
14
13
 
15
14
  ---
16
15
 
17
- ## 🧭 Patterns
16
+ ## Codebase Patterns
18
17
 
19
- Validated approaches that consistently work. These represent discovered best practices that have proven themselves in the field.
18
+ Validated approaches that work in this codebase, and anti-patterns to avoid. Includes architecture conventions, naming patterns, error handling style, and technology-specific insights. Tagged [repo] for project-specific or [general] for cross-colony patterns.
20
19
 
21
- *No patterns recorded yet. Patterns are promoted from PATTERN pheromones after 3+ validations.*
20
+ *No codebase patterns recorded yet.*
22
21
 
23
22
  ---
24
23
 
25
- ## ⚠️ Redirects
24
+ ## Build Learnings
26
25
 
27
- Anti-patterns to avoid. These represent approaches that have caused problems and should be redirected away from.
26
+ What worked and what failed during builds. Captures the full picture of colony experience -- successes, failures, and adjustments. Each entry includes the phase where it was learned.
28
27
 
29
- *No redirects recorded yet. Redirects are promoted from REDIRECT pheromones after 2+ triggers.*
28
+ *No build learnings recorded yet.*
30
29
 
31
30
  ---
32
31
 
33
- ## 🔧 Stack Wisdom
32
+ ## Instincts
34
33
 
35
- Technology-specific insights and constraints detected through codebase analysis.
34
+ High-confidence behavioral patterns that have been validated through repeated colony work. Auto-promoted when confidence reaches 0.8 or higher. These represent the colony's deepest learned behaviors.
36
35
 
37
- *No stack wisdom recorded yet. Stack wisdom is auto-populated by `/ant:colonize`.*
36
+ *No instincts recorded yet.*
38
37
 
39
38
  ---
40
39
 
41
- ## 🏛️ Decrees
40
+ ## Evolution Log
42
41
 
43
- User-mandated rules that override other guidance. These represent explicit directives from the Queen.
44
-
45
- *No decrees recorded yet. Decrees are added via `/ant:decree "<rule>"`.*
46
-
47
- ---
48
-
49
- ## 📊 Evolution Log
50
-
51
- Track how wisdom has evolved over time.
52
-
53
- | Date | Colony | Change | Details |
54
- |------|--------|--------|---------|
42
+ | Date | Source | Type | Details |
43
+ |------|--------|------|---------|
55
44
  | {TIMESTAMP} | system | initialized | QUEEN.md created from template |
56
45
 
57
46
  ---
58
47
 
59
48
  <!-- METADATA
60
49
  {
61
- "version": "1.0.0",
50
+ "version": "2.0.0",
51
+ "wisdom_version": "2.0",
62
52
  "last_evolved": "{TIMESTAMP}",
63
53
  "colonies_contributed": [],
64
- "promotion_thresholds": {
65
- "philosophy": 5,
66
- "pattern": 3,
67
- "redirect": 2,
68
- "stack": 1,
69
- "decree": 0
70
- },
71
54
  "stats": {
72
- "total_philosophies": 0,
73
- "total_patterns": 0,
74
- "total_redirects": 0,
75
- "total_stack_entries": 0,
76
- "total_decrees": 0
55
+ "total_user_prefs": 0,
56
+ "total_codebase_patterns": 0,
57
+ "total_build_learnings": 0,
58
+ "total_instincts": 0
77
59
  }
78
60
  }
79
61
  -->
@@ -3,6 +3,7 @@
3
3
  # Version: 1.0
4
4
 
5
5
  .goal = null |
6
+ .colony_version = 0 |
6
7
  .state = "IDLE" |
7
8
  .current_phase = 0 |
8
9
  .plan.phases = [] |
@@ -3,11 +3,15 @@
3
3
  "_version": "3.0",
4
4
  "_instructions": "Write this file to .aether/data/COLONY_STATE.json. Replace every __PLACEHOLDER__ value with real data (see _comment_* fields for details). After filling all placeholders, remove every key whose name starts with underscore (_template, _version, _instructions, and all _comment_*) before writing the final file.",
5
5
  "_comment_goal": "Replace __GOAL__ with the user's goal string exactly as provided to /ant:init.",
6
+ "_comment_colony_name": "Set during first charter-write. Human-readable name derived from repo directory or package.json.",
7
+ "_comment_colony_version": "Integer counter incremented each time the colony is sealed. Starts at 1 on colony initialization. Reset to 0 on entomb (ready for next colony). Tracks how many times this colony has been sealed.",
6
8
  "_comment_session": "Replace __SESSION_ID__ with a generated ID in the format: session_{unix_timestamp}_{random}. Replace __ISO8601_TIMESTAMP__ with the current UTC time in ISO-8601 format (e.g., 2026-02-20T00:00:00Z). The same timestamp value is used in both 'initialized_at' and the events array entry.",
7
9
  "_comment_memory": "Replace __PHASE_LEARNINGS__ with a JSON array (e.g., [] if no prior colony found, or [{...}, ...] if inherited from completion-report.md). Replace __INSTINCTS__ with a JSON array (e.g., [] or [{...}, ...]). IMPORTANT: both must be JSON arrays, not strings — write [] not \"[]\".",
8
10
  "_comment_events": "The events array records colony lifecycle events. Each entry is a pipe-delimited string: 'ISO8601_TIMESTAMP|event_type|source|description'. The initialization event uses the same __ISO8601_TIMESTAMP__ as 'initialized_at'. Do not add extra events during init — the single initialization entry is correct.",
9
11
  "version": "3.0",
10
12
  "goal": "__GOAL__",
13
+ "colony_name": null,
14
+ "colony_version": 1,
11
15
  "state": "READY",
12
16
  "current_phase": 0,
13
17
  "session_id": "__SESSION_ID__",