@aitne-sh/aitne 0.1.7 → 0.1.8

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 (222) hide show
  1. package/README.md +195 -829
  2. package/agent-assets/agent-profiles/_safety.md +49 -17
  3. package/agent-assets/agent-profiles/profile-importer.md +1 -1
  4. package/agent-assets/agent-profiles/routine.md +4 -3
  5. package/agent-assets/docs/concepts/agent-day.md +6 -1
  6. package/agent-assets/docs/concepts/auth-health.md +10 -1
  7. package/agent-assets/docs/concepts/backends-and-tiers.md +74 -40
  8. package/agent-assets/docs/concepts/costs-and-quotas.md +25 -5
  9. package/agent-assets/docs/concepts/delegated-mode.md +147 -68
  10. package/agent-assets/docs/concepts/memory-model.md +9 -4
  11. package/agent-assets/docs/concepts/observations.md +13 -1
  12. package/agent-assets/docs/concepts/process-keys.md +20 -5
  13. package/agent-assets/docs/concepts/routines.md +38 -20
  14. package/agent-assets/docs/concepts/safety-model.md +30 -13
  15. package/agent-assets/docs/concepts/skills.md +12 -7
  16. package/agent-assets/docs/features/integrations/calendar.md +1 -1
  17. package/agent-assets/docs/features/integrations/git.md +2 -2
  18. package/agent-assets/docs/features/integrations/github.md +9 -2
  19. package/agent-assets/docs/features/integrations/mail.md +1 -1
  20. package/agent-assets/docs/features/integrations/notion.md +34 -6
  21. package/agent-assets/docs/features/integrations/obsidian.md +7 -2
  22. package/agent-assets/docs/features/lifestyle/git.md +4 -7
  23. package/agent-assets/docs/features/lifestyle/receipts.md +17 -2
  24. package/agent-assets/docs/features/lifestyle/travel-bookings.md +15 -0
  25. package/agent-assets/docs/features/lifestyle/travel-time.md +7 -1
  26. package/agent-assets/docs/features/memory-files/agent-journal.md +2 -2
  27. package/agent-assets/docs/features/memory-files/projects.md +6 -0
  28. package/agent-assets/docs/features/memory-files/roadmap.md +5 -0
  29. package/agent-assets/docs/features/memory-files/today.md +1 -0
  30. package/agent-assets/docs/features/memory-files/user-profile.md +6 -0
  31. package/agent-assets/docs/features/messaging/bang-commands.md +20 -10
  32. package/agent-assets/docs/features/messaging/discord.md +12 -1
  33. package/agent-assets/docs/features/messaging/overview.md +10 -7
  34. package/agent-assets/docs/features/messaging/slack.md +13 -1
  35. package/agent-assets/docs/features/messaging/telegram.md +7 -1
  36. package/agent-assets/docs/features/messaging/whatsapp.md +12 -1
  37. package/agent-assets/docs/features/operations/activity-and-conversations.md +2 -2
  38. package/agent-assets/docs/features/operations/approvals.md +6 -0
  39. package/agent-assets/docs/features/operations/backend-routing.md +7 -0
  40. package/agent-assets/docs/features/operations/cost-tracking.md +6 -0
  41. package/agent-assets/docs/features/operations/notifications.md +6 -0
  42. package/agent-assets/docs/features/operations/schedule-approaching.md +22 -9
  43. package/agent-assets/docs/features/routines/custom-routines.md +10 -4
  44. package/agent-assets/docs/features/routines/evening-review.md +1 -1
  45. package/agent-assets/docs/features/routines/hourly-check.md +1 -1
  46. package/agent-assets/docs/features/routines/morning-routine.md +24 -15
  47. package/agent-assets/docs/features/routines/weekly-review.md +38 -12
  48. package/agent-assets/docs/features/wiki/commands.md +11 -0
  49. package/agent-assets/docs/features/wiki/overview.md +13 -3
  50. package/agent-assets/docs/getting-started/01-what-is-this.md +32 -11
  51. package/agent-assets/docs/getting-started/02-first-steps.md +17 -4
  52. package/agent-assets/docs/getting-started/03-what-can-this-do.md +21 -11
  53. package/agent-assets/docs/getting-started/04-first-day.md +14 -0
  54. package/agent-assets/docs/glossary.md +65 -12
  55. package/agent-assets/docs/guides/add-a-custom-routine.md +12 -0
  56. package/agent-assets/docs/guides/backup-and-restore.md +16 -2
  57. package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +6 -0
  58. package/agent-assets/docs/guides/build-your-wiki.md +14 -0
  59. package/agent-assets/docs/guides/change-which-model-handles-x.md +7 -0
  60. package/agent-assets/docs/guides/connect-a-new-mail-account.md +16 -0
  61. package/agent-assets/docs/guides/explore-with-trace-and-connect.md +6 -0
  62. package/agent-assets/docs/guides/import-knowledge-file.md +11 -0
  63. package/agent-assets/docs/guides/install-and-run.md +20 -4
  64. package/agent-assets/docs/guides/maintain-wiki-health.md +6 -0
  65. package/agent-assets/docs/guides/migrate-machines.md +13 -1
  66. package/agent-assets/docs/guides/multiple-wikis-for-multiple-domains.md +9 -0
  67. package/agent-assets/docs/guides/pause-the-agent.md +12 -4
  68. package/agent-assets/docs/guides/reinstall-cleanly.md +19 -4
  69. package/agent-assets/docs/guides/setup-wizard.md +20 -9
  70. package/agent-assets/docs/guides/switch-default-backend.md +10 -1
  71. package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +5 -0
  72. package/agent-assets/docs/reference/api.md +29 -1
  73. package/agent-assets/docs/reference/cli-commands.md +22 -3
  74. package/agent-assets/docs/reference/config.md +37 -5
  75. package/agent-assets/docs/reference/disallowed-tools.md +13 -0
  76. package/agent-assets/docs/reference/keyboard-shortcuts.md +13 -0
  77. package/agent-assets/docs/reference/process-keys.md +70 -20
  78. package/agent-assets/docs/reference/skills.md +27 -9
  79. package/agent-assets/docs/troubleshooting/auth-failed.md +7 -2
  80. package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +13 -1
  81. package/agent-assets/docs/troubleshooting/fallback-keeps-firing.md +10 -0
  82. package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +11 -0
  83. package/agent-assets/docs/troubleshooting/morning-routine-didnt-run.md +9 -4
  84. package/agent-assets/docs/troubleshooting/observation-not-detected.md +12 -0
  85. package/agent-assets/docs/troubleshooting/quota-exhausted.md +7 -1
  86. package/agent-assets/docs/troubleshooting/wiki-ingest-full-blocked.md +5 -0
  87. package/agent-assets/docs/troubleshooting/wiki-write-failed.md +5 -0
  88. package/agent-assets/optimizer-skills/drift-analysis/SKILL.md +1 -1
  89. package/agent-assets/optimizer-skills/skill-curation/SKILL.md +2 -2
  90. package/agent-assets/skills/agent-actions/SKILL.md +122 -0
  91. package/agent-assets/skills/attach/SKILL.md +1 -2
  92. package/agent-assets/skills/context/SKILL.md +36 -454
  93. package/agent-assets/skills/context/references/api.md +220 -0
  94. package/agent-assets/skills/context/references/required-frontmatter.md +73 -0
  95. package/agent-assets/skills/context/references/snapshot-files.md +103 -0
  96. package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +1 -1
  97. package/agent-assets/skills/docs-search/SKILL.md +13 -13
  98. package/agent-assets/skills/external-services/SKILL.delegated.claude.md +5 -7
  99. package/agent-assets/skills/external-services/SKILL.delegated.codex.md +5 -7
  100. package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +5 -7
  101. package/agent-assets/skills/external-services/SKILL.md +6 -259
  102. package/agent-assets/skills/external-services/SKILL.native.claude.md +1 -2
  103. package/agent-assets/skills/external-services/SKILL.native.codex.md +1 -2
  104. package/agent-assets/skills/external-services/SKILL.native.gemini.md +1 -2
  105. package/agent-assets/skills/external-services/references/calendar-apple.md +97 -0
  106. package/agent-assets/skills/external-services/references/calendar-google.md +72 -0
  107. package/agent-assets/skills/external-services/references/calendar-outlook.md +36 -0
  108. package/agent-assets/skills/external-services/references/github.md +17 -0
  109. package/agent-assets/skills/external-services/references/obsidian.md +49 -0
  110. package/agent-assets/skills/external-services/references/skills-crud.md +27 -0
  111. package/agent-assets/skills/gmail-lifestyle/SKILL.md +224 -0
  112. package/agent-assets/skills/gmail-lifestyle/references/receipts-api.md +93 -0
  113. package/agent-assets/skills/gmail-lifestyle/references/travel-bookings-api.md +75 -0
  114. package/agent-assets/skills/gmail-lifestyle/references/travel-time-api.md +59 -0
  115. package/agent-assets/skills/mail/SKILL.delegated.claude.md +1 -1
  116. package/agent-assets/skills/mail/SKILL.delegated.codex.md +1 -1
  117. package/agent-assets/skills/mail/SKILL.delegated.gemini.md +1 -1
  118. package/agent-assets/skills/mail/SKILL.md +9 -114
  119. package/agent-assets/skills/mail/SKILL.native.claude.md +1 -1
  120. package/agent-assets/skills/mail/SKILL.native.codex.md +1 -1
  121. package/agent-assets/skills/mail/SKILL.native.gemini.md +1 -1
  122. package/agent-assets/skills/mail/references/api.md +108 -0
  123. package/agent-assets/skills/mail/references/examples.md +70 -0
  124. package/agent-assets/skills/mail/references/providers.md +8 -8
  125. package/agent-assets/skills/managed-tasks/SKILL.md +472 -0
  126. package/agent-assets/skills/managed-tasks/references/errors.md +70 -0
  127. package/agent-assets/skills/managed-tasks/references/output-path.md +75 -0
  128. package/agent-assets/skills/managed-tasks/references/recurrence-rule.md +86 -0
  129. package/agent-assets/skills/management-policy/SKILL.md +33 -105
  130. package/agent-assets/skills/management-policy/references/policy-workflow.md +101 -0
  131. package/agent-assets/skills/notify/SKILL.md +6 -78
  132. package/agent-assets/skills/notify/references/priority.md +60 -0
  133. package/agent-assets/skills/notion/SKILL.delegated.claude.md +1 -1
  134. package/agent-assets/skills/notion/SKILL.delegated.codex.md +1 -1
  135. package/agent-assets/skills/notion/SKILL.delegated.gemini.md +1 -1
  136. package/agent-assets/skills/notion/SKILL.md +6 -10
  137. package/agent-assets/skills/notion/SKILL.native.claude.md +1 -2
  138. package/agent-assets/skills/notion/SKILL.native.codex.md +1 -2
  139. package/agent-assets/skills/notion/SKILL.native.gemini.md +1 -2
  140. package/agent-assets/skills/observations/SKILL.md +1 -6
  141. package/agent-assets/skills/project-doc/SKILL.md +1 -5
  142. package/agent-assets/skills/reading/SKILL.md +2 -2
  143. package/agent-assets/skills/roadmap/SKILL.md +37 -135
  144. package/agent-assets/skills/roadmap/references/api.md +100 -0
  145. package/agent-assets/skills/roadmap/references/cross-check.md +73 -0
  146. package/agent-assets/skills/roadmap/references/migration.md +56 -0
  147. package/agent-assets/skills/roadmap/references/preparation-timeline.md +2 -2
  148. package/agent-assets/skills/schedule/SKILL.md +52 -88
  149. package/agent-assets/skills/schedule/references/batch.md +93 -0
  150. package/agent-assets/skills/schedule/references/errors.md +214 -0
  151. package/agent-assets/skills/schedule/references/model-selection.md +96 -0
  152. package/agent-assets/skills/schedule/references/recurrence-rule.md +86 -0
  153. package/agent-assets/skills/schedule/references/recurring.md +185 -0
  154. package/agent-assets/skills/scheduled-managed-task/SKILL.md +13 -15
  155. package/agent-assets/skills/today/SKILL.md +27 -57
  156. package/agent-assets/skills/today/references/agent-plan-lifecycle.md +113 -0
  157. package/agent-assets/skills/user-interview/SKILL.md +12 -59
  158. package/agent-assets/skills/user-interview/references/op-briefing.md +51 -0
  159. package/agent-assets/skills/user-interview/references/op-morning.md +59 -0
  160. package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +1 -1
  161. package/agent-assets/skills/user-profile/SKILL.md +43 -63
  162. package/agent-assets/skills/user-profile/references/character-preferences.md +83 -0
  163. package/agent-assets/skills/user-profile/seeds/topic-files.seed.json +28 -0
  164. package/agent-assets/skills/wiki/wiki-ask/SKILL.md +0 -1
  165. package/agent-assets/skills/wiki/wiki-compile/SKILL.md +0 -1
  166. package/agent-assets/skills/wiki/wiki-connect/SKILL.md +0 -1
  167. package/agent-assets/skills/wiki/wiki-graduate/SKILL.md +0 -1
  168. package/agent-assets/skills/wiki/wiki-ingest/SKILL.md +0 -1
  169. package/agent-assets/skills/wiki/wiki-lint/SKILL.md +0 -1
  170. package/agent-assets/skills/wiki/wiki-trace/SKILL.md +0 -1
  171. package/agent-assets/skills/wiki/wiki-vault-rules/SKILL.md +0 -1
  172. package/agent-assets/system-prompts/routine-fetch-window.md +68 -0
  173. package/agent-assets/system-prompts/skill-index-instruction.md +26 -0
  174. package/agent-assets/task-flows/_partials/calendar-acquire.google_calendar.md +18 -11
  175. package/agent-assets/task-flows/_partials/calendar-acquire.outlook_calendar.md +16 -9
  176. package/agent-assets/task-flows/_partials/capture-user-info.md +24 -0
  177. package/agent-assets/task-flows/_partials/confirm-subflow.md +68 -0
  178. package/agent-assets/task-flows/_partials/dm-intent.long-horizon.md +35 -0
  179. package/agent-assets/task-flows/_partials/dm-intent.project.md +391 -0
  180. package/agent-assets/task-flows/_partials/mail-acquire.gmail.md +20 -11
  181. package/agent-assets/task-flows/_partials/mail-acquire.outlook_mail.md +17 -9
  182. package/agent-assets/task-flows/_partials/notion-acquire.notion.md +18 -12
  183. package/agent-assets/task-flows/knowledge.import.md +1 -1
  184. package/agent-assets/task-flows/message.received.dm.md +13 -15
  185. package/agent-assets/task-flows/message.received.dm_first.md +10 -14
  186. package/agent-assets/task-flows/routine.custom.md +3 -1
  187. package/agent-assets/task-flows/routine.evening_review.md +39 -163
  188. package/agent-assets/task-flows/routine.fetch_window.md +17 -12
  189. package/agent-assets/task-flows/routine.hourly_check.md +16 -8
  190. package/agent-assets/task-flows/routine.hourly_check.triage.md +1 -1
  191. package/agent-assets/task-flows/routine.monthly_review.md +46 -4
  192. package/agent-assets/task-flows/routine.morning_routine_journal.md +113 -0
  193. package/agent-assets/task-flows/routine.morning_routine_today.md +673 -0
  194. package/agent-assets/task-flows/routine.roadmap_refresh.md +60 -15
  195. package/agent-assets/task-flows/routine.user_profile_sweep.md +9 -10
  196. package/agent-assets/task-flows/routine.weekly_review.md +285 -70
  197. package/agent-assets/task-flows/scheduled.dm.md +8 -8
  198. package/agent-assets/task-flows/scheduled.task.md +5 -5
  199. package/agent-assets/task-flows/setup.initial.md +165 -245
  200. package/agent-assets/task-flows/wiki.ingest_url.md +1 -1
  201. package/agent-assets/templates/_manifest.json +7 -7
  202. package/agent-assets/templates/dossiers/_index.md +1 -1
  203. package/agent-assets/templates/rules/journal-format.md +145 -38
  204. package/agent-assets/templates/user/expertise.md +4 -2
  205. package/agent-assets/templates/user/goals.md +4 -2
  206. package/agent-assets/templates/user/people.md +8 -2
  207. package/agent-assets/templates/user/personal.md +4 -2
  208. package/agent-assets/templates/user/work.md +4 -2
  209. package/bin/aitne.mjs +8 -1
  210. package/package.json +4 -4
  211. package/scripts/commands/doctor.mjs +52 -0
  212. package/scripts/commands/run-now.mjs +202 -0
  213. package/scripts/commands/verify.mjs +264 -0
  214. package/agent-assets/docs/features/routines/monthly-review.md +0 -65
  215. package/agent-assets/skills/management-task-modify/SKILL.md +0 -203
  216. package/agent-assets/skills/management-task-register/SKILL.md +0 -330
  217. package/agent-assets/skills/management-task-stop/SKILL.md +0 -166
  218. package/agent-assets/skills/receipts/SKILL.md +0 -134
  219. package/agent-assets/skills/travel/SKILL.md +0 -132
  220. package/agent-assets/skills/travel-time/SKILL.md +0 -158
  221. package/agent-assets/task-flows/routine.morning_routine.md +0 -322
  222. package/agent-assets/task-flows/routine.morning_routine_initial.md +0 -204
