@aitne-sh/aitne 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +464 -0
  3. package/agent-assets/agent-profiles/_safety.md +26 -0
  4. package/agent-assets/agent-profiles/conversational.md +33 -0
  5. package/agent-assets/agent-profiles/docs-qa.md +24 -0
  6. package/agent-assets/agent-profiles/observer.md +28 -0
  7. package/agent-assets/agent-profiles/profile-importer.md +63 -0
  8. package/agent-assets/agent-profiles/proxy.md +28 -0
  9. package/agent-assets/agent-profiles/routine.md +16 -0
  10. package/agent-assets/agent-profiles/task.md +18 -0
  11. package/agent-assets/docs/concepts/agent-day.md +88 -0
  12. package/agent-assets/docs/concepts/auth-health.md +75 -0
  13. package/agent-assets/docs/concepts/backends-and-tiers.md +126 -0
  14. package/agent-assets/docs/concepts/costs-and-quotas.md +103 -0
  15. package/agent-assets/docs/concepts/delegated-mode.md +223 -0
  16. package/agent-assets/docs/concepts/memory-model.md +118 -0
  17. package/agent-assets/docs/concepts/observations.md +80 -0
  18. package/agent-assets/docs/concepts/process-keys.md +89 -0
  19. package/agent-assets/docs/concepts/routines.md +108 -0
  20. package/agent-assets/docs/concepts/safety-and-execution.md +109 -0
  21. package/agent-assets/docs/concepts/safety-model.md +279 -0
  22. package/agent-assets/docs/concepts/skills.md +100 -0
  23. package/agent-assets/docs/features/integrations/calendar.md +92 -0
  24. package/agent-assets/docs/features/integrations/git.md +95 -0
  25. package/agent-assets/docs/features/integrations/github.md +170 -0
  26. package/agent-assets/docs/features/integrations/mail.md +106 -0
  27. package/agent-assets/docs/features/integrations/notion.md +69 -0
  28. package/agent-assets/docs/features/integrations/obsidian.md +71 -0
  29. package/agent-assets/docs/features/lifestyle/git.md +178 -0
  30. package/agent-assets/docs/features/lifestyle/reading.md +93 -0
  31. package/agent-assets/docs/features/lifestyle/receipts.md +71 -0
  32. package/agent-assets/docs/features/lifestyle/travel-bookings.md +44 -0
  33. package/agent-assets/docs/features/lifestyle/travel-time.md +52 -0
  34. package/agent-assets/docs/features/memory-files/agent-journal.md +105 -0
  35. package/agent-assets/docs/features/memory-files/projects.md +56 -0
  36. package/agent-assets/docs/features/memory-files/roadmap.md +61 -0
  37. package/agent-assets/docs/features/memory-files/schedule.md +112 -0
  38. package/agent-assets/docs/features/memory-files/today.md +73 -0
  39. package/agent-assets/docs/features/memory-files/user-profile.md +81 -0
  40. package/agent-assets/docs/features/messaging/dashboard-chat.md +93 -0
  41. package/agent-assets/docs/features/messaging/discord.md +50 -0
  42. package/agent-assets/docs/features/messaging/overview.md +111 -0
  43. package/agent-assets/docs/features/messaging/pairing-and-magic-phrase.md +69 -0
  44. package/agent-assets/docs/features/messaging/slack.md +51 -0
  45. package/agent-assets/docs/features/messaging/telegram.md +63 -0
  46. package/agent-assets/docs/features/messaging/whatsapp.md +48 -0
  47. package/agent-assets/docs/features/operations/activity-and-conversations.md +105 -0
  48. package/agent-assets/docs/features/operations/approvals.md +58 -0
  49. package/agent-assets/docs/features/operations/backend-routing.md +62 -0
  50. package/agent-assets/docs/features/operations/cost-tracking.md +59 -0
  51. package/agent-assets/docs/features/operations/notifications.md +69 -0
  52. package/agent-assets/docs/features/operations/quiet-hours.md +106 -0
  53. package/agent-assets/docs/features/operations/schedule-approaching.md +60 -0
  54. package/agent-assets/docs/features/routines/custom-routines.md +101 -0
  55. package/agent-assets/docs/features/routines/evening-review.md +81 -0
  56. package/agent-assets/docs/features/routines/hourly-check.md +85 -0
  57. package/agent-assets/docs/features/routines/monthly-review.md +65 -0
  58. package/agent-assets/docs/features/routines/morning-routine.md +123 -0
  59. package/agent-assets/docs/features/routines/weekly-review.md +70 -0
  60. package/agent-assets/docs/getting-started/01-what-is-this.md +192 -0
  61. package/agent-assets/docs/getting-started/02-first-steps.md +80 -0
  62. package/agent-assets/docs/getting-started/03-what-can-this-do.md +110 -0
  63. package/agent-assets/docs/getting-started/04-first-day.md +287 -0
  64. package/agent-assets/docs/glossary.md +116 -0
  65. package/agent-assets/docs/guides/add-a-custom-routine.md +71 -0
  66. package/agent-assets/docs/guides/backup-and-restore.md +54 -0
  67. package/agent-assets/docs/guides/change-which-model-handles-x.md +47 -0
  68. package/agent-assets/docs/guides/connect-a-new-mail-account.md +59 -0
  69. package/agent-assets/docs/guides/import-knowledge-file.md +275 -0
  70. package/agent-assets/docs/guides/install-and-run.md +72 -0
  71. package/agent-assets/docs/guides/migrate-machines.md +52 -0
  72. package/agent-assets/docs/guides/pause-the-agent.md +65 -0
  73. package/agent-assets/docs/guides/reinstall-cleanly.md +52 -0
  74. package/agent-assets/docs/guides/setup-wizard.md +107 -0
  75. package/agent-assets/docs/guides/switch-default-backend.md +60 -0
  76. package/agent-assets/docs/reference/api.md +51 -0
  77. package/agent-assets/docs/reference/cli-commands.md +121 -0
  78. package/agent-assets/docs/reference/config.md +74 -0
  79. package/agent-assets/docs/reference/disallowed-tools.md +76 -0
  80. package/agent-assets/docs/reference/keyboard-shortcuts.md +39 -0
  81. package/agent-assets/docs/reference/process-keys.md +59 -0
  82. package/agent-assets/docs/reference/skills.md +50 -0
  83. package/agent-assets/docs/troubleshooting/auth-failed.md +57 -0
  84. package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +55 -0
  85. package/agent-assets/docs/troubleshooting/fallback-keeps-firing.md +54 -0
  86. package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +53 -0
  87. package/agent-assets/docs/troubleshooting/morning-routine-didnt-run.md +75 -0
  88. package/agent-assets/docs/troubleshooting/observation-not-detected.md +57 -0
  89. package/agent-assets/docs/troubleshooting/quota-exhausted.md +57 -0
  90. package/agent-assets/optimizer-skills/drift-analysis/SKILL.md +75 -0
  91. package/agent-assets/optimizer-skills/knowledge-map/SKILL.md +71 -0
  92. package/agent-assets/optimizer-skills/skill-curation/SKILL.md +108 -0
  93. package/agent-assets/project-doc-templates/git-repo.md +21 -0
  94. package/agent-assets/project-doc-templates/project.md +38 -0
  95. package/agent-assets/skills/attach/SKILL.md +104 -0
  96. package/agent-assets/skills/context/SKILL.md +257 -0
  97. package/agent-assets/skills/context/curation.json +37 -0
  98. package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +13 -0
  99. package/agent-assets/skills/context/seeds/frontmatter-requirements.seed.json +40 -0
  100. package/agent-assets/skills/docs-search/SKILL.md +176 -0
  101. package/agent-assets/skills/external-services/SKILL.delegated.claude.md +369 -0
  102. package/agent-assets/skills/external-services/SKILL.delegated.codex.md +349 -0
  103. package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +347 -0
  104. package/agent-assets/skills/external-services/SKILL.md +371 -0
  105. package/agent-assets/skills/mail/SKILL.delegated.claude.md +284 -0
  106. package/agent-assets/skills/mail/SKILL.delegated.codex.md +261 -0
  107. package/agent-assets/skills/mail/SKILL.delegated.gemini.md +255 -0
  108. package/agent-assets/skills/mail/SKILL.md +313 -0
  109. package/agent-assets/skills/mail/references/errors.md +17 -0
  110. package/agent-assets/skills/mail/references/providers.md +40 -0
  111. package/agent-assets/skills/mail/references/query-grammar.md +24 -0
  112. package/agent-assets/skills/management-policy/SKILL.md +307 -0
  113. package/agent-assets/skills/management-policy/curation.json +13 -0
  114. package/agent-assets/skills/management-policy/seeds/policy-file-shape.seed.json +16 -0
  115. package/agent-assets/skills/management-task-modify/SKILL.md +202 -0
  116. package/agent-assets/skills/management-task-register/SKILL.md +330 -0
  117. package/agent-assets/skills/management-task-stop/SKILL.md +166 -0
  118. package/agent-assets/skills/notify/SKILL.md +196 -0
  119. package/agent-assets/skills/notion/SKILL.delegated.claude.md +254 -0
  120. package/agent-assets/skills/notion/SKILL.delegated.codex.md +195 -0
  121. package/agent-assets/skills/notion/SKILL.delegated.gemini.md +194 -0
  122. package/agent-assets/skills/notion/SKILL.md +86 -0
  123. package/agent-assets/skills/observations/SKILL.md +234 -0
  124. package/agent-assets/skills/observations/curation.json +13 -0
  125. package/agent-assets/skills/observations/seeds/source-namespacing.seed.json +20 -0
  126. package/agent-assets/skills/project-doc/SKILL.md +86 -0
  127. package/agent-assets/skills/project-doc/curation.json +21 -0
  128. package/agent-assets/skills/project-doc/seeds/project-shape.seed.json +25 -0
  129. package/agent-assets/skills/project-doc/seeds/slug-grammar.seed.json +20 -0
  130. package/agent-assets/skills/reading/SKILL.md +198 -0
  131. package/agent-assets/skills/reading/references/reading-taste.md +197 -0
  132. package/agent-assets/skills/receipts/SKILL.md +134 -0
  133. package/agent-assets/skills/roadmap/SKILL.md +276 -0
  134. package/agent-assets/skills/roadmap/curation.json +13 -0
  135. package/agent-assets/skills/roadmap/references/horizon-tags.md +40 -0
  136. package/agent-assets/skills/roadmap/references/preparation-timeline.md +47 -0
  137. package/agent-assets/skills/roadmap/seeds/entry-types.seed.json +16 -0
  138. package/agent-assets/skills/schedule/SKILL.md +228 -0
  139. package/agent-assets/skills/scheduled-managed-task/SKILL.md +392 -0
  140. package/agent-assets/skills/today/SKILL.md +198 -0
  141. package/agent-assets/skills/today/curation.json +21 -0
  142. package/agent-assets/skills/today/seeds/agent-notes-flavors.seed.json +17 -0
  143. package/agent-assets/skills/today/seeds/section-shape.seed.json +17 -0
  144. package/agent-assets/skills/travel/SKILL.md +132 -0
  145. package/agent-assets/skills/travel-time/SKILL.md +149 -0
  146. package/agent-assets/skills/user-interview/SKILL.md +323 -0
  147. package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +94 -0
  148. package/agent-assets/skills/user-profile/SKILL.md +210 -0
  149. package/agent-assets/skills/user-profile/curation.json +29 -0
  150. package/agent-assets/skills/user-profile/seeds/learned-context-format.seed.json +14 -0
  151. package/agent-assets/skills/user-profile/seeds/routing-table.seed.json +53 -0
  152. package/agent-assets/skills/user-profile/seeds/topic-files.seed.json +27 -0
  153. package/agent-assets/task-flows/dashboard.docs_qa.md +43 -0
  154. package/agent-assets/task-flows/default.md +11 -0
  155. package/agent-assets/task-flows/git.branch.created.md +25 -0
  156. package/agent-assets/task-flows/git.lifecycle.poll.md +52 -0
  157. package/agent-assets/task-flows/git.local_ahead.stale.md +34 -0
  158. package/agent-assets/task-flows/git.merge_to_default.md +30 -0
  159. package/agent-assets/task-flows/git.project.refresh_architecture.md +100 -0
  160. package/agent-assets/task-flows/git.project.retemplate.md +73 -0
  161. package/agent-assets/task-flows/git.push.detected.md +32 -0
  162. package/agent-assets/task-flows/git.push.force_pushed.md +36 -0
  163. package/agent-assets/task-flows/git.tag.created.md +24 -0
  164. package/agent-assets/task-flows/github.assigned.md +43 -0
  165. package/agent-assets/task-flows/github.pull_request.review_requested.md +57 -0
  166. package/agent-assets/task-flows/github.security_alert.md +45 -0
  167. package/agent-assets/task-flows/github.workflow_run.failed.md +57 -0
  168. package/agent-assets/task-flows/knowledge.import.md +161 -0
  169. package/agent-assets/task-flows/message.received.dm.md +142 -0
  170. package/agent-assets/task-flows/message.received.dm_first.md +117 -0
  171. package/agent-assets/task-flows/message.received.md +14 -0
  172. package/agent-assets/task-flows/routine.custom.md +38 -0
  173. package/agent-assets/task-flows/routine.evening_review.md +323 -0
  174. package/agent-assets/task-flows/routine.hourly_check.delegated.claude.md +405 -0
  175. package/agent-assets/task-flows/routine.hourly_check.delegated.codex.md +400 -0
  176. package/agent-assets/task-flows/routine.hourly_check.delegated.gemini.md +404 -0
  177. package/agent-assets/task-flows/routine.hourly_check.md +184 -0
  178. package/agent-assets/task-flows/routine.hourly_check.triage.md +93 -0
  179. package/agent-assets/task-flows/routine.monthly_review.md +250 -0
  180. package/agent-assets/task-flows/routine.morning_routine.md +300 -0
  181. package/agent-assets/task-flows/routine.morning_routine_initial.md +184 -0
  182. package/agent-assets/task-flows/routine.roadmap_refresh.md +275 -0
  183. package/agent-assets/task-flows/routine.today_refresh.md +172 -0
  184. package/agent-assets/task-flows/routine.user_profile_sweep.md +242 -0
  185. package/agent-assets/task-flows/routine.weekly_review.md +247 -0
  186. package/agent-assets/task-flows/schedule.approaching.md +124 -0
  187. package/agent-assets/task-flows/scheduled.dm.md +391 -0
  188. package/agent-assets/task-flows/scheduled.task.md +141 -0
  189. package/agent-assets/task-flows/setup.initial.md +277 -0
  190. package/agent-assets/task-flows/setup.update.md +53 -0
  191. package/agent-assets/templates/README.md +85 -0
  192. package/agent-assets/templates/_index.md +39 -0
  193. package/agent-assets/templates/_manifest.json +103 -0
  194. package/agent-assets/templates/agent/journal.md +10 -0
  195. package/agent-assets/templates/agent/profile-questions.md +74 -0
  196. package/agent-assets/templates/context-index.md +42 -0
  197. package/agent-assets/templates/dossiers/_index.md +22 -0
  198. package/agent-assets/templates/dossiers/evening.md +23 -0
  199. package/agent-assets/templates/dossiers/hourly.md +23 -0
  200. package/agent-assets/templates/dossiers/monthly.md +23 -0
  201. package/agent-assets/templates/dossiers/morning.md +23 -0
  202. package/agent-assets/templates/dossiers/roadmap.md +23 -0
  203. package/agent-assets/templates/dossiers/weekly.md +23 -0
  204. package/agent-assets/templates/projects/_active.base +14 -0
  205. package/agent-assets/templates/projects/_index.md +29 -0
  206. package/agent-assets/templates/roadmap.md +15 -0
  207. package/agent-assets/templates/routines/_index.md +20 -0
  208. package/agent-assets/templates/routines/evening.md +22 -0
  209. package/agent-assets/templates/routines/hourly.md +30 -0
  210. package/agent-assets/templates/routines/monthly.md +25 -0
  211. package/agent-assets/templates/routines/morning.md +26 -0
  212. package/agent-assets/templates/routines/weekly.md +23 -0
  213. package/agent-assets/templates/rules/_index.md +19 -0
  214. package/agent-assets/templates/rules/journal-export.md +41 -0
  215. package/agent-assets/templates/rules/journal-format.md +61 -0
  216. package/agent-assets/templates/rules/management.md +48 -0
  217. package/agent-assets/templates/rules/mcp.md +40 -0
  218. package/agent-assets/templates/rules/policies/_index.md +22 -0
  219. package/agent-assets/templates/rules/redaction.md +30 -0
  220. package/agent-assets/templates/today.md +13 -0
  221. package/agent-assets/templates/user/_index.md +16 -0
  222. package/agent-assets/templates/user/expertise.md +7 -0
  223. package/agent-assets/templates/user/goals.md +7 -0
  224. package/agent-assets/templates/user/people.md +7 -0
  225. package/agent-assets/templates/user/personal.md +7 -0
  226. package/agent-assets/templates/user/profile.md +28 -0
  227. package/agent-assets/templates/user/work.md +7 -0
  228. package/bin/aitne.mjs +1096 -0
  229. package/package.json +78 -0
  230. package/personal-agent.mjs +39 -0
  231. package/scripts/browser.mjs +99 -0
  232. package/scripts/check-redaction-coverage.mjs +109 -0
  233. package/scripts/commands/audit.mjs +309 -0
  234. package/scripts/commands/doctor.mjs +437 -0
  235. package/scripts/commands/open.mjs +40 -0
  236. package/scripts/commands/setup.mjs +21 -0
  237. package/scripts/commands/uninstall.mjs +114 -0
  238. package/scripts/commands/update.mjs +96 -0
  239. package/scripts/commands/version.mjs +62 -0
  240. package/scripts/commands.md +0 -0
  241. package/scripts/lib/sqlite-loader.mjs +49 -0
  242. package/scripts/message-discipline-digest.mjs +535 -0
  243. package/scripts/poc/google-connector-inheritance/REPORT.md +197 -0
  244. package/scripts/poc/google-connector-inheritance/claude-sdk-probe.mjs +79 -0
  245. package/scripts/remint-roadmap-ids.mjs +257 -0
  246. package/scripts/rm-paths.mjs +22 -0
  247. package/scripts/run-node.mjs +223 -0
  248. package/scripts/smoke-obsidian-api.mjs +166 -0
  249. package/scripts/start.mjs +160 -0
