@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
@@ -2,7 +2,7 @@
2
2
  "kind": "knowledge_layout",
3
3
  "files": [
4
4
  {
5
- "path": "today.md",
5
+ "path": "state/today.md",
6
6
  "purpose": "today's plan, schedule, agent log, and handoff to tomorrow",
7
7
  "sections": [
8
8
  { "heading": "## Plan", "contains": "the day's intent in plain prose" },
@@ -16,12 +16,12 @@ morning briefing). This skill is how every callsite touches that queue.
16
16
 
17
17
  ## Source-of-truth file
18
18
 
19
- **`agent/profile-questions.md`** — agent-internal markdown. Three
19
+ **`state/profile-questions.md`** — agent-internal markdown. Three
20
20
  top-level sections: `## Pending`, `## In Progress`, `## Answered`.
21
21
  Never auto-injected into prompts; load only when this skill is in use.
22
22
 
23
23
  ```bash
24
- curl -s http://localhost:8321/api/context/agent/profile-questions
24
+ curl -s http://localhost:8321/api/context/state/profile-questions
25
25
  ```
26
26
 
27
27
  ### Pending row format
@@ -34,7 +34,7 @@ curl -s http://localhost:8321/api/context/agent/profile-questions
34
34
  |---|---|
35
35
  | `PRIO` | `HIGH` / `MID` / `LOW` — selection priority |
36
36
  | `<id>` | snake_case unique. Doubles as the correlation id in any scheduled DM description (`profile_interview:<id> — <hint>`) |
37
- | `target_path` | which user file the answer should land in, e.g. `user/profile.md` |
37
+ | `target_path` | which user file the answer should land in, e.g. `identity/profile.md` |
38
38
  | `## Section` | optional — narrows to a section within the target file |
39
39
  | `match=<anchor>` | optional — bullet key (English, like `Name`, `Timezone`, `Sleep`, `Working hours`). Required when multiple rows share a section, or when setup pre-seeds the section with an unrelated bullet |
40
40
  | `ask-hint` | English brief of WHAT to ask (agent-internal, Policy A). Render the actual DM per `<output_language_policy>` — this skill intentionally splits the two surfaces |
@@ -101,38 +101,13 @@ curl -s "http://localhost:8321/api/profile-questions/slot-filled?path=user/profi
101
101
  This wraps the canonical TS helper. Use it — do NOT re-derive the rule
102
102
  in prose. URL-encode `section` and `anchor` if they contain spaces.
103
103
 
104
- ## Operation 1 — Pick a question (morning routine Step 7.5)
104
+ ## Operation 1 — Pick a question (Morning Routine Step 7.5)
105
105
 
106
- ```
107
- 1. GET agent/profile-questions.md.
108
- 2. Skip the entire step if any of:
109
- - ## In Progress is non-empty.
110
- - ## Pending is empty.
111
- - User has not sent a DM in the last 24h.
112
- - Day-type focus for [personal] on line 2 of <today> is `off`.
113
- - The current run is the initial morning routine
114
- (`routine.morning_routine_initial`) — it lands during setup; piling
115
- on a question is bad UX.
116
- 3. Walk Pending rows in priority order (HIGH → MID → LOW, then file
117
- order). For each candidate:
118
- a. If the row carries `<!-- last_attempted=YYYY-MM-DD -->` and that
119
- date is within the last 7 days, skip — cooldown.
120
- b. Call /api/profile-questions/slot-filled for the row's target. If
121
- the slot turns out to be filled (Layer 2 catches drift since
122
- last sweep), tick the row [x] (read-rebuild + replace) and
123
- append `- [x] <today> → <id> (reconciled:morning)` to ## Answered.
124
- Continue to the next candidate.
125
- c. Otherwise, this is the chosen row. Stop walking.
126
- 4. Append a single line to today.md ## Agent Notes (latent-question
127
- flavor, see "Today.md surfacing" below):
128
- `- Profile question (latent): <id> — wait for natural opportunity`
129
- 5. Append to ## In Progress in the queue file (PATCH replace, read-rebuild):
130
- `- <id> :: state=latent :: since=<today>`
131
- The `since=` date is load-bearing — the evening sweep needs it to
132
- compute the 3-day fallback threshold.
133
- 6. Do NOT POST /api/schedule for this row. Latent rows are NOT
134
- scheduled DMs — they wait for an opportunity.
135
- ```
106
+ Morning-routine-only. The full skip gates (5 conditions), walk order,
107
+ drift-tick recovery, today.md mirror line, and no-schedule rule are in
108
+ the op-morning reference below.
109
+
110
+ {{> ref:op-morning }}
136
111
 
137
112
  ## Operation 2 — Latent opportunity check (DM handler)
138
113
 
@@ -175,11 +150,11 @@ composing the reply.
175
150
  b. After the reply is ready (final assistant text already includes
176
151
  the question), issue **two PATCH replaces** (separate calls —
177
152
  they target different files):
178
- - `PATCH /api/context/agent/profile-questions` section=in_progress
153
+ - `PATCH /api/context/state/profile-questions` section=in_progress
179
154
  — flip the entry to
180
155
  `state=asked :: since=<unchanged> :: asked_at=<current_time>`
181
156
  (preserve the original `since=` date).
182
- - `PATCH /api/context/today` section=agent_notes — replace the
157
+ - `PATCH /api/context/state/today` section=agent_notes — replace the
183
158
  parenthetical from `(latent)` to `(asked HH:MM)` and append
184
159
  `(asked HH:MM)` to the same line; preserve every other Agent
185
160
  Notes line byte-for-byte.
@@ -190,34 +165,12 @@ composing the reply.
190
165
 
191
166
  ## Operation 3 — Latent piggyback (morning briefing composition)
192
167
 
193
- Mirror of Operation 2, run inside the `## Morning briefing` sub-flow of
194
- `scheduled.dm.md`. The briefing is already an outgoing DM the agent
195
- composes; it is one of the few naturally-occurring opportunities to
196
- slip in a question.
168
+ Scheduled.dm-only. Mirror of Operation 2 but run inside the
169
+ `## Morning briefing` sub-flow of `scheduled.dm.md`. Slot-filled
170
+ pre-check, domain-overlap judgment, and the two PATCHes are in the
171
+ op-briefing reference below.
197
172
 
198
- ```
199
- 1. GET agent/profile-questions.md ## In Progress.
200
- 2. If no entry has state=latent, skip.
201
- 2.5 Slot-filled pre-check (MANDATORY). Same recipe as Operation 2 step 2.5:
202
- GET /api/profile-questions/slot-filled. If `filled: true`, resolve
203
- the row (tick Pending, remove In Progress, append
204
- `- [x] <today> → <id> (reconciled:opportunity)` to Answered, remove
205
- the matching `Profile question (latent):` line from today.md ## Agent Notes) and
206
- skip the piggyback — DO NOT weave the question.
207
- 3. Decide whether the briefing's main content overlaps with the
208
- question's domain (work questions when the day is calendar-heavy
209
- with work meetings; personal questions when the day is light /
210
- personal). If yes, weave one question into the briefing as a closing
211
- side note. Same naturalness rules as Operation 2 — no preamble, no
212
- separate paragraph.
213
- 4. After composing, issue two PATCH replaces (separate calls):
214
- - `PATCH /api/context/agent/profile-questions` section=in_progress —
215
- flip the entry to
216
- `state=asked :: since=<unchanged> :: asked_at=<current_time>`.
217
- - `PATCH /api/context/today` section=agent_notes — flip the matching
218
- `Profile question (latent):` line by changing the parenthetical to
219
- `(asked HH:MM)`.
220
- ```
173
+ {{> ref:op-briefing }}
221
174
 
222
175
  ## Operation 4 — Capture the answer (DM handler queue reconcile)
223
176
 
@@ -278,7 +231,7 @@ The heuristic anchor lookup matches against bullet keys written by the
278
231
  - Sleep: 23:00–07:00
279
232
  ```
280
233
 
281
- Anchors in `agent/profile-questions.md` MUST match these English keys —
234
+ Anchors in `state/profile-questions.md` MUST match these English keys —
282
235
  not the user's primary-language phrasing. If a future `user-profile`
283
236
  schema change introduces non-English keys, Layers 1–3 silently miss
284
237
  those bullets and the system degrades to Layer-4-only protection
@@ -302,20 +255,23 @@ those bullets and the system degrades to Layer-4-only protection
302
255
 
303
256
  ```bash
304
257
  # Read the queue
305
- curl -s http://localhost:8321/api/context/agent/profile-questions
258
+ curl -s http://localhost:8321/api/context/state/profile-questions
306
259
 
307
260
  # Slot-filled probe
308
261
  curl -s "http://localhost:8321/api/profile-questions/slot-filled?path=user/profile.md&section=Identity&anchor=Name"
309
262
 
310
263
  # Section-level edit (queue file uses the standard context API)
311
- curl -s -X PATCH http://localhost:8321/api/context/agent/profile-questions \
264
+ curl -s -X PATCH http://localhost:8321/api/context/state/profile-questions \
312
265
  -H 'Content-Type: application/json' \
313
266
  -d '{"section": "in_progress", "mode": "replace", "content": "- name :: state=latent"}'
314
267
 
315
268
  # Fallback DM scheduling (Operation 5B only)
269
+ # `prompt` is REQUIRED (the wake-up session has NO memory — it is the only
270
+ # instruction). `description` stays as the short label whose
271
+ # `profile_interview:<id>` prefix triggers the Operation 6 sub-flow.
316
272
  curl -s -X POST http://localhost:8321/api/schedule \
317
273
  -H 'Content-Type: application/json' \
318
- -d '{"time":"<ISO>","taskType":"dm_session","description":"profile_interview:<id> — <hint>","model":"sonnet","taskContext":{"scheduledBy":"user_profile_sweep_fallback","queueId":"<id>","importance":"low"}}'
274
+ -d '{"time":"<ISO>","taskType":"dm_session","prompt":"profile_interview:<id> — run the scheduled.dm ## Profile interview sub-flow (Operation 6): fire-time slot-filled abort check, then compose one short natural DM around <hint>.","description":"profile_interview:<id> — <hint>","tier":"medium","taskContext":{"scheduledBy":"user_profile_sweep_fallback","queueId":"<id>","importance":"low"}}'
319
275
  ```
320
276
 
321
277
  The PATCH `section` argument is snake_case of the heading: `pending`,
@@ -0,0 +1,51 @@
1
+ ---
2
+ kind: reference
3
+ name: op-briefing
4
+ description: Operation 3 — weave a latent profile question into the morning briefing inside scheduled.dm's ## Morning briefing sub-flow. Slot-filled pre-check, domain overlap, two PATCHes.
5
+ ---
6
+
7
+ # Operation 3 — Latent piggyback (morning briefing composition)
8
+
9
+ Run this inside the `## Morning briefing` sub-flow of
10
+ `scheduled.dm.md`. The briefing is already an outgoing DM the agent
11
+ composes; it is one of the few naturally-occurring opportunities to
12
+ slip in a question without surfacing a cold standalone DM.
13
+
14
+ ```
15
+ 1. GET agent/profile-questions.md ## In Progress.
16
+ 2. If no entry has state=latent, skip.
17
+ 2.5 Slot-filled pre-check (MANDATORY). Same recipe as Operation 2
18
+ step 2.5: GET /api/profile-questions/slot-filled. If
19
+ `filled: true`, resolve the row (tick Pending, remove In Progress,
20
+ append `- [x] <today> → <id> (reconciled:opportunity)` to Answered,
21
+ remove the matching `Profile question (latent):` line from
22
+ today.md ## Agent Notes) and skip the piggyback — DO NOT weave the
23
+ question.
24
+ 3. Decide whether the briefing's main content overlaps with the
25
+ question's domain (work questions when the day is calendar-heavy
26
+ with work meetings; personal questions when the day is light /
27
+ personal). If yes, weave one question into the briefing as a
28
+ closing side note. Same naturalness rules as Operation 2 — no
29
+ preamble, no separate paragraph.
30
+ 4. After composing, issue two PATCH replaces (separate calls):
31
+ - `PATCH /api/context/state/profile-questions` section=in_progress —
32
+ flip the entry to
33
+ `state=asked :: since=<unchanged> :: asked_at=<current_time>`
34
+ (preserve the original `since=` date).
35
+ - `PATCH /api/context/state/today` section=agent_notes — flip the
36
+ matching `Profile question (latent):` line by changing the
37
+ parenthetical to `(asked HH:MM)`.
38
+ ```
39
+
40
+ ## What "natural piggyback" means in this sub-flow
41
+
42
+ The briefing already enumerates today's calendar items, deltas since
43
+ yesterday, and any flagged inbound from the overnight window. A
44
+ piggyback question should feel like a side comment on one of those —
45
+ "the design review is at 14:00 — what's your usual ramp-up before
46
+ those?" — not a separate `## Question:` paragraph.
47
+
48
+ If the briefing's main content does not have any natural anchor for
49
+ the latent question's domain, do not force it. Leave the entry
50
+ `state=latent` and let Operation 2 catch it on the next DM the user
51
+ sends.
@@ -0,0 +1,59 @@
1
+ ---
2
+ kind: reference
3
+ name: op-morning
4
+ description: Operation 1 — pick a profile-interview question during Morning Routine Step 7.5. Skip gates, walk order, drift-tick recovery, today.md mirror, no-schedule rule.
5
+ ---
6
+
7
+ # Operation 1 — Pick a question (Morning Routine Step 7.5)
8
+
9
+ Run this only inside `routine.morning_routine` (and its split
10
+ variants `routine.morning_routine_today`). DM handlers, scheduled.dm
11
+ briefings, and hourly checks do not run this operation — they use
12
+ Operation 2 / 3 / 4 instead.
13
+
14
+ ```
15
+ 1. GET agent/profile-questions.md.
16
+ 2. Skip the entire step if any of:
17
+ - ## In Progress is non-empty.
18
+ - ## Pending is empty.
19
+ - User has not sent a DM in the last 24h.
20
+ - Day-type focus for [personal] on line 2 of <today> is `off`.
21
+ - This is the first-run morning routine (`<yesterday>` is absent
22
+ from your prompt context — the wizard just finished setup and a
23
+ profile question on day 1 piles onto an already busy onboarding
24
+ surface). Pre-Phase-4 this was keyed off the
25
+ `routine.morning_routine_initial` process key, which the
26
+ dispatcher no longer emits — both branches now route through
27
+ `routine.morning_routine` and the cue is `<yesterday>` absence.
28
+ 3. Walk Pending rows in priority order (HIGH → MID → LOW, then file
29
+ order). For each candidate:
30
+ a. If the row carries `<!-- last_attempted=YYYY-MM-DD -->` and
31
+ that date is within the last 7 days, skip — cooldown.
32
+ b. Call /api/profile-questions/slot-filled for the row's target.
33
+ If the slot turns out to be filled (Layer 2 catches drift
34
+ since last sweep), tick the row [x] (read-rebuild + replace)
35
+ and append `- [x] <today> → <id> (reconciled:morning)` to
36
+ ## Answered. Continue to the next candidate.
37
+ c. Otherwise, this is the chosen row. Stop walking.
38
+ 4. Append a single line to today.md ## Agent Notes (latent-question
39
+ flavor, see "Today.md surfacing" in the skill body):
40
+ `- Profile question (latent): <id> — wait for natural opportunity`
41
+ 5. Append to ## In Progress in the queue file (PATCH replace,
42
+ read-rebuild):
43
+ `- <id> :: state=latent :: since=<today>`
44
+ The `since=` date is load-bearing — the evening sweep needs it to
45
+ compute the 3-day fallback threshold.
46
+ 6. Do NOT POST /api/schedule for this row. Latent rows are NOT
47
+ scheduled DMs — they wait for an opportunity.
48
+ ```
49
+
50
+ ## Why no schedule?
51
+
52
+ A cold scheduled DM that asks "what's your timezone?" out of nowhere
53
+ is exactly the failure mode the queue exists to avoid. The latent row
54
+ sits in `## In Progress` until either Operation 2 (DM-handler
55
+ opportunity match) or Operation 3 (morning briefing piggyback)
56
+ naturally weaves it in. Only the evening sweep's Operation 5B fallback
57
+ (3 days latent without an opportunity, user still active) escalates to
58
+ a scheduled DM — and that's the design's safety valve, not the
59
+ primary path.
@@ -30,10 +30,18 @@ B. LATENT FALLBACK PROMOTION.
30
30
  state=scheduled. Register POST /api/schedule with:
31
31
  {time: tomorrow @ 14:00 local (or quiet_hours_end + 2h),
32
32
  taskType: "dm_session",
33
+ prompt: "profile_interview:<id> — run Operation 6 (the
34
+ scheduled.dm ## Profile interview sub-flow): fire-time
35
+ slot-filled abort check, then compose one short natural
36
+ DM around <ask-hint>.",
33
37
  description: "profile_interview:<id> — <ask-hint>",
34
- model: "sonnet",
38
+ tier: "medium",
35
39
  taskContext: {scheduledBy: "user_profile_sweep_fallback",
36
40
  queueId: "<id>", importance: "low"}}
41
+ NOTE: `prompt` is REQUIRED by POST /api/schedule (the wake-up
42
+ session has NO memory — the prompt is its only instruction).
43
+ `description` is the short list label whose `profile_interview:<id>`
44
+ prefix triggers Operation 6; keep both fields.
37
45
  Update the In Progress entry to
38
46
  `state=scheduled :: since=<unchanged> :: scheduled_at=<tomorrow 14:00>`.
39
47
  Remove the matching `Profile question (latent): <id>` line from
@@ -8,26 +8,21 @@ allowed-tools:
8
8
 
9
9
  # User Profile Update Guide
10
10
 
11
- Output language: follow `<output_language_policy>`. `user/profile.md`
12
- and `user/*.md` are Policy B — template H2 headers (`## Identity`,
13
- `## Work Pattern`, `## Platforms`, `## Expertise`, `## Notification
14
- Preferences`, `## Learned Context`, `## Raw Signals`) are skeleton and
15
- stay English; the facts you write under them are in
16
- `<settings primary_language>`. Preserve user-customized headers verbatim.
11
+ Output language: `identity/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.
17
12
 
18
- `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).
19
14
 
20
- 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 `user/*.md`. Read `identity/_index.md` first, then fetch only the topic file you need.
21
16
 
22
17
  ## When to Update
23
18
 
24
19
  **Immediately (same turn) when the user shares:**
25
20
  - Identity or role — "I'm a …", "I work at …", "my title is …" → `profile.md ## Identity`
26
- - People they know — names + relationship, e.g. "my sister", "my manager Sarah" → `user/people.md`
27
- - Workplace specifics — company, team, tech stack, tools — "I use Postgres at work" → `user/work.md`
28
- - 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)
29
- - Hobbies, habits, health, lifestyle (factual) — "I run every morning", "I don't eat meat" → `user/personal.md`
30
- - 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`
31
26
  - A notification or day-type preference — "no work notifications on weekends" → `profile.md ## Notification Preferences`
