@aitne-sh/aitne 0.1.9 → 0.1.11

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 (218) hide show
  1. package/README.md +41 -11
  2. package/agent-assets/agent-profiles/background-task.md +53 -0
  3. package/agent-assets/agent-profiles/conversational.md +1 -0
  4. package/agent-assets/agent-profiles/routine-fetch-window.md +14 -75
  5. package/agent-assets/agent-profiles/routine.md +1 -1
  6. package/agent-assets/agents/{hourly-check → activity-scan}/agent.md +22 -17
  7. package/agent-assets/agents/monthly-review/agent.md +6 -5
  8. package/agent-assets/docs/concepts/agent-day.md +6 -7
  9. package/agent-assets/docs/concepts/auth-health.md +23 -20
  10. package/agent-assets/docs/concepts/backends-and-tiers.md +13 -9
  11. package/agent-assets/docs/concepts/costs-and-quotas.md +14 -12
  12. package/agent-assets/docs/concepts/delegated-mode.md +18 -17
  13. package/agent-assets/docs/concepts/memory-model.md +16 -9
  14. package/agent-assets/docs/concepts/observations.md +24 -20
  15. package/agent-assets/docs/concepts/process-keys.md +10 -9
  16. package/agent-assets/docs/concepts/routines.md +34 -31
  17. package/agent-assets/docs/concepts/safety-and-execution.md +11 -7
  18. package/agent-assets/docs/concepts/safety-model.md +39 -25
  19. package/agent-assets/docs/concepts/skills.md +12 -10
  20. package/agent-assets/docs/features/integrations/browser-history.md +23 -18
  21. package/agent-assets/docs/features/integrations/calendar.md +28 -17
  22. package/agent-assets/docs/features/integrations/git.md +13 -11
  23. package/agent-assets/docs/features/integrations/github.md +22 -14
  24. package/agent-assets/docs/features/integrations/mail.md +25 -22
  25. package/agent-assets/docs/features/integrations/notion.md +35 -11
  26. package/agent-assets/docs/features/integrations/obsidian.md +8 -8
  27. package/agent-assets/docs/features/lifestyle/git.md +27 -23
  28. package/agent-assets/docs/features/lifestyle/reading.md +20 -11
  29. package/agent-assets/docs/features/lifestyle/receipts.md +11 -10
  30. package/agent-assets/docs/features/lifestyle/travel-bookings.md +4 -3
  31. package/agent-assets/docs/features/memory-files/agent-journal.md +53 -26
  32. package/agent-assets/docs/features/memory-files/agent-lessons.md +178 -0
  33. package/agent-assets/docs/features/memory-files/projects.md +11 -8
  34. package/agent-assets/docs/features/memory-files/roadmap.md +17 -14
  35. package/agent-assets/docs/features/memory-files/schedule.md +6 -3
  36. package/agent-assets/docs/features/memory-files/today.md +10 -7
  37. package/agent-assets/docs/features/memory-files/user-profile.md +14 -9
  38. package/agent-assets/docs/features/messaging/bang-commands.md +21 -6
  39. package/agent-assets/docs/features/messaging/overview.md +17 -14
  40. package/agent-assets/docs/features/messaging/telegram.md +10 -9
  41. package/agent-assets/docs/features/operations/activity-and-conversations.md +6 -5
  42. package/agent-assets/docs/features/operations/approvals.md +6 -5
  43. package/agent-assets/docs/features/operations/browser-tasks.md +184 -0
  44. package/agent-assets/docs/features/operations/cost-tracking.md +11 -1
  45. package/agent-assets/docs/features/operations/managed-chromium.md +4 -2
  46. package/agent-assets/docs/features/operations/notifications.md +11 -1
  47. package/agent-assets/docs/features/operations/quiet-hours.md +41 -11
  48. package/agent-assets/docs/features/operations/schedule-approaching.md +2 -2
  49. package/agent-assets/docs/features/routines/activity-scan.md +220 -0
  50. package/agent-assets/docs/features/routines/custom-routines.md +82 -134
  51. package/agent-assets/docs/features/routines/evening-review.md +23 -13
  52. package/agent-assets/docs/features/routines/morning-routine.md +7 -5
  53. package/agent-assets/docs/features/routines/weekly-review.md +24 -3
  54. package/agent-assets/docs/features/wiki/commands.md +4 -4
  55. package/agent-assets/docs/features/wiki/cost-and-approval.md +4 -3
  56. package/agent-assets/docs/features/wiki/dashboard.md +7 -6
  57. package/agent-assets/docs/features/wiki/overview.md +3 -3
  58. package/agent-assets/docs/features/wiki/search.md +5 -5
  59. package/agent-assets/docs/features/wiki/workspaces.md +2 -2
  60. package/agent-assets/docs/getting-started/01-what-is-this.md +3 -3
  61. package/agent-assets/docs/getting-started/02-first-steps.md +5 -3
  62. package/agent-assets/docs/getting-started/04-first-day.md +27 -30
  63. package/agent-assets/docs/glossary.md +8 -8
  64. package/agent-assets/docs/guides/add-a-custom-routine.md +122 -68
  65. package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +2 -2
  66. package/agent-assets/docs/guides/connect-a-new-mail-account.md +4 -2
  67. package/agent-assets/docs/guides/explore-with-trace-and-connect.md +5 -4
  68. package/agent-assets/docs/guides/install-and-run.md +2 -2
  69. package/agent-assets/docs/guides/maintain-wiki-health.md +2 -2
  70. package/agent-assets/docs/guides/pause-the-agent.md +27 -21
  71. package/agent-assets/docs/guides/reinstall-cleanly.md +2 -0
  72. package/agent-assets/docs/guides/setup-wizard.md +12 -6
  73. package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +6 -6
  74. package/agent-assets/docs/reference/api.md +26 -5
  75. package/agent-assets/docs/reference/cli-commands.md +3 -3
  76. package/agent-assets/docs/reference/config.md +51 -24
  77. package/agent-assets/docs/reference/disallowed-tools.md +6 -4
  78. package/agent-assets/docs/reference/keyboard-shortcuts.md +2 -2
  79. package/agent-assets/docs/reference/knowledge-layout.md +25 -12
  80. package/agent-assets/docs/reference/process-keys.md +9 -9
  81. package/agent-assets/docs/reference/skills.md +10 -6
  82. package/agent-assets/docs/troubleshooting/auth-failed.md +9 -8
  83. package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +16 -9
  84. package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +2 -2
  85. package/agent-assets/docs/troubleshooting/morning-routine-didnt-run.md +32 -16
  86. package/agent-assets/docs/troubleshooting/observation-not-detected.md +26 -24
  87. package/agent-assets/docs/troubleshooting/quota-exhausted.md +7 -6
  88. package/agent-assets/docs/troubleshooting/wiki-write-failed.md +3 -3
  89. package/agent-assets/skills/agent-actions/SKILL.md +23 -39
  90. package/agent-assets/skills/agent-create/SKILL.md +26 -6
  91. package/agent-assets/skills/attach/SKILL.md +8 -27
  92. package/agent-assets/skills/background-task/SKILL.md +184 -0
  93. package/agent-assets/skills/background-task-reply/SKILL.md +100 -0
  94. package/agent-assets/skills/browser-history/SKILL.md +60 -29
  95. package/agent-assets/skills/browser-history-respond/SKILL.md +6 -1
  96. package/agent-assets/skills/browser-task/SKILL.md +33 -31
  97. package/agent-assets/skills/context/SKILL.md +26 -34
  98. package/agent-assets/skills/context/curation.json +12 -12
  99. package/agent-assets/skills/context/references/api.md +22 -20
  100. package/agent-assets/skills/context/references/required-frontmatter.md +10 -9
  101. package/agent-assets/skills/context/references/snapshot-files.md +16 -15
  102. package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +5 -5
  103. package/agent-assets/skills/context/seeds/frontmatter-requirements.seed.json +3 -3
  104. package/agent-assets/skills/docs-search/SKILL.md +19 -31
  105. package/agent-assets/skills/external-services/SKILL.delegated.claude.md +8 -95
  106. package/agent-assets/skills/external-services/SKILL.delegated.codex.md +8 -94
  107. package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +8 -94
  108. package/agent-assets/skills/external-services/SKILL.native.claude.md +15 -9
  109. package/agent-assets/skills/external-services/SKILL.native.codex.md +11 -5
  110. package/agent-assets/skills/external-services/SKILL.native.gemini.md +11 -5
  111. package/agent-assets/skills/external-services/references/exec-errors.md +32 -0
  112. package/agent-assets/skills/external-services/references/skills-crud.md +5 -5
  113. package/agent-assets/skills/gmail-lifestyle/SKILL.md +3 -2
  114. package/agent-assets/skills/gmail-lifestyle/references/receipts-api.md +4 -0
  115. package/agent-assets/skills/gmail-lifestyle/references/travel-bookings-api.md +9 -0
  116. package/agent-assets/skills/mail/SKILL.delegated.claude.md +13 -25
  117. package/agent-assets/skills/mail/SKILL.delegated.codex.md +3 -2
  118. package/agent-assets/skills/mail/SKILL.delegated.gemini.md +3 -2
  119. package/agent-assets/skills/mail/SKILL.md +12 -20
  120. package/agent-assets/skills/mail/SKILL.native.claude.md +24 -16
  121. package/agent-assets/skills/mail/SKILL.native.codex.md +16 -9
  122. package/agent-assets/skills/mail/SKILL.native.gemini.md +12 -6
  123. package/agent-assets/skills/mail/references/api.md +6 -1
  124. package/agent-assets/skills/mail/references/examples.md +2 -1
  125. package/agent-assets/skills/managed-tasks/SKILL.md +44 -77
  126. package/agent-assets/skills/managed-tasks/references/errors.md +25 -14
  127. package/agent-assets/skills/managed-tasks/references/output-path.md +33 -17
  128. package/agent-assets/skills/managed-tasks/references/recurrence-rule.md +26 -16
  129. package/agent-assets/skills/management-policy/SKILL.md +36 -28
  130. package/agent-assets/skills/management-policy/curation.json +1 -1
  131. package/agent-assets/skills/management-policy/references/policy-workflow.md +30 -18
  132. package/agent-assets/skills/notify/SKILL.md +16 -13
  133. package/agent-assets/skills/notify/references/priority.md +42 -26
  134. package/agent-assets/skills/notion/SKILL.delegated.claude.md +1 -1
  135. package/agent-assets/skills/notion/SKILL.delegated.codex.md +1 -1
  136. package/agent-assets/skills/notion/SKILL.delegated.gemini.md +1 -1
  137. package/agent-assets/skills/notion/SKILL.md +18 -18
  138. package/agent-assets/skills/notion/SKILL.native.claude.md +4 -4
  139. package/agent-assets/skills/notion/SKILL.native.codex.md +3 -3
  140. package/agent-assets/skills/notion/SKILL.native.gemini.md +3 -3
  141. package/agent-assets/skills/observations/SKILL.md +9 -24
  142. package/agent-assets/skills/observations/references/fetch-fallback.md +22 -0
  143. package/agent-assets/skills/project-doc/SKILL.md +9 -6
  144. package/agent-assets/skills/project-doc/curation.json +3 -3
  145. package/agent-assets/skills/project-doc/seeds/project-shape.seed.json +2 -2
  146. package/agent-assets/skills/project-doc/seeds/slug-grammar.seed.json +3 -3
  147. package/agent-assets/skills/reading/SKILL.md +8 -42
  148. package/agent-assets/skills/reading/references/reading-taste.md +5 -5
  149. package/agent-assets/skills/roadmap/SKILL.md +3 -19
  150. package/agent-assets/skills/roadmap/references/api.md +23 -8
  151. package/agent-assets/skills/roadmap/references/horizon-tags.md +11 -0
  152. package/agent-assets/skills/roadmap/references/migration.md +8 -6
  153. package/agent-assets/skills/roadmap/references/retention.md +18 -0
  154. package/agent-assets/skills/schedule/SKILL.md +20 -28
  155. package/agent-assets/skills/schedule/references/importance.md +23 -0
  156. package/agent-assets/skills/schedule/references/recurrence-rule.md +26 -16
  157. package/agent-assets/skills/scheduled-managed-task/SKILL.md +46 -46
  158. package/agent-assets/skills/today/SKILL.md +38 -81
  159. package/agent-assets/skills/today/references/agent-plan-lifecycle.md +9 -4
  160. package/agent-assets/skills/today/references/agent-plan-revision.md +28 -0
  161. package/agent-assets/skills/today/references/today-skeleton.md +66 -0
  162. package/agent-assets/skills/today/seeds/agent-notes-flavors.seed.json +1 -1
  163. package/agent-assets/skills/today/seeds/section-shape.seed.json +6 -6
  164. package/agent-assets/skills/user-interview/SKILL.md +15 -90
  165. package/agent-assets/skills/user-interview/references/op-briefing.md +1 -1
  166. package/agent-assets/skills/user-interview/references/op-dm-handler.md +88 -0
  167. package/agent-assets/skills/user-interview/references/op-morning.md +2 -2
  168. package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +1 -1
  169. package/agent-assets/skills/user-profile/SKILL.md +16 -26
  170. package/agent-assets/skills/user-profile/curation.json +3 -3
  171. package/agent-assets/skills/user-profile/references/character-preferences.md +3 -3
  172. package/agent-assets/skills/wiki/wiki-ask/SKILL.md +1 -1
  173. package/agent-assets/skills/wiki/wiki-compile/SKILL.md +5 -4
  174. package/agent-assets/skills/wiki/wiki-connect/SKILL.md +32 -5
  175. package/agent-assets/skills/wiki/wiki-ingest/SKILL.md +6 -50
  176. package/agent-assets/skills/wiki/wiki-ingest/references/curl-errors.md +58 -0
  177. package/agent-assets/skills/wiki/wiki-lint/SKILL.md +20 -14
  178. package/agent-assets/skills/wiki/wiki-trace/SKILL.md +10 -5
  179. package/agent-assets/skills/wiki/wiki-vault-rules/SKILL.md +2 -0
  180. package/agent-assets/system-prompts/routine-research-cluster-update.md +71 -0
  181. package/agent-assets/task-flows/_partials/feedback-capture.md +30 -0
  182. package/agent-assets/task-flows/_partials/notion-acquire.notion.md +47 -21
  183. package/agent-assets/task-flows/background_task.md +81 -0
  184. package/agent-assets/task-flows/git.local_ahead.stale.md +1 -1
  185. package/agent-assets/task-flows/git.push.detected.md +1 -1
  186. package/agent-assets/task-flows/git.tag.created.md +1 -1
  187. package/agent-assets/task-flows/github.assigned.md +1 -1
  188. package/agent-assets/task-flows/github.pull_request.review_requested.md +2 -2
  189. package/agent-assets/task-flows/github.security_alert.md +1 -1
  190. package/agent-assets/task-flows/message.received.dm.md +11 -3
  191. package/agent-assets/task-flows/message.received.dm_first.md +8 -2
  192. package/agent-assets/task-flows/{routine.hourly_check.md → routine.activity_scan.md} +31 -23
  193. package/agent-assets/task-flows/{routine.hourly_check.triage.md → routine.activity_scan.triage.md} +3 -3
  194. package/agent-assets/task-flows/routine.evening_review.md +80 -0
  195. package/agent-assets/task-flows/routine.monthly_review.md +81 -8
  196. package/agent-assets/task-flows/routine.research_cluster_update.md +33 -19
  197. package/agent-assets/task-flows/routine.roadmap_refresh.md +2 -2
  198. package/agent-assets/task-flows/routine.today_refresh.md +1 -1
  199. package/agent-assets/task-flows/routine.weekly_review.md +124 -4
  200. package/agent-assets/task-flows/schedule.approaching.md +2 -2
  201. package/agent-assets/task-flows/scheduled.dm.md +77 -1
  202. package/agent-assets/task-flows/scheduled.task.md +7 -1
  203. package/agent-assets/task-flows/wiki.trace.md +1 -1
  204. package/agent-assets/templates/_manifest.json +2 -2
  205. package/agent-assets/templates/knowledge/dossiers/_index.md +1 -1
  206. package/agent-assets/templates/knowledge/dossiers/{hourly.md → activity-scan.md} +1 -1
  207. package/agent-assets/templates/policies/journal-format.md +1 -1
  208. package/agent-assets/templates/policies/mcp.md +1 -1
  209. package/agent-assets/templates/policies/routines/_index.md +1 -1
  210. package/agent-assets/templates/policies/routines/{hourly.md → activity-scan.md} +5 -5
  211. package/bin/aitne.mjs +45 -11
  212. package/package.json +6 -5
  213. package/scripts/commands/doctor.mjs +11 -2
  214. package/scripts/lib/process-identity.d.mts +46 -0
  215. package/scripts/lib/process-identity.mjs +193 -0
  216. package/scripts/lib/read-api-token.mjs +1 -1
  217. package/scripts/start.mjs +14 -4
  218. package/agent-assets/docs/features/routines/hourly-check.md +0 -205
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: context
3
- description: Load when reading or writing project notes, weekly/monthly summaries, or agent/journal.md. Owns GET/PATCH for context files except today.md and roadmap.md, which use their dedicated skills.
3
+ description: Load when reading or writing project notes, weekly/monthly summaries, or journal/agent.md. Owns GET/PATCH for context files except today.md and roadmap.md, which use their dedicated skills.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
6
  - Read