@@ -0,0 +1,369 @@
1
+ ---
2
+ name: external-services
3
+ description: Load when the task involves Google Calendar, the user's external Obsidian vault, GitHub, or Skills management AND Google Calendar is in cross-backend delegated mode (DM session on Claude Code, Calendar delegated to a different backend's connector). Calendar calls flow through `POST /api/integrations/google_calendar/exec`; the rest of the surface (Obsidian, GitHub, recurring schedules, one-shot scheduling, skills CRUD) is unchanged from the direct-mode body.
4
+ allowed-tools:
5
+ - Bash(curl *)
6
+ - Bash(jq *)
7
+ - Read
8
+ ---
9
+
10
+ # External Services API Reference — Cross-Backend Delegated (Claude DM)
11
+
12
+ Base URL: `http://localhost:8321`. All calls via `curl -s` with
13
+ `Content-Type: application/json` on POST/PATCH/PUT.
14
+
15
+ Your DM session runs on Claude Code. **Google Calendar** access has been
16
+ delegated to a different backend whose Calendar connector is signed in.
17
+ You describe Calendar intent in natural language; the daemon spawns the
18
+ delegated backend, lets it pick the right MCP tool, and returns a
19
+ schema-validated JSON result. The `mcp__claude_ai_Google_Calendar__*`
20
+ tools are not on the inventory here (Calendar is not delegated to
21
+ Claude in this session).
22
+
23
+ The rest of this skill — Obsidian, GitHub, recurring schedules, one-shot
24
+ scheduling, skills CRUD — works identically to the direct-mode body.
25
+ Refer to that body for those services; **only the Calendar section
26
+ below changes** under cross-backend delegation.
27
+
28
+ To check which backend currently owns the Calendar connector, read
29
+ `~/.personal-agent/integrations.md`. The `/exec` body below is
30
+ backend-agnostic — Codex, Gemini, and any custom MCP server the user
31
+ installs are all addressed the same way.
32
+
33
+ ## Shell rules (read before writing curl pipelines)
34
+
35
+ - **JSON post-processing: use `jq`, never `python3`.** `python3` is not
36
+ in the daemon's allowlist, so `curl ... | python3 -c ...` is denied
37
+ under `permissionMode: "dontAsk"` and the call silently fails. Use
38
+ `jq` for all field extraction, filtering, and pretty-printing.
39
+ - **`jq` is restricted**: `--slurpfile`, `--rawfile`, `-L`, and the
40
+ `env` filter are blocked by the security hook. Use only the filter
41
+ language itself.
42
+ - **`curl` is restricted to `http://localhost:8321`**: connection-
43
+ override flags and non-localhost hosts are blocked.
44
+
45
+ ---
46
+
47
+ <!-- service:calendar -->
48
+ ## Calendar (delegated, cross-backend)
49
+
50
+ Every Calendar operation is one POST to the daemon's task-mode endpoint:
51
+
52
+ ```bash
53
+ curl -s -X POST http://localhost:8321/api/integrations/google_calendar/exec \
54
+ -H 'Content-Type: application/json' \
55
+ -d '{"task": "<natural-language intent>", "outputSchema": { ... }, "cacheable": true}'
56
+ ```
57
+
58
+ The daemon:
59
+
60
+ 1. Verifies Calendar is in `mode="delegated"`. If not, you get
61
+ `409 mode_mismatch` — re-read `integrations.md` and stop.
62
+ 2. Verifies your DM backend isn't the same as `delegatedBackend`. If it
63
+ is, you get `409 mode_mismatch` and should switch to native MCP
64
+ (you'd have those tools without this skill).
65
+ 3. Spawns the delegatedBackend, lets it pick the right tool against the
66
+ per-task allowed-tools envelope, validates the final JSON against
67
+ your `outputSchema`, returns it.
68
+
69
+ You **describe Calendar intent in natural language**. Tool name
70
+ divergence between Codex (`search_events`, `create_event`), Gemini
71
+ (`listEvents`, `createEvent`) and any custom MCP server the user
72
+ installs is invisible to you.
73
+
74
+ ### Worked examples
75
+
76
+ #### List events in a window (read)
77
+
78
+ ```bash
79
+ curl -s -X POST http://localhost:8321/api/integrations/google_calendar/exec \
80
+ -H 'Content-Type: application/json' \
81
+ -d '{
82
+ "task": "List every confirmed event on my primary calendar between 2026-04-29T00:00:00+09:00 and 2026-05-30T00:00:00+09:00. Sort by start time ascending.",
83
+ "outputSchema": {
84
+ "type": "object",
85
+ "required": ["events"],
86
+ "properties": {
87
+ "events": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "object",
91
+ "required": ["id", "title", "start", "end"],
92
+ "properties": {
93
+ "id": {"type": "string"},
94
+ "title": {"type": "string"},
95
+ "start": {"type": "string", "format": "date-time"},
96
+ "end": {"type": "string", "format": "date-time"},
97
+ "attendees": {"type": "array", "items": {"type": "string"}}
98
+ }
99
+ }
100
+ }
101
+ }
102
+ },
103
+ "cacheable": true
104
+ }'
105
+ ```
106
+
107
+ #### Find free time + create an event (multi-step composition)
108
+
109
+ ```bash
110
+ curl -s -X POST http://localhost:8321/api/integrations/google_calendar/exec \
111
+ -H 'Content-Type: application/json' \
112
+ -d '{
113
+ "task": "Find a 30-minute free slot on my primary calendar tomorrow afternoon (13:00-17:00 local). Create a Calendar event titled \"Focus block\" in that slot with description \"Heads-down on the migration plan\".",
114
+ "outputSchema": {
115
+ "type": "object",
116
+ "required": ["eventId", "start", "end"],
117
+ "properties": {
118
+ "eventId": {"type": "string"},
119
+ "start": {"type": "string", "format": "date-time"},
120
+ "end": {"type": "string", "format": "date-time"}
121
+ }
122
+ },
123
+ "maxToolCalls": 5,
124
+ "allowDestructive": true
125
+ }'
126
+ ```
127
+
128
+ (Create / update / delete are destructive — pass
129
+ `allowDestructive: true` after the user has confirmed the
130
+ `needsConfirmation` plan, or skip the dance for self-only events you
131
+ already greenlit.)
132
+
133
+ `outputSchema` is **required** (4 KB cap). Defaults: `maxToolCalls=7`,
134
+ `maxBudgetUsd=0.05`, `timeoutMs=60000`. Bump up to 15 / 0.50 / 300000
135
+ for genuinely larger intents.
136
+
137
+ ### Destructive-confirm two-step (`allowDestructive`)
138
+
139
+ Default is `false`. The subprocess will not run create / update /
140
+ delete / respond — it returns:
141
+
142
+ ```jsonc
143
+ {
144
+ "needsConfirmation": true,
145
+ "confirmationPlan": "I will create a 30-min event titled \"Focus block\" tomorrow at 14:00 JST."
146
+ }
147
+ ```
148
+
149
+ Surface the plan to the user verbatim. On explicit OK, re-issue the
150
+ **same `task` verbatim** with `allowDestructive: true`. Do NOT set
151
+ `cacheable: true` on the second call.
152
+
153
+ ### `cacheable: true` for read-only Calendar lookups
154
+
155
+ Calendar list / search responses are good cache candidates because the
156
+ agent often follows up immediately with a related read. The 60s TTL
157
+ keeps stale-vs-fresh tension acceptable for week-scale and month-scale
158
+ queries. **Skip caching** for "today's events" if minute-level
159
+ freshness matters, and never on a destructive-confirm second call.
160
+
161
+ ### Decision rules
162
+
163
+ - **Update / delete + send invite are destructive.** The
164
+ `needsConfirmation` envelope is the standard interaction; surface
165
+ the plan and ask before pressing OK.
166
+ - **All-day vs timed**: timed events need ISO 8601 timestamps with TZ
167
+ offset (e.g. `2026-04-02T14:00:00-04:00`). All-day events use
168
+ `YYYY-MM-DD` with no offset. Be explicit in the `task` body which
169
+ shape you intend.
170
+ - **Attendees on update**: treat the `attendees` field as
171
+ authoritative on the next write — describe the full final list in
172
+ your `task`, not a delta.
173
+ - **Free/busy** under cross-backend: phrase the intent as
174
+ "find a free slot…" — the subprocess picks the right primitive
175
+ (`findFreeTime` / `get_availability` / window-list inspection)
176
+ whichever connector is active.
177
+ - When you do mutate the calendar in a way the user would want to
178
+ know about, call `POST /api/notify` with a one-line summary. The
179
+ daemon does NOT auto-notify — it's an explicit choice.
180
+
181
+ ### Error envelope
182
+
183
+ `/exec` extends the direct-mode envelope with delegated-mode fields.
184
+ Discriminator: `body.mode === "delegated"`.
185
+
186
+ | HTTP | `error` | retry? | What to do |
187
+ |---|---|---|---|
188
+ | 400 | `validation_error` / `schema_too_large` | no | Fix the request body. |
189
+ | 409 | `mode_mismatch` | no | Calendar isn't delegated, OR your DM backend matches `delegatedBackend`. Re-read `integrations.md` and stop. |
190
+ | 409 | `precondition` | no | Mode/backend flipped during the queue wait. Re-check state and re-plan. |
191
+ | 429 | `task_quota_exhausted` | no | Daily cap reached; wait or surface. |
192
+ | 502 | `parse_error` / `schema_violation` | no (daemon already retried once) | Consider a simpler schema. |
193
+ | 502 | `tool_unavailable` | no | No connector tool fits the intent. Surface the gap. |
194
+ | 502 | `tool_failed` | maybe | Connector tool returned an error. Surface `body.message` verbatim; retry only if clearly transient. |
195
+ | 502 | `auth_error` | no | Connector signed out. Tell the user to re-authenticate it. |
196
+ | 502 | `policy_violation` | no | Subprocess attempted a tool outside the per-task allowlist (anti-injection). |
197
+ | 502 | `loop_aborted` | no | `maxToolCalls` exceeded. Bump the cap or simplify. |
198
+ | 502 | `budget_exhausted` | no | `maxBudgetUsd` exceeded. Caller can raise the cap. |
199
+ | 502 | `post_write_format_failure` | no | Write succeeded; formatting failed. Side effect is real — surface with the partial trace. |
200
+ | 503 | `delegated_proxy_busy` | yes | Daemon queue saturated. Backoff a few seconds, try once. |
201
+ | 503 | `task_mode_disabled` | no | Operator turned the kill switch off. Stop. |
202
+ | 504 | `timeout` | yes (1×) | Wall-clock fired. Retry once if intent was simple. |
203
+ | 500 | `subprocess_crashed` | no | Unhandled exception inside the subprocess. Surface and stop. |
204
+
205
+ Always preserve `body.message` verbatim when reporting to the user — it
206
+ carries the connector's own language.
207
+ <!-- /service:calendar -->
208
+
209
+ ---
210
+
211
+ <!-- service:obsidian -->
212
+ ## Obsidian (external vault)
213
+
214
+ **Scope**: this skill targets a **separate** Obsidian vault the user
215
+ maintains alongside this app — e.g. a personal knowledge base. It is
216
+ **not** the agent's own primary management store. The agent's primary
217
+ files (`today.md`, `roadmap.md`, `projects/`, `rules/`, `routines/`,
218
+ `user/`, `agent/`, …) live in the primary vault and are reached via
219
+ `/api/context/*` (see the `context` skill). **Never** use this skill to
220
+ read or write the primary vault.
221
+
222
+ Use this skill when the user asks the agent to look up, append to, or
223
+ create notes inside their external knowledge vault — never for the
224
+ agent's own working state.
225
+
226
+ Full CRUD over the external vault. Requires the Obsidian app running
227
+ (the CLI proxies through it). Omit `.md` extension from paths. All
228
+ writes are Autonomous; the daemon does not DM the owner before/after
229
+ the call. Call `POST /api/notify` yourself when the user would want to
230
+ know.
231
+
232
+ ```bash
233
+ curl -s http://localhost:8321/api/obsidian/status # external vault availability
234
+ curl -s "http://localhost:8321/api/obsidian/search?q=meeting+notes&limit=10" # search external vault
235
+ curl -s http://localhost:8321/api/obsidian/notes/Daily%20Notes/2026-04-06 # read external note
236
+ curl -s -X POST http://localhost:8321/api/obsidian/notes \
237
+ -H 'Content-Type: application/json' \
238
+ -d '{"name": "Meeting Notes 2026-04-02", "content": "# Meeting\n..."}' # create external note (fails if exists)
239
+ curl -s -X PUT http://localhost:8321/api/obsidian/notes/Projects/ProjectA \
240
+ -H 'Content-Type: application/json' -d '{"content": "# Full body"}' # create-or-overwrite external note
241
+ curl -s -X PATCH http://localhost:8321/api/obsidian/notes \
242
+ -H 'Content-Type: application/json' \
243
+ -d '{"file": "Meeting Notes 2026-04-02", "content": "\n- Action item"}' # append to external note
244
+ curl -s -X PATCH http://localhost:8321/api/obsidian/daily \
245
+ -H 'Content-Type: application/json' -d '{"content": "- [ ] Follow up"}' # append to external daily note
246
+ curl -s -X DELETE http://localhost:8321/api/obsidian/notes/Projects/Old # delete from external vault (moves to trash)
247
+ ```
248
+ **Endpoint choice**: Read → GET, Create-only → POST, Edit → PUT, Append → PATCH.
249
+
250
+ If the user's request is really about the agent's own state (today, roadmap,
251
+ projects, journal, rules, routines, user profile), switch to the `context`
252
+ skill and the `/api/context/*` endpoints instead.
253
+ <!-- /service:obsidian -->
254
+
255
+ ---
256
+
257
+ <!-- service:github -->
258
+ ## GitHub
259
+
260
+ ```bash
261
+ curl -s http://localhost:8321/api/github/repos # list watched repos
262
+ curl -s "http://localhost:8321/api/github/pulls?state=open" # list PRs
263
+ curl -s -X POST http://localhost:8321/api/github/pulls/comment \
264
+ -H 'Content-Type: application/json' \
265
+ -d '{"owner": "user", "repo": "repo", "pullNumber": 42, "body": "LGTM"}' # comment — Autonomous
266
+ ```
267
+ <!-- /service:github -->
268
+
269
+ ---
270
+
271
+ <!-- service:notion -->
272
+ ## Notion
273
+
274
+ Notion operations live in the dedicated `notion` skill — load that when
275
+ the user asks anything Notion-shaped (search, query, read, create,
276
+ update, archive).
277
+ <!-- /service:notion -->
278
+
279
+ ---
280
+
281
+ ## Recurring Schedules
282
+
283
+ CRUD for repeating agent tasks. Timezone auto-filled from daemon config.
284
+
285
+ ```bash
286
+ curl -s -X POST http://localhost:8321/api/recurring-schedules \
287
+ -H 'Content-Type: application/json' \
288
+ -d '{"taskType": "wake", "description": "Morning inbox triage.", "recurrenceRule": {"frequency": "daily", "time": "09:00"}}'
289
+ curl -s "http://localhost:8321/api/recurring-schedules?enabled=true" # list
290
+ curl -s -X PATCH http://localhost:8321/api/recurring-schedules/1 \
291
+ -H 'Content-Type: application/json' \
292
+ -d '{"recurrenceRule": {"frequency": "weekly", "time": "10:00", "daysOfWeek": [1,3,5]}}'
293
+ curl -s -X PATCH http://localhost:8321/api/recurring-schedules/1 \
294
+ -H 'Content-Type: application/json' -d '{"enabled": false}' # disable
295
+ curl -s -X DELETE http://localhost:8321/api/recurring-schedules/1 # delete
296
+ ```
297
+ `recurrenceRule`: `frequency` (daily/weekly/monthly), `time` (HH:MM), `daysOfWeek` (0=Sun..6=Sat, weekly), `daysOfMonth` (1-31, monthly). → Full guide: load `schedule` skill.
298
+
299
+ ---
300
+
301
+ ## One-Shot Scheduling
302
+
303
+ Schedule a future DM or agent task. Use `<current_time>` to resolve relative times into absolute ISO 8601 with offset.
304
+
305
+ ### DM vs Agent Task
306
+
307
+ | Criterion | `/api/schedule/dm` (free) | `/api/schedule` (~$0.03) |
308
+ |---|---|---|
309
+ | Message text knowable now? | Yes | No — needs lookup/decision at execution |
310
+ | Needs API data at execution? | No | Yes |
311
+ | Multi-step action? | No | Yes |
312
+ | Conditional on state that may change? | No | Yes |
313
+
314
+ **Default to DM** — every agent wake-up costs money and context.
315
+
316
+ ### Context-loss warning
317
+
318
+ > The wake-up agent has NO memory of why it was scheduled — the `description` field is its only context.
319
+
320
+ Include: **What** (verb + object), **Why** (trigger/reason), **Who/What** (names, IDs, URLs), **Expected output** (what success looks like).
321
+
322
+ Bad: `"Meeting prep"` — which meeting? when? what to prepare? The wake-up agent will skip ambiguous descriptions.
323
+
324
+ ### POST /api/schedule/dm — Pre-composed DM
325
+ ```bash
326
+ curl -s -X POST http://localhost:8321/api/schedule/dm \
327
+ -H 'Content-Type: application/json' \
328
+ -d '{"time": "2026-04-06T16:00:00-04:00", "message": "Reminder: Design review in 30 min.", "platform": "slack"}'
329
+ ```
330
+
331
+ ### POST /api/schedule — Agent task
332
+ ```bash
333
+ curl -s -X POST http://localhost:8321/api/schedule \
334
+ -H 'Content-Type: application/json' \
335
+ -d '{"time": "2026-04-06T16:00:00-04:00", "taskType": "wake", "description": "Check PR #42 status and notify user.", "model": "sonnet", "taskContext": {"scheduledBy": "dm_conversation"}}'
336
+ ```
337
+ Fields: `time` (required), `taskType` (`wake`), `description` (required, min 20 chars), `model` (optional), `taskContext` (optional metadata).
338
+
339
+ ### Manage pending items
340
+ ```bash
341
+ curl -s "http://localhost:8321/api/schedule?status=pending" # list
342
+ curl -s -X PATCH http://localhost:8321/api/schedule/42 \
343
+ -H 'Content-Type: application/json' -d '{"time": "2026-04-06T17:00:00-04:00"}' # edit
344
+ curl -s -X DELETE http://localhost:8321/api/schedule/42 # cancel
345
+ ```
346
+ Editable: `time`, `description`, `message` (dm only), `model`, `taskContext`. Only `pending` items.
347
+
348
+ ### Time discipline
349
+ - Absolute ISO 8601 with offset required — no relative times.
350
+ - Do not schedule during quiet hours (default 22:00–08:00, configurable) unless critical.
351
+ - Maximum 5 wake-ups per execution.
352
+
353
+ ---
354
+
355
+ ## Skills Management
356
+
357
+ 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.
358
+
359
+ ```bash
360
+ curl -s http://localhost:8321/api/skills # list all
361
+ curl -s http://localhost:8321/api/skills/todo-digest # read one
362
+ curl -s -X POST http://localhost:8321/api/skills \
363
+ -H 'Content-Type: application/json' \
364
+ -d '{"name": "todo-digest", "description": "Summarize today.md", "content": "# TODO Digest\n...", "allowedTools": ["Bash(curl *)", "Read"]}'
365
+ curl -s -X PUT http://localhost:8321/api/skills/todo-digest \
366
+ -H 'Content-Type: application/json' -d '{"description": "New description"}' # update
367
+ curl -s -X DELETE http://localhost:8321/api/skills/todo-digest # delete
368
+ ```
369
+ Always `GET /api/skills` before creating (check name collisions). **Omit frontmatter** from `content` — the API injects it.