32
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
33
28
 
@@ -40,9 +35,9 @@ Detailed, dictionary-like background belongs under `user/*.md`. Read `user/_inde
40
35
  **Routing edge cases** (for shapes the trigger list above doesn't disambiguate):
41
36
  - "my name is Alex" — explicit identity statement goes to `profile.md ## Identity`, not a topic file.
42
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.
43
- - "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.
44
39
 
45
- See the `message.received.dm.md` / `message.received.dm_first.md` **Capture user info** block for the full decision rule (profile.md vs `user/<topic>.md` tie-breakers, `section_not_found` → `append_to_file` first-write fallback, and a worked `curl` example).
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.
46
41
 
47
42
  ## Section ownership
48
43
 
@@ -74,6 +69,21 @@ All `user/*.md` files must keep YAML frontmatter with `type: user`,
74
69
  section-level PATCH, preserve the existing frontmatter. When doing a
75
70
  full-file PUT, update `updated` to today's date.
76
71
 
72
+ **Bullet key convention — load-bearing.** Bullets under each H2 use
73
+ **English label keys**, any-language values:
74
+
75
+ ```
76
+ - Name: Alex
77
+ - Timezone: America/New_York
78
+ - Working hours: Weekdays 09:00–18:00
79
+ ```
80
+
81
+ The `user-interview` skill's queue (`state/profile-questions.md`)
82
+ matches against these English keys. If you introduce a non-English
83
+ label here, the queue's slot-filled probe silently misses the bullet
84
+ and re-asks the same question on the next opportunity. See
85
+ `user-interview/SKILL.md` §"Anchor convention — load-bearing".
86
+
77
87
  ## Notification Preferences format