@@ -28,23 +28,23 @@ vault**, not this primary store.
28
28
  |---|---|---|---|
29
29
  | `state/today.md` | Today's schedule, tasks, agent log, handoff | See `today` skill | Yes (Morning Routine) |
30
30
  | `plans/roadmap.md` | Long-horizon agent action plan + Long-term Plans | See `roadmap` skill | Yes (Roadmap Refresh) |
31
- | `projects/*.md` | Project state summaries | Any event on material state change | No |
32
- | `weekly/YYYY-Www.md` | Weekly review snapshots | Friday Weekly Review only (PUT) | No |
33
- | `monthly/YYYY-MM.md` | Monthly review snapshots | Month-end Monthly Review only (PUT) | No |
34
- | `rules/*.md` | User-controlled policy files | Explicit user request only | No |
31
+ | `plans/projects/*.md` | Project state summaries | Any event on material state change | No |
32
+ | `journal/weekly/YYYY-Www.md` | Weekly review snapshots | Friday Weekly Review only (PUT) | No |
33
+ | `journal/monthly/YYYY-MM.md` | Monthly review snapshots | Month-end Monthly Review only (PUT) | No |
34
+ | `policies/*.md` | User-controlled policy files | Explicit user request only | No |
35
35
  | `policies/management-captures/<slug>.md` | Durable management policies captured from DM | `management-policy` skill — **do not write from here** | No |
