@aitne-sh/aitne 0.1.8 → 0.1.10

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 (308) hide show
  1. package/README.md +251 -164
  2. package/agent-assets/agent-profiles/_safety.md +3 -3
  3. package/agent-assets/agent-profiles/browser-task.md +108 -0
  4. package/agent-assets/agent-profiles/conversational.md +3 -3
  5. package/agent-assets/agent-profiles/profile-importer.md +2 -2
  6. package/agent-assets/agent-profiles/routine-fetch-window.md +30 -19
  7. package/agent-assets/agents/context-index-reconcile/agent.md +52 -0
  8. package/agent-assets/agents/evening-review/agent.md +53 -0
  9. package/agent-assets/agents/hourly-check/agent.md +62 -0
  10. package/agent-assets/agents/monthly-review/agent.md +55 -0
  11. package/agent-assets/agents/morning-routine/agent.md +78 -0
  12. package/agent-assets/agents/roadmap-maintenance/agent.md +52 -0
  13. package/agent-assets/agents/skill-curation/agent.md +52 -0
  14. package/agent-assets/agents/user-profile-sweep-evening/agent.md +48 -0
  15. package/agent-assets/agents/user-profile-sweep-morning/agent.md +53 -0
  16. package/agent-assets/agents/weekly-review/agent.md +51 -0
  17. package/agent-assets/docs/concepts/agent-day.md +13 -11
  18. package/agent-assets/docs/concepts/auth-health.md +47 -10
  19. package/agent-assets/docs/concepts/backends-and-tiers.md +66 -31
  20. package/agent-assets/docs/concepts/costs-and-quotas.md +51 -15
  21. package/agent-assets/docs/concepts/delegated-mode.md +56 -17
  22. package/agent-assets/docs/concepts/memory-model.md +77 -34
  23. package/agent-assets/docs/concepts/observations.md +49 -11
  24. package/agent-assets/docs/concepts/process-keys.md +56 -22
  25. package/agent-assets/docs/concepts/routines.md +60 -33
  26. package/agent-assets/docs/concepts/safety-and-execution.md +50 -21
  27. package/agent-assets/docs/concepts/safety-model.md +61 -50
  28. package/agent-assets/docs/concepts/skills.md +34 -18
  29. package/agent-assets/docs/features/integrations/browser-history.md +196 -0
  30. package/agent-assets/docs/features/integrations/calendar.md +39 -29
  31. package/agent-assets/docs/features/integrations/git.md +18 -7
  32. package/agent-assets/docs/features/integrations/github.md +84 -33
  33. package/agent-assets/docs/features/integrations/mail.md +61 -17
  34. package/agent-assets/docs/features/integrations/notion.md +18 -6
  35. package/agent-assets/docs/features/integrations/obsidian.md +28 -5
  36. package/agent-assets/docs/features/lifestyle/git.md +44 -40
  37. package/agent-assets/docs/features/lifestyle/reading.md +57 -22
  38. package/agent-assets/docs/features/lifestyle/receipts.md +51 -21
  39. package/agent-assets/docs/features/lifestyle/travel-bookings.md +77 -14
  40. package/agent-assets/docs/features/memory-files/agent-journal.md +132 -53
  41. package/agent-assets/docs/features/memory-files/agent-lessons.md +177 -0
  42. package/agent-assets/docs/features/memory-files/projects.md +73 -17
  43. package/agent-assets/docs/features/memory-files/roadmap.md +54 -11
  44. package/agent-assets/docs/features/memory-files/schedule.md +113 -70
  45. package/agent-assets/docs/features/memory-files/today.md +46 -21
  46. package/agent-assets/docs/features/memory-files/user-profile.md +63 -33
  47. package/agent-assets/docs/features/messaging/bang-commands.md +113 -36
  48. package/agent-assets/docs/features/messaging/dashboard-chat.md +43 -21
  49. package/agent-assets/docs/features/messaging/discord.md +35 -4
  50. package/agent-assets/docs/features/messaging/overview.md +37 -19
  51. package/agent-assets/docs/features/messaging/pairing-and-magic-phrase.md +94 -27
  52. package/agent-assets/docs/features/messaging/slack.md +67 -14
  53. package/agent-assets/docs/features/messaging/telegram.md +22 -8
  54. package/agent-assets/docs/features/messaging/whatsapp.md +71 -17
  55. package/agent-assets/docs/features/operations/activity-and-conversations.md +45 -15
  56. package/agent-assets/docs/features/operations/approvals.md +49 -16
  57. package/agent-assets/docs/features/operations/backend-routing.md +68 -16
  58. package/agent-assets/docs/features/operations/cost-tracking.md +84 -17
  59. package/agent-assets/docs/features/operations/managed-chromium.md +222 -0
  60. package/agent-assets/docs/features/operations/notifications.md +52 -11
  61. package/agent-assets/docs/features/operations/quiet-hours.md +64 -40
  62. package/agent-assets/docs/features/operations/schedule-approaching.md +54 -24
  63. package/agent-assets/docs/features/routines/custom-routines.md +98 -26
  64. package/agent-assets/docs/features/routines/evening-review.md +82 -21
  65. package/agent-assets/docs/features/routines/hourly-check.md +149 -29
  66. package/agent-assets/docs/features/routines/morning-routine.md +54 -35
  67. package/agent-assets/docs/features/routines/weekly-review.md +46 -21
  68. package/agent-assets/docs/features/wiki/commands.md +26 -16
  69. package/agent-assets/docs/features/wiki/cost-and-approval.md +241 -0
  70. package/agent-assets/docs/features/wiki/dashboard.md +256 -0
  71. package/agent-assets/docs/features/wiki/overview.md +70 -12
  72. package/agent-assets/docs/features/wiki/search.md +248 -0
  73. package/agent-assets/docs/features/wiki/workspaces.md +254 -0
  74. package/agent-assets/docs/getting-started/01-what-is-this.md +34 -23
  75. package/agent-assets/docs/getting-started/02-first-steps.md +17 -10
  76. package/agent-assets/docs/getting-started/03-what-can-this-do.md +25 -14
  77. package/agent-assets/docs/getting-started/04-first-day.md +39 -21
  78. package/agent-assets/docs/glossary.md +235 -24
  79. package/agent-assets/docs/guides/add-a-custom-routine.md +63 -23
  80. package/agent-assets/docs/guides/backup-and-restore.md +80 -16
  81. package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +57 -26
  82. package/agent-assets/docs/guides/build-your-wiki.md +22 -9
  83. package/agent-assets/docs/guides/change-which-model-handles-x.md +64 -10
  84. package/agent-assets/docs/guides/connect-a-new-mail-account.md +66 -15
  85. package/agent-assets/docs/guides/explore-with-trace-and-connect.md +32 -14
  86. package/agent-assets/docs/guides/import-knowledge-file.md +50 -40
  87. package/agent-assets/docs/guides/install-and-run.md +49 -20
  88. package/agent-assets/docs/guides/maintain-wiki-health.md +35 -10
  89. package/agent-assets/docs/guides/migrate-machines.md +74 -18
  90. package/agent-assets/docs/guides/multiple-wikis-for-multiple-domains.md +111 -60
  91. package/agent-assets/docs/guides/pause-the-agent.md +69 -24
  92. package/agent-assets/docs/guides/reinstall-cleanly.md +88 -18
  93. package/agent-assets/docs/guides/setup-wizard.md +116 -54
  94. package/agent-assets/docs/guides/switch-default-backend.md +62 -16
  95. package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +30 -14
  96. package/agent-assets/docs/reference/api.md +153 -32
  97. package/agent-assets/docs/reference/cli-commands.md +39 -18
  98. package/agent-assets/docs/reference/config.md +241 -49
  99. package/agent-assets/docs/reference/disallowed-tools.md +34 -13
  100. package/agent-assets/docs/reference/keyboard-shortcuts.md +34 -10
  101. package/agent-assets/docs/reference/knowledge-layout.md +629 -0
  102. package/agent-assets/docs/reference/process-keys.md +62 -6
  103. package/agent-assets/docs/reference/skills.md +41 -14
  104. package/agent-assets/docs/troubleshooting/auth-failed.md +51 -21
  105. package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +97 -28
  106. package/agent-assets/docs/troubleshooting/fallback-keeps-firing.md +86 -22
  107. package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +68 -24
  108. package/agent-assets/docs/troubleshooting/morning-routine-didnt-run.md +80 -20
  109. package/agent-assets/docs/troubleshooting/observation-not-detected.md +73 -21
  110. package/agent-assets/docs/troubleshooting/quota-exhausted.md +33 -8
  111. package/agent-assets/docs/troubleshooting/wiki-ingest-full-blocked.md +126 -54
  112. package/agent-assets/docs/troubleshooting/wiki-write-failed.md +29 -12
  113. package/agent-assets/optimizer-skills/drift-analysis/SKILL.md +1 -1
  114. package/agent-assets/optimizer-skills/knowledge-map/SKILL.md +1 -1
  115. package/agent-assets/optimizer-skills/skill-curation/SKILL.md +1 -1
  116. package/agent-assets/sandbox/linux/aitne-chromium.apparmor +91 -0
  117. package/agent-assets/sandbox/macos/aitne-chromium.sb +156 -0
  118. package/agent-assets/skills/agent-actions/SKILL.md +25 -41
  119. package/agent-assets/skills/agent-create/SKILL.md +158 -0
  120. package/agent-assets/skills/attach/SKILL.md +10 -29
  121. package/agent-assets/skills/browser-history/SKILL.md +211 -0
  122. package/agent-assets/skills/browser-history-respond/SKILL.md +111 -0
  123. package/agent-assets/skills/browser-task/SKILL.md +164 -0
  124. package/agent-assets/skills/context/SKILL.md +35 -44
  125. package/agent-assets/skills/context/curation.json +14 -14
  126. package/agent-assets/skills/context/references/api.md +52 -40
  127. package/agent-assets/skills/context/references/required-frontmatter.md +13 -12
  128. package/agent-assets/skills/context/references/snapshot-files.md +18 -17
  129. package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +8 -8
  130. package/agent-assets/skills/context/seeds/frontmatter-requirements.seed.json +3 -3
  131. package/agent-assets/skills/docs-search/SKILL.md +23 -34
  132. package/agent-assets/skills/external-services/SKILL.delegated.claude.md +17 -114
  133. package/agent-assets/skills/external-services/SKILL.delegated.codex.md +17 -113
  134. package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +17 -113
  135. package/agent-assets/skills/external-services/SKILL.md +3 -3
  136. package/agent-assets/skills/external-services/SKILL.native.claude.md +7 -7
  137. package/agent-assets/skills/external-services/SKILL.native.codex.md +7 -7
  138. package/agent-assets/skills/external-services/SKILL.native.gemini.md +4 -4
  139. package/agent-assets/skills/external-services/references/calendar-apple.md +2 -2
  140. package/agent-assets/skills/external-services/references/calendar-outlook.md +1 -1
  141. package/agent-assets/skills/external-services/references/exec-errors.md +32 -0
  142. package/agent-assets/skills/external-services/references/obsidian.md +2 -2
  143. package/agent-assets/skills/external-services/references/skills-crud.md +5 -5
  144. package/agent-assets/skills/gmail-lifestyle/SKILL.md +11 -83
  145. package/agent-assets/skills/gmail-lifestyle/references/receipts-api.md +4 -0
  146. package/agent-assets/skills/gmail-lifestyle/references/travel-bookings-api.md +9 -0
  147. package/agent-assets/skills/mail/SKILL.delegated.claude.md +15 -18
  148. package/agent-assets/skills/mail/SKILL.delegated.codex.md +11 -6
  149. package/agent-assets/skills/mail/SKILL.delegated.gemini.md +11 -6
  150. package/agent-assets/skills/mail/SKILL.md +10 -18
  151. package/agent-assets/skills/mail/SKILL.native.claude.md +8 -7
  152. package/agent-assets/skills/mail/SKILL.native.codex.md +1 -1
  153. package/agent-assets/skills/mail/SKILL.native.gemini.md +1 -1
  154. package/agent-assets/skills/mail/references/api.md +10 -3
  155. package/agent-assets/skills/mail/references/examples.md +2 -1
  156. package/agent-assets/skills/mail/references/providers.md +1 -1
  157. package/agent-assets/skills/managed-tasks/SKILL.md +48 -81
  158. package/agent-assets/skills/managed-tasks/references/errors.md +33 -19
  159. package/agent-assets/skills/managed-tasks/references/output-path.md +33 -17
  160. package/agent-assets/skills/managed-tasks/references/recurrence-rule.md +7 -5
  161. package/agent-assets/skills/management-policy/SKILL.md +42 -42
  162. package/agent-assets/skills/management-policy/curation.json +1 -1
  163. package/agent-assets/skills/management-policy/references/policy-workflow.md +11 -12
  164. package/agent-assets/skills/management-policy/seeds/policy-file-shape.seed.json +1 -1
  165. package/agent-assets/skills/notify/SKILL.md +14 -16
  166. package/agent-assets/skills/notify/references/priority.md +28 -20
  167. package/agent-assets/skills/notion/SKILL.delegated.claude.md +2 -2
  168. package/agent-assets/skills/notion/SKILL.delegated.codex.md +2 -2
  169. package/agent-assets/skills/notion/SKILL.delegated.gemini.md +2 -2
  170. package/agent-assets/skills/notion/SKILL.md +17 -17
  171. package/agent-assets/skills/notion/SKILL.native.claude.md +11 -7
  172. package/agent-assets/skills/notion/SKILL.native.codex.md +10 -5
  173. package/agent-assets/skills/notion/SKILL.native.gemini.md +10 -5
  174. package/agent-assets/skills/observations/SKILL.md +29 -28
  175. package/agent-assets/skills/observations/references/fetch-fallback.md +22 -0
  176. package/agent-assets/skills/project-doc/SKILL.md +10 -7
  177. package/agent-assets/skills/project-doc/curation.json +3 -3
  178. package/agent-assets/skills/project-doc/seeds/project-shape.seed.json +8 -5
  179. package/agent-assets/skills/project-doc/seeds/slug-grammar.seed.json +5 -5
  180. package/agent-assets/skills/reading/SKILL.md +18 -42
  181. package/agent-assets/skills/reading/references/reading-taste.md +7 -7
  182. package/agent-assets/skills/roadmap/SKILL.md +8 -24
  183. package/agent-assets/skills/roadmap/curation.json +1 -1
  184. package/agent-assets/skills/roadmap/references/api.md +21 -11
  185. package/agent-assets/skills/roadmap/references/cross-check.md +15 -8
  186. package/agent-assets/skills/roadmap/references/horizon-tags.md +11 -0
  187. package/agent-assets/skills/roadmap/references/migration.md +12 -10
  188. package/agent-assets/skills/roadmap/references/retention.md +18 -0
  189. package/agent-assets/skills/roadmap/seeds/entry-types.seed.json +1 -1
  190. package/agent-assets/skills/schedule/SKILL.md +41 -50
  191. package/agent-assets/skills/schedule/references/batch.md +2 -2
  192. package/agent-assets/skills/schedule/references/errors.md +7 -4
  193. package/agent-assets/skills/schedule/references/importance.md +23 -0
  194. package/agent-assets/skills/schedule/references/model-selection.md +3 -3
  195. package/agent-assets/skills/schedule/references/recurrence-rule.md +7 -5
  196. package/agent-assets/skills/scheduled-managed-task/SKILL.md +77 -70
  197. package/agent-assets/skills/today/SKILL.md +24 -83
  198. package/agent-assets/skills/today/curation.json +3 -3
  199. package/agent-assets/skills/today/references/agent-plan-lifecycle.md +6 -5
  200. package/agent-assets/skills/today/references/today-skeleton.md +66 -0
  201. package/agent-assets/skills/today/seeds/agent-notes-flavors.seed.json +1 -1
  202. package/agent-assets/skills/today/seeds/section-shape.seed.json +7 -7
  203. package/agent-assets/skills/user-interview/SKILL.md +21 -93
  204. package/agent-assets/skills/user-interview/references/op-briefing.md +3 -3
  205. package/agent-assets/skills/user-interview/references/op-dm-handler.md +88 -0
  206. package/agent-assets/skills/user-interview/references/op-morning.md +1 -1
  207. package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +9 -1
  208. package/agent-assets/skills/user-profile/SKILL.md +29 -39
  209. package/agent-assets/skills/user-profile/curation.json +4 -4
  210. package/agent-assets/skills/user-profile/references/character-preferences.md +3 -3
  211. package/agent-assets/skills/user-profile/seeds/routing-table.seed.json +8 -8
  212. package/agent-assets/skills/user-profile/seeds/topic-files.seed.json +6 -6
  213. package/agent-assets/skills/wiki/wiki-ask/SKILL.md +1 -1
  214. package/agent-assets/skills/wiki/wiki-compile/SKILL.md +9 -8
  215. package/agent-assets/skills/wiki/wiki-connect/SKILL.md +32 -5
  216. package/agent-assets/skills/wiki/wiki-ingest/SKILL.md +6 -50
  217. package/agent-assets/skills/wiki/wiki-ingest/references/curl-errors.md +58 -0
  218. package/agent-assets/skills/wiki/wiki-lint/SKILL.md +20 -14
  219. package/agent-assets/skills/wiki/wiki-trace/SKILL.md +10 -5
  220. package/agent-assets/skills/wiki/wiki-vault-rules/SKILL.md +2 -0
  221. package/agent-assets/system-prompts/routine-fetch-window.md +22 -12
  222. package/agent-assets/task-flows/_partials/calendar-acquire.google_calendar.md +4 -2
  223. package/agent-assets/task-flows/_partials/calendar-acquire.outlook_calendar.md +4 -2
  224. package/agent-assets/task-flows/_partials/capture-user-info.md +2 -2
  225. package/agent-assets/task-flows/_partials/dm-intent.long-horizon.md +1 -1
  226. package/agent-assets/task-flows/_partials/dm-intent.project.md +9 -9
  227. package/agent-assets/task-flows/_partials/feedback-capture.md +30 -0
  228. package/agent-assets/task-flows/_partials/mail-acquire.outlook_mail.md +3 -2
  229. package/agent-assets/task-flows/_partials/notion-acquire.notion.md +10 -5
  230. package/agent-assets/task-flows/browser_task.md +84 -0
  231. package/agent-assets/task-flows/github.assigned.md +1 -1
  232. package/agent-assets/task-flows/github.pull_request.review_requested.md +2 -2
  233. package/agent-assets/task-flows/github.workflow_run.failed.md +2 -2
  234. package/agent-assets/task-flows/knowledge.import.md +14 -14
  235. package/agent-assets/task-flows/message.received.dm.md +13 -4
  236. package/agent-assets/task-flows/message.received.dm_first.md +7 -3
  237. package/agent-assets/task-flows/routine.custom.md +3 -3
  238. package/agent-assets/task-flows/routine.evening_review.md +88 -8
  239. package/agent-assets/task-flows/routine.fetch_window.md +2 -2
  240. package/agent-assets/task-flows/routine.hourly_check.md +16 -12
  241. package/agent-assets/task-flows/routine.monthly_review.md +93 -21
  242. package/agent-assets/task-flows/routine.morning_routine_journal.md +119 -97
  243. package/agent-assets/task-flows/routine.morning_routine_today.md +43 -43
  244. package/agent-assets/task-flows/routine.research_cluster_update.md +35 -0
  245. package/agent-assets/task-flows/routine.research_dispatch.md +38 -0
  246. package/agent-assets/task-flows/routine.research_offer_dm.md +125 -0
  247. package/agent-assets/task-flows/routine.research_wiki_summary.md +53 -0
  248. package/agent-assets/task-flows/routine.roadmap_refresh.md +10 -10
  249. package/agent-assets/task-flows/routine.today_refresh.md +4 -4
  250. package/agent-assets/task-flows/routine.user_profile_sweep.md +10 -10
  251. package/agent-assets/task-flows/routine.weekly_review.md +114 -24
  252. package/agent-assets/task-flows/schedule.approaching.md +0 -1
  253. package/agent-assets/task-flows/scheduled.dm.md +5 -5
  254. package/agent-assets/task-flows/scheduled.task.md +4 -4
  255. package/agent-assets/task-flows/setup.initial.md +21 -21
  256. package/agent-assets/task-flows/setup.update.md +2 -2
  257. package/agent-assets/task-flows/wiki.trace.md +1 -1
  258. package/agent-assets/templates/README.md +27 -20
  259. package/agent-assets/templates/_index.md +42 -26
  260. package/agent-assets/templates/_manifest.json +34 -99
  261. package/agent-assets/templates/{user → identity}/_index.md +1 -1
  262. package/agent-assets/templates/{user → identity}/profile.md +2 -2
  263. package/agent-assets/templates/{dossiers → knowledge/dossiers}/_index.md +1 -1
  264. package/agent-assets/templates/{projects → plans/projects}/_active.base +1 -1
  265. package/agent-assets/templates/policies/_index.md +21 -0
  266. package/agent-assets/templates/{rules → policies}/journal-export.md +1 -1
  267. package/agent-assets/templates/{rules → policies}/journal-format.md +5 -5
  268. package/agent-assets/templates/{rules/policies → policies/management-captures}/_index.md +2 -2
  269. package/agent-assets/templates/{rules → policies}/management.md +3 -3
  270. package/agent-assets/templates/{rules → policies}/mcp.md +1 -1
  271. package/agent-assets/templates/{rules → policies}/redaction.md +1 -1
  272. package/agent-assets/templates/{routines → policies/routines}/_index.md +1 -1
  273. package/agent-assets/templates/{routines → policies/routines}/evening.md +2 -2
  274. package/agent-assets/templates/{routines → policies/routines}/hourly.md +1 -1
  275. package/agent-assets/templates/{routines → policies/routines}/monthly.md +2 -2
  276. package/bin/aitne.mjs +58 -15
  277. package/package.json +5 -4
  278. package/scripts/commands/doctor.mjs +25 -10
  279. package/scripts/commands/run-now.mjs +6 -21
  280. package/scripts/lib/ports.d.mts +27 -0
  281. package/scripts/lib/ports.mjs +36 -0
  282. package/scripts/lib/process-identity.d.mts +46 -0
  283. package/scripts/lib/process-identity.mjs +193 -0
  284. package/scripts/lib/read-api-token.mjs +176 -0
  285. package/scripts/start.mjs +16 -5
  286. package/agent-assets/docs/features/lifestyle/travel-time.md +0 -58
  287. package/agent-assets/skills/gmail-lifestyle/references/travel-time-api.md +0 -59
  288. package/agent-assets/skills/schedule/references/recurring.md +0 -185
  289. package/agent-assets/templates/context-index.md +0 -42
  290. package/agent-assets/templates/rules/_index.md +0 -19
  291. /package/agent-assets/templates/{user → identity}/expertise.md +0 -0
  292. /package/agent-assets/templates/{user → identity}/goals.md +0 -0
  293. /package/agent-assets/templates/{user → identity}/people.md +0 -0
  294. /package/agent-assets/templates/{user → identity}/personal.md +0 -0
  295. /package/agent-assets/templates/{user → identity}/work.md +0 -0
  296. /package/agent-assets/templates/{agent/journal.md → journal/agent.md} +0 -0
  297. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/evening.md +0 -0
  298. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/hourly.md +0 -0
  299. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/monthly.md +0 -0
  300. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/morning.md +0 -0
  301. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/roadmap.md +0 -0
  302. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/weekly.md +0 -0
  303. /package/agent-assets/templates/{projects → plans/projects}/_index.md +0 -0
  304. /package/agent-assets/templates/{roadmap.md → plans/roadmap.md} +0 -0
  305. /package/agent-assets/templates/{routines → policies/routines}/morning.md +0 -0
  306. /package/agent-assets/templates/{routines → policies/routines}/weekly.md +0 -0
  307. /package/agent-assets/templates/{agent → state}/profile-questions.md +0 -0
  308. /package/agent-assets/templates/{today.md → state/today.md} +0 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: user-profile