78
88
 
79
89
  Morning Routine reads this daily to derive today.md's day-type filter. Keep bullets machine-parseable:
@@ -92,31 +102,17 @@ If the user says "I don't want work notifications on weekends", paraphrase into
92
102
 
93
103
  ## Tone / character preferences
94
104
 
95
- **Tone, style, voice, formality, emoji, verbosity, language preferences are NOT profile content** — they are agent directives, not user facts. Route them to the `character` runtime-config field via `PATCH /api/config/character` (see `docs/design/15-character.md`), never to `user/profile.md`.
96
-
97
- Triggers: "always reply in English", "shorter please", "no emojis", "speak casually", "be more concise", "more formal please", "end every reply with a period".
98
-
99
- **Read-before-write still applies.** Do this in one turn:
100
-
101
- ```bash
102
- # 1. Read current character
103
- curl -s http://localhost:8321/api/config/character | jq -r .character
104
-
105
- # 2. Merge the new preference into the existing value, then PATCH:
106
- curl -s -X PATCH http://localhost:8321/api/config/character \
107
- -H 'Content-Type: application/json' \
108
- -d '{"character": "Speak casually. Tight bullets. No emojis. End every reply with a period."}'
109
- ```
110
-
111
- **Endpoint note.** Use `/api/config/character` (narrow, agent-callable),
112
- not `/api/config` — the general config surface is dashboard-only (Approve
113
- tier) and will return 401 from an agent curl. The narrow endpoint accepts
114
- only the `character` field, runs the same Zod validation, and fans the
115
- new value out to active sessions identically.
105
+ **Tone, style, voice, formality, emoji, verbosity, language
106
+ preferences are NOT profile content.** Route them to the `character`
107
+ runtime-config field via `PATCH /api/config/character` (narrow
108
+ endpoint, 1000-char cap, read-before-write). Never write tone /
109
+ style preferences into `identity/profile.md` or any `user/*.md`.
116
110
 
