@aitne-sh/aitne 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/README.md +256 -833
  2. package/agent-assets/agent-profiles/_safety.md +52 -20
  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 +3 -3
  6. package/agent-assets/agent-profiles/routine-fetch-window.md +30 -19
  7. package/agent-assets/agent-profiles/routine.md +4 -3
  8. package/agent-assets/agents/context-index-reconcile/agent.md +52 -0
  9. package/agent-assets/agents/evening-review/agent.md +53 -0
  10. package/agent-assets/agents/hourly-check/agent.md +62 -0
  11. package/agent-assets/agents/monthly-review/agent.md +55 -0
  12. package/agent-assets/agents/morning-routine/agent.md +78 -0
  13. package/agent-assets/agents/roadmap-maintenance/agent.md +52 -0
  14. package/agent-assets/agents/skill-curation/agent.md +52 -0
  15. package/agent-assets/agents/user-profile-sweep-evening/agent.md +48 -0
  16. package/agent-assets/agents/user-profile-sweep-morning/agent.md +53 -0
  17. package/agent-assets/agents/weekly-review/agent.md +51 -0
  18. package/agent-assets/docs/concepts/agent-day.md +18 -11
  19. package/agent-assets/docs/concepts/auth-health.md +56 -10
  20. package/agent-assets/docs/concepts/backends-and-tiers.md +110 -41
  21. package/agent-assets/docs/concepts/costs-and-quotas.md +74 -19
  22. package/agent-assets/docs/concepts/delegated-mode.md +193 -75
  23. package/agent-assets/docs/concepts/memory-model.md +79 -34
  24. package/agent-assets/docs/concepts/observations.md +61 -11
  25. package/agent-assets/docs/concepts/process-keys.md +66 -17
  26. package/agent-assets/docs/concepts/routines.md +77 -32
  27. package/agent-assets/docs/concepts/safety-and-execution.md +50 -21
  28. package/agent-assets/docs/concepts/safety-model.md +62 -37
  29. package/agent-assets/docs/concepts/skills.md +38 -17
  30. package/agent-assets/docs/features/integrations/browser-history.md +195 -0
  31. package/agent-assets/docs/features/integrations/calendar.md +40 -30
  32. package/agent-assets/docs/features/integrations/git.md +20 -9
  33. package/agent-assets/docs/features/integrations/github.md +93 -35
  34. package/agent-assets/docs/features/integrations/mail.md +60 -17
  35. package/agent-assets/docs/features/integrations/notion.md +51 -11
  36. package/agent-assets/docs/features/integrations/obsidian.md +35 -7
  37. package/agent-assets/docs/features/lifestyle/git.md +45 -44
  38. package/agent-assets/docs/features/lifestyle/reading.md +50 -22
  39. package/agent-assets/docs/features/lifestyle/receipts.md +66 -21
  40. package/agent-assets/docs/features/lifestyle/travel-bookings.md +91 -14
  41. package/agent-assets/docs/features/memory-files/agent-journal.md +111 -50
  42. package/agent-assets/docs/features/memory-files/projects.md +75 -15
  43. package/agent-assets/docs/features/memory-files/roadmap.md +55 -10
  44. package/agent-assets/docs/features/memory-files/schedule.md +113 -70
  45. package/agent-assets/docs/features/memory-files/today.md +47 -21
  46. package/agent-assets/docs/features/memory-files/user-profile.md +67 -31
  47. package/agent-assets/docs/features/messaging/bang-commands.md +115 -28
  48. package/agent-assets/docs/features/messaging/dashboard-chat.md +43 -21
  49. package/agent-assets/docs/features/messaging/discord.md +46 -4
  50. package/agent-assets/docs/features/messaging/overview.md +40 -19
  51. package/agent-assets/docs/features/messaging/pairing-and-magic-phrase.md +94 -27
  52. package/agent-assets/docs/features/messaging/slack.md +79 -14
  53. package/agent-assets/docs/features/messaging/telegram.md +25 -6
  54. package/agent-assets/docs/features/messaging/whatsapp.md +79 -14
  55. package/agent-assets/docs/features/operations/activity-and-conversations.md +45 -16
  56. package/agent-assets/docs/features/operations/approvals.md +53 -15
  57. package/agent-assets/docs/features/operations/backend-routing.md +75 -16
  58. package/agent-assets/docs/features/operations/cost-tracking.md +90 -17
  59. package/agent-assets/docs/features/operations/managed-chromium.md +221 -0
  60. package/agent-assets/docs/features/operations/notifications.md +58 -11
  61. package/agent-assets/docs/features/operations/quiet-hours.md +63 -40
  62. package/agent-assets/docs/features/operations/schedule-approaching.md +59 -16
  63. package/agent-assets/docs/features/routines/custom-routines.md +97 -23
  64. package/agent-assets/docs/features/routines/evening-review.md +75 -22
  65. package/agent-assets/docs/features/routines/hourly-check.md +150 -30
  66. package/agent-assets/docs/features/routines/morning-routine.md +60 -33
  67. package/agent-assets/docs/features/routines/weekly-review.md +65 -20
  68. package/agent-assets/docs/features/wiki/commands.md +37 -16
  69. package/agent-assets/docs/features/wiki/cost-and-approval.md +240 -0
  70. package/agent-assets/docs/features/wiki/dashboard.md +255 -0
  71. package/agent-assets/docs/features/wiki/overview.md +80 -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 +64 -32
  75. package/agent-assets/docs/getting-started/02-first-steps.md +28 -10
  76. package/agent-assets/docs/getting-started/03-what-can-this-do.md +42 -21
  77. package/agent-assets/docs/getting-started/04-first-day.md +52 -20
  78. package/agent-assets/docs/glossary.md +285 -21
  79. package/agent-assets/docs/guides/add-a-custom-routine.md +74 -22
  80. package/agent-assets/docs/guides/backup-and-restore.md +92 -14
  81. package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +62 -25
  82. package/agent-assets/docs/guides/build-your-wiki.md +33 -6
  83. package/agent-assets/docs/guides/change-which-model-handles-x.md +70 -9
  84. package/agent-assets/docs/guides/connect-a-new-mail-account.md +80 -15
  85. package/agent-assets/docs/guides/explore-with-trace-and-connect.md +32 -9
  86. package/agent-assets/docs/guides/import-knowledge-file.md +60 -39
  87. package/agent-assets/docs/guides/install-and-run.md +64 -19
  88. package/agent-assets/docs/guides/maintain-wiki-health.md +41 -10
  89. package/agent-assets/docs/guides/migrate-machines.md +86 -18
  90. package/agent-assets/docs/guides/multiple-wikis-for-multiple-domains.md +119 -59
  91. package/agent-assets/docs/guides/pause-the-agent.md +71 -22
  92. package/agent-assets/docs/guides/reinstall-cleanly.md +102 -17
  93. package/agent-assets/docs/guides/setup-wizard.md +126 -56
  94. package/agent-assets/docs/guides/switch-default-backend.md +72 -17
  95. package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +31 -10
  96. package/agent-assets/docs/reference/api.md +162 -23
  97. package/agent-assets/docs/reference/cli-commands.md +55 -15
  98. package/agent-assets/docs/reference/config.md +246 -39
  99. package/agent-assets/docs/reference/disallowed-tools.md +42 -10
  100. package/agent-assets/docs/reference/keyboard-shortcuts.md +47 -10
  101. package/agent-assets/docs/reference/knowledge-layout.md +620 -0
  102. package/agent-assets/docs/reference/process-keys.md +126 -20
  103. package/agent-assets/docs/reference/skills.md +62 -18
  104. package/agent-assets/docs/troubleshooting/auth-failed.md +53 -19
  105. package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +96 -22
  106. package/agent-assets/docs/troubleshooting/fallback-keeps-firing.md +94 -20
  107. package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +77 -22
  108. package/agent-assets/docs/troubleshooting/morning-routine-didnt-run.md +87 -22
  109. package/agent-assets/docs/troubleshooting/observation-not-detected.md +85 -21
  110. package/agent-assets/docs/troubleshooting/quota-exhausted.md +36 -6
  111. package/agent-assets/docs/troubleshooting/wiki-ingest-full-blocked.md +128 -51
  112. package/agent-assets/docs/troubleshooting/wiki-write-failed.md +33 -11
  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 +2 -2
  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 +122 -0
  119. package/agent-assets/skills/agent-create/SKILL.md +149 -0
  120. package/agent-assets/skills/attach/SKILL.md +3 -4
  121. package/agent-assets/skills/browser-history/SKILL.md +198 -0
  122. package/agent-assets/skills/browser-history-respond/SKILL.md +106 -0
  123. package/agent-assets/skills/browser-task/SKILL.md +169 -0
  124. package/agent-assets/skills/context/SKILL.md +45 -463
  125. package/agent-assets/skills/context/curation.json +2 -2
  126. package/agent-assets/skills/context/references/api.md +232 -0
  127. package/agent-assets/skills/context/references/required-frontmatter.md +73 -0
  128. package/agent-assets/skills/context/references/snapshot-files.md +103 -0
  129. package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +4 -4
  130. package/agent-assets/skills/docs-search/SKILL.md +17 -16
  131. package/agent-assets/skills/external-services/SKILL.delegated.claude.md +14 -26
  132. package/agent-assets/skills/external-services/SKILL.delegated.codex.md +14 -26
  133. package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +14 -26
  134. package/agent-assets/skills/external-services/SKILL.md +9 -262
  135. package/agent-assets/skills/external-services/SKILL.native.claude.md +6 -7
  136. package/agent-assets/skills/external-services/SKILL.native.codex.md +8 -9
  137. package/agent-assets/skills/external-services/SKILL.native.gemini.md +5 -6
  138. package/agent-assets/skills/external-services/references/calendar-apple.md +97 -0
  139. package/agent-assets/skills/external-services/references/calendar-google.md +72 -0
  140. package/agent-assets/skills/external-services/references/calendar-outlook.md +36 -0
  141. package/agent-assets/skills/external-services/references/github.md +17 -0
  142. package/agent-assets/skills/external-services/references/obsidian.md +49 -0
  143. package/agent-assets/skills/external-services/references/skills-crud.md +27 -0
  144. package/agent-assets/skills/gmail-lifestyle/SKILL.md +151 -0
  145. package/agent-assets/skills/gmail-lifestyle/references/receipts-api.md +93 -0
  146. package/agent-assets/skills/gmail-lifestyle/references/travel-bookings-api.md +75 -0
  147. package/agent-assets/skills/mail/SKILL.delegated.claude.md +15 -6
  148. package/agent-assets/skills/mail/SKILL.delegated.codex.md +9 -5
  149. package/agent-assets/skills/mail/SKILL.delegated.gemini.md +9 -5
  150. package/agent-assets/skills/mail/SKILL.md +9 -114
  151. package/agent-assets/skills/mail/SKILL.native.claude.md +1 -1
  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 +110 -0
  155. package/agent-assets/skills/mail/references/examples.md +70 -0
  156. package/agent-assets/skills/mail/references/providers.md +8 -8
  157. package/agent-assets/skills/managed-tasks/SKILL.md +472 -0
  158. package/agent-assets/skills/managed-tasks/references/errors.md +73 -0
  159. package/agent-assets/skills/managed-tasks/references/output-path.md +75 -0
  160. package/agent-assets/skills/managed-tasks/references/recurrence-rule.md +86 -0
  161. package/agent-assets/skills/management-policy/SKILL.md +54 -125
  162. package/agent-assets/skills/management-policy/curation.json +1 -1
  163. package/agent-assets/skills/management-policy/references/policy-workflow.md +101 -0
  164. package/agent-assets/skills/management-policy/seeds/policy-file-shape.seed.json +1 -1
  165. package/agent-assets/skills/notify/SKILL.md +10 -82
  166. package/agent-assets/skills/notify/references/priority.md +65 -0
  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 +6 -10
  171. package/agent-assets/skills/notion/SKILL.native.claude.md +11 -8
  172. package/agent-assets/skills/notion/SKILL.native.codex.md +10 -6
  173. package/agent-assets/skills/notion/SKILL.native.gemini.md +10 -6
  174. package/agent-assets/skills/observations/SKILL.md +25 -14
  175. package/agent-assets/skills/project-doc/SKILL.md +2 -6
  176. package/agent-assets/skills/project-doc/curation.json +3 -3
  177. package/agent-assets/skills/project-doc/seeds/project-shape.seed.json +7 -4
  178. package/agent-assets/skills/project-doc/seeds/slug-grammar.seed.json +3 -3
  179. package/agent-assets/skills/reading/SKILL.md +12 -2
  180. package/agent-assets/skills/reading/references/reading-taste.md +2 -2
  181. package/agent-assets/skills/roadmap/SKILL.md +43 -141
  182. package/agent-assets/skills/roadmap/curation.json +1 -1
  183. package/agent-assets/skills/roadmap/references/api.md +100 -0
  184. package/agent-assets/skills/roadmap/references/cross-check.md +80 -0
  185. package/agent-assets/skills/roadmap/references/migration.md +56 -0
  186. package/agent-assets/skills/roadmap/references/preparation-timeline.md +2 -2
  187. package/agent-assets/skills/roadmap/seeds/entry-types.seed.json +1 -1
  188. package/agent-assets/skills/schedule/SKILL.md +76 -104
  189. package/agent-assets/skills/schedule/references/batch.md +93 -0
  190. package/agent-assets/skills/schedule/references/errors.md +217 -0
  191. package/agent-assets/skills/schedule/references/model-selection.md +96 -0
  192. package/agent-assets/skills/schedule/references/recurrence-rule.md +86 -0
  193. package/agent-assets/skills/scheduled-managed-task/SKILL.md +59 -51
  194. package/agent-assets/skills/today/SKILL.md +32 -62
  195. package/agent-assets/skills/today/curation.json +3 -3
  196. package/agent-assets/skills/today/references/agent-plan-lifecycle.md +114 -0
  197. package/agent-assets/skills/today/seeds/section-shape.seed.json +1 -1
  198. package/agent-assets/skills/user-interview/SKILL.md +23 -67
  199. package/agent-assets/skills/user-interview/references/op-briefing.md +51 -0
  200. package/agent-assets/skills/user-interview/references/op-morning.md +59 -0
  201. package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +9 -1
  202. package/agent-assets/skills/user-profile/SKILL.md +54 -74
  203. package/agent-assets/skills/user-profile/curation.json +2 -2
  204. package/agent-assets/skills/user-profile/references/character-preferences.md +83 -0
  205. package/agent-assets/skills/user-profile/seeds/routing-table.seed.json +8 -8
  206. package/agent-assets/skills/user-profile/seeds/topic-files.seed.json +30 -2
  207. package/agent-assets/skills/wiki/wiki-ask/SKILL.md +0 -1
  208. package/agent-assets/skills/wiki/wiki-compile/SKILL.md +4 -5
  209. package/agent-assets/skills/wiki/wiki-connect/SKILL.md +0 -1
  210. package/agent-assets/skills/wiki/wiki-graduate/SKILL.md +0 -1
  211. package/agent-assets/skills/wiki/wiki-ingest/SKILL.md +0 -1
  212. package/agent-assets/skills/wiki/wiki-lint/SKILL.md +0 -1
  213. package/agent-assets/skills/wiki/wiki-trace/SKILL.md +0 -1
  214. package/agent-assets/skills/wiki/wiki-vault-rules/SKILL.md +0 -1
  215. package/agent-assets/system-prompts/routine-fetch-window.md +78 -0
  216. package/agent-assets/system-prompts/skill-index-instruction.md +26 -0
  217. package/agent-assets/task-flows/_partials/calendar-acquire.google_calendar.md +20 -11
  218. package/agent-assets/task-flows/_partials/calendar-acquire.outlook_calendar.md +18 -9
  219. package/agent-assets/task-flows/_partials/capture-user-info.md +24 -0
  220. package/agent-assets/task-flows/_partials/confirm-subflow.md +68 -0
  221. package/agent-assets/task-flows/_partials/dm-intent.long-horizon.md +35 -0
  222. package/agent-assets/task-flows/_partials/dm-intent.project.md +391 -0
  223. package/agent-assets/task-flows/_partials/mail-acquire.gmail.md +20 -11
  224. package/agent-assets/task-flows/_partials/mail-acquire.outlook_mail.md +18 -9
  225. package/agent-assets/task-flows/_partials/notion-acquire.notion.md +26 -15
  226. package/agent-assets/task-flows/browser_task.md +84 -0
  227. package/agent-assets/task-flows/github.assigned.md +1 -1
  228. package/agent-assets/task-flows/github.pull_request.review_requested.md +2 -2
  229. package/agent-assets/task-flows/github.workflow_run.failed.md +2 -2
  230. package/agent-assets/task-flows/knowledge.import.md +15 -15
  231. package/agent-assets/task-flows/message.received.dm.md +20 -17
  232. package/agent-assets/task-flows/message.received.dm_first.md +11 -15
  233. package/agent-assets/task-flows/routine.custom.md +6 -4
  234. package/agent-assets/task-flows/routine.evening_review.md +46 -170
  235. package/agent-assets/task-flows/routine.fetch_window.md +19 -14
  236. package/agent-assets/task-flows/routine.hourly_check.md +27 -15
  237. package/agent-assets/task-flows/routine.hourly_check.triage.md +1 -1
  238. package/agent-assets/task-flows/routine.monthly_review.md +67 -25
  239. package/agent-assets/task-flows/routine.morning_routine_journal.md +135 -0
  240. package/agent-assets/task-flows/routine.morning_routine_today.md +673 -0
  241. package/agent-assets/task-flows/routine.research_cluster_update.md +35 -0
  242. package/agent-assets/task-flows/routine.research_dispatch.md +38 -0
  243. package/agent-assets/task-flows/routine.research_offer_dm.md +125 -0
  244. package/agent-assets/task-flows/routine.research_wiki_summary.md +53 -0
  245. package/agent-assets/task-flows/routine.roadmap_refresh.md +68 -23
  246. package/agent-assets/task-flows/routine.today_refresh.md +4 -4
  247. package/agent-assets/task-flows/routine.user_profile_sweep.md +19 -20
  248. package/agent-assets/task-flows/routine.weekly_review.md +370 -86
  249. package/agent-assets/task-flows/schedule.approaching.md +0 -1
  250. package/agent-assets/task-flows/scheduled.dm.md +13 -13
  251. package/agent-assets/task-flows/scheduled.task.md +9 -9
  252. package/agent-assets/task-flows/setup.initial.md +171 -251
  253. package/agent-assets/task-flows/setup.update.md +2 -2
  254. package/agent-assets/task-flows/wiki.ingest_url.md +1 -1
  255. package/agent-assets/templates/README.md +27 -20
  256. package/agent-assets/templates/_index.md +42 -26
  257. package/agent-assets/templates/_manifest.json +34 -99
  258. package/agent-assets/templates/{user → identity}/_index.md +1 -1
  259. package/agent-assets/templates/identity/expertise.md +9 -0
  260. package/agent-assets/templates/identity/goals.md +9 -0
  261. package/agent-assets/templates/identity/people.md +13 -0
  262. package/agent-assets/templates/identity/personal.md +9 -0
  263. package/agent-assets/templates/{user → identity}/profile.md +2 -2
  264. package/agent-assets/templates/identity/work.md +9 -0
  265. package/agent-assets/templates/{dossiers → knowledge/dossiers}/_index.md +2 -2
  266. package/agent-assets/templates/{projects → plans/projects}/_active.base +1 -1
  267. package/agent-assets/templates/policies/_index.md +21 -0
  268. package/agent-assets/templates/{rules → policies}/journal-export.md +1 -1
  269. package/agent-assets/templates/policies/journal-format.md +168 -0
  270. package/agent-assets/templates/{rules/policies → policies/management-captures}/_index.md +2 -2
  271. package/agent-assets/templates/{rules → policies}/management.md +3 -3
  272. package/agent-assets/templates/{rules → policies}/mcp.md +1 -1
  273. package/agent-assets/templates/{rules → policies}/redaction.md +1 -1
  274. package/agent-assets/templates/{routines → policies/routines}/_index.md +1 -1
  275. package/agent-assets/templates/{routines → policies/routines}/evening.md +2 -2
  276. package/agent-assets/templates/{routines → policies/routines}/hourly.md +1 -1
  277. package/agent-assets/templates/{routines → policies/routines}/monthly.md +2 -2
  278. package/bin/aitne.mjs +21 -5
  279. package/package.json +5 -4
  280. package/scripts/commands/doctor.mjs +63 -5
  281. package/scripts/commands/run-now.mjs +187 -0
  282. package/scripts/commands/verify.mjs +264 -0
  283. package/scripts/lib/ports.d.mts +27 -0
  284. package/scripts/lib/ports.mjs +36 -0
  285. package/scripts/lib/read-api-token.mjs +176 -0
  286. package/scripts/start.mjs +2 -1
  287. package/agent-assets/docs/features/lifestyle/travel-time.md +0 -52
  288. package/agent-assets/docs/features/routines/monthly-review.md +0 -65
  289. package/agent-assets/skills/management-task-modify/SKILL.md +0 -203
  290. package/agent-assets/skills/management-task-register/SKILL.md +0 -330
  291. package/agent-assets/skills/management-task-stop/SKILL.md +0 -166
  292. package/agent-assets/skills/receipts/SKILL.md +0 -134
  293. package/agent-assets/skills/travel/SKILL.md +0 -132
  294. package/agent-assets/skills/travel-time/SKILL.md +0 -158
  295. package/agent-assets/task-flows/routine.morning_routine.md +0 -322
  296. package/agent-assets/task-flows/routine.morning_routine_initial.md +0 -204
  297. package/agent-assets/templates/context-index.md +0 -42
  298. package/agent-assets/templates/rules/_index.md +0 -19
  299. package/agent-assets/templates/rules/journal-format.md +0 -61
  300. package/agent-assets/templates/user/expertise.md +0 -7
  301. package/agent-assets/templates/user/goals.md +0 -7
  302. package/agent-assets/templates/user/people.md +0 -7
  303. package/agent-assets/templates/user/personal.md +0 -7
  304. package/agent-assets/templates/user/work.md +0 -7
  305. /package/agent-assets/templates/{agent/journal.md → journal/agent.md} +0 -0
  306. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/evening.md +0 -0
  307. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/hourly.md +0 -0
  308. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/monthly.md +0 -0
  309. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/morning.md +0 -0
  310. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/roadmap.md +0 -0
  311. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/weekly.md +0 -0
  312. /package/agent-assets/templates/{projects → plans/projects}/_index.md +0 -0
  313. /package/agent-assets/templates/{roadmap.md → plans/roadmap.md} +0 -0
  314. /package/agent-assets/templates/{routines → policies/routines}/morning.md +0 -0
  315. /package/agent-assets/templates/{routines → policies/routines}/weekly.md +0 -0
  316. /package/agent-assets/templates/{agent → state}/profile-questions.md +0 -0
  317. /package/agent-assets/templates/{today.md → state/today.md} +0 -0