3
- description: Record user facts — identity, people, work, expertise, habits, goals, tendencies. Top-level → user/profile.md; detail → user/<topic>.md. Tone/style/voice/language are NOT facts — route to PATCH /api/config/character. Same turn as reply. Skip duplicates. Never notify.
3
+ description: Record user facts — identity, people, work, expertise, habits, goals, tendencies. Top-level → identity/profile.md; detail → identity/<topic>.md. Tone/style/voice/language are NOT facts — route to PATCH /api/config/character. Same turn as reply. Skip dupes. Never notify.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
6
  - Read
@@ -8,21 +8,21 @@ allowed-tools:
8
8
 
9
9
  # User Profile Update Guide
10
10
 
11
- Output language: `user/profile.md` and `user/*.md` are Policy B — see `<output_language_policy>`. Template H2 headers stay English skeleton; the facts under them are in `<settings primary_language>`. Preserve user-customized headers verbatim.
11
+ Output language: `identity/profile.md` and `identity/*.md` are Policy B — see `<output_language_policy>`. Template H2 headers stay English skeleton; the facts under them are in `<settings primary_language>`. Preserve user-customized headers verbatim.
12
12
 
13
- `user/profile.md` stores the user's identity, preferences, and learned behavioral patterns. It is injected into every agent session via `<user>` tags — keep it concise (target: under ~600 tokens total).
13
+ `identity/profile.md` stores the user's identity, preferences, and learned behavioral patterns. It is injected into every agent session via `<user>` tags — keep it concise (target: under ~600 tokens total).
14
14
 