117
- **Observe the 1000-char cap.** If the merged value would exceed 1000 characters, surface the excess to the user ("Your style guide is 1180 characters, over the 1000 limit — shall I trim?") rather than silently truncating. Zod rejects over-cap writes with 400 at the API.
111
+ Full recipe triggers, merge rules, endpoint note, cap-handling, and
112
+ where the value ends up — is in the character-preferences reference
113
+ below.
118
114
 
119
- The character value is written verbatim into every session's `CLAUDE.md` / `AGENTS.md` / `GEMINI.md` between the safety preamble and the profile body. It applies across Claude, Codex, and Gemini uniformly — no separate injection per backend.
115
+ {{> ref:character-preferences }}
120
116
 
121
117
  ## Read-before-write — mandatory for PATCH replace
122
118
 
@@ -126,7 +122,7 @@ See _safety.md "Common Patterns" for the general rule. Section name in PATCH is
126
122
 
127
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:
128
124
  ```bash
129
- curl -s -X PATCH http://localhost:8321/api/context/user/profile \
125
+ curl -s -X PATCH http://localhost:8321/api/context/identity/profile \
130
126
  -H 'Content-Type: application/json' \
131
127
  -d '{"section": "learned_context", "mode": "append", "content": "- [2026-04-23] Reading goal: 20 books/year"}'
132
128
  ```