@@ -0,0 +1,232 @@
1
+ ---
2
+ kind: reference
3
+ name: api
4
+ description: Canonical /api/context/* surface — read / write / list / lock / archive / restore / health / repair / action-log. Organised by operation.
5
+ ---
6
+
7
+ # /api/context/* — Operation reference
8
+
9
+ Body submission follows `_safety.md` "Daemon-API body submission":
10
+ small section PATCHes use inline `-d '{...}'`; full-file PUT uses the
11
+ stdin heredoc `-d @- <<'JSON'` shape because the body runs multi-KB.
12
+
13
+ Add `X-Lock-Id: <today_write_lock_id>` (for `state/today.md`) or
14
+ `X-Lock-Id: <roadmap_write_lock_id>` (for `plans/roadmap.md`) on every
15
+ PUT / PATCH when the matching lock-id tag is in your context — the
16
+ daemon emits the tag only while the corresponding lock is held by
17
+ this session.
18
+
19
+ ## Read
20
+
21
+ ### GET /api/context/:path
22
+
23
+ ```bash
24
+ curl -s http://localhost:8321/api/context/plans/roadmap
25
+ ```
26
+
27
+ Response: `{ "content": "...", "lastModified": "ISO8601" }` or `404`.
28
+ Returns the **entire file** — no section-level GET. Path traversal is
29
+ rejected; the trailing `.md` is implicit (do not include it in the
30
+ URL).
31
+
32
+ ### GET /api/context/list/:dir
33
+
34
+ ```bash
35
+ curl -s http://localhost:8321/api/context/list/projects
36
+ ```
37
+
38
+ Response: `{ "files": [{ "name", "lastModified" }, …] }`. Use this to
39
+ enumerate `projects/`, `weekly/`, `monthly/`, `user/`, `rules/`,
40
+ `routines/`, `inbox/` before deciding a write target.
41
+
42
+ ### GET /api/context/today/reconciliation
43
+
44
+ Returns the Morning Routine's reconciliation report for `state/today.md`
45
+ (which mail/calendar/Notion sources contributed what to User Tasks /
46
+ Agent Plan). Read-only diagnostic surface; not the place to write
47
+ changes.
48
+
49
+ ### GET /api/context/health
50
+
51
+ Returns a file-by-file health report — missing frontmatter, stale
52
+ `updated`, validator failures. Read-only.
53
+
54
+ ## Write
55
+
56
+ ### PUT /api/context/:path — Full replace
57
+
58
+ Fields:
59
+
60
+ | Field | Type | Description |
61
+ |---|---|---|
62
+ | `content` | string (required) | Full file body, including frontmatter and H1 where the file's validator requires them. |
63
+ | `expectedMtime` | string (optional) | ISO 8601. When present the daemon returns `409` if the current mtime differs — race protection for read-modify-write loops. |
64
+
65
+ Add `X-Lock-Id: <lock-id>` when writing a locked file (`state/today.md`,
66
+ `plans/roadmap.md`). Snapshots the prior content for restore.
67
+
68
+ Common rejections:
69
+
70
+ - `400 {error:"validation_error", message, path}` — file-specific
71
+ validator failed (e.g. `state/today.md` line-1 date regex, `plans/roadmap.md`
72
+ transition guard, required frontmatter missing on `user/*.md` /
73
+ `rules/*.md` / `projects/*.md` / `daily/*.md` / `weekly/*.md` /
74
+ `monthly/*.md`).
75
+ - `409 {error:"morning_routine_lock_held"}` — the Morning Routine holds
76
+ the `state/today.md` write lock; `409 {error:"roadmap_write_lock_held"}`
77
+ — another session holds the `plans/roadmap.md` lock. Retry with
78
+ backoff (30s × 3).
79
+ - `400 {error:"validation_error", message, path}` — also covers the
80
+ `state/today.md` line-1 agent-day mismatch (the message echoes both the
81
+ supplied date and the daemon's current agent-day). The `422` status is
82
+ reserved for *frontmatter* validation on globbed files (`user/*.md`,
83
+ `rules/*.md`, `projects/*.md`, `daily/*.md`, `weekly/*.md`,
84
+ `monthly/*.md`), not for today.md line-1.
85
+
86
+ `policies/management.md` is user-controlled policy: modify only when the
87
+ user explicitly asks, and preserve every unrelated section.
88
+
89
+ ### PATCH /api/context/:path — Section operation
90
+
91
+ ```bash
92
+ curl -s -X PATCH http://localhost:8321/api/context/state/today \
93
+ -H 'Content-Type: application/json' \
94
+ -d '{"section": "agent_log", "mode": "append", "content": "- 09:35 Processed meeting summary"}'
95
+ ```
96
+
97
+ | Field | Type | Description |
98
+ |---|---|---|
99
+ | `section` | string | snake_case of the heading (e.g. `learned_context`, `agent_log`, `log`). **Omit for `append_to_file` and `frontmatterMerge`**; required for every other mode. |
100
+ | `mode` | `append` \| `replace` \| `clear` \| `clear_before` \| `append_to_file` \| `frontmatterMerge` | Default `append`. |
101
+ | `content` | string | Ignored for `clear` / `clear_before` / `frontmatterMerge`. |
102
+ | `cutoff` | string | **Required when `mode: "clear_before"`.** SQLite format `YYYY-MM-DD HH:MM:SS` (zero-padded). Removes bullet rows whose `- [YYYY-MM-DD HH:MM:SS]` timestamp is ≤ cutoff. |
103
+ | `maxEntries` | number | Optional for `mode: "append"`. After appending, trim oldest bullet entries from the top of the section body so at most `maxEntries` bullets remain. Non-bullet lines are preserved. SignalDetector uses cap = 20. |
104
+ | `frontmatter` | object | **Required when `mode: "frontmatterMerge"`** (and only valid then). Non-empty partial frontmatter object, deep-merged into the file's YAML frontmatter. |
105
+
106
+ Mode semantics:
107
+
108
+ - `append` — add `content` to the end of the section body. Preserves siblings byte-for-byte.
109
+ - `replace` — replace the entire section body with `content`. **Read-before-write is mandatory** — `replace` does not merge; sending just one bullet erases every sibling. The skill body's "Worked example" shows the GET-merge-PATCH pattern.
110
+ - `clear` — drop the section body, keep the heading.
111
+ - `clear_before` — rolling-log trim, drops bullets with timestamps ≤ `cutoff`. Non-bullet lines preserved. Race-safe consumption shape for `Raw Signals` and similar logs.
112
+ - `append_to_file` — omit `section`, append `content` to the end of the file. The intended first-write path when a section header does not exist yet: include the header inside `content` (`"\n## Section\n- bullet\n"`). Also the only write shape for files with no canonical section schema (`journal/agent.md`).
113
+ - `frontmatterMerge` — omit `section`; deep-merge the `frontmatter` object into the file's existing YAML frontmatter (nested objects merge key-by-key; scalars/arrays replace), preserving the body verbatim. The chokepoint-safe way to link entity `sources.<app>.<id>` + set `last_synced_at` without a read-modify-write of the whole file (design 21 §10.4).
114
+
115
+ Common rejections (informational responses worth knowing):
116
+
117
+ - `400 {error:"section_not_found", section, availableSections:[…]}` — the section name did not match. `availableSections` lists every snake_cased heading the file actually has; pick the closest match and retry. Do NOT retry the same `section` value.
118
+ - `400 {error:"validation_error", message, path}` — content failed the file-specific validator.
119
+ - `400 {error:"cutoff_required", message}` — `clear_before` was called without a valid `cutoff`.
120
+ - `409 {error:"morning_routine_lock_held"}` (PATCH/PUT on `state/today`) or
121
+ `409 {error:"roadmap_write_lock_held"}` (PATCH/PUT on `plans/roadmap`) —
122
+ the file's write lock is held by another session. (The generic
123
+ `lock_held` code is only emitted by `POST /api/context/lock/morning-routine`
124
+ on contended acquisition, never by a PATCH/PUT.)
125
+
126
+ ### DELETE /api/context/:path
127
+
128
+ Removes the file (snapshot first). The daemon only allows DELETE on a
129
+ small set of paths — notably `policies/routines/custom/<slug>` (after the user
130
+ asks to retire a custom routine). Most files are NOT delete-eligible
131
+ (e.g. `state/today.md`, `plans/roadmap.md`, `identity/profile.md`); the daemon returns
132
+ `403 {error:"forbidden"}` (with `errors[0].code: "context.write_forbidden"`)
133
+ for those.
134
+
135
+ ## Lifecycle
136
+
137
+ ### POST /api/context/archive-today
138
+
139
+ Rotates `state/today.md` → `state/yesterday.md` (synthesized `daily/YYYY-MM-DD.md`
140
+ is now written by the Morning Routine, not this endpoint). Called by
141
+ the Morning Routine during day rotation; other sessions should NOT
142
+ invoke this directly.
143
+
144
+ ### POST /api/context/restore-snapshot/:id
145
+
146
+ Restores the file from snapshot `id` (the daemon snapshots every PUT /
147
+ PATCH / DELETE). Diagnostic / recovery surface; never part of a normal
148
+ write path. The snapshot listing endpoint is `GET /api/context/health`
149
+ adjacent and is dashboard-only — agents should not rely on it in flows.
150
+
151
+ ### POST /api/context/repair/stub
152
+
153
+ Auto-repairs a stubbed file (e.g. a file that exists but has only the
154
+ H1) by re-running its template seed. Recovery surface; called only
155
+ when `GET /api/context/health` reports the file as stubbed.
156
+
157
+ ## Locks
158
+
159
+ `state/today.md` and `plans/roadmap.md` are locked files: `PUT` / `PATCH` requires
160
+ the lock to be held by the calling session, and the daemon emits an
161
+ `X-Lock-Id` header value that must be echoed on each request via the
162
+ `X-Lock-Id:` header.
163
+
164
+ ### Morning-routine lock (today.md)
165
+
166
+ | Action | Verb | Path |
167
+ |---|---|---|
168
+ | Acquire | `POST` | `/api/context/lock/morning-routine` |
169
+ | Release | `DELETE` | `/api/context/lock/morning-routine` (body `{"lockId":"…"}`) |
170
+
171
+ The dispatcher auto-acquires this lock for `routine.morning_routine`
172
+ and surfaces the id via `<today_write_lock_id>` in the prompt context.
173
+ Other sessions get `409 morning_routine_lock_held` on PUT / PATCH while
174
+ the lock is held — back off 30 s and retry up to 3 times.
175
+
176
+ ### Roadmap lock
177
+
178
+ | Action | Verb | Path |
179
+ |---|---|---|
180
+ | Acquire | `POST` | `/api/context/lock/roadmap` |
181
+ | Release | `DELETE` | `/api/context/lock/roadmap` (body `{"lockId":"…"}`) |
182
+
183
+ The dispatcher auto-acquires for `routine.roadmap_refresh`. Other
184
+ flows (DM handler, evening sweeper) can acquire / release manually.
185
+ PUT / PATCH returns `409 roadmap_write_lock_held` while held by
186
+ another session — same 30 s × 3 retry pattern.
187
+
188
+ **Path-name gotchas** (these return `404 {"error":"unknown_route", …}`
189
+ with a hint pointing at the correct path):
190
+
191
+ - `POST /api/context/plans/roadmap/lock` — order reversed.
192
+ - `POST /api/context/plans/roadmap/write-lock` — order reversed and wrong noun.
193
+ - `POST /api/context/lock/roadmap-write` — wrong noun.
194
+
195
+ A `401 {"error":"unauthorized"}` from a path you believe is correct
196
+ means the path is still wrong (the lock endpoints are Autonomous-tier
197
+ so no bearer token is required).
198
+
199
+ ## Roadmap-specific writes
200
+
201
+ ### POST /api/context/plans/roadmap/id
202
+
203
+ Mints a new stable entry id (`rm-YYYYMMDD-<hash>`) for a roadmap row.
204
+ Requires `X-Lock-Id: <roadmap_write_lock_id>`.
205
+
206
+ ```bash
207
+ curl -s -X POST http://localhost:8321/api/context/plans/roadmap/id \
208
+ -H 'Content-Type: application/json' \
209
+ -H 'X-Lock-Id: <roadmap_write_lock_id>' \
210
+ -d '{"creationDate":"YYYY-MM-DD"}'
211
+ ```
212
+
213
+ The roadmap API also validates ID uniqueness on PUT / PATCH and runs a
214
+ transition guard: if an entry id survives from previous → next
215
+ content, every previous `completed …` row for that id must still
216
+ exist byte-for-byte. If an entry id disappears entirely, removal is
217
+ accepted only when the retention window permits it or the operator
218
+ bypass header is used.
219
+
220
+ ## Action log
221
+
222
+ ### POST /api/action/log
223
+
224
+ ```bash
225
+ curl -s -X POST http://localhost:8321/api/action/log \
226
+ -H 'Content-Type: application/json' \
227
+ -d '{"actionType": "observation", "detail": "reviewed 6 pending changes, added 2 tasks", "result": "success"}'
228
+ ```
229
+
230
+ Records an entry in `agent_actions` for the dashboard's audit feed.
231
+ Not the same as `state/today.md ## Agent Log` (that's a markdown surface;
232
+ this is a SQLite row). Risk tier: Autonomous.
@@ -0,0 +1,73 @@
1
+ ---
2
+ kind: reference
3
+ name: required-frontmatter
4
+ description: YAML frontmatter required by /api/context/* validators on full-file PUT — per-glob type/owner/updated values, H1 requirement.
5
+ ---
6
+
7
+ # Required frontmatter — guarded files
8
+
9
+ Full-file `PUT /api/context/<path>` for the following globs is rejected
10
+ (`400 validation_error`) unless the body opens with the matching YAML
11
+ frontmatter followed by at least one H1 heading.
12
+
13
+ Use today's date (the value from `<current_agent_day date="…" />`) for
14
+ `updated`. The daemon does not auto-fill `updated`; an outdated value
15
+ trips the Evening Review's stale-file detector.
16
+
17
+ ## Per-glob frontmatter
18
+
19
+ | File glob | `type` | `owner` | Required H1 |
20
+ |---|---|---|---|
21
+ | `projects/*.md` | `project` | `shared` | Yes |
22
+ | `daily/*.md` | `daily` | `agent` | Yes |
23
+ | `weekly/*.md` | `weekly` | `agent` | Yes |
24
+ | `monthly/*.md` | `monthly` | `agent` | Yes |
25
+ | `rules/*.md` | `rule` | `shared` | Yes |
26
+ | `user/*.md` | `user` | `shared` | Yes |
27
+
28
+ Every glob also requires `updated: YYYY-MM-DD`.
29
+
30
+ ## Skeleton
31
+
32
+ ```yaml
33
+ ---
34
+ type: <from table>
35
+ owner: <from table>
36
+ updated: YYYY-MM-DD
37
+ ---
38
+
39
+ # <Title>
40
+
41
+ …body…
42
+ ```
43
+
44
+ ## Section-level PATCH
45
+
46
+ `PATCH /api/context/<path>` (`section` + `mode`) **preserves existing
47
+ frontmatter** byte-for-byte. You do not need to re-supply the
48
+ frontmatter on PATCH. The validator only re-runs the frontmatter check
49
+ on `PUT` (full replace).
50
+
51
+ ## Files outside the table
52
+
53
+ `state/today.md`, `plans/roadmap.md`, `journal/agent.md`, and `policies/management-captures/*.md`
54
+ have their own validators (date-line regex, transition guard, append-
55
+ only mode, policy schema). The frontmatter rules in this reference do
56
+ not apply to them — see each owning skill for the specifics.
57
+
58
+ ## Common 400 envelope
59
+
60
+ ```json
61
+ {
62
+ "error": "validation_error",
63
+ "message": "identity/people.md is missing required frontmatter field: updated",
64
+ "path": "identity/people.md"
65
+ }
66
+ ```
67
+
68
+ The `message` field names the offending field. Re-PUT with the
69
+ corrected frontmatter; the daemon does not partially repair the body.
70
+
71
+ `POST /api/context/repair/stub` is the recovery path for a file that
72
+ exists but has only the H1 — it re-runs the template seed. Do not use
73
+ it to bypass a frontmatter validation failure on your own PUT body.
@@ -0,0 +1,103 @@
1
+ ---
2
+ kind: reference
3
+ name: snapshot-files
4
+ description: Weekly / monthly review snapshots, rules / routines files — who writes, when, with what cadence and frontmatter.
5
+ ---
6
+
7
+ # Snapshot files — weekly / monthly / rules / routines
8
+
9
+ These files live in the primary management vault under
10
+ `weekly/`, `monthly/`, `rules/`, and `routines/`. They are not part
11
+ of the day-to-day context churn (`state/today.md`, `plans/roadmap.md`,
12
+ `projects/*.md`); they accumulate slowly and are written by routines
13
+ or by explicit user request.
14
+
15
+ ## weekly/*.md, monthly/*.md
16
+
17
+ | File | Path | Cadence | Writer | Verb |
18
+ |---|---|---|---|---|
19
+ | Weekly review | `weekly/YYYY-Www.md` | Friday Weekly Review only | `routine.weekly_review` | `PUT` (full body) |
20
+ | Monthly review | `monthly/YYYY-MM.md` | Month-end Monthly Review only | `routine.monthly_review` | `PUT` (full body) |
21
+
22
+ Notes:
23
+
24
+ - Monthly files are **user-facing only** — agent-side metrics (cost,
25
+ retry counts, self-critique) go to `journal/agent.md`, not here.
26
+ - Weekly file name uses ISO week (`YYYY-Www` — `2026-W19`, not
27
+ `2026-W5`); pad the week to two digits.
28
+ - Never write `weekly/*.md` or `monthly/*.md` on any other day. The
29
+ Morning Routine, Hourly Check, Evening Review, and DM handlers do
30
+ not produce these files; if you are not the matching review
31
+ routine, do not PUT this path.
32
+ - `PATCH` is technically accepted but unusual. The normal write is a
33
+ single full-body `PUT` at the end of the review session.
34
+ - **Weekly leverage contract.** `weekly/YYYY-Www.md` carries three
35
+ load-bearing H2 sections — `## Carry Over to Next Week`,
36
+ `## Next Week Focus`, `## Lessons for Next Week` — that the
37
+ morning_routine lifts mechanically via the `<previous_week>` context
38
+ block every morning of the next ISO week. Headings must match
39
+ verbatim (digest extractor is header-regex bound); caps are 5 / 3 /
40
+ 3 bullets respectively; empty sections render as `(none recorded)`
41
+ downstream. Full design: `docs/design/appendices/weekly-next-week-leverage.md`.
42
+
43
+ ## agent/journal.md
44
+
45
+ | Field | Value |
46
+ |---|---|
47
+ | Owner | agent |
48
+ | User-facing | No — never read in DMs / briefings / notifications |
49
+ | Write verb | `PATCH mode: "append_to_file"` (no `section` needed) |
50
+
51
+ Weekly sections: `## Weekly YYYY-Www` (What worked / slipped /
52
+ improvements / Metrics). Monthly: `## Monthly YYYY-MM` (follow-up /
53
+ self-critique / gap / adjustments / Metrics). The Evening Review,
54
+ Weekly Review, and Monthly Review each append their own block.
55
+
56
+ **Nothing from this file should appear in notifications.** The journal
57
+ is the agent's private metrics surface, not user-readable content.
58
+
59
+ ## rules/*.md, routines/*.md
60
+
61
+ User-controlled policy and routine files. Only modify when the user
62
+ explicitly asks to change the policy or routine itself.
63
+
64
+ ### `rules/*.md`
65
+
66
+ - Preserve unrelated sections verbatim. PATCH the one section the
67
+ user is changing; do not full-body PUT.
68
+ - `policies/management.md` is the durable management policy file —
69
+ modify only when the user explicitly asks.
70
+
71
+ ### `policies/management-captures/<slug>.md` and `policies/management-captures/_index.md`
72
+
73
+ Route to the `management-policy` skill. It owns the read-before-write,
74
+ similarity-detection, and pause/resume fan-out for durable policies.
75
+ **Do not hand-edit from this skill.** A direct PATCH here bypasses the
76
+ similarity check and the dossier / routine fan-out.
77
+
78
+ ### `routines/<cadence>.md` (built-in cadences)
79
+
80
+ - Cadences: `morning`, `evening`, `weekly`, `monthly`, `hourly`.
81
+ - Keep the existing frontmatter. Keep a `## Checks` section.
82
+ - Append or edit `### <label>` blocks under `## Checks`; each block
83
+ is one user-authored rule the cadence runs.
84
+
85
+ ### `policies/routines/custom/<slug>.md`
86
+
87
+ Full-file `PUT` is usually safest. Required frontmatter:
88
+
89
+ ```yaml
90
+ type: rule
91
+ slug: <kebab-name>
92
+ cron: '<cron expression>'
93
+ process_key: <ProcessKey from packages/shared/src/process-key.ts>
94
+ enabled: true
95
+ backend_tier: lite | medium | high
96
+ max_budget_usd: <number>
97
+ ```
98
+
99
+ The file body must also contain a `## Checks` section.
100
+
101
+ Deleting a custom routine uses `DELETE /api/context/policies/routines/custom/<slug>`
102
+ **only** after the user asks to retire it. The daemon snapshots the
103
+ prior content for restore.
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "kind": "knowledge_layout",
3
3
  "files": [
4
- { "path": "today.md", "purpose": "today's schedule, tasks, agent log, handoff", "sections": [{ "heading": "## Schedule", "contains": "today's events" }, { "heading": "## Tasks", "contains": "open tasks" }, { "heading": "## Agent Notes", "contains": "agent observations" }] },
5
- { "path": "roadmap.md", "purpose": "long-horizon agent action plan + Long-term Plans", "sections": [{ "heading": "## Annual Goals", "contains": "year-scope outcomes" }, { "heading": "## Quarterly Milestones", "contains": "quarter-scope deliverables" }, { "heading": "## Focus Areas", "contains": "current themes of work" }] },
4
+ { "path": "state/today.md", "purpose": "today's schedule, tasks, agent log, handoff", "sections": [{ "heading": "## Schedule", "contains": "today's events" }, { "heading": "## Tasks", "contains": "open tasks" }, { "heading": "## Agent Notes", "contains": "agent observations" }] },
5
+ { "path": "plans/roadmap.md", "purpose": "long-horizon agent action plan + Long-term Plans", "sections": [{ "heading": "## Annual Goals", "contains": "year-scope outcomes" }, { "heading": "## Quarterly Milestones", "contains": "quarter-scope deliverables" }, { "heading": "## Focus Areas", "contains": "current themes of work" }] },
6
6
  { "path": "projects/*.md", "purpose": "per-project state summaries (slug-named)", "sections": [{ "heading": "## Overview", "contains": "what the project is about" }, { "heading": "## Lifecycle Phases", "contains": "phase ladder for the project" }] },
7
- { "path": "weekly/*.md", "purpose": "weekly review snapshots (YYYY-Www)", "sections": [{ "heading": "## Highlights", "contains": "wins and lessons of the week" }] },
7
+ { "path": "weekly/*.md", "purpose": "weekly review snapshots (YYYY-Www); Carry Over / Next Week Focus / Lessons are lifted into next week's morning_routine via <previous_week>", "sections": [{ "heading": "## Highlights", "contains": "wins of the week" }, { "heading": "## Open Loops", "contains": "tasks/commitments still pending" }, { "heading": "## Carry Over to Next Week", "contains": "open loops to carry over (max 5) with one-line reason" }, { "heading": "## Next Week Focus", "contains": "top priorities for next week (max 3)" }, { "heading": "## Lessons for Next Week", "contains": "behavioral observation → action (max 3)" }] },
8
8
  { "path": "monthly/*.md", "purpose": "monthly review snapshots (YYYY-MM)", "sections": [{ "heading": "## Theme", "contains": "the month's overall theme" }] },
9
9
  { "path": "rules/*.md", "purpose": "user-controlled policy files", "sections": [{ "heading": "## Why", "contains": "rationale for the rule" }, { "heading": "## How", "contains": "concrete rule shape" }] },
10
10
  { "path": "user/*.md", "purpose": "user identity and preferences dictionary", "sections": [{ "heading": "## Identity", "contains": "name role tz" }] },
11
- { "path": "agent/journal.md", "purpose": "agent-owned weekly + monthly self-critique", "sections": [{ "heading": "## Weekly", "contains": "what worked, what slipped, improvements" }] }
11
+ { "path": "journal/agent.md", "purpose": "agent-owned weekly + monthly self-critique", "sections": [{ "heading": "## Weekly", "contains": "what worked, what slipped, improvements" }] }
12
12
  ]
13
13
  }
@@ -16,7 +16,7 @@ other endpoint is in the allow-list.
16
16
  **Daemon URL is not optional.** Every call must go to
17
17
  `http://localhost:8321/api/docs/...`. The session's `curl` wrapper
18
18
  rejects any other host/port silently (stdout stays empty), so a request
19
- to `localhost:3000` or a path with no host returns nothing and reads as
19
+ to `localhost:8322` or a path with no host returns nothing and reads as
20
20
  "0 results" — exactly the failure mode that masquerades as "the docs
21
21
  don't cover this".
22
22
 
@@ -31,22 +31,22 @@ the FTS query in three steps:
31
31
  | Input | Topic |
32
32
  |---|---|
33
33
  | "what is delegated mode?" | `delegated mode` |
34
- | "delegatedモードとは何?" | `delegatedモード` |
34
+ | "什么是 delegated 模式?" | `delegated模式` |
35
35
  | "tell me about ProcessKey" | `ProcessKey` |
36
- | "ProcessKeyについて教えて" | `ProcessKey` |
36
+ | "ProcessKey 是什么?" | `ProcessKey` |
37
37
  | "how does the morning routine work?" | `morning routine` |
38
- | "朝のルーチンの動きは?" | `朝のルーチン` |
38
+ | "早晨例行公事是怎么运作的?" | `早晨例行公事` |
39
39
 
40
40
  2. **Split at script boundaries.** If the topic mixes Latin and CJK
41
41
  without spaces, insert a space at every Latin↔CJK boundary. FTS5
42
42
  quotes each whitespace-separated token as a phrase before
43
- AND-joining; an unsplit `delegatedモード` becomes one unmatchable
43
+ AND-joining; an unsplit `delegated模式` becomes one unmatchable
44
44
  trigram phrase.
45
45
 
46
46
  | Input | Split |
47
47
  |---|---|
48
- | `delegatedモード` | `delegated モード` |
49
- | `ProcessKey一覧` | `ProcessKey 一覧` |
48
+ | `delegated模式` | `delegated 模式` |
49
+ | `ProcessKey列表` | `ProcessKey 列表` |
50
50
 
51
51
  3. **Latin wins.** If the split topic contains both Latin and CJK
52
52
  tokens, drop the CJK tokens. The corpus is English; CJK is the
@@ -56,9 +56,9 @@ the FTS query in three steps:
56
56
 
57
57
  | Input | Final query |
58
58
  |---|---|
59
- | `delegated モード` | `delegated` |
60
- | `ProcessKey 一覧` | `ProcessKey` |
61
- | `朝のルーチン` | `朝のルーチン` (passes through; may miss) |
59
+ | `delegated 模式` | `delegated` |
60
+ | `ProcessKey 列表` | `ProcessKey` |
61
+ | `早晨例行公事` | `早晨例行公事` (passes through; may miss) |
62
62
 
63
63
  ## Endpoints
64
64
 
@@ -74,8 +74,9 @@ wrapper.
74
74
  | `curl -s "http://localhost:8321/api/docs"` | Tree listing. Use only when the operator asks "what docs are there?" |
75
75
 
76
76
  The slug in `by-slug/<slug>` is path-style (e.g.
77
- `features/routines/morning-routine`), exactly as it appears in the
78
- search response and inside `[doc:...]` citations.
77
+ `features/routines/morning-routine`, a docs slug not a vault path), <!-- drift-allow -->
78
+ exactly as it appears in the search response and inside `[doc:...]`
79
+ citations.
79
80
 
80
81
  ## Search-call budget — at most 3 per turn
81
82
 
@@ -113,14 +114,14 @@ Optional filters supported by both `term-search` and `search`:
113
114
  ## Worked example
114
115
 
115
116
  ```
116
- Operator: "delegatedモードとは何?"
117
+ Operator: "什么是 delegated 模式?"
117
118
 
118
119
  Step 1 — extract topic:
119
- Strip "とは何?" → "delegatedモード"
120
+ Strip "什么是 / ?" → "delegated模式"
120
121
  Step 2 — split scripts:
121
- "delegatedモード" → "delegated モード"
122
+ "delegated模式" → "delegated 模式"
122
123
  Step 3 — Latin wins:
123
- "delegated モード" → "delegated"
124
+ "delegated 模式" → "delegated"
124
125
  Step 4 — call:
125
126
  curl -s "http://localhost:8321/api/docs/term-search?q=delegated&limit=5"
126
127
  Top hit:
@@ -1,9 +1,8 @@
1
1
  ---
2
2
  name: external-services
3
- description: Load when the task involves Google Calendar, the user's external Obsidian vault, GitHub, or Skills management AND Google Calendar is in cross-backend delegated mode (DM session on Claude Code, Calendar delegated to a different backend's connector). Calendar calls flow through `POST /api/integrations/google_calendar/exec`; the rest of the surface (Obsidian, GitHub, recurring schedules, one-shot scheduling, skills CRUD) is unchanged from the direct-mode body.
3
+ description: Load when the task touches Google Calendar, Obsidian, GitHub, or Skills CRUD AND Google Calendar is cross-backend delegated from a Claude DM session. Calendar calls route through `POST /api/integrations/google_calendar/exec`; other surfaces keep their direct routes.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
- - Bash(jq *)
7
6
  - Read
8
7
  ---
9
8
 
@@ -22,8 +21,7 @@ Claude in this session).
22
21
 
23
22
  The rest of this skill — Obsidian, GitHub, recurring schedules, one-shot
24
23
  scheduling, skills CRUD — works identically to the direct-mode body.
25
- Refer to that body for those services; **only the Calendar section
26
- below changes** under cross-backend delegation.
24
+ Refer to that body for those services; **only the Calendar section below changes** under cross-backend delegation.
27
25
 
28
26
  To check which backend currently owns the Calendar connector, read
29
27
  `~/.personal-agent/integrations.md`. The `/exec` body below is
@@ -214,7 +212,7 @@ carries the connector's own language.
214
212
  **Scope**: this skill targets a **separate** Obsidian vault the user
215
213
  maintains alongside this app — e.g. a personal knowledge base. It is
216
214
  **not** the agent's own primary management store. The agent's primary
217
- files (`today.md`, `roadmap.md`, `projects/`, `rules/`, `routines/`,
215
+ files (`state/today.md`, `plans/roadmap.md`, `projects/`, `rules/`, `routines/`,
218
216
  `user/`, `agent/`, …) live in the primary vault and are reached via
219
217
  `/api/context/*` (see the `context` skill). **Never** use this skill to
220
218
  read or write the primary vault.
@@ -259,10 +257,10 @@ skill and the `/api/context/*` endpoints instead.
259
257
 
260
258
  ```bash
261
259
  curl -s http://localhost:8321/api/github/repos # list watched repos
262
- curl -s "http://localhost:8321/api/github/pulls?state=open" # list PRs
260
+ curl -s "http://localhost:8321/api/github/pulls?owner=user&repo=repo&state=open" # list PRs
263
261
  curl -s -X POST http://localhost:8321/api/github/pulls/comment \
264
262
  -H 'Content-Type: application/json' \
265
- -d '{"owner": "user", "repo": "repo", "pullNumber": 42, "body": "LGTM"}' # comment — Autonomous
263
+ -d '{"owner": "user", "repo": "repo", "pull_number": 42, "comment": "LGTM"}' # comment — Autonomous
266
264
  ```
267
265
  <!-- /service:github -->
268
266
 
@@ -278,23 +276,13 @@ update, archive).
278
276
 
279
277
  ---
280
278
 
281
- ## Recurring Schedules
279
+ ## Recurring tasks
282
280
 
283
- CRUD for repeating agent tasks. Timezone auto-filled from daemon config.
284
-
285
- ```bash
286
- curl -s -X POST http://localhost:8321/api/recurring-schedules \
287
- -H 'Content-Type: application/json' \
288
- -d '{"taskType": "wake", "description": "Morning inbox triage.", "recurrenceRule": {"frequency": "daily", "time": "09:00"}}'
289
- curl -s "http://localhost:8321/api/recurring-schedules?enabled=true" # list
290
- curl -s -X PATCH http://localhost:8321/api/recurring-schedules/1 \
291
- -H 'Content-Type: application/json' \
292
- -d '{"recurrenceRule": {"frequency": "weekly", "time": "10:00", "daysOfWeek": [1,3,5]}}'
293
- curl -s -X PATCH http://localhost:8321/api/recurring-schedules/1 \
294
- -H 'Content-Type: application/json' -d '{"enabled": false}' # disable
295
- curl -s -X DELETE http://localhost:8321/api/recurring-schedules/1 # delete
296
- ```
297
- `recurrenceRule`: `frequency` (daily/weekly/monthly), `time` (HH:MM), `daysOfWeek` (0=Sun..6=Sat, weekly), `daysOfMonth` (1-31, monthly). → Full guide: load `schedule` skill.
281
+ Recurring autonomous **work** (fetch / check / act on a cadence) is an **Agent** —
282
+ create one with the `agent-create` skill (`POST /api/agents`), managed on `/agents`.
283
+ Recurring scheduled **DMs / briefings** stay on `POST /api/recurring-schedules`
284
+ with `taskType: "dm_session"`. `GET /api/recurring-schedules?enabled=true` lists
285
+ existing rows (dedup). → Full guide: load the `agent-create` or `schedule` skill.
298
286
 
299
287
  ---
300
288
 
@@ -332,9 +320,9 @@ curl -s -X POST http://localhost:8321/api/schedule/dm \
332
320
  ```bash
333
321
  curl -s -X POST http://localhost:8321/api/schedule \
334
322
  -H 'Content-Type: application/json' \
335
- -d '{"time": "2026-04-06T16:00:00-04:00", "taskType": "wake", "description": "Check PR #42 status and notify user.", "model": "sonnet", "taskContext": {"scheduledBy": "dm_conversation"}}'
323
+ -d '{"time": "2026-04-06T16:00:00-04:00", "taskType": "wake", "prompt": "Check PR #42 status and notify user.", "description": "PR #42 status check", "tier": "medium", "taskContext": {"scheduledBy": "dm_conversation"}}'
336
324
  ```
337
- Fields: `time` (required), `taskType` (`wake`), `description` (required, min 20 chars), `model` (optional), `taskContext` (optional metadata).
325
+ Fields: `time` (required), `taskType` (`wake`), `prompt` (required — the agent instruction, ≤8000 chars), `description` (optional label, ≤200 chars), `tier` (`lite`/`medium`/`high`) **or** `model` (registered id like `claude-opus-4-8`, legacy alias `sonnet`/`opus`, or composite `<backendId>/<modelId>`) — mutually exclusive, `taskContext` (optional metadata). See the `schedule` skill body for the full surface and `/api/schedule/options` for the live model list.
338
326
 
339
327
  ### Manage pending items
340
328
  ```bash
@@ -343,7 +331,7 @@ curl -s -X PATCH http://localhost:8321/api/schedule/42 \
343
331
  -H 'Content-Type: application/json' -d '{"time": "2026-04-06T17:00:00-04:00"}' # edit
344
332
  curl -s -X DELETE http://localhost:8321/api/schedule/42 # cancel
345
333
  ```
346
- Editable: `time`, `description`, `message` (dm only), `model`, `taskContext`. Only `pending` items.
334
+ Editable: `time`, `description`, `message` (dm only), `tier` (or `model`, mutually exclusive — pass `null` to clear), `taskContext`. Only `pending` items.
347
335
 
348
336
  ### Time discipline
349
337
  - Absolute ISO 8601 with offset required — no relative times.