36
36
  | `policies/management-captures/_index.md` | Readable index of active policies | `management-policy` skill — **do not write from here** | No |
37
- | `routines/*.md` | Per-cadence check rulebooks | Explicit user request only | No |
37
+ | `policies/routines/*.md` | Per-cadence check rulebooks | Explicit user request only | No |
38
38
  | `identity/profile.md` | User identity and preferences | `user-profile` skill — **do not write from here** | No |
39
- | `user/*.md` | Detailed user dictionary | `user-profile` skill — **do not write from here** | No |
39
+ | `identity/*.md` | Detailed user dictionary | `user-profile` skill — **do not write from here** | No |
40
40
 
41
41
  Morning Routine scans roadmap daily and processes matching Preparation
42
42
  Timeline rows into `state/today.md` — see the `roadmap` skill for the full
43
43
  entry taxonomy and the morning routine task-flow for the scanning rules.
44
44
 
45
- ## projects/*.md
45
+ ## plans/projects/*.md
46
46
 
47
- Update on status changes, milestones reached/delayed, or active set changes. Use `GET /api/context/list/projects` to discover files. The source of truth is always the individual `projects/<slug>.md` notes; `_active.base` is only the Obsidian Bases view config, not a narrative summary note.
47
+ Update on status changes, milestones reached/delayed, or active set changes. Use `GET /api/context/list/plans/projects` to discover files. The source of truth is always the individual `plans/projects/<slug>.md` notes; `_active.base` is only the Obsidian Bases view config, not a narrative summary note.
48
48
 