15
- Detailed, dictionary-like background belongs under `user/*.md`. Read `user/_index.md` first, then fetch only the topic file you need.
15
+ Detailed, dictionary-like background belongs under `identity/*.md`. Read `identity/_index.md` first, then fetch only the topic file you need.
16
16
 
17
17
  ## When to Update
18
18
 
19
19
  **Immediately (same turn) when the user shares:**
20
20
  - Identity or role — "I'm a …", "I work at …", "my title is …" → `profile.md ## Identity`
21
- - People they know — names + relationship, e.g. "my sister", "my manager Sarah" → `user/people.md`
22
- - Workplace specifics — company, team, tech stack, tools — "I use Postgres at work" → `user/work.md`
23
- - Expertise or tools they use habitually — "I've been writing Go for ten years", "I'm new to React" → `user/expertise.md` (add a one-line summary in `profile.md ## Expertise` when the fact also shapes how the agent should explain things)
24
- - Hobbies, habits, health, lifestyle (factual) — "I run every morning", "I don't eat meat" → `user/personal.md`
25
- - Goals or learning targets — "I want to get better at Rust", "I want to read 20 books this year" → `user/goals.md`
21
+ - People they know — names + relationship, e.g. "my sister", "my manager Sarah" → `identity/people.md`
22
+ - Workplace specifics — company, team, tech stack, tools — "I use Postgres at work" → `identity/work.md`
23
+ - Expertise or tools they use habitually — "I've been writing Go for ten years", "I'm new to React" → `identity/expertise.md` (add a one-line summary in `profile.md ## Expertise` when the fact also shapes how the agent should explain things)
24
+ - Hobbies, habits, health, lifestyle (factual) — "I run every morning", "I don't eat meat" → `identity/personal.md`
25
+ - Goals or learning targets — "I want to get better at Rust", "I want to read 20 books this year" → `identity/goals.md`
26
26
  - A notification or day-type preference — "no work notifications on weekends" → `profile.md ## Notification Preferences`