@@ -134,7 +130,7 @@ For a full-section replace, GET first, merge with existing bullets, then PATCH w
134
130
 
135
131
  **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.
136
132
 
137
- For writes to `user/<topic>.md` (people / work / expertise / personal / goals), see the **Capture user info** block in `message.received.dm.md` / `message.received.dm_first.md` for the decision rule, the `section_not_found` → `append_to_file` first-write fallback, and a worked `curl` example against `user/people.md`. The read-before-write rule above applies identically when merging into an existing `user/<topic>.md` section.
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 `identity/people.md`). The read-before-write rule applies identically when merging into an existing `user/<topic>.md` section.
138
134
 
139
135
  ## Learned Context entry format
140
136
 
@@ -159,50 +155,34 @@ Review can prune entries older than 30 days:
159
155
 
160
156
  ## Initial Setup
161
157
 
162
- 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".
158
+ 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".
163
159
 
164
- *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`.*
160
+ *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`.*
165
161
 
166
162
  ---
167
163
 
168
164
  ## API Reference
169
165
 
170
- ### Read
171
- ```bash
172
- curl -s http://localhost:8321/api/context/user/profile # Full profile
173
- curl -s http://localhost:8321/api/context/user/_index # Topic index
174
- curl -s http://localhost:8321/api/context/user/people # Specific topic
175
- ```
166
+ The generic GET / PATCH surface (modes, fields, error envelopes) is
167
+ documented in the **context** skill `references/api.md`. user-profile
168
+ writes target the two paths `/api/context/identity/profile` (the injected
169
+ summary file) and `/api/context/user/:topic` (one of `people` /
170
+ `work` / `expertise` / `personal` / `goals`).
176
171
 