49
49
  The canonical frontmatter schema is documented in `plans/projects/_index.md`
50
50
  (seeded from `agent-assets/templates/plans/projects/_index.md`). The API
@@ -56,43 +56,35 @@ validates only `type: project`, `owner: shared`, `updated`, and an H1
56
56
 
57
57
  ## Project DM-intent detection
58
58
 
59
- DM-driven project state writes are dispatched from
60
- `message.received.dm.md` / `message.received.dm_first.md` Step 4 via
61
- the `_partials/dm-intent.project.md` task-flow partialthat partial
62
- carries the decision tree (existing-vs-new match, decline-marker
63
- pre-check, no-match confirm sub-flow scheduling, reply branches,
64
- cross-path cancellation, slug grammar, tie-breakers).
59
+ DM-driven project writes are dispatched by
60
+ `_partials/dm-intent.project.md` (the decision tree match, decline
61
+ markers, confirm sub-flow, slug grammar, tie-breakers lives there).
62
+ **This skill is the writer:** it executes the `plans/projects/*.md`
63
+ PUT / PATCH / archive per the API Reference below.
65
64
 
66
- **This skill is the writer.** `projects/<slug>.md` PUT / PATCH / archive
67
- goes through `/api/context/projects/*` per the API Reference below. The
68
- partial dispatches; this skill executes the writes.
65
+ ## Snapshot files weekly / monthly / policies / routines
69
66
 
70
- Cross-references previously in this section ("Reply branches",
71
- "Cross-path cancellation", "Decline-marker reversal", "Tie-breakers",
72
- "Slug grammar") now live alongside their decision-tree steps inside
73
- the partial.
74
-
75
- ## Snapshot files — weekly / monthly / rules / routines
76
-
77
- Weekly and monthly review snapshots, the user-controlled `rules/*.md`
78
- policy files, the built-in `routines/<cadence>.md` rulebooks, custom
79
- routines under `policies/routines/custom/`, and the agent-private
67
+ Weekly and monthly review snapshots, the user-controlled `policies/*.md`
68
+ policy files, the built-in `policies/routines/<cadence>.md` rulebooks, legacy
69
+ custom-routine files under `policies/routines/custom/` (inert converted to
70
+ Agents at the Agents-hub redesign), and the agent-private
80
71
  `journal/agent.md` all have stable per-file conventions (writer event,
81
72
  verb, frontmatter, retention) documented in the snapshot-files
82
73
  reference below.
83
74
 
84
- DM handlers and Hourly Checks should generally not write these files
75
+ DM handlers and Activity Scans should generally not write these files
85
76
  — the cadence-matching routine is the right writer.
86
77
 
87
78
  {{> ref:snapshot-files }}
88
79
 
89
80
  ## Required frontmatter for guarded files
90
81
 
91
- Full-file writes to `user/*.md`, `rules/*.md`, `projects/*.md`,
92
- `daily/*.md`, `weekly/*.md`, and `monthly/*.md` must open with the
93
- matching YAML frontmatter (`type`, `owner`, `updated`) followed by at
94
- least one H1 heading. Per-glob values and the common rejection
95
- envelope are in the required-frontmatter reference below.
82
+ Full-file writes to `identity/*.md`, `policies/*.md`,
83
+ `plans/projects/*.md`, `journal/daily/*.md`, `journal/weekly/*.md`, and
84
+ `journal/monthly/*.md` must open with the matching YAML frontmatter
85
+ (`type`, `owner`, `updated`) followed by at least one H1 heading.
86
+ Per-glob values and the common rejection envelope are in the
87
+ required-frontmatter reference below.
96
88
 
97
89
  {{> ref:required-frontmatter }}
98
90
 
@@ -10,12 +10,12 @@
10
10
  "scope_paths": [
11
11
  "state/today.md",
12
12
  "plans/roadmap.md",
13
- "projects/*.md",
14
- "weekly/*.md",
15
- "monthly/*.md",
16
- "rules/*.md",
17
- "user/*.md",
18
- "agent/*.md"
13
+ "plans/projects/*.md",
14
+ "journal/weekly/*.md",
15
+ "journal/monthly/*.md",
16
+ "policies/*.md",
17
+ "identity/*.md",
18
+ "journal/agent.md"
19
19
  ]
20
20
  },