27
27
  - A self-reported behavioral pattern the agent should adapt to — "I'm not a morning person", "I tend to skim long messages" → `profile.md ## Learned Context` with today's `[YYYY-MM-DD]` prefix
28
28
 
@@ -35,36 +35,26 @@ Detailed, dictionary-like background belongs under `user/*.md`. Read `user/_inde
35
35
  **Routing edge cases** (for shapes the trigger list above doesn't disambiguate):
36
36
  - "my name is Alex" — explicit identity statement goes to `profile.md ## Identity`, not a topic file.
37
37
  - "user has been unusually curt over the last week" — a pattern inferred across multiple turns with no single user statement. Written to `profile.md ## Learned Context` by Evening Review Step 3a only; the DM handler and sweep do not write inferred patterns.
38
- - "my sister just had a baby" → `user/people.md ## Family`. If the section doesn't exist yet (fresh topic file with only the H1), the PATCH returns `section_not_found` — retry with `mode: "append_to_file"` and include `"\n## Family\n- <bullet>"` in `content`. The next write to that section succeeds normally.
38
+ - "my sister just had a baby" → `identity/people.md ## Family`. If the section doesn't exist yet (fresh topic file with only the H1), the PATCH returns `section_not_found` — retry with `mode: "append_to_file"` and include `"\n## Family\n- <bullet>"` in `content`. The next write to that section succeeds normally.
39
39
 
40
- The decision rule (profile.md vs `user/<topic>.md` tie-breakers, `section_not_found` → `append_to_file` first-write fallback, and the read-before-write `curl` recipe) is documented in full in this skill — see §"Section ownership", §"File schema", and §"Worked example" below.
40
+ The decision rule (profile.md vs `identity/<topic>.md` tie-breakers, `section_not_found` → `append_to_file` first-write fallback, and the read-before-write `curl` recipe) is documented in full in this skill — see §"Section ownership", §"File schema", and §"Worked example" below.
41
41
 
42
42
  ## Section ownership
43
43
 
44
- | Section | Update trigger | Who writes |
45
- |---|---|---|
46
- | Identity | Explicit statement | DM handler, sweep |
47
- | Work Pattern | Explicit statement | DM handler, sweep |
48
- | Platforms | Explicit statement | Setup, explicit change |
49
- | Expertise | Explicit statement (summary) | DM handler, sweep |
50
- | Notification Preferences | Explicit statement | DM handler, sweep |
51
- | Learned Context | Stated preferences (DM) + Raw Signals graduation (evening) | DM handler, sweep, Evening Review 3a |
52
- | Raw Signals | Behavioral detection | SignalDetector only |
53
- | `user/<topic>.md` (people / work / expertise / personal / goals) | Any detail-heavy fact per the capture decision rule in the DM task-flow | DM handler, `routine.user_profile_sweep` |
44
+ Per-section trigger destination writer is in the auto-curated **When-to-update routing** block below. Writer notes layered on top:
54
45
 
55
- "DM handler" above covers both `message.received.dm` and `message.received.dm_first`. "Sweep" is `routine.user_profile_sweep` (fires 03:50 and 17:50 local; see its task-flow). Evening Review Step 3a is an additional writer to Learned Context only, synthesizing entries from Raw Signals graduation.
46
+ - "DM handler" covers both `message.received.dm` and `message.received.dm_first`. "Sweep" is `routine.user_profile_sweep` (fires 03:50 and 17:50 local; see its task-flow). Evening Review Step 3a is an additional writer to Learned Context only, synthesizing entries from Raw Signals graduation.
47
+ - **Do not write to Raw Signals from other events — that section is `SignalDetector`'s alone.**
56
48
 
57
- **Do not write to Raw Signals from other events — that section is `SignalDetector`'s alone.**
49
+ ## identity/profile.md vs identity/<topic>
58
50
 
59
- ## user/profile.md vs user/
51
+ **identity/profile.md** injected every session: Identity, Work Pattern, Platforms, Expertise summary, Notification Preferences, Learned Context.
60
52
 