177
- ### PATCH /api/context/user/profile Section-level edit
178
- ```bash
179
- curl -s -X PATCH http://localhost:8321/api/context/user/profile \
180
- -H 'Content-Type: application/json' \
181
- -d '{"section": "learned_context", "mode": "append", "content": "- [YYYY-MM-DD] ..."}'
182
- ```
172
+ Two user-profile-specific notes layered on top of the generic surface:
183
173
 
184
- | Field | Type | Description |
185
- |---|---|---|
186
- | `section` | string | snake_case of heading (e.g. `learned_context`) |
187
- | `mode` | `append` \| `replace` \| `clear` \| `clear_before` | Default `append` |
188
- | `content` | string | Ignored for `clear` / `clear_before` |
189
- | `cutoff` | string | `clear_before` only: entries with `[timestamp] ≤ cutoff` are removed (race-safe consumption for Raw Signals) |
190
- | `maxEntries` | number | `append` only: trims oldest entries to cap (SignalDetector uses cap=20) |
174
+ - **`clear_before` on `## Raw Signals`** is the race-safe consumption
175
+ path Evening Review uses to drain Raw Signals without dropping
176
+ concurrent appends. Pass a SQLite-format `cutoff`:
191
177
 
192
- `clear_before` example (Evening Review consuming Raw Signals without dropping concurrent appends):
193
- ```bash
194
- curl -s -X PATCH http://localhost:8321/api/context/user/profile \
195
- -H 'Content-Type: application/json' \
196
- -d '{"section": "raw_signals", "mode": "clear_before", "cutoff": "2026-04-10 02:33:00"}'
197
- ```
178
+ ```bash
179
+ curl -s -X PATCH http://localhost:8321/api/context/identity/profile \
180
+ -H 'Content-Type: application/json' \
181
+ -d '{"section": "raw_signals", "mode": "clear_before", "cutoff": "2026-04-10 02:33:00"}'
182
+ ```
198
183
 