@@ -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
 
@@ -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
 
@@ -315,7 +268,7 @@ curl -s -X PATCH http://localhost:8321/api/context/agent/profile-questions \
315
268
  # Fallback DM scheduling (Operation 5B only)
316
269
  curl -s -X POST http://localhost:8321/api/schedule \
317
270
  -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"}}'
271
+ -d '{"time":"<ISO>","taskType":"dm_session","description":"profile_interview:<id> — <hint>","tier":"medium","taskContext":{"scheduledBy":"user_profile_sweep_fallback","queueId":"<id>","importance":"low"}}'
319
272
  ```
320
273
 
321
274
  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/agent/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/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.
@@ -31,7 +31,7 @@ B. LATENT FALLBACK PROMOTION.
31
31
  {time: tomorrow @ 14:00 local (or quiet_hours_end + 2h),
32
32
  taskType: "dm_session",
33
33
  description: "profile_interview:<id> — <ask-hint>",
34
- model: "sonnet",
34
+ tier: "medium",
35
35
  taskContext: {scheduledBy: "user_profile_sweep_fallback",
36
36
  queueId: "<id>", importance: "low"}}
37
37
  Update the In Progress entry to
@@ -8,12 +8,7 @@ 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: `user/profile.md` and `user/*.md` are Policy B — see `<output_language_policy>`. Template H2 headers stay English skeleton; the facts under them are in `<settings primary_language>`. Preserve user-customized headers verbatim.
17
12
 
18
13
  `user/profile.md` stores the user's identity, preferences, and learned behavioral patterns. It is injected into every agent session via `<user>` tags — keep it concise (target: under ~600 tokens total).
19
14
 
@@ -42,7 +37,7 @@ Detailed, dictionary-like background belongs under `user/*.md`. Read `user/_inde
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
38
  - "my sister just had a baby" → `user/people.md ## Family`. If the section doesn't exist yet (fresh topic file with only the H1), the PATCH returns `section_not_found` — retry with `mode: "append_to_file"` and include `"\n## Family\n- <bullet>"` in `content`. The next write to that section succeeds normally.
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 (`agent/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:
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 `user/profile.md` or any `user/*.md`.
100
110
 
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
- ```
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.
110
114
 
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.
116
-
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.
118
-
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
 
@@ -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 `user/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
 
@@ -167,42 +163,26 @@ Populate `user/profile.md` (Identity, Work Pattern, Platforms, Expertise summary
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/user/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/user/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
 
@@ -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
+ `user/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 `user/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*.
@@ -22,6 +22,34 @@
22
22
  { "heading": "## Colleagues", "contains": "current and recent coworkers" },
23
23
  { "heading": "## Friends", "contains": "social ties" }
24
24
  ]
25
+ },
26
+ {
27
+ "path": "user/work.md",
28
+ "purpose": "workplace, team, tech stack",
29
+ "sections": [
30
+ { "heading": "## Stack", "contains": "tools, languages, services used at work" }
31
+ ]
32
+ },
33
+ {
34
+ "path": "user/expertise.md",
35
+ "purpose": "domains, tools, skill levels",
36
+ "sections": [
37
+ { "heading": "## Tools", "contains": "tools the user uses habitually" }
38
+ ]
39
+ },
40
+ {
41
+ "path": "user/personal.md",
42
+ "purpose": "hobbies, health, habits",
43
+ "sections": [
44
+ { "heading": "## Habits", "contains": "routines, lifestyle, health" }
45
+ ]
46
+ },
47
+ {
48
+ "path": "user/goals.md",
49
+ "purpose": "developmental goals and learning targets",
50
+ "sections": [
51
+ { "heading": "## Learning", "contains": "skills the user wants to build" }
52
+ ]
25
53
  }
26
54
  ]
27
55
  }
@@ -3,7 +3,6 @@ name: wiki-ask
3
3
  description: Load for wiki.ask. Answers a question from the wiki and records the answer under 30_outputs.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
- - Bash(jq *)
7
6
  ---
8
7
 
9
8
  # Wiki Ask
@@ -3,7 +3,6 @@ name: wiki-compile
3
3
  description: Load for wiki.compile. Synthesizes 10_raw notes into 20_wiki notes via the daemon Wiki API and updates the wiki index.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
- - Bash(jq *)
7
6
  ---
8
7
 
9
8
  # Wiki Compile
@@ -3,7 +3,6 @@ name: wiki-connect
3
3
  description: Load for wiki.connect. Bridges two domains by surfacing shared terms, references, and structural analogies; writes a cited connection report to 30_outputs/.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
- - Bash(jq *)
7
6
  ---
8
7
 
9
8
  # Wiki Connect
@@ -3,7 +3,6 @@ name: wiki-graduate
3
3
  description: Load alongside wiki-compile. Promotes ready inbox material into a real wiki note with the canonical schema; never invents content beyond the source.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
- - Bash(jq *)
7
6
  ---
8
7
 
9
8
  # Wiki Graduate
@@ -4,7 +4,6 @@ description: Load for wiki.ingest_url. Captures one URL into 10_raw/<slug>.md by
4
4
  allowed-tools:
5
5
  - WebFetch
6
6
  - Bash(curl *)
7
- - Bash(jq *)
8
7
  ---
9
8
 
10
9
  # Wiki URL Ingestion
@@ -3,7 +3,6 @@ name: wiki-lint
3
3
  description: Load for wiki.lint. Audits the wiki for orphans, broken links, schema drift, taxonomy candidates, and stale notes; writes a dated health report.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
- - Bash(jq *)
7
6
  ---
8
7
 
9
8
  # Wiki Lint
@@ -3,7 +3,6 @@ name: wiki-trace
3
3
  description: Load for wiki.trace. Reconstructs the chronological evolution of an idea across raw, wiki, and outputs; writes a cited timeline to 30_outputs/.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
- - Bash(jq *)
7
6
  ---
8
7
 
9
8
  # Wiki Trace
@@ -3,7 +3,6 @@ name: wiki-vault-rules
3
3
  description: Load for every wiki.* process. Defines wiki vault layout, layer ownership, and the daemon Wiki API call convention (endpoints + canonical curl shape).
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
- - Bash(jq *)
7
6
  - Read
8
7
  ---
9
8
 
@@ -0,0 +1,68 @@
1
+ You are Claude Code, Anthropic's official CLI for Claude. This session is the
2
+ **routine.fetch_window pre-pass** dispatched by the Aitne daemon: a short,
3
+ mechanical fetch session whose only job is to materialise the rows in the
4
+ `<acquisition-plan>` block of your prompt into fresh `/api/observations`
5
+ rows. The parent routine session is spawned immediately after you terminate.
6
+
7
+ ## Operating principles
8
+
9
+ - **Fetch, don't think.** The daemon already resolved the
10
+ `(integration, mode, window, account?)` routing. Trust it. Do not probe
11
+ MCP registries, do not list "common tool names", do not guess. The
12
+ inlined integration partial in your user prompt states the call shape;
13
+ your bound tools resolve it. If no surface is bound for a row, record a
14
+ `no-surface` error and move on.
15
+ - **One window → one curl → one JSON body.** Each acquired window is sent
16
+ as a single `POST /api/observations/batch` call (up to 200 items in
17
+ `observations[]`). Do NOT loop over items in a shell `for`. Do NOT write
18
+ a script under `/tmp/` and pipe / source / bash it. Do NOT chain
19
+ multiple `curl` calls in one Bash invocation. The daemon's hooks block
20
+ those shapes.
21
+ - **No interpretation.** Do not summarize, rank, filter, or annotate
22
+ payloads. The async summarizer worker drains `/api/observations` after
23
+ you return.
24
+ - **Emit exactly one JSON line on stdout, then terminate.** The shape is
25
+ `{"fetched":<int>,"posted":<int>,"duplicates":<int>,"errors":[<{type,...}>]}`.
26
+ No prose, no markdown fences. The dispatcher reads the last
27
+ JSON-shaped object on stdout — a malformed line surfaces as
28
+ `pre-pass-failed`.
29
+
30
+ ## Tool conventions
31
+
32
+ - **Bash**: only `curl` against `http://localhost:<apiPort>/*` to call the
33
+ daemon's REST API. The localhost-only check, secret-flag scrubber, and
34
+ pipe-chain block are enforced as PreToolUse hooks at runtime — the
35
+ policy layer is authoritative, not this prompt. One curl per Bash
36
+ call; heredoc bodies are fine. **Do not** read or write context MD
37
+ files via `/api/context/*`, do not call `/api/notify`.
38
+ - **MCP tools (`mcp__<server>__<tool>`)**: when the integration partial
39
+ routes through `native` or `delegated-same`, the tool surface is
40
+ whatever your session has bound. Their schemas may be deferred behind
41
+ `ToolSearch` — fetch the schema before calling.
42
+ - **ToolSearch**: load deferred MCP schemas by name or keyword. Use it
43
+ before calling an MCP tool whose schema is not yet visible.
44
+ - **No other tools are needed.** Do not invoke Skill, Read, Write, Edit,
45
+ Glob, Grep, NotebookEdit, WebFetch, WebSearch, Task, EnterPlanMode,
46
+ ScheduleWakeup, or sub-agents. Even if a tool is not explicitly
47
+ forbidden, the boundary above is enforced by the SDK allowlist.
48
+
49
+ ## Boundaries
50
+
51
+ - Do NOT spawn sub-tasks or sub-agents — keep the run flat so the
52
+ dispatcher can clamp turn / budget cleanly.
53
+ - Do NOT exceed `max_turns` / `max_budget_usd`. If you hit the cap,
54
+ record `{"type":"budget-exhausted","remaining":[…]}` in `errors` and
55
+ print the JSON line.
56
+ - `actor` on every observations element MUST be `"agent"`. Do NOT
57
+ compute `contentHash` — the server derives it.
58
+ - The pre-pass is invisible to the owner by contract. No notifications,
59
+ no DMs, no file writes outside the observations API.
60
+
61
+ ## Output
62
+
63
+ When every `<fetch>` row has been processed (success, duplicate, or
64
+ recorded error), emit exactly one JSON line on stdout in the shape
65
+ above and terminate. The user prompt below carries the full
66
+ `<acquisition-plan>` and the integration partial that names the
67
+ endpoint / argument shapes. Follow that partial verbatim — do not
68
+ transfer argument names across integration boundaries.