61
- **user/profile.md** — injected every session: Identity, Work Pattern, Platforms, Expertise summary, Notification Preferences, Learned Context.
62
-
63
- **user/*.md** — dictionary-like (`people` | `work` | `expertise` | `goals` | `personal`), too detailed for every session. Read `_index.md` first → fetch only the relevant topic.
53
+ **identity/*.md** — dictionary-like (`people` | `work` | `expertise` | `goals` | `personal`), too detailed for every session. Read `identity/_index.md` first fetch only the relevant topic. Per-topic ownership is in the auto-curated **Knowledge map** block below.
64
54
 
65
55
  ## File schema
66
56
 
67
- All `user/*.md` files must keep YAML frontmatter with `type: user`,
57
+ All `identity/*.md` files must keep YAML frontmatter with `type: user`,
68
58
  `owner: shared`, and `updated: YYYY-MM-DD`, followed by an H1. When using
69
59
  section-level PATCH, preserve the existing frontmatter. When doing a
70
60
  full-file PUT, update `updated` to today's date.
@@ -78,7 +68,7 @@ full-file PUT, update `updated` to today's date.
78
68
  - Working hours: Weekdays 09:00–18:00
79
69
  ```
80
70
 
81
- The `user-interview` skill's queue (`agent/profile-questions.md`)
71
+ The `user-interview` skill's queue (`state/profile-questions.md`)
82
72
  matches against these English keys. If you introduce a non-English
83
73
  label here, the queue's slot-filled probe silently misses the bullet
84
74
  and re-asks the same question on the next opportunity. See
@@ -106,7 +96,7 @@ If the user says "I don't want work notifications on weekends", paraphrase into
106
96
  preferences are NOT profile content.** Route them to the `character`
107
97
  runtime-config field via `PATCH /api/config/character` (narrow
108
98
  endpoint, 1000-char cap, read-before-write). Never write tone /
109
- style preferences into `user/profile.md` or any `user/*.md`.
99
+ style preferences into `identity/profile.md` or any `identity/*.md`.
110
100
 
111
101
  Full recipe — triggers, merge rules, endpoint note, cap-handling, and
112
102
  where the value ends up — is in the character-preferences reference
@@ -120,9 +110,9 @@ See _safety.md "Common Patterns" for the general rule. Section name in PATCH is
120
110
 
121
111
  ### Worked example
122
112
 
123
- User: `"I want to read 20 books this year."` → GET user/profile.md (or topic file), merge new bullet into the right section. For a top-level goal summary bullet:
113
+ User: `"I want to read 20 books this year."` → GET identity/profile.md (or topic file), merge new bullet into the right section. For a top-level goal summary bullet:
124
114
  ```bash
125
- curl -s -X PATCH http://localhost:8321/api/context/user/profile \
115
+ curl -s -X PATCH http://localhost:8321/api/context/identity/profile \
126
116
  -H 'Content-Type: application/json' \
127
117
  -d '{"section": "learned_context", "mode": "append", "content": "- [2026-04-23] Reading goal: 20 books/year"}'
128
118
  ```
@@ -130,7 +120,7 @@ For a full-section replace, GET first, merge with existing bullets, then PATCH w
130
120
 
131
121
  **WRONG** (erases existing bullets): `curl -s -X PATCH ... -d '{"section": "learned_context", "mode": "replace", "content": "- [2026-04-23] Reading goal: ..."}'` when the section already held other bullets.
132
122
 
133
- For writes to `user/<topic>.md` (people / work / expertise / personal / goals), the same decision rule applies — §"Routing edge cases" above documents the `section_not_found` → `append_to_file` first-write fallback (with a worked `curl` example against `user/people.md`). The read-before-write rule applies identically when merging into an existing `user/<topic>.md` section.
123
+ For writes to `identity/<topic>.md` (people / work / expertise / personal / goals), the same decision rule applies — §"Routing edge cases" above documents the `section_not_found` → `append_to_file` first-write fallback (with a worked `curl` example against `identity/people.md`). The read-before-write rule applies identically when merging into an existing `identity/<topic>.md` section.
134
124
 
135
125
  ## Learned Context entry format
136
126
 
@@ -150,14 +140,14 @@ Review can prune entries older than 30 days:
150
140
  - **Silent updates.** Never notify the user about profile changes.
151
141
  - **Keep concise.** 2–5 bullets per section max. Consolidate similar bullets.
152
142
  - **No duplicates.** Scan before adding. Prefer refining an existing bullet.
153
- - **Total budget ~600 tokens** for user/profile.md. Consolidate aggressively.
143
+ - **Total budget ~600 tokens** for identity/profile.md. Consolidate aggressively.
154
144
  - **Don't write verbatim user messages.** Paraphrase into stable preference statements.
155
145
 
156
146
  ## Initial Setup
157
147
 
158
- Populate `user/profile.md` (Identity, Work Pattern, Platforms, Expertise summary, Notification Preferences — leave Learned Context/Raw Signals empty). Read skeleton first → prefer `mode: "append"` → `mode: "replace"` only for full merged body. Tone / style preferences do NOT go into profile.md — see §"Tone / character preferences".
148
+ Populate `identity/profile.md` (Identity, Work Pattern, Platforms, Expertise summary, Notification Preferences — leave Learned Context/Raw Signals empty). Read skeleton first → prefer `mode: "append"` → `mode: "replace"` only for full merged body. Tone / style preferences do NOT go into profile.md — see §"Tone / character preferences".
159
149
 
160
- *During setup, seed `user/profile.md` only. The topic files (`user/people.md`, `work.md`, `expertise.md`, `personal.md`, `goals.md`) stay empty and grow from lived conversation via the DM handler and `routine.user_profile_sweep`.*
150
+ *During setup, seed `identity/profile.md` only. The topic files (`identity/people.md`, `work.md`, `expertise.md`, `personal.md`, `goals.md`) stay empty and grow from lived conversation via the DM handler and `routine.user_profile_sweep`.*
161
151
 
162
152
  ---
163
153
 
@@ -165,8 +155,8 @@ Populate `user/profile.md` (Identity, Work Pattern, Platforms, Expertise summary
165
155
 
166
156
  The generic GET / PATCH surface (modes, fields, error envelopes) is
167
157
  documented in the **context** skill `references/api.md`. user-profile
168
- writes target the two paths `/api/context/user/profile` (the injected
169
- summary file) and `/api/context/user/:topic` (one of `people` /
158
+ writes target the two paths `/api/context/identity/profile` (the injected
159
+ summary file) and `/api/context/identity/:topic` (one of `people` /
170
160
  `work` / `expertise` / `personal` / `goals`).
171
161
 
172
162
  Two user-profile-specific notes layered on top of the generic surface:
@@ -176,7 +166,7 @@ Two user-profile-specific notes layered on top of the generic surface:
176
166
  concurrent appends. Pass a SQLite-format `cutoff`:
177
167
 
178
168
  ```bash
179
- curl -s -X PATCH http://localhost:8321/api/context/user/profile \
169
+ curl -s -X PATCH http://localhost:8321/api/context/identity/profile \
180
170
  -H 'Content-Type: application/json' \
181
171
  -d '{"section": "raw_signals", "mode": "clear_before", "cutoff": "2026-04-10 02:33:00"}'
182
172
  ```
@@ -6,8 +6,8 @@
6
6
  "kind": "knowledge_layout",
7
7
  "anchor": "<!-- CURATION:knowledge_layout id=\"topic-files\" -->",
8
8
  "human_label": "Topic file layout",
9
- "description": "Which user/* file owns which kind of fact",
10
- "scope_paths": ["user/profile.md", "user/*.md"]
9
+ "description": "Which identity/* file owns which kind of fact",
10
+ "scope_paths": ["identity/profile.md", "identity/*.md"]
11
11
  },
12
12
  {
13
13
  "id": "routing-table",
@@ -15,7 +15,7 @@
15
15
  "anchor": "<!-- CURATION:routing_table id=\"routing-table\" -->",
16
16
  "human_label": "When-to-update routing rules",
17
17
  "description": "Trigger phrases mapped to destination file, section, and write mode",
18
- "scope_paths": ["user/*.md"]
18
+ "scope_paths": ["identity/*.md"]
19
19
  },
20
20
  {
21
21
  "id": "learned-context-format",
@@ -23,7 +23,7 @@
23
23
  "anchor": "<!-- CURATION:convention_notes id=\"learned-context-format\" -->",
24
24
  "human_label": "Learned Context bullet conventions",
25
25
  "description": "Date-prefix rule, prune cadence, refresh-on-merge",
26
- "scope_paths": ["user/profile.md"]
26
+ "scope_paths": ["identity/profile.md"]
27
27
  }
28
28
  ]
29
29
  }
@@ -10,7 +10,7 @@ description: Tone / style / voice / language preferences are agent directives
10
10
  are NOT profile content** — they are agent directives, not user facts.
11
11
  Route them to the `character` runtime-config field via `PATCH
12
12
  /api/config/character` (see `docs/design/15-character.md`), never to
13
- `user/profile.md` or any `user/*.md`.
13
+ `identity/profile.md` or any `identity/*.md`.
14
14
 
15
15
  ## Triggers
16
16
 
@@ -78,6 +78,6 @@ uniformly — no separate injection per backend.
78
78
  ## What does NOT belong here
79
79
 
80
80
  Facts about the user — identity, role, expertise, hobbies, people,
81
- goals — go to `user/profile.md` or `user/<topic>.md`, not to
81
+ goals — go to `identity/profile.md` or `identity/<topic>.md`, not to
82
82
  `character`. The split is: `character` says *how* the agent speaks;
83
- `user/*` says *who the user is*.
83
+ `identity/*` says *who the user is*.
@@ -3,49 +3,49 @@
3
3
  "rules": [
4
4
  {
5
5
  "trigger_pattern": "user states identity or role (I'm a, I work at, my title is)",
6
- "destination_path": "user/profile.md",
6
+ "destination_path": "identity/profile.md",
7
7
  "destination_section": "## Identity",
8
8
  "destination_mode": "replace"
9
9
  },
10
10
  {
11
11
  "trigger_pattern": "user mentions a person they know with a name plus relationship",
12
- "destination_path": "user/people.md",
12
+ "destination_path": "identity/people.md",
13
13
  "destination_section": "## Family",
14
14
  "destination_mode": "append_to_file"
15
15
  },
16
16
  {
17
17
  "trigger_pattern": "user mentions a workplace specific (company, team, tech stack)",
18
- "destination_path": "user/work.md",
18
+ "destination_path": "identity/work.md",
19
19
  "destination_section": "## Stack",
20
20
  "destination_mode": "append_to_file"
21
21
  },
22
22
  {
23
23
  "trigger_pattern": "user describes hobbies, habits, health, or lifestyle facts",
24
- "destination_path": "user/personal.md",
24
+ "destination_path": "identity/personal.md",
25
25
  "destination_section": "## Habits",
26
26
  "destination_mode": "append_to_file"
27
27
  },
28
28
  {
29
29
  "trigger_pattern": "user states a goal or learning target",
30
- "destination_path": "user/goals.md",
30
+ "destination_path": "identity/goals.md",
31
31
  "destination_section": "## Learning",
32
32
  "destination_mode": "append_to_file"
33
33
  },
34
34
  {
35
35
  "trigger_pattern": "user states expertise level or tools they use habitually",
36
- "destination_path": "user/expertise.md",
36
+ "destination_path": "identity/expertise.md",
37
37
  "destination_section": "## Tools",
38
38
  "destination_mode": "append_to_file"
39
39
  },
40
40
  {
41
41
  "trigger_pattern": "user states a notification or day-type preference",
42
- "destination_path": "user/profile.md",
42
+ "destination_path": "identity/profile.md",
43
43
  "destination_section": "## Notification Preferences",
44
44
  "destination_mode": "replace"
45
45
  },
46
46
  {
47
47
  "trigger_pattern": "user reports a behavioral pattern the agent should adapt to",
48
- "destination_path": "user/profile.md",
48
+ "destination_path": "identity/profile.md",
49
49
  "destination_section": "## Learned Context",
50
50
  "destination_mode": "append"
51
51
  }
@@ -2,7 +2,7 @@
2
2
  "kind": "knowledge_layout",
3
3
  "files": [
4
4
  {
5
- "path": "user/profile.md",
5
+ "path": "identity/profile.md",
6
6
  "purpose": "identity, preferences, learned context",
7
7
  "sections": [
8
8
  { "heading": "## Identity", "contains": "name, role, time zone" },
@@ -15,7 +15,7 @@
15
15
  ]
16
16
  },
17
17
  {
18
- "path": "user/people.md",
18
+ "path": "identity/people.md",
19
19
  "purpose": "people the user knows",
20
20
  "sections": [
21
21
  { "heading": "## Family", "contains": "household members" },
@@ -24,28 +24,28 @@
24
24
  ]
25
25
  },
26
26
  {
27
- "path": "user/work.md",
27
+ "path": "identity/work.md",
28
28
  "purpose": "workplace, team, tech stack",
29
29
  "sections": [
30
30
  { "heading": "## Stack", "contains": "tools, languages, services used at work" }
31
31
  ]
32
32
  },
33
33
  {
34
- "path": "user/expertise.md",
34
+ "path": "identity/expertise.md",
35
35
  "purpose": "domains, tools, skill levels",
36
36
  "sections": [
37
37
  { "heading": "## Tools", "contains": "tools the user uses habitually" }
38
38
  ]
39
39
  },
40
40
  {
41
- "path": "user/personal.md",
41
+ "path": "identity/personal.md",
42
42
  "purpose": "hobbies, health, habits",
43
43
  "sections": [
44
44
  { "heading": "## Habits", "contains": "routines, lifestyle, health" }
45
45
  ]
46
46
  },
47
47
  {
48
- "path": "user/goals.md",
48
+ "path": "identity/goals.md",
49
49
  "purpose": "developmental goals and learning targets",
50
50
  "sections": [
51
51
  { "heading": "## Learning", "contains": "skills the user wants to build" }
@@ -9,7 +9,7 @@ allowed-tools:
9
9
 
10
10
  You run under process key `wiki.ask`.
11
11
 
12
- Read `<wiki_command>` for the user's `question`. Search and read relevant `20_wiki/` notes first; read `10_raw/` only when the wiki notes need source verification.
12
+ Read `<wiki_command>` for the user's `question`. Search and read relevant `20_wiki/` notes first (see wiki-vault-rules for `/search` and `/index`); read `10_raw/` only when the wiki notes need source verification.
13
13
 
14
14
  Write the answer to:
15
15
 
@@ -26,10 +26,10 @@ Therefore:
26
26
  | Method | Path | Purpose |
27
27
  |---|---|---|
28
28
  | `GET` | `/api/wiki/{{workspace_name}}/index` | List every file in the workspace with `path`/`mtime`/`sizeBytes`. Primary enumeration tool. |
29
- | `GET` | `/api/wiki/{{workspace_name}}/search?q=<query>` | Body-substring search for duplicate detection. |
29
+ | `GET` | `/api/wiki/{{workspace_name}}/search?q=<query>` | Duplicate detection. Defaults to FTS5 token matching; append `&kind=grep` for literal substring matches. |
30
30
  | `GET` | `/api/wiki/{{workspace_name}}/files/<path>` | Read raw notes, existing wiki notes, taxonomy, log. |
31
31
  | `POST` | `/api/wiki/{{workspace_name}}/files/20_wiki/<slug>.md` | Create a new wiki note. |
32
- | `PATCH` | `/api/wiki/{{workspace_name}}/files/20_wiki/<slug>.md` | Rewrite an existing wiki note (`mode: "replace"`). |
32
+ | `POST` | `/api/wiki/{{workspace_name}}/files/20_wiki/<slug>.md` | Rewrite an existing wiki note — re-POST to the same path overwrites in place (a `.snapshots/` backup is taken first). |
33
33
  | `PATCH` | `/api/wiki/{{workspace_name}}/files/20_wiki/_index.md` | Append a new wiki note's entry (`mode: "append"`). |
34
34
  | `PATCH` | `/api/wiki/{{workspace_name}}/files/log.md` | Append the per-run summary (`mode: "append"`). |
35
35
 
@@ -52,7 +52,7 @@ Every request must include `-H 'x-process-key: wiki.compile'`. The `wiki-vault-r
52
52
  - Use `90_meta/taxonomy.md` for canonical slugs.
53
53
  - Preserve source URLs and quoted passages verbatim. Mark conflicts and unknowns explicitly.
54
54
  - Each note's frontmatter MUST list every source raw under a `sources:` array and the synthesis date under `compiled_at:`.
55
- - Write via `POST` (new slug) or `PATCH mode: "replace"` (existing slug). Read-before-write any slug you `PATCH`-replace so you preserve material that the new raws didn't cover.
55
+ - Write via `POST` for both new and existing slugs re-POSTing to an existing `20_wiki/<slug>.md` overwrites it in place (the daemon snapshots the prior version to `.snapshots/` first). Read-before-write any slug you overwrite so you preserve material that the new raws didn't cover. (`PATCH` on `20_wiki/<slug>.md` only supports `mode: "append"` / `"prepend"` — there is no `replace` mode.)
56
56
  6. **Append `20_wiki/_index.md`** with one bullet per newly created or modified wiki note (`PATCH mode: "append"`). Skip notes that were unchanged.
57
57
  7. **Append `log.md`** with one operational line summarising the run: `[<ISO>] wiki.compile (<mode>): compiled <N> notes from <M> raws — added <A>, updated <B>, unchanged <C>`.
58
58
 
@@ -93,22 +93,23 @@ Inside `<<'JSON'` (single-quoted marker) the body is verbatim — only JSON's ow
93
93
  ## Anti-patterns (silent denials — never claim success after these)
94
94
 
95
95
  - `Write` / `Edit` tools — **stripped from the session allow-list** for every `wiki.*` process key. The SDK denies them silently under `dontAsk` ("Permission to use Write has been denied …"). There is no path-rewrite that makes them work; use the Wiki API via curl. The agent that hit "Write denied → reported failure" is the canonical failure mode this section exists to prevent.
96
- - `Bash(find ...)`, `Bash(ls ...)`, `Bash(cat ...)`, `Bash(grep ...)`, `Bash(wc ...)`, and every other shell utility — silently denied. Only `Bash(curl *)` and `Bash(jq *)` are on the allow-list. Enumerate via `GET /api/wiki/<ws>/index`, not from disk.
96
+ - `Bash(find ...)`, `Bash(ls ...)`, `Bash(cat ...)`, `Bash(grep ...)`, `Bash(wc ...)`, and every other shell utility — silently denied. Only `Bash(curl *)` and `Bash(jq *)` are on the allow-list (`jq` runs standalone or as `curl … | jq`). Enumerate via `GET /api/wiki/<ws>/index`, not from disk.
97
97
  - `echo '{...}' | curl ...`, `cat <<JSON | curl ... -d @- JSON`, `bash -c "curl ..."`, `( curl ... )`, `var=... curl ...`, `curl ... ; curl ...` — Bash command does not start with `curl`; silently denied. The reverse — `curl ... -d @- <<'JSON' … JSON` on the same line — DOES start with `curl` and IS allowed (the heredoc redirects into curl's stdin).
98
98
  - `curl ... -d @/some/path` — `@<filepath>` is blocked by the security hook and the shim. The only acceptable `@…` value is the literal stdin marker `@-`.
99
99
  - `curl http://example.com/...` (non-loopback) — only `http://localhost:8321/api/*` is permitted.
100
100
  - POST to a non-existent path (`/api/send-message`, `/api/notify-user`, `/api/dm`, etc.) — not daemon routes; calls return 401/404 and DO NOT notify anyone. Your completion DM (final assistant text) is what the daemon forwards.
101
- - Re-POSTing to `/api/wiki/.../20_wiki/<slug>.md` to updatePOST is create-only; the second call returns 409. Use `PATCH mode: "replace"` to overwrite, or pick a different slug.
101
+ - Assuming POST to `/api/wiki/.../20_wiki/<slug>.md` is create-onlyit is NOT. Re-POSTing to an existing `20_wiki/<slug>.md` overwrites it in place (with a `.snapshots/` backup first); the `wiki` layer has no create-only guard. The `409 append_only` guard only fires for the `10_raw/` and `log.md` layers. There is no `PATCH mode: "replace"` PATCH only supports `append` / `prepend`.
102
102
 
103
103
  ## Common error codes
104
104
 
105
105
  | Status | Body code | Cause | Recovery |
106
106
  |---|---|---|---|
107
- | 400 | `invalid_body` | JSON body did not parse / `content` not a string | Switch to the heredoc shape if you were inline-escaping a multi-KB body. |
107
+ | 400 | `invalid_json_body` | JSON body did not parse (checked first, before Zod) | Switch to the heredoc shape if you were inline-escaping a multi-KB body. |
108
+ | 400 | `invalid_body` | Body parsed but `content` is not a string (Zod rejection) | Ensure `content` is a JSON string. |
108
109
  | 400 | `invalid_path` / `invalid_layer` | Slug shape or layer prefix rejected | Path must be exactly `20_wiki/<slug>.md`. Slug matches `^[a-z0-9][a-z0-9-]*$`. |
109
110
  | 403 | `missing_process_key` | Header missing | Add `-H 'x-process-key: wiki.compile'`. |
110
- | 403 | `wiki_write_denied` | Trying to write outside `20_wiki/` (or the `_index.md` / `log.md` exceptions) under `wiki.compile` | Fix the target path. Use `wiki-graduate` for inbox-to-wiki promotion (same process key, different source layer). |
111
- | 409 | `append_only` | POST to an existing slug | Use `PATCH mode: "replace"` or pick a different slug. |
111
+ | 403 | `wiki_write_denied` | A non-`wiki.compile` key targeting the `20_wiki` layer. `_index.md` is a normal `20_wiki` file; `log.md` is its own append-only layer (PATCH-only). | Fix the target path. Use `wiki-graduate` for inbox-to-wiki promotion (same process key, different source layer). |
112
+ | 409 | `append_only` | POST to an existing `10_raw/` file or `log.md` (those two layers are create-only). Does NOT apply to `20_wiki/<slug>.md` — re-POSTing there overwrites in place. | For `log.md` use `PATCH mode: "append"`. `10_raw/` files cannot be overwritten by design. |
112
113
  | 413 | — | Body exceeds 512 KB | Split the note or trim verbatim extracts. |
113
114
  | 5xx | — | Daemon error | Append a failure line to `log.md`, classify the run as partial, do not retry inside the same turn. |
114
115
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wiki-connect
3
- description: Load for wiki.connect. Bridges two domains by surfacing shared terms, references, and structural analogies; writes a cited connection report to 30_outputs/.
3
+ description: Bridge two wiki domains on /connect A B surface shared terms, common references, and structural analogies, then write a cited connection report to 30_outputs/. Runs under process key wiki.connect.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
6
  ---
@@ -11,6 +11,16 @@ You run under process key `wiki.connect`.
11
11
 
12
12
  Read `<wiki_command>` for the two topics — fields `topic_a` and `topic_b`. Your job is to find genuine bridges between the two domains using only what the wiki contains. Speculative analogies are out of scope; if there is no real overlap, say so plainly.
13
13
 
14
+ ## Endpoints
15
+
16
+ Every request includes `-H 'x-process-key: wiki.connect'`. Body shapes:
17
+
18
+ | Method | Path | Body |
19
+ |---|---|---|
20
+ | `GET` | `/api/wiki/{{workspace_name}}/search?q=<topic>` | — |
21
+ | `POST` | `/api/wiki/{{workspace_name}}/files/30_outputs/<file>.md` | `{"content":"<report-md>"}` |
22
+ | `PATCH` | `/api/wiki/{{workspace_name}}/files/log.md` | `{"mode":"append","content":"<line>\n"}` |
23
+
14
24
  ## Method
15
25
 
16
26
  1. Search each topic independently:
@@ -30,11 +40,18 @@ Read `<wiki_command>` for the two topics — fields `topic_a` and `topic_b`. You
30
40
 
31
41
  Write exactly one report:
32
42
 
33
- ```
34
- POST /api/wiki/{{workspace_name}}/files/30_outputs/<YYYY-MM-DD>-connect-<slug>.md
35
- x-process-key: wiki.connect
43
+ ```bash
44
+ curl http://localhost:8321/api/wiki/{{workspace_name}}/files/30_outputs/<YYYY-MM-DD>-connect-<slug>.md \
45
+ -X POST \
46
+ -H 'content-type: application/json' \
47
+ -H 'x-process-key: wiki.connect' \
48
+ -d @- <<'JSON'
49
+ {"content":"<report-md>"}
50
+ JSON
36
51
  ```
37
52
 
53
+ The body is `{"content":"<report-md>"}` — `wikiFilePostSchema` requires the `content` field. An empty body returns `400 invalid_json_body`; valid JSON missing `content` returns `400 invalid_body`. Always send the `content` field.
54
+
38
55
  - `<YYYY-MM-DD>` is today's date.
39
56
  - `<slug>` is `<slug-a>--<slug-b>` using the canonical slugs from `90_meta/taxonomy.md` when available, kebab-cased and joined by a double hyphen.
40
57
 
@@ -59,7 +76,17 @@ Report shape:
59
76
  - proposed wiki slug, one-sentence rationale, suggested anchor notes
60
77
  ```
61
78
 
62
- If no genuine bridges exist, write the report anyway with empty sections marked `_(none)_` and a `## Summary` that names that clearly — a "no connection" finding is still useful to the owner. Append a one-line `log.md` entry referencing the output filename and both topics.
79
+ If no genuine bridges exist, write the report anyway with empty sections marked `_(none)_` and a `## Summary` that names that clearly — a "no connection" finding is still useful to the owner.
80
+
81
+ Then append a one-line `log.md` entry referencing the output filename and both topics. `log.md` is append-only — POST to an existing `log.md` returns `409 'Use PATCH to append log.md'`. Use PATCH:
82
+
83
+ ```bash
84
+ curl http://localhost:8321/api/wiki/{{workspace_name}}/files/log.md \
85
+ -X PATCH \
86
+ -H 'content-type: application/json' \
87
+ -H 'x-process-key: wiki.connect' \
88
+ -d '{"mode":"append","content":"[<ISO>] wiki.connect: <topic_a> ↔ <topic_b> → 30_outputs/<file>.md\n"}'
89
+ ```
63
90
 
64
91
  ### Completion message (mandatory)
65
92
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wiki-ingest
3
- description: Load for wiki.ingest_url. Captures one URL into 10_raw/<slug>.md by POSTing through the daemon Wiki API. Carries the canonical curl invocation, the path / response contract, and the strict success-verification rule.
3
+ description: Load for wiki.ingest_url. Use when ingesting one shared URL/article into the wiki raw layer (10_raw) via the daemon Wiki API. Carries the canonical curl invocation, the path / response contract, and the strict success-verification rule.
4
4
  allowed-tools:
5
5
  - WebFetch
6
6
  - Bash(curl *)
@@ -47,7 +47,7 @@ Do NOT call any other daemon endpoint. The daemon has **no** `/api/send-message`
47
47
  - `## Source extracts` — verbatim or close-paraphrase quotes.
48
48
  - `## Open questions` — anything you could not verify from the page.
49
49
  4. **POST the note** via the canonical curl shape (next section). Inspect the response body.
50
- 5. **Verify**: the response body must be exactly `{"ok":true,"path":"10_raw/<slug>.md"}`. If anything else (4xx/5xx, missing `ok`, wrong path, no body, `PA_API_ERROR …` on stderr), treat it as failure. Follow the error table below or PATCH `log.md` and emit the failure DM.
50
+ 5. **Verify**: the response body must be exactly `{"ok":true,"path":"10_raw/<slug>.md"}`. If anything else (4xx/5xx, missing `ok`, wrong path, no body, `PA_API_ERROR …` on stderr), treat it as failure. Follow the error->recovery table in "Curl mechanics" or PATCH `log.md` and emit the failure DM.
51
51
  6. **Emit the completion DM** (last section). Success or failure, exactly one line, no extra prose.
52
52
 
53
53
  ## Path shape — exact, no nesting
@@ -119,59 +119,15 @@ curl http://localhost:8321/api/wiki/{{workspace_name}}/files/log.md \
119
119
  -d '{"mode":"append","content":"[2026-05-13T05:08:00Z] wiki.ingest_url failed https://news.example.com/path/123 — fetch returned 403\n"}'
120
120
  ```
121
121
 
122
- ## Body-quoting rules
122
+ ## Curl mechanics, anti-patterns, and error recovery
123
123
 
124
- **Heredoc body (recommended for article bodies):** wrap with a single-quoted marker (`<<'JSON' JSON`). The body is verbatim — shell does NOT expand `$`, backticks, or quotes. Only JSON's own escapes apply: `\"`, `\\`, `\n`. The line `JSON` must appear at column 0 with no trailing characters.
124
+ Body-quoting rules, the silent-denial anti-patterns, and the per-status error->recovery table live on demand:
125
125
 
126
- **Inline body (short bodies only):** wrap the JSON in outer single quotes; inside, use JSON escapes:
127
-
128
- | Need in `content` | Write in shell-arg |
129
- |---|---|
130
- | `"` | `\"` |
131
- | `\` | `\\` |
132
- | newline | `\n` |
133
- | `'` | `'\''` (close-escape-reopen), or substitute `’` (U+2019) |
134
- | `$`, backticks | leave as-is (single quotes suppress expansion) |
135
-
136
- Keep the note compact — well under 512 KB. Curate 5-20 KB of the most informative extracts rather than dumping the whole page.
137
-
138
- ## Anti-patterns (silent denials / 4xx — never claim success after these)
139
-
140
- - `WebFetch http://localhost:8321/...` — Claude WebFetch refuses loopback. Use curl.
141
- - `echo '{...}' | curl ...`, `cat <<JSON | curl ... -d @- JSON ; …`, `bash -c "curl ..."` — Bash command does not start with `curl`; denied silently under `dontAsk`. (Heredoc redirected directly into curl on the same line — `curl ... -d @- <<'JSON' … JSON` — IS allowed because the command still starts with `curl`.)
142
- - `curl ... -d @/tmp/body.json` — `@<path>` form is blocked by the security hook and by the shim.
143
- - `curl http://example.com/...` (non-loopback) — security hook denies; only `http://localhost:8321/api/*` is permitted.
144
- - POST to a non-existent path like `/api/send-message`, `/api/whatsapp/send`, `/api/notify-user`, `/api/dm`. These are NOT daemon routes; calls return 401/404 and DO NOT notify anyone.
145
- - POST/PATCH to `/api/wiki/.../10_raw/<slug>.md` a second time — raw is create-only; the second call returns 409 and **does NOT** modify the file.
146
- - `Write` / `Edit` tools — stripped from the session allow-list for every `wiki.*` process key. The SDK denies them silently under `dontAsk` (you'll see "Permission to use Write has been denied …"). There is no path-rewrite that makes them work; use the Wiki API via curl. `Bash(find ...)`, `Bash(ls ...)`, `Bash(cat ...)` and other shell utilities are also denied — only `Bash(curl *)` and `Bash(jq *)` are on the allow-list.
147
-
148
- ## Troubleshooting
149
-
150
- Every non-2xx response causes the curl shim to write one line to stderr:
151
-
152
- ```
153
- PA_API_ERROR {"method":"POST","path":"/api/wiki/...","status":<n>,"bodyPreview":"<json error>"}
154
- ```
155
-
156
- Read `status` + `bodyPreview` and react:
157
-
158
- | Status | Body code | Cause | Recovery |
159
- |---|---|---|---|
160
- | 200 | (response is `{"ok":true,"path":...}`) | Success | Emit the success DM. |
161
- | 200 | (response missing `ok` or `path`) | Should not happen — but if it does, treat as failure | Emit failure DM. |
162
- | 400 | `invalid_body` | JSON body did not parse / `content` not a string | Re-emit the body. For inline `-d` check your single-quote / `\n` / `\"` escapes. If the body was `@-` literally, the heredoc was missed — switch to the heredoc shape (`-d @- <<'JSON' … JSON` on the same line as curl). |
163
- | 400 | `invalid_path` / `invalid_layer` | Slug or layer rejected | Path must be **exactly** `10_raw/<slug>.md`, slug matching `^[a-z0-9][a-z0-9-]*$`. No nested folders. |
164
- | 403 | `missing_process_key` | Header missing | Add `-H 'x-process-key: wiki.ingest_url'` and retry. |
165
- | 403 | `raw_write_denied` | Process key isn't `wiki.ingest_url` | Configuration error; emit failure DM, do not retry. |
166
- | 409 | `append_only` | Slug already exists in `10_raw/` | Suffix the slug (`<slug>-2`), retry the POST **once**. If `-2` also 409, PATCH log.md and emit failure DM — do not loop further. |
167
- | 413 | (body too large) | Article > 512 KB | Trim verbatim extracts; keep essentials. |
168
- | 5xx | — | Daemon error | PATCH log.md and emit failure DM. Do not retry — the daemon will not heal mid-turn. |
169
-
170
- If the Bash call returns to the prompt with **no stdout body and no `PA_API_ERROR`**, your command did not start with literal `curl` and was silently denied. Rewrite it as a flat, single-line curl invocation following the canonical shape above.
126
+ {{> ref:curl-errors }}
171
127
 
172
128
  ## Completion message (mandatory final assistant text)
173
129
 
174
- Emit exactly one line as your final assistant message. The daemon forwards this verbatim to the channel the bang came from — no other delivery mechanism is needed and you must NOT try to "send" it through another endpoint.
130
+ Emit exactly one line as your final assistant message. The daemon forwards this verbatim to the channel the bang came from — no other delivery mechanism is needed and you must NOT try to "send" it through another endpoint (no /api/send-message etc.; see "Allowed endpoints").
175
131
 
176
132
  - Success (only after seeing `{"ok":true,"path":"10_raw/<slug>.md"}`): `Ingested <url> → 10_raw/<slug>.md`
177
133
  - Failure (any other outcome): `Failed <url> — <one-sentence reason>`
@@ -0,0 +1,58 @@
1
+ ---
2
+ kind: reference
3
+ name: curl-errors
4
+ description: On-demand detail for wiki-ingest curl mechanics — body-quoting rules, silent-denial anti-patterns, and the per-status error->recovery table.
5
+ ---
6
+
7
+ # Curl mechanics, anti-patterns, and error recovery
8
+
9
+ ## Body-quoting rules
10
+
11
+ **Heredoc body (recommended for article bodies):** wrap with a single-quoted marker (`<<'JSON' … JSON`). The body is verbatim — shell does NOT expand `$`, backticks, or quotes. Only JSON's own escapes apply: `\"`, `\\`, `\n`. The line `JSON` must appear at column 0 with no trailing characters.
12
+
13
+ **Inline body (short bodies only):** wrap the JSON in outer single quotes; inside, use JSON escapes:
14
+
15
+ | Need in `content` | Write in shell-arg |
16
+ |---|---|
17
+ | `"` | `\"` |
18
+ | `\` | `\\` |
19
+ | newline | `\n` |
20
+ | `'` | `'\''` (close-escape-reopen), or substitute `’` (U+2019) |
21
+ | `$`, backticks | leave as-is (single quotes suppress expansion) |
22
+
23
+ Keep the note compact — well under 512 KB. Curate 5-20 KB of the most informative extracts rather than dumping the whole page.
24
+
25
+ ## Anti-patterns (silent denials / 4xx — never claim success after these)
26
+
27
+ - `WebFetch http://localhost:8321/...` — Claude WebFetch refuses loopback. Use curl.
28
+ - `echo '{...}' | curl ...`, `cat <<JSON | curl ... -d @- JSON ; …`, `bash -c "curl ..."` — Bash command does not start with `curl`; denied silently under `dontAsk` (see "Canonical curl invocation"). (Heredoc redirected directly into curl on the same line — `curl ... -d @- <<'JSON' … JSON` — IS allowed because the command still starts with `curl`.)
29
+ - `curl ... -d @/tmp/body.json` — `@<path>` form is blocked by the security hook and by the shim.
30
+ - `curl http://example.com/...` (non-loopback) — security hook denies; only `http://localhost:8321/api/*` is permitted.
31
+ - POST to a non-existent path like `/api/send-message` etc. (see "Allowed endpoints") — calls return 401/404 and DO NOT notify anyone.
32
+ - POST/PATCH to `/api/wiki/.../10_raw/<slug>.md` a second time — raw is create-only; the second call returns 409 and **does NOT** modify the file.
33
+ - `Write` / `Edit` tools — stripped from the session allow-list for every `wiki.*` process key. The SDK denies them silently under `dontAsk` (you'll see "Permission to use Write has been denied …"). There is no path-rewrite that makes them work; use the Wiki API via curl. `Bash(find ...)`, `Bash(ls ...)`, `Bash(cat ...)` and other shell utilities are also denied — only `Bash(curl *)` and `Bash(jq *)` are on the allow-list.
34
+
35
+ ## Troubleshooting
36
+
37
+ Every non-2xx response causes the curl shim to write one line to stderr:
38
+
39
+ ```
40
+ PA_API_ERROR {"method":"POST","path":"/api/wiki/...","status":<n>,"bodyPreview":"<json error>"}
41
+ ```
42
+
43
+ Read `status` + `bodyPreview` and react:
44
+
45
+ | Status | Body code | Cause | Recovery |
46
+ |---|---|---|---|
47
+ | 200 | (response is `{"ok":true,"path":...}`) | Success | Emit the success DM. |
48
+ | 200 | (response missing `ok` or `path`) | Should not happen — but if it does, treat as failure | Emit failure DM. |
49
+ | 400 | `invalid_json_body` | JSON body did not parse (runs before the Zod check) | Re-emit the body. For inline `-d` check your single-quote / `\n` / `\"` escapes. If the body was `@-` literally, the heredoc was missed — switch to the heredoc shape (`-d @- <<'JSON' … JSON` on the same line as curl). |
50
+ | 400 | `invalid_body` | Body parsed but `content` is not a string (Zod rejection) | Re-emit the body with `content` as a JSON string. |
51
+ | 400 | `invalid_path` / `invalid_layer` | Slug or layer rejected | Path must be **exactly** `10_raw/<slug>.md`, slug matching `^[a-z0-9][a-z0-9-]*$`. No nested folders. |
52
+ | 403 | `missing_process_key` | Header missing | Add `-H 'x-process-key: wiki.ingest_url'` and retry. |
53
+ | 403 | `raw_write_denied` | Process key isn't `wiki.ingest_url` | Configuration error; emit failure DM, do not retry. |
54
+ | 409 | `append_only` | Slug already exists in `10_raw/` | Suffix the slug (`<slug>-2`), retry the POST **once**. If `-2` also 409, PATCH log.md and emit failure DM — do not loop further. |
55
+ | 413 | (body too large) | Article > 512 KB | Trim verbatim extracts; keep essentials. |
56
+ | 5xx | — | Daemon error | PATCH log.md and emit failure DM. Do not retry — the daemon will not heal mid-turn. |
57
+
58
+ If the Bash call returns to the prompt with **no stdout body and no `PA_API_ERROR`**, your command was silently denied (see "Canonical curl invocation"). Rewrite it as a flat, single-line curl invocation following the canonical shape.