199
- ### PATCH /api/context/user/:topic
200
- Same shape. Target a section within a topic file:
201
- ```bash
202
- curl -s -X PATCH http://localhost:8321/api/context/user/people \
203
- -H 'Content-Type: application/json' \
204
- -d '{"section": "colleagues", "mode": "append", "content": "- Alice: PM on Project X"}'
205
- ```
184
+ - **`maxEntries`** on `## Raw Signals` append is the SignalDetector's
185
+ cap (= 20). Other writers do not set it.
206
186
 
207
187
  ## Knowledge map — topic files (auto-curated)
208
188
 
@@ -7,7 +7,7 @@
7
7
  "anchor": "<!-- CURATION:knowledge_layout id=\"topic-files\" -->",
8
8
  "human_label": "Topic file layout",
9
9
  "description": "Which user/* file owns which kind of fact",
10
- "scope_paths": ["user/profile.md", "user/*.md"]
10
+ "scope_paths": ["identity/profile.md", "user/*.md"]
11
11
  },
12
12
  {
13
13
  "id": "routing-table",
@@ -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
  }
@@ -0,0 +1,83 @@
1
+ ---
2
+ kind: reference
3
+ name: character-preferences
4
+ description: Tone / style / voice / language preferences are agent directives — route to PATCH /api/config/character (read-before-write, 1000-char cap, narrow endpoint).
5
+ ---
6
+
7
+ # Tone / character preferences
8
+
9
+ **Tone, style, voice, formality, emoji, verbosity, language preferences
10
+ are NOT profile content** — they are agent directives, not user facts.
11
+ Route them to the `character` runtime-config field via `PATCH
12
+ /api/config/character` (see `docs/design/15-character.md`), never to
13
+ `identity/profile.md` or any `user/*.md`.
14
+
15
+ ## Triggers
16
+
17
+ The user is asking for a character change when they say things like:
18
+
19
+ - "always reply in English" / "speak Japanese from now on"
20
+ - "shorter please" / "be more concise" / "stop padding"
21
+ - "no emojis" / "drop the emojis"
22
+ - "speak casually" / "be more formal please"
23
+ - "end every reply with a period"
24
+ - "don't ask follow-up questions, just answer"
25
+ - "stop with the disclaimers"
26
+
27
+ If the phrasing reads as a behavioral preference for *how* the agent
28
+ speaks rather than a fact about the user, it belongs in
29
+ `character`, not in profile.md.
30
+
31
+ ## Read-before-write — mandatory
32
+
33
+ `PATCH /api/config/character` replaces the value wholesale. If you write
34
+ just the new preference, you lose every preference the user previously
35
+ set. Do this in one turn:
36
+
37
+ ```bash
38
+ # 1. Read current character
39
+ curl -s http://localhost:8321/api/config/character | jq -r .character
40
+
41
+ # 2. Merge the new preference into the existing value, then PATCH:
42
+ curl -s -X PATCH http://localhost:8321/api/config/character \
43
+ -H 'Content-Type: application/json' \
44
+ -d '{"character": "Speak casually. Tight bullets. No emojis. End every reply with a period."}'
45
+ ```
46
+
47
+ Merge rules: if the new preference conflicts with an existing one
48
+ (e.g. user used to ask for "formal" and now asks for "casual"), drop
49
+ the old one. If it is additive (a new "no emojis" on top of an
50
+ existing "tight bullets"), append.
51
+
52
+ ## Endpoint note — use the narrow path
53
+
54
+ Use `/api/config/character` (narrow, agent-callable), **not** `/api/config`.
55
+ The general config surface is dashboard-only (Approve tier) and will
56
+ return 401 from an agent curl. The narrow endpoint accepts only the
57
+ `character` field, runs the same Zod validation, and fans the new value
58
+ out to active sessions identically.
59
+
60
+ ## 1000-char cap
61
+
62
+ If the merged value would exceed 1000 characters, **surface the excess
63
+ to the user** ("Your style guide is 1180 characters, over the 1000
64
+ limit — shall I trim?") rather than silently truncating. Zod rejects
65
+ over-cap writes with HTTP 400 at the API.
66
+
67
+ A character value over the cap usually means the user added a
68
+ preference that *replaces* an older one rather than extending it —
69
+ offer to drop the obsoleted bullet as the first trim candidate.
70
+
71
+ ## Where the value ends up
72
+
73
+ The character value is written verbatim into every session's
74
+ `CLAUDE.md` / `AGENTS.md` / `GEMINI.md` between the safety preamble
75
+ and the profile body. It applies across Claude, Codex, and Gemini
76
+ uniformly — no separate injection per backend.
77
+
78
+ ## What does NOT belong here
79
+
80
+ Facts about the user — identity, role, expertise, hobbies, people,
81
+ goals — go to `identity/profile.md` or `user/<topic>.md`, not to
82
+ `character`. The split is: `character` says *how* the agent speaks;
83
+ `user/*` says *who the user is*.