geneseed 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/CHANGELOG.md +938 -0
  2. package/DESIGN.md +1423 -0
  3. package/LICENSE +21 -0
  4. package/QUICKSTART.md +48 -0
  5. package/README.md +336 -0
  6. package/SETUP.md +1027 -0
  7. package/SHIPPED.md +70 -0
  8. package/adapters/bob/README.md +100 -0
  9. package/adapters/claude-code/README.md +101 -0
  10. package/adapters/claude-code/settings.json +47 -0
  11. package/adapters/claude-code/skills/geneseed/SKILL.md +72 -0
  12. package/adapters/copilot/README.md +76 -0
  13. package/adapters/opencode/GLOBAL-HARNESS-SPEC.md +434 -0
  14. package/adapters/opencode/HOW-OPENCODE-LOADS.md +158 -0
  15. package/adapters/opencode/README.md +582 -0
  16. package/adapters/opencode/agents/orchestrator.md +25 -0
  17. package/adapters/opencode/opencode.json +44 -0
  18. package/adapters/opencode/plugins/geneseed-activity.js +430 -0
  19. package/adapters/opencode/plugins/geneseed-context.js +876 -0
  20. package/adapters/opencode/plugins/geneseed-guard.js +290 -0
  21. package/adapters/opencode/plugins/geneseed-learn.js +396 -0
  22. package/adapters/opencode/plugins/geneseed-notify.js +142 -0
  23. package/adapters/opencode/plugins/geneseed-ponytail.js +148 -0
  24. package/adapters/opencode/plugins/geneseed-workflow.js +183 -0
  25. package/adapters/opencode/workflows/_runtime.js +277 -0
  26. package/adapters/opencode/workflows/council.js +64 -0
  27. package/adapters/opencode/workflows/dispatch.js +89 -0
  28. package/adapters/opencode/workflows/research-plan-implement.js +43 -0
  29. package/adapters/opencode/workflows/review.js +57 -0
  30. package/bin/geneseed-cli.mjs +412 -0
  31. package/bin/geneseed-hook.mjs +129 -0
  32. package/bin/geneseed.mjs +1086 -0
  33. package/docs/declined.md +149 -0
  34. package/docs/limits.md +270 -0
  35. package/docs/opencode-plugin-setup.md +64 -0
  36. package/docs/token-footprint.md +68 -0
  37. package/docs/web/_groups.json +45 -0
  38. package/docs/web/about.md +6 -0
  39. package/docs/web/adapters-claude-code.md +8 -0
  40. package/docs/web/adapters-opencode-loads.md +8 -0
  41. package/docs/web/adapters-opencode-spec.md +8 -0
  42. package/docs/web/adapters-opencode.md +8 -0
  43. package/docs/web/agents.md +8 -0
  44. package/docs/web/authoring.md +11 -0
  45. package/docs/web/autostart.md +9 -0
  46. package/docs/web/claude-hooks.md +36 -0
  47. package/docs/web/cli.md +6 -0
  48. package/docs/web/collaboration.md +27 -0
  49. package/docs/web/configure-wiki.md +9 -0
  50. package/docs/web/design.md +7 -0
  51. package/docs/web/env-knobs.md +9 -0
  52. package/docs/web/exclusions.md +26 -0
  53. package/docs/web/first-session.md +28 -0
  54. package/docs/web/footprint.md +31 -0
  55. package/docs/web/foreman-mode.md +33 -0
  56. package/docs/web/glossary.md +6 -0
  57. package/docs/web/harnesses.md +28 -0
  58. package/docs/web/headless.md +9 -0
  59. package/docs/web/ingest-docs.md +9 -0
  60. package/docs/web/install-paths.md +9 -0
  61. package/docs/web/install-quick.md +35 -0
  62. package/docs/web/lsp-overview.md +37 -0
  63. package/docs/web/mcp-claude-code.md +10 -0
  64. package/docs/web/mcp-filesystem.md +9 -0
  65. package/docs/web/mcp-gitlab.md +9 -0
  66. package/docs/web/mcp-markitdown.md +9 -0
  67. package/docs/web/mcp-overview.md +34 -0
  68. package/docs/web/mcp-trouble.md +9 -0
  69. package/docs/web/mcp-verify.md +9 -0
  70. package/docs/web/memory.md +7 -0
  71. package/docs/web/migrate.md +39 -0
  72. package/docs/web/model.md +20 -0
  73. package/docs/web/notebook.md +7 -0
  74. package/docs/web/pipelines.md +24 -0
  75. package/docs/web/plugin-activity.md +23 -0
  76. package/docs/web/plugin-context.md +26 -0
  77. package/docs/web/plugin-guard.md +24 -0
  78. package/docs/web/plugin-learn.md +27 -0
  79. package/docs/web/plugin-notify.md +24 -0
  80. package/docs/web/plugin-ponytail.md +23 -0
  81. package/docs/web/plugin-setup.md +7 -0
  82. package/docs/web/plugin-workflow.md +24 -0
  83. package/docs/web/plugins.md +17 -0
  84. package/docs/web/project-context.md +9 -0
  85. package/docs/web/rules.md +8 -0
  86. package/docs/web/run-anywhere.md +9 -0
  87. package/docs/web/self-improve.md +8 -0
  88. package/docs/web/setup-choices.md +39 -0
  89. package/docs/web/skills.md +8 -0
  90. package/docs/web/themes-author.md +8 -0
  91. package/docs/web/themes.md +9 -0
  92. package/docs/web/token-footprint.md +7 -0
  93. package/docs/web/trouble.md +38 -0
  94. package/docs/web/upgrade.md +9 -0
  95. package/docs/web/verify.md +30 -0
  96. package/docs/web/wiki.md +7 -0
  97. package/docs/web/worktree.md +10 -0
  98. package/docs/web-ui.md +144 -0
  99. package/docs/wiki.md +43 -0
  100. package/geneseed +39 -0
  101. package/geneseed.cmd +34 -0
  102. package/harness.config.json +6 -0
  103. package/js/anim.mjs +326 -0
  104. package/js/catalog.mjs +112 -0
  105. package/js/checkout.mjs +88 -0
  106. package/js/cli-table.json +1034 -0
  107. package/js/cli.mjs +498 -0
  108. package/js/diff.mjs +384 -0
  109. package/js/doctor.mjs +1364 -0
  110. package/js/emit.mjs +1373 -0
  111. package/js/excludes.mjs +271 -0
  112. package/js/generate.mjs +379 -0
  113. package/js/hooks.mjs +1026 -0
  114. package/js/hosts.mjs +253 -0
  115. package/js/installs.mjs +378 -0
  116. package/js/inventory.mjs +175 -0
  117. package/js/lib/fs.mjs +913 -0
  118. package/js/lib/proc.mjs +28 -0
  119. package/js/lib/udiff.mjs +275 -0
  120. package/js/link.mjs +286 -0
  121. package/js/mcp.mjs +335 -0
  122. package/js/memory.mjs +108 -0
  123. package/js/menu.mjs +118 -0
  124. package/js/migrate.mjs +251 -0
  125. package/js/native.mjs +426 -0
  126. package/js/opencode.mjs +325 -0
  127. package/js/registry.mjs +110 -0
  128. package/js/render.mjs +282 -0
  129. package/js/settings.mjs +924 -0
  130. package/js/setup.mjs +492 -0
  131. package/js/status.mjs +281 -0
  132. package/js/themes.mjs +195 -0
  133. package/js/tui.mjs +444 -0
  134. package/js/uninstall.mjs +1137 -0
  135. package/js/update.mjs +910 -0
  136. package/js/web/actions.mjs +868 -0
  137. package/js/web/activity.mjs +284 -0
  138. package/js/web/api.mjs +873 -0
  139. package/js/web/docs.mjs +531 -0
  140. package/js/web/graph.mjs +0 -0
  141. package/js/web/jobs.mjs +480 -0
  142. package/js/web/server.mjs +1135 -0
  143. package/package.json +54 -0
  144. package/registry.json +474 -0
  145. package/src/AGENT.md.tmpl +390 -0
  146. package/src/agents/_template.md +76 -0
  147. package/src/agents/advocate.md +36 -0
  148. package/src/agents/architect.md +55 -0
  149. package/src/agents/developer.md +66 -0
  150. package/src/agents/docs.md +54 -0
  151. package/src/agents/empiricist.md +39 -0
  152. package/src/agents/explorer.md +54 -0
  153. package/src/agents/framer.md +36 -0
  154. package/src/agents/historian.md +51 -0
  155. package/src/agents/operator.md +37 -0
  156. package/src/agents/pragmatist.md +37 -0
  157. package/src/agents/reviewer.md +52 -0
  158. package/src/agents/security.md +57 -0
  159. package/src/agents/skeptic.md +48 -0
  160. package/src/agents/steward.md +36 -0
  161. package/src/agents/tester.md +54 -0
  162. package/src/agents/user-advocate.md +36 -0
  163. package/src/agents/visionary.md +36 -0
  164. package/src/laws/universal.md +387 -0
  165. package/src/memory/README.md +109 -0
  166. package/src/memory/gitignore +6 -0
  167. package/src/modes/README.md +26 -0
  168. package/src/modes/direct.md +2 -0
  169. package/src/modes/foreman.md +19 -0
  170. package/src/notebook/README.md +39 -0
  171. package/src/notebook/gitignore +7 -0
  172. package/src/postures/README.md +31 -0
  173. package/src/postures/artisan.md +14 -0
  174. package/src/postures/assistant.md +12 -0
  175. package/src/postures/expert.md +11 -0
  176. package/src/postures/mentor.md +11 -0
  177. package/src/postures/peer.md +12 -0
  178. package/src/skills/_template.md +47 -0
  179. package/src/skills/brainstorm.md +28 -0
  180. package/src/skills/clarify.md +28 -0
  181. package/src/skills/codebase-design.md +44 -0
  182. package/src/skills/commit.md +48 -0
  183. package/src/skills/council.md +34 -0
  184. package/src/skills/crash-course.md +28 -0
  185. package/src/skills/daydream/.claude-plugin/plugin.json +9 -0
  186. package/src/skills/daydream/SKILL.md +74 -0
  187. package/src/skills/daydream/VENDOR.md +25 -0
  188. package/src/skills/daydream/critic-prompt.md +38 -0
  189. package/src/skills/daydream/instructions.md +422 -0
  190. package/src/skills/daydream/synthesizer-prompt.md +41 -0
  191. package/src/skills/debug.md +37 -0
  192. package/src/skills/decode.md +28 -0
  193. package/src/skills/develop.md +29 -0
  194. package/src/skills/document-project.md +79 -0
  195. package/src/skills/domain-modeling.md +38 -0
  196. package/src/skills/drill.md +28 -0
  197. package/src/skills/feynman.md +26 -0
  198. package/src/skills/forge-mcp.md +48 -0
  199. package/src/skills/fresh-eyes.md +29 -0
  200. package/src/skills/frontend-design.md +58 -0
  201. package/src/skills/gap-detector.md +27 -0
  202. package/src/skills/geneseed-code-review.md +33 -0
  203. package/src/skills/geneseed.md +29 -0
  204. package/src/skills/git-archaeology.md +47 -0
  205. package/src/skills/git-rescue.md +68 -0
  206. package/src/skills/handoff.md +29 -0
  207. package/src/skills/herdr.md +164 -0
  208. package/src/skills/ingest.md +49 -0
  209. package/src/skills/learning-path.md +26 -0
  210. package/src/skills/migrate.md +45 -0
  211. package/src/skills/opencode-theme.md +52 -0
  212. package/src/skills/parallel-agents.md +28 -0
  213. package/src/skills/pipeline.md +52 -0
  214. package/src/skills/plan.md +45 -0
  215. package/src/skills/ponytail.md +29 -0
  216. package/src/skills/profile.md +58 -0
  217. package/src/skills/prose.md +42 -0
  218. package/src/skills/prototype.md +44 -0
  219. package/src/skills/react-view-transitions/AGENTS.md +955 -0
  220. package/src/skills/react-view-transitions/README.md +42 -0
  221. package/src/skills/react-view-transitions/SKILL.md +320 -0
  222. package/src/skills/react-view-transitions/VENDOR.md +16 -0
  223. package/src/skills/react-view-transitions/metadata.json +12 -0
  224. package/src/skills/react-view-transitions/references/css-recipes.md +242 -0
  225. package/src/skills/react-view-transitions/references/implementation.md +182 -0
  226. package/src/skills/react-view-transitions/references/nextjs.md +176 -0
  227. package/src/skills/react-view-transitions/references/patterns.md +262 -0
  228. package/src/skills/refactor.md +32 -0
  229. package/src/skills/release.md +43 -0
  230. package/src/skills/repo-map.md +36 -0
  231. package/src/skills/research.md +42 -0
  232. package/src/skills/review-response.md +36 -0
  233. package/src/skills/roast-me.md +28 -0
  234. package/src/skills/rule.md +100 -0
  235. package/src/skills/ship.md +49 -0
  236. package/src/skills/tdd.md +31 -0
  237. package/src/skills/tickets.md +44 -0
  238. package/src/skills/token-report/SKILL.md +76 -0
  239. package/src/skills/token-report/VENDOR.md +23 -0
  240. package/src/skills/token-report/scripts/token_report.mjs +1301 -0
  241. package/src/skills/wayfinder.md +49 -0
  242. package/src/skills/wiki.md +68 -0
  243. package/src/skills/workflow.md +38 -0
  244. package/themes/README.md +69 -0
  245. package/themes/_TEMPLATE.json +147 -0
  246. package/themes/biker.json +147 -0
  247. package/themes/commentator.json +147 -0
  248. package/themes/cyberpunk.json +147 -0
  249. package/themes/gamer.json +147 -0
  250. package/themes/imperial.json +147 -0
  251. package/themes/joker.json +147 -0
  252. package/themes/marvin.json +147 -0
  253. package/themes/mean.json +147 -0
  254. package/themes/military.json +147 -0
  255. package/themes/neutral.json +147 -0
  256. package/themes/opencode/README.md +58 -0
  257. package/themes/opencode/catppuccin.json +27 -0
  258. package/themes/opencode/dracula.json +27 -0
  259. package/themes/opencode/everforest.json +27 -0
  260. package/themes/opencode/gruvbox.json +27 -0
  261. package/themes/opencode/kanagawa.json +27 -0
  262. package/themes/opencode/neon.json +27 -0
  263. package/themes/opencode/nord.json +27 -0
  264. package/themes/opencode/rosepine.json +27 -0
  265. package/themes/opencode/tokyonight.json +27 -0
  266. package/themes/pirate.json +147 -0
  267. package/themes/sports.json +147 -0
  268. package/themes/verstappen.json +147 -0
  269. package/themes/wizard.json +147 -0
  270. package/web/dist/assets/About-DX1-VTBP.js +1 -0
  271. package/web/dist/assets/Activity-Dp9NaXOn.js +1 -0
  272. package/web/dist/assets/ActivityDetail-HpOBtrXS.js +1 -0
  273. package/web/dist/assets/Diff-Ct4G3Se8.js +5 -0
  274. package/web/dist/assets/Doctor-DGjkZFuA.js +1 -0
  275. package/web/dist/assets/Graph-b8o-S6kv.js +1 -0
  276. package/web/dist/assets/Harnesses-gr3-aHBF.js +1 -0
  277. package/web/dist/assets/Laws-DTwF5tTC.js +1 -0
  278. package/web/dist/assets/Library-BEZscyaQ.js +1 -0
  279. package/web/dist/assets/Markdown-k_LSLBGq.js +1 -0
  280. package/web/dist/assets/Profile-DydukTxP.js +1 -0
  281. package/web/dist/assets/Rules-CIRG4Ldt.js +1 -0
  282. package/web/dist/assets/Skills-Buoi1IBr.js +1 -0
  283. package/web/dist/assets/StatusBadge-CE_AJttl.js +1 -0
  284. package/web/dist/assets/Themes-CI4o3gJC.js +2 -0
  285. package/web/dist/assets/activity-BCW7e6Cy.js +1 -0
  286. package/web/dist/assets/audiowide-latin-400-normal-6GFCX7ni.woff2 +0 -0
  287. package/web/dist/assets/geist-mono-latin-400-normal-DKaoCDn5.woff2 +0 -0
  288. package/web/dist/assets/geist-mono-latin-500-normal-C3sF8Y1B.woff2 +0 -0
  289. package/web/dist/assets/geist-mono-latin-600-normal-BHzjB6_C.woff2 +0 -0
  290. package/web/dist/assets/hanken-grotesk-latin-400-italic-Bserb8X5.woff2 +0 -0
  291. package/web/dist/assets/hanken-grotesk-latin-400-normal-BG6hkEXj.woff2 +0 -0
  292. package/web/dist/assets/hanken-grotesk-latin-500-italic-BGfwwhek.woff2 +0 -0
  293. package/web/dist/assets/hanken-grotesk-latin-500-normal-DrDcrrxK.woff2 +0 -0
  294. package/web/dist/assets/hanken-grotesk-latin-600-normal-CIXX6EOa.woff2 +0 -0
  295. package/web/dist/assets/hanken-grotesk-latin-700-normal-CeQ8H3UY.woff2 +0 -0
  296. package/web/dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  297. package/web/dist/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  298. package/web/dist/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
  299. package/web/dist/assets/ibm-plex-serif-latin-400-normal-BIGslYFI.woff2 +0 -0
  300. package/web/dist/assets/ibm-plex-serif-latin-500-normal-REKAfBVG.woff2 +0 -0
  301. package/web/dist/assets/ibm-plex-serif-latin-600-normal-DAxitmSu.woff2 +0 -0
  302. package/web/dist/assets/index-B1PIx7RM.js +1 -0
  303. package/web/dist/assets/index-BnTQUSUz.js +12 -0
  304. package/web/dist/assets/index-Ck2iCdaC.js +2 -0
  305. package/web/dist/assets/index-DUCsDv7z.css +1 -0
  306. package/web/dist/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
  307. package/web/dist/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
  308. package/web/dist/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
  309. package/web/dist/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
  310. package/web/dist/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  311. package/web/dist/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  312. package/web/dist/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
  313. package/web/dist/assets/marked.esm-JKvyS0Pp.js +46 -0
  314. package/web/dist/assets/oswald-latin-400-normal-BAFo8sP8.woff2 +0 -0
  315. package/web/dist/assets/oswald-latin-500-normal-B-eyT0Dw.woff2 +0 -0
  316. package/web/dist/assets/oswald-latin-600-normal-plFmSr5g.woff2 +0 -0
  317. package/web/dist/assets/oswald-latin-700-normal-vy6hmKSr.woff2 +0 -0
  318. package/web/dist/assets/poppins-latin-400-normal-cpxAROuN.woff2 +0 -0
  319. package/web/dist/assets/poppins-latin-500-normal-C8OXljZJ.woff2 +0 -0
  320. package/web/dist/assets/poppins-latin-600-normal-zEkxB9Mr.woff2 +0 -0
  321. package/web/dist/assets/poppins-latin-700-normal-Qrb0O0WB.woff2 +0 -0
  322. package/web/dist/assets/react-DOpiTn5v.js +32 -0
  323. package/web/dist/assets/roman-DkYN0LX9.js +1 -0
  324. package/web/dist/assets/space-grotesk-latin-400-normal-CJ-V5oYT.woff2 +0 -0
  325. package/web/dist/assets/space-grotesk-latin-500-normal-lFbtlQH6.woff2 +0 -0
  326. package/web/dist/assets/space-grotesk-latin-600-normal-DjKNqYRj.woff2 +0 -0
  327. package/web/dist/assets/space-grotesk-latin-700-normal-RjhwGPKo.woff2 +0 -0
  328. package/web/dist/assets/space-mono-latin-400-italic-YylcN9Ay.woff2 +0 -0
  329. package/web/dist/assets/space-mono-latin-400-normal-Rg4St2Dn.woff2 +0 -0
  330. package/web/dist/assets/space-mono-latin-700-italic-vNvENeTh.woff2 +0 -0
  331. package/web/dist/assets/space-mono-latin-700-normal-mWgeinG7.woff2 +0 -0
  332. package/web/dist/icon-maskable.svg +10 -0
  333. package/web/dist/icon.svg +8 -0
  334. package/web/dist/index.html +21 -0
  335. package/web/dist/manifest.webmanifest +14 -0
  336. package/web/dist/sw.js +40 -0
  337. package/web/src/pages/Laws.jsx +230 -0