21
21
  {
@@ -25,12 +25,12 @@
25
25
  "human_label": "Required frontmatter for guarded files",
26
26
  "description": "Per file-glob: required + conventional frontmatter keys",
27
27
  "scope_paths": [
28
- "projects/*.md",
29
- "user/*.md",
30
- "rules/*.md",
31
- "weekly/*.md",
32
- "monthly/*.md",
33
- "daily/*.md"
28
+ "plans/projects/*.md",
29
+ "identity/*.md",
30
+ "policies/*.md",
31
+ "journal/weekly/*.md",
32
+ "journal/monthly/*.md",
33
+ "journal/daily/*.md"
34
34
  ]
35
35
  }
36
36
  ]
@@ -24,7 +24,8 @@ this session.
24
24
  curl -s http://localhost:8321/api/context/plans/roadmap
25
25
  ```
26
26
 
27
- Response: `{ "content": "...", "lastModified": "ISO8601" }` or `404`.
27
+ Response: `{ "content": "...", "lastModified": "ISO8601", "editable": true }` or `404`
28
+ (`editable` is a boolean — `isWriteAllowed(path, "PUT")`).
28
29
  Returns the **entire file** — no section-level GET. Path traversal is
29
30
  rejected; the trailing `.md` is implicit (do not include it in the
30
31
  URL).
@@ -32,12 +33,13 @@ URL).
32
33
  ### GET /api/context/list/:dir
33
34
 
34
35
  ```bash