@@ -0,0 +1,422 @@
1
+ # Vault Daydream — Implementation Instructions
2
+
3
+ You are running the Vault Daydream skill. Follow these steps precisely.
4
+
5
+ ## Step 0: Resolve Vault Root
6
+
7
+ Determine `VAULT_ROOT`:
8
+ 1. **Geneseed `wiki.jsonc` first.** Look for `wiki.jsonc` beside the harness `AGENT.md` (or at `$GENESEED_WIKI`). Strip `//` and `/* */` comments, parse it, and take the first `wikis[].path` whose root exists on disk — that is the vault. Prefer a declared vault whose `path` contains a `.obsidian/` folder; if several qualify, ask which to use. (This is Geneseed's machine-wide knowledge-base manifest — see AGENT.md's Wiki section.)
9
+ 2. Otherwise, check if the current working directory contains a `.obsidian/` folder. If yes, use it as `VAULT_ROOT`.
10
+ 3. If still unresolved, use `AskUserQuestion` to ask:
11
+ - Question: "Where is your Obsidian vault located?"
12
+ - Options: provide 2-3 likely paths if detectable (e.g., from `find ~ -maxdepth 3 -name ".obsidian" -type d 2>/dev/null | head -3`), plus an "Other" option for custom input.
13
+ 4. Store the resolved path as `VAULT_ROOT` for all subsequent steps.
14
+
15
+ ## Constants
16
+
17
+ ```
18
+ VAULT_ROOT = (resolved in Step 0)
19
+ DAYDREAMS_DIR = Daydreams
20
+ DIGESTS_DIR = Daydreams/digests
21
+ HISTORY_FILE = ai-research/daydream/history.json
22
+ DAILY_DIR = Daily
23
+ EXCLUDE_DIRS = .obsidian, templates, node_modules, Daydreams, .claude, .git
24
+ LOOKBACK_DAYS = 120
25
+ PAIR_COUNT = 50
26
+ BATCH_SIZE = 5
27
+ SCORE_THRESHOLD = 7.0
28
+ MAX_EXCERPT_WORDS = 500
29
+ ```
30
+
31
+ ---
32
+
33
+ ## Step 1: Scan Vault
34
+
35
+ ### 1a. Get today's date
36
+ ```bash
37
+ date +"%Y%m%d"
38
+ ```
39
+ Store as `TODAY` (e.g., `20260214`).
40
+
41
+ ### 1b. Find recent notes
42
+ Use Bash to list all .md files modified in the last 120 days, excluding certain directories:
43
+
44
+ ```bash
45
+ find $VAULT_ROOT -name "*.md" -type f -mtime -120 \
46
+ -not -path "*/.obsidian/*" \
47
+ -not -path "*/templates/*" \
48
+ -not -path "*/node_modules/*" \
49
+ -not -path "*/Daydreams/*" \
50
+ -not -path "*/.claude/*" \
51
+ -not -path "*/.git/*" \
52
+ -exec stat -f "%m %N" {} \; | sort -rn
53
+ ```
54
+
55
+ This returns lines like: `1707900000 /path/to/note.md`
56
+
57
+ Parse into a list of `{path, timestamp}` objects.
58
+
59
+ ### 1c. Load history for dedup
60
+ Read `ai-research/daydream/history.json` if it exists. This contains previously sampled pairs:
61
+ ```json
62
+ {
63
+ "sampled_pairs": [
64
+ {"a": "Note A.md", "b": "Note B.md", "date": "20260213"}
65
+ ]
66
+ }
67
+ ```
68
+ If file doesn't exist, treat as empty: `{"sampled_pairs": []}`.
69
+
70
+ ---
71
+
72
+ ## Step 2: Extract Excerpts
73
+
74
+ For each note found in Step 1 (up to 200 notes — if more, take the 200 most recent):
75
+
76
+ 1. **Read the file** using the Read tool
77
+ 2. **Strip YAML frontmatter**: Remove everything between the first `---` and the second `---` (inclusive)
78
+ 3. **Strip noise**: Remove code blocks (``` fenced blocks), raw URLs (http://...), wikilink brackets (keep the display text or link text), image embeds (![[...]]), HTML tags
79
+ 4. **Extract title**: Use the first `# ` heading, or the filename (without .md extension) if no heading
80
+ 5. **Take first 500 words** of the cleaned text
81
+ 6. **Compute days ago**: `(now_timestamp - file_timestamp) / 86400`
82
+
83
+ Store as array:
84
+ ```json
85
+ {
86
+ "path": "relative/path.md",
87
+ "title": "Note Title",
88
+ "excerpt": "First 500 words...",
89
+ "days_ago": 5
90
+ }
91
+ ```
92
+
93
+ **Important**: Do NOT read all 200 files sequentially. Read in parallel batches of 20 using the Read tool (call 20 Read tools in a single response).
94
+
95
+ ---
96
+
97
+ ## Step 3: Generate Weighted Random Pairs
98
+
99
+ ### 3a. Assign weights
100
+ For each note, assign a sampling weight based on recency:
101
+ - **days_ago <= 7**: weight = 3
102
+ - **days_ago <= 30**: weight = 2
103
+ - **days_ago > 30**: weight = 1
104
+
105
+ ### 3b. Weighted random sampling
106
+ Generate 50 unique pairs using weighted random sampling:
107
+
108
+ Use Bash with Node for the random sampling:
109
+ ```bash
110
+ node -e "
111
+ const notes = JSON.parse(require('fs').readFileSync(0, 'utf8'));
112
+ const historyPairs = new Set(); // populated from history.json, as 'pathA\0pathB'
113
+
114
+ // Build weighted pool
115
+ const pool = [];
116
+ notes.forEach((note, i) => {
117
+ const w = note.days_ago <= 7 ? 3 : (note.days_ago <= 30 ? 2 : 1);
118
+ for (let k = 0; k < w; k++) pool.push(i);
119
+ });
120
+
121
+ const draw = () => pool[Math.floor(Math.random() * pool.length)];
122
+ const pairs = new Map();
123
+ for (let attempts = 0; pairs.size < 50 && attempts < 500; attempts++) {
124
+ const a = draw(), b = draw();
125
+ if (a === b) continue;
126
+ const lo = Math.min(a, b), hi = Math.max(a, b);
127
+ if (pairs.has(lo + ',' + hi)) continue;
128
+ if (historyPairs.has(notes[lo].path + '\0' + notes[hi].path)) continue;
129
+ pairs.set(lo + ',' + hi, [lo, hi]);
130
+ }
131
+
132
+ const result = [...pairs.values()].map(([x, y]) => ({ a: notes[x], b: notes[y] }));
133
+ console.log(JSON.stringify(result));
134
+ " <<< 'NOTES_JSON_HERE'
135
+ ```
136
+
137
+ Replace `NOTES_JSON_HERE` with the actual JSON array from Step 2. Also incorporate history dedup by adding known pairs to `history_pairs`.
138
+
139
+ If fewer than 50 pairs generated, that's fine — proceed with whatever was generated.
140
+
141
+ ### 3c. Output
142
+ Store the pairs array. Each pair has:
143
+ ```json
144
+ {
145
+ "a": {"path": "...", "title": "...", "excerpt": "..."},
146
+ "b": {"path": "...", "title": "...", "excerpt": "..."}
147
+ }
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Step 4: Synthesize Connections (Parallel Task Agents)
153
+
154
+ ### 4a. Read synthesizer prompt
155
+ Read `synthesizer-prompt.md` from this skill's own folder to get the prompt template (in a deployed Geneseed bundle that is `skills/daydream/synthesizer-prompt.md`; an upstream Claude install uses `.claude/skills/daydream/synthesizer-prompt.md`).
156
+
157
+ ### 4b. Batch pairs
158
+ Split the pairs into batches of 5. This yields up to 10 batches.
159
+
160
+ ### 4c. Launch Task agents in parallel
161
+ For each batch, launch a Task agent with `model: sonnet`:
162
+
163
+ ```
164
+ Task(
165
+ subagent_type: "general-purpose",
166
+ model: "sonnet",
167
+ description: "Synthesize daydream batch N",
168
+ prompt: "You are processing a batch of note pairs for the Vault Daydream system.
169
+
170
+ For each pair below, find deep non-obvious connections. Return a JSON array of results.
171
+
172
+ [SYNTHESIZER PROMPT TEMPLATE — filled in for each pair]
173
+
174
+ Pair 1:
175
+ Note A: {title} --- {excerpt} ---
176
+ Note B: {title} --- {excerpt} ---
177
+
178
+ Pair 2:
179
+ ...
180
+
181
+ Pair 5:
182
+ ...
183
+
184
+ Return ONLY a valid JSON array with one object per pair:
185
+ [
186
+ {
187
+ \"connection\": \"...\",
188
+ \"synthesis\": \"...\",
189
+ \"implication\": \"...\",
190
+ \"suggested_title\": \"...\",
191
+ \"title_a\": \"...\",
192
+ \"title_b\": \"...\",
193
+ \"path_a\": \"...\",
194
+ \"path_b\": \"...\"
195
+ },
196
+ ...
197
+ ]
198
+
199
+ Do NOT wrap in markdown code fences. Return raw JSON only."
200
+ )
201
+ ```
202
+
203
+ **Launch up to 10 Task agents in a SINGLE message** (all in parallel). Each processes 5 pairs.
204
+
205
+ ### 4d. Collect results
206
+ Parse the JSON arrays returned by each Task agent. Combine into one flat array of synthesis results.
207
+
208
+ If a Task agent returns malformed JSON, skip that batch and note the error. Do not retry.
209
+
210
+ ---
211
+
212
+ ## Step 5: Critique and Score (Parallel Task Agents)
213
+
214
+ ### 5a. Read critic prompt
215
+ Read `critic-prompt.md` from this skill's own folder to get the prompt template (in a deployed Geneseed bundle that is `skills/daydream/critic-prompt.md`; an upstream Claude install uses `.claude/skills/daydream/critic-prompt.md`).
216
+
217
+ ### 5b. Batch synthesis results
218
+ Split synthesis results into batches of 5 (same pattern as Step 4).
219
+
220
+ ### 5c. Launch Task agents in parallel
221
+ For each batch, launch a Task agent with `model: haiku`:
222
+
223
+ ```
224
+ Task(
225
+ subagent_type: "general-purpose",
226
+ model: "haiku",
227
+ description: "Critique daydream batch N",
228
+ prompt: "You are scoring synthesized insights for the Vault Daydream system.
229
+
230
+ For each insight below, rate on Novelty, Coherence, and Usefulness (1-10 each).
231
+ Accept if average >= 7.0. Be genuinely critical.
232
+
233
+ Insight 1:
234
+ Source notes: \"{title_a}\" and \"{title_b}\"
235
+ Connection: {connection}
236
+ Synthesis: {synthesis}
237
+ Implication: {implication}
238
+
239
+ Insight 2:
240
+ ...
241
+
242
+ Return ONLY a valid JSON array with one object per insight:
243
+ [
244
+ {
245
+ \"novelty\": 8,
246
+ \"coherence\": 7,
247
+ \"usefulness\": 9,
248
+ \"average\": 8.0,
249
+ \"verdict\": \"accept\",
250
+ \"reason\": \"...\",
251
+ \"suggested_title\": \"...\",
252
+ \"title_a\": \"...\",
253
+ \"title_b\": \"...\"
254
+ },
255
+ ...
256
+ ]
257
+
258
+ Include suggested_title, title_a, title_b from the input for tracking.
259
+ Do NOT wrap in markdown code fences. Return raw JSON only."
260
+ )
261
+ ```
262
+
263
+ **Launch up to 10 Task agents in a SINGLE message** (all in parallel).
264
+
265
+ ### 5d. Filter results
266
+ Combine all critic responses. Merge each critic score with its corresponding synthesis result. Keep only entries where `verdict == "accept"` AND `average >= 7.0`.
267
+
268
+ ---
269
+
270
+ ## Step 6: Write Outputs
271
+
272
+ ### 6a. Create directories
273
+ ```bash
274
+ mkdir -p $VAULT_ROOT/Daydreams/digests
275
+ ```
276
+
277
+ ### 6b. Write individual insight notes
278
+ For each accepted insight, create a file:
279
+
280
+ **Filename**: `Daydreams/{TODAY}-{slug}.md`
281
+
282
+ Generate `slug` from `suggested_title`: lowercase, replace spaces with hyphens, remove special characters, max 50 chars.
283
+
284
+ **Content template**:
285
+ ```markdown
286
+ ---
287
+ created_date: '[[{TODAY}]]'
288
+ type: daydream
289
+ source_notes:
290
+ - '[[{title_a}]]'
291
+ - '[[{title_b}]]'
292
+ scores:
293
+ novelty: {novelty}
294
+ coherence: {coherence}
295
+ usefulness: {usefulness}
296
+ average: {average}
297
+ ---
298
+
299
+ # {suggested_title}
300
+
301
+ > Connection between [[{title_a}]] and [[{title_b}]]
302
+
303
+ {synthesis}
304
+
305
+ ## Implication
306
+
307
+ {implication}
308
+
309
+ ## Critic's Note
310
+
311
+ {reason}
312
+ ```
313
+
314
+ Write each file using the Write tool. If multiple insights, write them in parallel.
315
+
316
+ ### 6c. Write daily digest
317
+ **File**: `Daydreams/digests/{TODAY}-digest.md`
318
+
319
+ ```markdown
320
+ ---
321
+ type: daydream-digest
322
+ date: {TODAY}
323
+ pairs_sampled: {total_pairs}
324
+ insights_accepted: {accepted_count}
325
+ ---
326
+
327
+ # Daydream Digest -- {TODAY}
328
+
329
+ ## Stats
330
+ - Pairs sampled: {total_pairs}
331
+ - Insights generated: {total_synthesized}
332
+ - Accepted (avg >= 7.0): {accepted_count}
333
+ - Acceptance rate: {acceptance_rate}%
334
+
335
+ ## Top Insights
336
+
337
+ {For each accepted insight, sorted by average score descending:}
338
+
339
+ ### {rank}. {suggested_title} (avg: {average})
340
+ **Connecting**: [[{title_a}]] <-> [[{title_b}]]
341
+ {connection}
342
+
343
+ ```
344
+
345
+ ### 6d. Update daily note
346
+ Read `Daily/{TODAY}.md`. If it doesn't exist, create it from template first. Check if a `## Daydream` section already exists — if so, **replace** it entirely (to handle re-runs). If it doesn't exist, append it.
347
+
348
+ Content:
349
+ ```markdown
350
+ ## Daydream
351
+
352
+ Vault daydream found {accepted_count} insights from {total_pairs} pairs ({acceptance_rate}% acceptance).
353
+
354
+ Top connections:
355
+ {For each accepted insight, up to 5:}
356
+ - [[{TODAY}-{slug}|{suggested_title}]] (avg: {average}) -- [[{title_a}]] <-> [[{title_b}]]
357
+ ```
358
+
359
+ ---
360
+
361
+ ## Step 7: Log History
362
+
363
+ ### 7a. Update history.json
364
+ Read the existing `ai-research/daydream/history.json` (or start fresh if missing).
365
+
366
+ Add ALL sampled pairs (not just accepted ones) to the `sampled_pairs` array:
367
+ ```json
368
+ {
369
+ "sampled_pairs": [
370
+ ...existing...,
371
+ {"a": "path/to/note-a.md", "b": "path/to/note-b.md", "date": "{TODAY}"}
372
+ ],
373
+ "runs": [
374
+ ...existing...,
375
+ {
376
+ "date": "{TODAY}",
377
+ "pairs_sampled": {total_pairs},
378
+ "insights_accepted": {accepted_count},
379
+ "acceptance_rate": {acceptance_rate}
380
+ }
381
+ ]
382
+ }
383
+ ```
384
+
385
+ Write back to `ai-research/daydream/history.json`.
386
+
387
+ ---
388
+
389
+ ## Step 8: Summary
390
+
391
+ Output a concise summary to the user:
392
+
393
+ ```
394
+ Vault Daydream complete -- {TODAY}
395
+
396
+ {accepted_count}/{total_pairs} pairs produced insights (acceptance rate: {acceptance_rate}%)
397
+
398
+ Top insights:
399
+ 1. {title} (avg: {score}) -- {title_a} <-> {title_b}
400
+ 2. ...
401
+ 3. ...
402
+
403
+ Files: Daydreams/{TODAY}-*.md
404
+ Digest: Daydreams/digests/{TODAY}-digest.md
405
+ ```
406
+
407
+ ---
408
+
409
+ ## Error Handling
410
+
411
+ - **No notes found**: Tell user "No notes modified in last 120 days. Nothing to daydream about."
412
+ - **Fewer than 10 notes**: Warn user, proceed with fewer pairs (minimum 5 pairs if possible)
413
+ - **Task agent returns bad JSON**: Skip that batch, log the error, continue with other batches
414
+ - **All insights rejected**: Write digest with 0 accepted, tell user "All insights scored below threshold -- the vault might need more diverse content, or try again tomorrow."
415
+ - **History file corrupt**: Start fresh, warn user
416
+
417
+ ## Performance Notes
418
+
419
+ - Reading 200 files: batch into groups of 20 parallel Read calls
420
+ - 10 synthesis Task agents run in parallel (single message)
421
+ - 10 critic Task agents run in parallel (single message)
422
+ - Total: ~3-4 tool-call rounds for the heavy lifting
@@ -0,0 +1,41 @@
1
+ # Synthesizer Prompt
2
+
3
+ Used by Task sub-agents (model: sonnet) to find connections between note pairs.
4
+
5
+ ---
6
+
7
+ You are a creative synthesizer exploring an Obsidian knowledge vault.
8
+ Your task is to find deep, non-obvious, and potentially groundbreaking
9
+ connections between two notes.
10
+
11
+ Do NOT state the obvious. Generate insights that the note author
12
+ would find surprising and valuable.
13
+
14
+ Note A: {title_a}
15
+ ---
16
+ {excerpt_a}
17
+ ---
18
+
19
+ Note B: {title_b}
20
+ ---
21
+ {excerpt_b}
22
+ ---
23
+
24
+ Explore these dimensions:
25
+ 1. Are these concepts analogous in some abstract way?
26
+ 2. Could one concept be a metaphor for the other?
27
+ 3. Do they represent a similar problem/solution in different domains?
28
+ 4. Could they be combined to create a new idea?
29
+ 5. What revealing contradiction or tension exists between them?
30
+
31
+ Respond with ONLY a JSON object (no markdown fences):
32
+ {
33
+ "connection": "A 1-sentence description of the non-obvious link",
34
+ "synthesis": "2-3 paragraphs exploring the connection in depth",
35
+ "implication": "What new question, project, or insight does this suggest?",
36
+ "suggested_title": "A compelling title for this insight note",
37
+ "title_a": "{title_a}",
38
+ "title_b": "{title_b}",
39
+ "path_a": "{path_a}",
40
+ "path_b": "{path_b}"
41
+ }
@@ -0,0 +1,37 @@
1
+ # {{SKILL}}: debug
2
+
3
+ > {{DESC_DEBUG}}
4
+
5
+ **Trigger:** a bug, test failure, crash, or behaviour that doesn't match expectation — before proposing a fix.
6
+
7
+ **No fix without a root cause.** A change you cannot tie to a cause you understand is
8
+ a guess — and a guess that happens to pass is worse than a failure, because it hides.
9
+ The pressure to skip straight to a patch is highest exactly when this rule matters most
10
+ (an emergency, an "obvious" one-liner, a fix that already failed once). Systematic is
11
+ faster than thrashing; do not trade it away under pressure.
12
+
13
+ ## Procedure
14
+ 1. Reproduce it first: find the smallest input or command that triggers the failure reliably. If you can't reproduce it, gather evidence (logs, stack trace, recent diff) until you can. Read the error and stack trace in full — they often name the cause outright.
15
+ 2. Isolate: binary-search the cause — narrow the input, the code path, or (for a regression) the commit range with `git bisect` (the [git-archaeology {{SKILL}}](git-archaeology.md) carries the full method). Change one variable at a time. In a multi-layer system (CI → build → sign, API → service → DB), instrument each boundary once to see *which* layer breaks before investigating inside it.
16
+ 3. State one hypothesis that explains ALL the evidence before touching code. If you can't, you don't yet understand the failure — gather more evidence, don't guess.
17
+ 4. Apply the smallest fix that addresses the root cause, not the symptom; resist fixing things the evidence doesn't implicate ({{LAW}} II). One change at a time — no bundled "while I'm here" edits, or you can't tell what worked.
18
+ 5. Verify: run the project's checks and read the actual output (universal {{LAW}} III) — the original reproduction now passes and nothing nearby broke. Where a test can pin the bug, add a regression test that fails before the fix and passes after, so it can never silently return. Dispatch the [tester {{AGENT}}](../{{DIR_AGENTS}}/tester.md) for a focused regression check when the blast radius is unclear.
19
+ 6. If a fix doesn't work, return to step 1 with what you learned — don't stack a second fix on top. **After three failed fixes, stop fixing:** when each attempt only shifts the symptom elsewhere, the architecture, not the line, is likely wrong. Surface that to the user and decide the approach together before trying again ({{LAW}} II).
20
+
21
+ **Diagnostic logging is scaffolding.** When you add logging to isolate a bug, use the project's real logger at a DEBUG level rather than scattered `print`/`console.log`, prefer correlation IDs over loose object dumps, and **never log secrets, tokens, or PII** ({{LAW}} I). Treat every temporary log as disposable: remove or downgrade each `print`/`console.log`/`debugger` before the change ships ({{LAW}} XXIV) — leftover debug noise in a diff is a defect, not a free comment.
22
+
23
+ ## Done when
24
+ - The failure is reproduced, root-caused, fixed at the cause, and the reproduction passes with no new breakage.
25
+
26
+ ## Self-improvement
27
+
28
+ Close each run with one beat of reflection on the {{SKILL}} itself:
29
+ - A step misled, a needed step was missing, or the trigger fired wrongly — that
30
+ is a flaw in this file. Propose the exact edit (trigger, procedure, or
31
+ done-when) and apply it with the user's assent ({{LAW}} II).
32
+ - A lesson that is *not* a flaw in this file goes to {{MEMORY}} only if it
33
+ clears {{LAW}} VI's bar: it would change how a future session behaves, and a
34
+ fresh read of the repo would not re-derive it. Update an existing memory over
35
+ adding one; when in doubt, leave it out.
36
+ - No friction, nothing learned — move on; this loop earns no ceremony. Most
37
+ runs end here.
@@ -0,0 +1,28 @@
1
+ # {{SKILL}}: decode
2
+
3
+ > {{DESC_DECODE}}
4
+
5
+ **Trigger:** the user hands over content that confuses them and wants it to *click* — "this is confusing, help me understand it", "break this down for me", "explain this passage". For a from-zero overview of a whole skill use [crash-course](crash-course.md); for practising a concept until it is reflex use [drill](drill.md); to convert a PDF or web doc into readable form first use [ingest](ingest.md).
6
+
7
+ ## Procedure
8
+ 1. Read the content the user is stuck on. Before explaining anything, find the one sentence that, once understood, makes the rest fall into place.
9
+ 2. Explain only that sentence first — using an everyday analogy, with no technical terms.
10
+ 3. Confirm that landed, then let the rest of the content follow from it rather than re-explaining every line.
11
+ 4. Ask three questions that only someone who truly understood it could answer. Do not continue until they pass all three.
12
+ 5. If they miss one, return to the analogy and re-anchor before asking again — don't just give the answer.
13
+
14
+ ## Done when
15
+ - The user has the keystone idea in plain terms and has answered all three comprehension questions correctly.
16
+
17
+ ## Self-improvement
18
+
19
+ Close each run with one beat of reflection on the {{SKILL}} itself:
20
+ - A step misled, a needed step was missing, or the trigger fired wrongly — that
21
+ is a flaw in this file. Propose the exact edit (trigger, procedure, or
22
+ done-when) and apply it with the user's assent ({{LAW}} II).
23
+ - A lesson that is *not* a flaw in this file goes to {{MEMORY}} only if it
24
+ clears {{LAW}} VI's bar: it would change how a future session behaves, and a
25
+ fresh read of the repo would not re-derive it. Update an existing memory over
26
+ adding one; when in doubt, leave it out.
27
+ - No friction, nothing learned — move on; this loop earns no ceremony. Most
28
+ runs end here.
@@ -0,0 +1,29 @@
1
+ # {{SKILL}}: develop
2
+
3
+ > {{DESC_DEVELOP}}
4
+
5
+ **Trigger:** implementing a feature, fixing a bug, or changing code behaviour in a repo that has (or should have) a test suite.
6
+
7
+ ## Procedure
8
+ 1. Orient on the project's own documentation for what you are about to touch ({{LAW}} XVII).
9
+ 2. Make the smallest change that advances the task ({{LAW}} XXV).
10
+ 3. Cover the behaviour — test-first via the [tdd {{SKILL}}](tdd.md) where the target is known up front; otherwise write the covering test alongside the change ({{LAW}} XXXV).
11
+ 4. Run the *affected* tests and read the output ({{LAW}} III); on failure, fix the cause, do not mask it ({{LAW}} XXIV).
12
+ 5. Tidy the green code via the [refactor {{SKILL}}](refactor.md) — the tests are your safety net.
13
+ 6. Commit the green slice via the [commit {{SKILL}}](commit.md) ({{LAW}} XX). Loop one slice at a time; dispatch the [tester {{AGENT}}](../{{DIR_AGENTS}}/tester.md) for heavier or unfamiliar coverage.
14
+
15
+ ## Done when
16
+ - The behaviour changed is covered by tests written this session, the affected suite is green with its output shown, and each slice was committed.
17
+
18
+ ## Self-improvement
19
+
20
+ Close each run with one beat of reflection on the {{SKILL}} itself:
21
+ - A step misled, a needed step was missing, or the trigger fired wrongly — that
22
+ is a flaw in this file. Propose the exact edit (trigger, procedure, or
23
+ done-when) and apply it with the user's assent ({{LAW}} II).
24
+ - A lesson that is *not* a flaw in this file goes to {{MEMORY}} only if it
25
+ clears {{LAW}} VI's bar: it would change how a future session behaves, and a
26
+ fresh read of the repo would not re-derive it. Update an existing memory over
27
+ adding one; when in doubt, leave it out.
28
+ - No friction, nothing learned — move on; this loop earns no ceremony. Most
29
+ runs end here.
@@ -0,0 +1,79 @@
1
+ # {{SKILL}}: document-project
2
+
3
+ > {{DESC_DOCUMENT_PROJECT}}
4
+
5
+ **Trigger:** the project's own documentation is missing, or it has drifted from the
6
+ current code — and you want the markdown docs *and* a single visual overview brought back
7
+ into line with the implementation.
8
+
9
+ ## Procedure
10
+ 1. **Find the doc home.** Look for an existing `docs/`, `doc/`, `documentation/`, or
11
+ `wiki/` folder at the project root, or a `context.json` pointer to one (the same
12
+ convention [repo-map {{SKILL}}](repo-map.md) and the context loader use). Reuse the one
13
+ that exists — never create a second. If none exists, create `docs/` at the root.
14
+ 2. **Survey the code, not the intent.** Map entry points, the public API / modules,
15
+ commands, config, and key directories — read the actual behaviour (universal {{LAW}} III,
16
+ {{LAW}} XVII). If there is no `ARCHITECTURE.md`, run [repo-map {{SKILL}}](repo-map.md)
17
+ first so you have the orientation map to build on.
18
+ 3. **Reconcile the markdown (whole tree).** Check every existing page against the current
19
+ implementation — renamed or removed APIs, changed flags, dead examples — and fix the
20
+ drift. Add pages for significant undocumented surfaces; remove docs for features that no
21
+ longer exist (deletion is deliberate — {{LAW}} IV). For substantial writing, dispatch
22
+ the [docs {{AGENT}}](../{{DIR_AGENTS}}/docs.md). Keep examples runnable — run them.
23
+ Every generated page follows three conventions:
24
+ - **Typed frontmatter.** Open each page with YAML frontmatter carrying `type:` (one of
25
+ `overview`, `module`, `api`, `flow`, `how-to`), `mirrors-commit: <sha>`, and
26
+ `generated: <date>` — so drift is auditable per page, not only in the HTML footer. The
27
+ doc-home `index.md` is reserved and carries no frontmatter.
28
+ - **Fenced generated regions.** Wrap the auto-generated body between
29
+ `<!-- geneseed:doc:start -->` and `<!-- geneseed:doc:end -->` markers, and on re-runs
30
+ rewrite *only* inside them — hand-authored prose outside the markers is never touched
31
+ ({{LAW}} XV: edit the layer you own, never the reader's additions).
32
+ - **Diagrams as Mermaid, keyed by purpose.** In the markdown, render diagrams as fenced
33
+ `mermaid` code blocks — they render natively on GitHub, Obsidian, and VS Code with no
34
+ dependency. Pick the kind by what you are showing: sequence for runtime/request flows,
35
+ ER for data models, state for lifecycles, flowchart for control flow. Reserve
36
+ hand-authored inline SVG for the offline HTML hero only (step 5).
37
+ 4. **Keep an index.** Ensure the doc home has an index/README linking every page, current
38
+ with the set you just reconciled.
39
+ 5. **Regenerate the HTML overview** — one self-contained file at the doc home (e.g.
40
+ `docs/overview.html`), a visual parallel to the markdown. Overwrite the previous one,
41
+ but confirm it is the generated artifact before clobbering ({{LAW}} III, {{LAW}} IV). It
42
+ must:
43
+ - **Stand alone, fully offline** — a single file, content pre-rendered to semantic HTML,
44
+ all styling in one inline `<style>`, at most minimal vanilla JS (light/dark toggle, TOC
45
+ scroll). No CDN, no external assets, no web fonts (use a system-font stack). Render any
46
+ diagram as hand-authored inline SVG or CSS — never a CDN library.
47
+ - **Carry the digest** — hero (project name + one-line purpose), a quick-facts strip
48
+ (language, entry point, build/test/run, license), an architecture section (component
49
+ cards and an inline-SVG or CSS directory tree), and links out to the markdown docs for
50
+ depth.
51
+ - **Go deep on the hard parts** — identify the few subsystems that carry the project's
52
+ essential complexity (the core engine, the load-bearing algorithms, the non-obvious
53
+ control or data flow) and render *those* in depth: a plain-language explanation, the
54
+ key code excerpt(s) in a styled monospace block, and the flow as inline SVG. Leave
55
+ peripheral code at digest level.
56
+ - **Stay project-facing** — clean and professional styling, never the harness voice; and
57
+ footer it with `mirrors commit <sha> · generated <date>` so the sync is auditable.
58
+ 6. **Do not auto-publish.** Leave the changes for the user to review; stage and commit only
59
+ on consent, via the [commit {{SKILL}}](commit.md) (universal {{LAW}} XX).
60
+
61
+ ## Done when
62
+ - The doc home mirrors the current implementation: every markdown page carries typed
63
+ frontmatter, wraps its generated body in `geneseed:doc` markers, and is verified against
64
+ the code or flagged; examples run, Mermaid fences are well-formed, and the index links
65
+ them all; the single-file `overview.html` opens offline and shows both the digest and the
66
+ complex-core deep-dives; and any surface left undocumented is named explicitly.
67
+
68
+ ## Self-improvement
69
+
70
+ Close each run with one beat of reflection on the {{SKILL}} itself:
71
+ - A step misled, a needed step was missing, or the trigger fired wrongly — that
72
+ is a flaw in this file. Propose the exact edit (trigger, procedure, or
73
+ done-when) and apply it with the user's assent ({{LAW}} II).
74
+ - A lesson that is *not* a flaw in this file goes to {{MEMORY}} only if it
75
+ clears {{LAW}} VI's bar: it would change how a future session behaves, and a
76
+ fresh read of the repo would not re-derive it. Update an existing memory over
77
+ adding one; when in doubt, leave it out.
78
+ - No friction, nothing learned — move on; this loop earns no ceremony. Most
79
+ runs end here.
@@ -0,0 +1,38 @@
1
+ # {{SKILL}}: domain-modeling
2
+
3
+ > {{DESC_DOMAIN_MODELING}}
4
+
5
+ **Trigger:** pinning down domain terminology, recording an architectural
6
+ decision, or a design conversation keeps stumbling over ambiguous terms.
7
+
8
+ ## Procedure
9
+ 1. Before designing, read `CONTEXT.md` at the repo root (the domain glossary)
10
+ and the ADRs under `docs/adr/` in the area being touched; use their
11
+ vocabulary verbatim in code, tests, and prose.
12
+ 2. When a term is ambiguous, or two words compete for one concept, challenge
13
+ it: propose one canonical term, test it against edge-case scenarios, and
14
+ record it in `CONTEXT.md` the moment it crystallises. Create files lazily —
15
+ the first resolved term creates the glossary.
16
+ 3. When a structural decision lands (storage choice, event model, seam
17
+ placement per the [codebase-design {{SKILL}}](codebase-design.md)), write an
18
+ ADR at `docs/adr/NNNN-<slug>.md`: context, decision, consequences. One
19
+ decision per file.
20
+ 4. Never re-litigate an existing ADR silently — a changed mind gets a new,
21
+ superseding ADR that links the one it replaces.
22
+
23
+ ## Done when
24
+ - The glossary and ADRs reflect every term and decision that crystallised this
25
+ session, and no two names compete for one concept.
26
+
27
+ ## Self-improvement
28
+
29
+ Close each run with one beat of reflection on the {{SKILL}} itself:
30
+ - A step misled, a needed step was missing, or the trigger fired wrongly — that
31
+ is a flaw in this file. Propose the exact edit (trigger, procedure, or
32
+ done-when) and apply it with the user's assent ({{LAW}} II).
33
+ - A lesson that is *not* a flaw in this file goes to {{MEMORY}} only if it
34
+ clears {{LAW}} VI's bar: it would change how a future session behaves, and a
35
+ fresh read of the repo would not re-derive it. Update an existing memory over
36
+ adding one; when in doubt, leave it out.
37
+ - No friction, nothing learned — move on; this loop earns no ceremony. Most
38
+ runs end here.