35
- curl -s http://localhost:8321/api/context/list/projects
36
+ curl -s http://localhost:8321/api/context/list/plans/projects
36
37
  ```
37
38
 
38
39
  Response: `{ "files": [{ "name", "lastModified" }, …] }`. Use this to
39
- enumerate `projects/`, `weekly/`, `monthly/`, `user/`, `rules/`,
40
- `routines/`, `inbox/` before deciding a write target.
40
+ enumerate `plans/projects/`, `journal/weekly/`, `journal/monthly/`,
41
+ `identity/`, `policies/`, `policies/routines/`, `state/inbox/` before
42
+ deciding a write target.
41
43
 
42
44
  ### GET /api/context/today/reconciliation
43
45
 
@@ -67,21 +69,19 @@ Add `X-Lock-Id: <lock-id>` when writing a locked file (`state/today.md`,
67
69
 
68
70
  Common rejections:
69
71
 
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`).
72
+ - `400 {error:"validation_error", message, path}` — a content-body
73
+ validator failed: `state/today.md` line-1 date regex (the message
74
+ echoes both the supplied date and the daemon's current agent-day) or
75
+ the `plans/roadmap.md` transition guard.
76
+ - `422 {error:"validation_error", message, path}` — *frontmatter* shape
77
+ is missing/wrong on a globbed file (`identity/*.md`, `policies/*.md`,
78
+ `plans/projects/*.md`, `journal/daily/*.md`, `journal/weekly/*.md`,
79
+ `journal/monthly/*.md`). Frontmatter validation is a 422; the today.md
80
+ line-1 case above is a 400.
75
81
  - `409 {error:"morning_routine_lock_held"}` — the Morning Routine holds
76
82
  the `state/today.md` write lock; `409 {error:"roadmap_write_lock_held"}`
77
83
  — another session holds the `plans/roadmap.md` lock. Retry with
78
84
  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
85
 
86
86
  `policies/management.md` is user-controlled policy: modify only when the
87
87
  user explicitly asks, and preserve every unrelated section.
@@ -126,8 +126,9 @@ Common rejections (informational responses worth knowing):
126
126
  ### DELETE /api/context/:path
127
127
 
128
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
129
+ small set of paths — notably legacy `policies/routines/custom/<slug>` files
130
+ (inert since the Agents-hub redesign; DELETE remains for cleanup after the
131
+ user asks). Most files are NOT delete-eligible
131
132
  (e.g. `state/today.md`, `plans/roadmap.md`, `identity/profile.md`); the daemon returns
132
133
  `403 {error:"forbidden"}` (with `errors[0].code: "context.write_forbidden"`)
133
134
  for those.
@@ -136,7 +137,7 @@ for those.
136
137
 
137
138
  ### POST /api/context/archive-today
138
139
 
139
- Rotates `state/today.md` → `state/yesterday.md` (synthesized `daily/YYYY-MM-DD.md`
140
+ Rotates `state/today.md` → `state/yesterday.md` (synthesized `journal/daily/YYYY-MM-DD.md`
140
141
  is now written by the Morning Routine, not this endpoint). Called by
141
142
  the Morning Routine during day rotation; other sessions should NOT
142
143
  invoke this directly.
@@ -145,8 +146,9 @@ invoke this directly.
145
146
 
146
147
  Restores the file from snapshot `id` (the daemon snapshots every PUT /
147
148
  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.
149
+ write path. Snapshot listing is dashboard-only via the Knowledge page;
150
+ no agent route exists, so `restore-snapshot/:id` is the only
151
+ agent-relevant snapshot op.
150
152
 
151
153
  ### POST /api/context/repair/stub
152
154
 
@@ -7,8 +7,9 @@ description: YAML frontmatter required by /api/context/* validators on full-file
7
7
  # Required frontmatter — guarded files
8
8
 
9
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.
10
+ (`422 validation_error` frontmatter shape is a 422, distinct from the
11
+ 400 returned for content-body validators) unless the body opens with the
12
+ matching YAML frontmatter followed by at least one H1 heading.
12
13
 
13
14
  Use today's date (the value from `<current_agent_day date="…" />`) for
14
15
  `updated`. The daemon does not auto-fill `updated`; an outdated value
@@ -18,12 +19,12 @@ trips the Evening Review's stale-file detector.
18
19
 
19
20
  | File glob | `type` | `owner` | Required H1 |
20
21
  |---|---|---|---|
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 |
22
+ | `plans/projects/*.md` | `project` | `shared` | Yes |
23
+ | `journal/daily/*.md` | `daily` | `agent` | Yes |
24
+ | `journal/weekly/*.md` | `weekly` | `agent` | Yes |
25
+ | `journal/monthly/*.md` | `monthly` | `agent` | Yes |
26
+ | `policies/*.md` | `rule` | `shared` | Yes |
27
+ | `identity/*.md` | `user` | `shared` | Yes |
27
28
 
28
29
  Every glob also requires `updated: YYYY-MM-DD`.
29
30
 
@@ -55,7 +56,7 @@ have their own validators (date-line regex, transition guard, append-
55
56
  only mode, policy schema). The frontmatter rules in this reference do
56
57
  not apply to them — see each owning skill for the specifics.
57
58
 
58
- ## Common 400 envelope
59
+ ## Common 422 envelope
59
60
 
60
61
  ```json
61
62
  {
@@ -7,17 +7,18 @@ description: Weekly / monthly review snapshots, rules / routines files — who w
7
7
  # Snapshot files — weekly / monthly / rules / routines
8
8
 
9
9
  These files live in the primary management vault under
10
- `weekly/`, `monthly/`, `rules/`, and `routines/`. They are not part
10
+ `journal/weekly/`, `journal/monthly/`, `policies/`, and
11
+ `policies/routines/`. They are not part
11
12
  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
+ `plans/projects/*.md`); they accumulate slowly and are written by routines
13
14
  or by explicit user request.
14
15
 
15
- ## weekly/*.md, monthly/*.md
16
+ ## journal/weekly/*.md, journal/monthly/*.md
16
17
 
17
18
  | File | Path | Cadence | Writer | Verb |
18
19
  |---|---|---|---|---|
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) |
20
+ | Weekly review | `journal/weekly/YYYY-Www.md` | Friday Weekly Review only | `routine.weekly_review` | `PUT` (full body) |
21
+ | Monthly review | `journal/monthly/YYYY-MM.md` | Month-end Monthly Review only | `routine.monthly_review` | `PUT` (full body) |
21
22
 
22
23
  Notes:
23
24
 
@@ -25,13 +26,13 @@ Notes:
25
26
  retry counts, self-critique) go to `journal/agent.md`, not here.
26
27
  - Weekly file name uses ISO week (`YYYY-Www` — `2026-W19`, not
27
28
  `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
29
+ - Never write `journal/weekly/*.md` or `journal/monthly/*.md` on any other day. The
30
+ Morning Routine, Activity Scan, Evening Review, and DM handlers do
30
31
  not produce these files; if you are not the matching review
31
32
  routine, do not PUT this path.
32
33
  - `PATCH` is technically accepted but unusual. The normal write is a
33
34
  single full-body `PUT` at the end of the review session.
34
- - **Weekly leverage contract.** `weekly/YYYY-Www.md` carries three
35
+ - **Weekly leverage contract.** `journal/weekly/YYYY-Www.md` carries three
35
36
  load-bearing H2 sections — `## Carry Over to Next Week`,
36
37
  `## Next Week Focus`, `## Lessons for Next Week` — that the
37
38
  morning_routine lifts mechanically via the `<previous_week>` context
@@ -40,7 +41,7 @@ Notes:
40
41
  3 bullets respectively; empty sections render as `(none recorded)`
41
42
  downstream. Full design: `docs/design/appendices/weekly-next-week-leverage.md`.
42
43
 
43
- ## agent/journal.md
44
+ ## journal/agent.md
44
45
 
45
46
  | Field | Value |
46
47
  |---|---|
@@ -56,12 +57,12 @@ Weekly Review, and Monthly Review each append their own block.
56
57
  **Nothing from this file should appear in notifications.** The journal
57
58
  is the agent's private metrics surface, not user-readable content.
58
59
 
59
- ## rules/*.md, routines/*.md
60
+ ## policies/*.md, policies/routines/*.md
60
61
 
61
62
  User-controlled policy and routine files. Only modify when the user
62
63
  explicitly asks to change the policy or routine itself.
63
64
 
64
- ### `rules/*.md`
65
+ ### `policies/*.md`
65
66
 
66
67
  - Preserve unrelated sections verbatim. PATCH the one section the
67
68
  user is changing; do not full-body PUT.
@@ -75,7 +76,7 @@ similarity-detection, and pause/resume fan-out for durable policies.
75
76
  **Do not hand-edit from this skill.** A direct PATCH here bypasses the
76
77
  similarity check and the dossier / routine fan-out.
77
78
 
78
- ### `routines/<cadence>.md` (built-in cadences)
79
+ ### `policies/routines/<cadence>.md` (built-in cadences)
79
80
 
80
81
  - Cadences: `morning`, `evening`, `weekly`, `monthly`, `hourly`.
81
82
  - Keep the existing frontmatter. Keep a `## Checks` section.
@@ -98,6 +99,6 @@ max_budget_usd: <number>
98
99
 
99
100
  The file body must also contain a `## Checks` section.
100
101
 
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.
102
+ Deleting a legacy custom-routine file uses
103
+ `DELETE /api/context/policies/routines/custom/<slug>` **only** after the user
104
+ asks to clean it up. The daemon snapshots the prior content for restore.
@@ -3,11 +3,11 @@
3
3
  "files": [
4
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
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
- { "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); 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
- { "path": "monthly/*.md", "purpose": "monthly review snapshots (YYYY-MM)", "sections": [{ "heading": "## Theme", "contains": "the month's overall theme" }] },
9
- { "path": "rules/*.md", "purpose": "user-controlled policy files", "sections": [{ "heading": "## Why", "contains": "rationale for the rule" }, { "heading": "## How", "contains": "concrete rule shape" }] },
10
- { "path": "user/*.md", "purpose": "user identity and preferences dictionary", "sections": [{ "heading": "## Identity", "contains": "name role tz" }] },
6
+ { "path": "plans/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": "journal/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
+ { "path": "journal/monthly/*.md", "purpose": "monthly review snapshots (YYYY-MM)", "sections": [{ "heading": "## Theme", "contains": "the month's overall theme" }] },
9
+ { "path": "policies/*.md", "purpose": "user-controlled policy files", "sections": [{ "heading": "## Why", "contains": "rationale for the rule" }, { "heading": "## How", "contains": "concrete rule shape" }] },
10
+ { "path": "identity/*.md", "purpose": "user identity and preferences dictionary", "sections": [{ "heading": "## Identity", "contains": "name role tz" }] },
11
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
  }
@@ -2,7 +2,7 @@
2
2
  "kind": "frontmatter_schema",
3
3
  "file_types": [
4
4
  {
5
- "glob": "projects/*.md",
5
+ "glob": "plans/projects/*.md",
6
6
  "required": [
7
7
  { "key": "type", "type": "enum", "example": "project" },
8
8
  { "key": "owner", "type": "string", "example": "shared" },
@@ -19,7 +19,7 @@
19
19
  ]
20
20
  },
21
21
  {
22
- "glob": "user/*.md",
22
+ "glob": "identity/*.md",
23
23
  "required": [
24
24
  { "key": "type", "type": "enum", "example": "user" },
25
25
  { "key": "owner", "type": "string", "example": "shared" },
@@ -28,7 +28,7 @@
28
28
  "conventional": []
29
29
  },
30
30
  {
31
- "glob": "rules/*.md",
31
+ "glob": "policies/*.md",
32
32
  "required": [
33
33
  { "key": "type", "type": "enum", "example": "rule" },
34
34
  { "key": "owner", "type": "string", "example": "shared" },
@@ -27,38 +27,24 @@ the FTS query in three steps:
27
27
 
28
28
  1. **Extract the topic.** Strip interrogatives, particles, and meta
29
29
  phrases. Keep only the noun phrase or technical term.
30
-
31
- | Input | Topic |
32
- |---|---|
33
- | "what is delegated mode?" | `delegated mode` |
34
- | "什么是 delegated 模式?" | `delegated模式` |
35
- | "tell me about ProcessKey" | `ProcessKey` |
36
- | "ProcessKey 是什么?" | `ProcessKey` |
37
- | "how does the morning routine work?" | `morning routine` |
38
- | "早晨例行公事是怎么运作的?" | `早晨例行公事` |
39
-
40
30
  2. **Split at script boundaries.** If the topic mixes Latin and CJK
41
31
  without spaces, insert a space at every Latin↔CJK boundary. FTS5
42
32
  quotes each whitespace-separated token as a phrase before
43
33
  AND-joining; an unsplit `delegated模式` becomes one unmatchable
44
34
  trigram phrase.
45
-
46
- | Input | Split |
47
- |---|---|
48
- | `delegated模式` | `delegated 模式` |
49
- | `ProcessKey列表` | `ProcessKey 列表` |
50
-
51
35
  3. **Latin wins.** If the split topic contains both Latin and CJK
52
- tokens, drop the CJK tokens. The corpus is English; CJK is the
53
- operator's gloss, not the indexed term. Pure-CJK topics are passed
54
- through unchanged (and may legitimately miss until bilingual aliases
55
- land — see "When you cannot find an answer" below).
36
+ tokens, drop the CJK tokens the corpus is English; CJK is the
37
+ operator's gloss, not the indexed term. Pure-CJK topics pass through
38
+ unchanged (and may legitimately miss until bilingual aliases land —
39
+ see "When you cannot find an answer" below).
56
40
 
57
- | Input | Final query |
58
- |---|---|
59
- | `delegated 模式` | `delegated` |
60
- | `ProcessKey 列表` | `ProcessKey` |
61
- | `早晨例行公事` | `早晨例行公事` (passes through; may miss) |
41
+ | Input | Final query |
42
+ |---|---|
43
+ | "what is delegated mode?" | `delegated` |
44
+ | "什么是 delegated 模式?" | `delegated` |
45
+ | "ProcessKey 是什么?" | `ProcessKey` |
46
+ | "how does the morning routine work?" | `morning routine` |
47
+ | "早晨例行公事是怎么运作的?" | `早晨例行公事` (passes through; may miss) |
62
48
 
63
49
  ## Endpoints
64
50
 
@@ -87,18 +73,20 @@ must not exceed 3. Quality rule, not a daemon-enforced cap.
87
73
  2. **Call 2 (optional).** If 0 hits and a Latin synonym is obvious,
88
74
  retry `term-search` with the synonym. Otherwise fall back to
89
75
  `search` with the same topic.
90
- 3. **Call 3 (rare).** Broaden — strip qualifiers, or add `&category=`
91
- / `&tag=` to narrow.
76
+ 3. **Call 3 (rare).** Broaden — strip qualifiers, or narrow with
77
+ `&category=` (both endpoints) or, on `search` only, `&tag=`.
92
78
 
93
79
  If three calls do not surface an answer, stop and tell the operator the
94
80
  docs do not cover their question.
95
81
 
96
82
  ## Search query syntax
97
83
 
98
- Treat `q` as an FTS5 query. Quote multi-word phrases (`"day plan"`)
99
- when you want them adjacent. Wildcards (`day*`) match prefixes. Boolean
100
- operators (`AND`, `OR`, `NOT`) work — but plain space-separated terms
101
- are usually enough. The bm25 weights already boost
84
+ `q` is **not** a raw FTS5 query. The daemon tokenizes it on whitespace,
85
+ wraps each token in quotes as a literal phrase, and AND-joins them, so
86
+ every term is required. Wildcards (`day*`), booleans (`AND`/`OR`/`NOT`),
87
+ and your own quotes are searched as literal text, not as operators —
88
+ multi-word queries are already implicit-AND across all tokens. Just send
89
+ space-separated terms. The bm25 weights already boost
102
90
  title/keywords/aliases over body, so a one-word query against a doc's
103
91
  `title` or `keywords` is typically the right first move.
104
92
 
@@ -128,7 +128,7 @@ curl -s -X POST http://localhost:8321/api/integrations/google_calendar/exec \
128
128
  `needsConfirmation` plan, or skip the dance for self-only events you
129
129
  already greenlit.)
130
130
 
131
- `outputSchema` is **required** (4 KB cap). Defaults: `maxToolCalls=7`,
131
+ `outputSchema` is **required** (4 KB cap). Defaults: `maxToolCalls=8`,
132
132
  `maxBudgetUsd=0.05`, `timeoutMs=60000`. Bump up to 15 / 0.50 / 300000
133
133
  for genuinely larger intents.
134
134
 
@@ -176,32 +176,7 @@ freshness matters, and never on a destructive-confirm second call.
176
176
  know about, call `POST /api/notify` with a one-line summary. The
177
177
  daemon does NOT auto-notify — it's an explicit choice.
178
178
 
179
- ### Error envelope
180
-
181
- `/exec` extends the direct-mode envelope with delegated-mode fields.
182
- Discriminator: `body.mode === "delegated"`.
183
-
184
- | HTTP | `error` | retry? | What to do |
185
- |---|---|---|---|
186
- | 400 | `validation_error` / `schema_too_large` | no | Fix the request body. |
187
- | 409 | `mode_mismatch` | no | Calendar isn't delegated, OR your DM backend matches `delegatedBackend`. Re-read `integrations.md` and stop. |
188
- | 409 | `precondition` | no | Mode/backend flipped during the queue wait. Re-check state and re-plan. |
189
- | 429 | `task_quota_exhausted` | no | Daily cap reached; wait or surface. |
190
- | 502 | `parse_error` / `schema_violation` | no (daemon already retried once) | Consider a simpler schema. |
191
- | 502 | `tool_unavailable` | no | No connector tool fits the intent. Surface the gap. |
192
- | 502 | `tool_failed` | maybe | Connector tool returned an error. Surface `body.message` verbatim; retry only if clearly transient. |
193
- | 502 | `auth_error` | no | Connector signed out. Tell the user to re-authenticate it. |
194
- | 502 | `policy_violation` | no | Subprocess attempted a tool outside the per-task allowlist (anti-injection). |
195
- | 502 | `loop_aborted` | no | `maxToolCalls` exceeded. Bump the cap or simplify. |
196
- | 502 | `budget_exhausted` | no | `maxBudgetUsd` exceeded. Caller can raise the cap. |
197
- | 502 | `post_write_format_failure` | no | Write succeeded; formatting failed. Side effect is real — surface with the partial trace. |
198
- | 503 | `delegated_proxy_busy` | yes | Daemon queue saturated. Backoff a few seconds, try once. |
199
- | 503 | `task_mode_disabled` | no | Operator turned the kill switch off. Stop. |
200
- | 504 | `timeout` | yes (1×) | Wall-clock fired. Retry once if intent was simple. |
201
- | 500 | `subprocess_crashed` | no | Unhandled exception inside the subprocess. Surface and stop. |
202
-
203
- Always preserve `body.message` verbatim when reporting to the user — it
204
- carries the connector's own language.
179
+ {{> ref:exec-errors }}
205
180
  <!-- /service:calendar -->
206
181
 
207
182
  ---
@@ -286,72 +261,10 @@ existing rows (dedup). → Full guide: load the `agent-create` or `schedule` ski
286
261
 
287
262
  ---
288
263
 
289
- ## One-Shot Scheduling
264
+ ## Scheduling & Skills CRUD
290
265
 
291
- Schedule a future DM or agent task. Use `<current_time>` to resolve relative times into absolute ISO 8601 with offset.
292
-
293
- ### DM vs Agent Task
294
-
295
- | Criterion | `/api/schedule/dm` (free) | `/api/schedule` (~$0.03) |
296
- |---|---|---|
297
- | Message text knowable now? | Yes | No — needs lookup/decision at execution |
298
- | Needs API data at execution? | No | Yes |
299
- | Multi-step action? | No | Yes |
300
- | Conditional on state that may change? | No | Yes |
301
-
302
- **Default to DM** — every agent wake-up costs money and context.
303
-
304
- ### Context-loss warning
305
-
306
- > The wake-up agent has NO memory of why it was scheduled — the `description` field is its only context.
307
-
308
- Include: **What** (verb + object), **Why** (trigger/reason), **Who/What** (names, IDs, URLs), **Expected output** (what success looks like).
309
-
310
- Bad: `"Meeting prep"` — which meeting? when? what to prepare? The wake-up agent will skip ambiguous descriptions.
311
-
312
- ### POST /api/schedule/dm — Pre-composed DM
313
- ```bash
314
- curl -s -X POST http://localhost:8321/api/schedule/dm \
315
- -H 'Content-Type: application/json' \
316
- -d '{"time": "2026-04-06T16:00:00-04:00", "message": "Reminder: Design review in 30 min.", "platform": "slack"}'
317
- ```
318
-
319
- ### POST /api/schedule — Agent task
320
- ```bash
321
- curl -s -X POST http://localhost:8321/api/schedule \
322
- -H 'Content-Type: application/json' \
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"}}'
324
- ```
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.
326
-
327
- ### Manage pending items
328
- ```bash
329
- curl -s "http://localhost:8321/api/schedule?status=pending" # list
330
- curl -s -X PATCH http://localhost:8321/api/schedule/42 \
331
- -H 'Content-Type: application/json' -d '{"time": "2026-04-06T17:00:00-04:00"}' # edit
332
- curl -s -X DELETE http://localhost:8321/api/schedule/42 # cancel
333
- ```
334
- Editable: `time`, `description`, `message` (dm only), `tier` (or `model`, mutually exclusive — pass `null` to clear), `taskContext`. Only `pending` items.
335
-
336
- ### Time discipline
337
- - Absolute ISO 8601 with offset required — no relative times.
338
- - Do not schedule during quiet hours (default 22:00–08:00, configurable) unless critical.
339
- - Maximum 5 wake-ups per execution.
340
-
341
- ---
342
-
343
- ## Skills Management
344
-
345
- User-authored skills: `~/.personal-agent/skills/{slug}/SKILL.md`. Built-in skills are read-only (403). Slug: lowercase kebab-case `[a-z0-9][a-z0-9-]*`, 1–64 chars.
346
-
347
- ```bash
348
- curl -s http://localhost:8321/api/skills # list all
349
- curl -s http://localhost:8321/api/skills/todo-digest # read one
350
- curl -s -X POST http://localhost:8321/api/skills \
351
- -H 'Content-Type: application/json' \
352
- -d '{"name": "todo-digest", "description": "Summarize today.md", "content": "# TODO Digest\n...", "allowedTools": ["Bash(curl *)", "Read"]}'
353
- curl -s -X PUT http://localhost:8321/api/skills/todo-digest \
354
- -H 'Content-Type: application/json' -d '{"description": "New description"}' # update
355
- curl -s -X DELETE http://localhost:8321/api/skills/todo-digest # delete
356
- ```
357
- Always `GET /api/skills` before creating (check name collisions). **Omit frontmatter** from `content` — the API injects it.
266
+ One-shot DMs / agent wake-ups (`/api/schedule`, `/api/schedule/dm`) and
267
+ user-authored Skills CRUD (`/api/skills`) work identically to direct
268
+ mode they are never proxied. Load the `schedule` skill for scheduling
269
+ and the `agent-create` skill for recurring work; this variant does not
270
+ mirror those surfaces.