holistic 0.2.3 → 0.3.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.
package/dist/core/docs.js CHANGED
@@ -1,6 +1,13 @@
1
1
  import fs from "node:fs";
2
+ import path from "node:path";
2
3
  import { renderCliFallbackNote } from './cli-fallback.js';
3
4
  import { readArchivedSessions } from './state.js';
5
+ function renderSessionCloseBlock(hasMcp) {
6
+ if (hasMcp) {
7
+ return `## Before ending this session\n\nCall \`holistic_handoff\` with a summary of what you did and what should happen next. This keeps repo memory current for the next agent.\n`;
8
+ }
9
+ return `## Before ending this session\n\nRun:\n\`\`\`\nholistic handoff --summary "..." --next "..."\n\`\`\`\nThis keeps repo memory current for the next agent.\n`;
10
+ }
4
11
  function renderList(items, emptyText) {
5
12
  if (items.length === 0) {
6
13
  return `- ${emptyText}`;
@@ -124,12 +131,12 @@ function renderKnownFixes(fixes) {
124
131
  }
125
132
  return entry;
126
133
  }).join("\n");
127
- return `## Known Fixes Do Not Regress
128
-
129
- ⚠️ If you are about to edit a file listed here, STOP and read the fix entry first.
130
-
131
- ${items}
132
-
134
+ return `## Known Fixes - Do Not Regress
135
+
136
+ ⚠️ If you are about to edit a file listed here, STOP and read the fix entry first.
137
+
138
+ ${items}
139
+
133
140
  `;
134
141
  }
135
142
  function renderHolisticMd(state) {
@@ -141,101 +148,101 @@ function renderHolisticMd(state) {
141
148
  .join("\n");
142
149
  const { fixes, other: otherRegressions } = parseKnownFixes(snapshot.regressions);
143
150
  const knownFixesBlock = renderKnownFixes(fixes);
144
- return `# HOLISTIC
145
-
146
- <!-- ═══════════════════════════════════════════════════════════════════════
147
- AGENT INSTRUCTIONS READ THIS ENTIRE FILE BEFORE DOING ANYTHING ELSE
148
- ═══════════════════════════════════════════════════════════════════════
149
-
150
- 1. Read this file top-to-bottom.
151
+ return `# HOLISTIC
152
+
153
+ <!-- ═══════════════════════════════════════════════════════════════════════
154
+ AGENT INSTRUCTIONS - READ THIS ENTIRE FILE BEFORE DOING ANYTHING ELSE
155
+ ═══════════════════════════════════════════════════════════════════════
156
+
157
+ 1. Read this file top-to-bottom.
151
158
  2. Read AGENTS.md for the setup steps specific to your agent.
152
159
  3. Summarise to the user: what was last worked on, what's planned next.
153
- 4. Ask: "What would you like to work on continue recent work, or start something new?"
160
+ 4. Ask: "What would you like to work on - continue recent work, or start something new?"
154
161
  5. Open the session with the repo-local Holistic helper for this repo.
155
-
156
- ⚠️ If you are about to edit a file listed under KNOWN FIXES, STOP and
157
- read that fix entry carefully before proceeding.
158
- ════════════════════════════════════════════════════════════════════════ -->
159
-
162
+
163
+ ⚠️ If you are about to edit a file listed under KNOWN FIXES, STOP and
164
+ read that fix entry carefully before proceeding.
165
+ ════════════════════════════════════════════════════════════════════════ -->
166
+
160
167
  ## Start Here
161
168
 
162
169
  This repo uses Holistic for cross-agent handoffs. The source of truth is the repo itself: handoff docs, history, and regression memory should be committed and synced so any device can continue. Read this file first, then review the long-term history docs and zero-touch architecture note, then use the adapter doc for your app. The Holistic daemon is optional and only improves passive capture on devices where it is installed.
163
170
 
164
171
  ${resumeFallbackNote}
165
-
166
- ## Product North Star
167
-
168
- Open repo, start working, Holistic quietly keeps continuity alive.
169
-
170
- That is the intended end state for this project. Prefer changes that reduce ceremony, keep continuity durable, and make Holistic fade further into the background of normal work.
171
-
172
- ${knownFixesBlock}## Current Objective
173
-
174
- **${snapshot.title}**
175
-
176
- ${snapshot.goal}
177
-
178
- ## Latest Work Status
179
-
180
- ${snapshot.status}
181
-
182
- ## What Was Tried
183
-
184
- ${renderList(snapshot.tried, "Nothing recorded yet.")}
185
-
186
- ## What To Try Next
187
-
188
- ${renderList(snapshot.next, "Ask the user what they'd like to work on.")}
189
-
190
- ## Active Plan
191
-
192
- ${renderList(snapshot.plan, "None yet will be set once work begins.")}
193
-
194
- ## Overall Impact So Far
195
-
196
- ${renderList(snapshot.impacts, "Nothing recorded yet.")}
197
-
198
- ## Regression Watch
199
-
200
- ${renderList(otherRegressions, "Review the regression watch document before changing related behavior.")}
201
-
202
- ## Key Assumptions
203
-
204
- ${renderList(snapshot.assumptions, "None recorded.")}
205
-
206
- ## Blockers
207
-
208
- ${renderList(snapshot.blockers, "None.")}
209
-
210
- ## Changed Files In Current Session
211
-
212
- ${renderList(snapshot.changedFiles, "No repo changes detected for the active session.")}
213
-
214
- ## Pending Work Queue
215
-
216
- ${pendingPreview.length === 0 ? "- None." : pendingPreview.map((item) => `- ${item.title}: ${item.recommendedNextStep}`).join("\n")}
217
-
218
- ## Long-Term Memory
219
-
220
- - Project history: [${state.docIndex.historyDoc}](${state.docIndex.historyDoc})
221
- - Regression watch: [${state.docIndex.regressionDoc}](${state.docIndex.regressionDoc})
222
- - Zero-touch architecture: [${state.docIndex.zeroTouchDoc}](${state.docIndex.zeroTouchDoc})
223
- - Portable sync model: handoffs are intended to be committed and synced so any device with repo access can continue.
224
-
225
- ## Supporting Documents
226
-
227
- - State file: [${state.docIndex.stateFile}](${state.docIndex.stateFile})
228
- - Current plan: [${state.docIndex.currentPlanDoc}](${state.docIndex.currentPlanDoc})
229
- - Session protocol: [${state.docIndex.protocolDoc}](${state.docIndex.protocolDoc})
230
- - Session archive: [${state.docIndex.sessionsDir}](${state.docIndex.sessionsDir})
231
- - Adapter docs:
232
- ${adapterLinks}
233
-
234
- ## Historical Memory
235
-
236
- - Last updated: ${state.updatedAt}
237
- - Last handoff: ${state.lastHandoff ? `${state.lastHandoff.summary}` : "None yet."}
238
- - Pending sessions remembered: ${state.pendingWork.length}
172
+
173
+ ## Product North Star
174
+
175
+ Open repo, start working, Holistic quietly keeps continuity alive.
176
+
177
+ That is the intended end state for this project. Prefer changes that reduce ceremony, keep continuity durable, and make Holistic fade further into the background of normal work.
178
+
179
+ ${knownFixesBlock}## Current Objective
180
+
181
+ **${snapshot.title}**
182
+
183
+ ${snapshot.goal}
184
+
185
+ ## Latest Work Status
186
+
187
+ ${snapshot.status}
188
+
189
+ ## What Was Tried
190
+
191
+ ${renderList(snapshot.tried, "Nothing recorded yet.")}
192
+
193
+ ## What To Try Next
194
+
195
+ ${renderList(snapshot.next, "Ask the user what they'd like to work on.")}
196
+
197
+ ## Active Plan
198
+
199
+ ${renderList(snapshot.plan, "None yet - will be set once work begins.")}
200
+
201
+ ## Overall Impact So Far
202
+
203
+ ${renderList(snapshot.impacts, "Nothing recorded yet.")}
204
+
205
+ ## Regression Watch
206
+
207
+ ${renderList(otherRegressions, "Review the regression watch document before changing related behavior.")}
208
+
209
+ ## Key Assumptions
210
+
211
+ ${renderList(snapshot.assumptions, "None recorded.")}
212
+
213
+ ## Blockers
214
+
215
+ ${renderList(snapshot.blockers, "None.")}
216
+
217
+ ## Changed Files In Current Session
218
+
219
+ ${renderList(snapshot.changedFiles, "No repo changes detected for the active session.")}
220
+
221
+ ## Pending Work Queue
222
+
223
+ ${pendingPreview.length === 0 ? "- None." : pendingPreview.map((item) => `- ${item.title}: ${item.recommendedNextStep}`).join("\n")}
224
+
225
+ ## Long-Term Memory
226
+
227
+ - Project history: [${state.docIndex.historyDoc}](${state.docIndex.historyDoc})
228
+ - Regression watch: [${state.docIndex.regressionDoc}](${state.docIndex.regressionDoc})
229
+ - Zero-touch architecture: [${state.docIndex.zeroTouchDoc}](${state.docIndex.zeroTouchDoc})
230
+ - Portable sync model: handoffs are intended to be committed and synced so any device with repo access can continue.
231
+
232
+ ## Supporting Documents
233
+
234
+ - State file: [${state.docIndex.stateFile}](${state.docIndex.stateFile})
235
+ - Current plan: [${state.docIndex.currentPlanDoc}](${state.docIndex.currentPlanDoc})
236
+ - Session protocol: [${state.docIndex.protocolDoc}](${state.docIndex.protocolDoc})
237
+ - Session archive: [${state.docIndex.sessionsDir}](${state.docIndex.sessionsDir})
238
+ - Adapter docs:
239
+ ${adapterLinks}
240
+
241
+ ## Historical Memory
242
+
243
+ - Last updated: ${state.updatedAt}
244
+ - Last handoff: ${state.lastHandoff ? `${state.lastHandoff.summary}` : "None yet."}
245
+ - Pending sessions remembered: ${state.pendingWork.length}
239
246
  `;
240
247
  }
241
248
  function renderAgentsMd(state) {
@@ -246,43 +253,43 @@ function renderAgentsMd(state) {
246
253
  const startNewNote = renderCliFallbackNote(state.docIndex.contextDir, "start-new --goal \"<goal>\"");
247
254
  const watchNote = renderCliFallbackNote(state.docIndex.contextDir, "watch");
248
255
  return `# AGENTS
249
-
250
- <!-- ═══════════════════════════════════════════════════════════════════
251
- AGENT AUTO-START INSTRUCTIONS
252
- ═══════════════════════════════════════════════════════════════════
253
-
254
- YOU ARE READING THIS FILE AUTOMATICALLY AT SESSION START. GOOD.
255
- Now do the following BEFORE responding to the user or doing any work:
256
-
257
- 1. Read HOLISTIC.md in full.
256
+
257
+ <!-- ═══════════════════════════════════════════════════════════════════
258
+ AGENT AUTO-START INSTRUCTIONS
259
+ ═══════════════════════════════════════════════════════════════════
260
+
261
+ YOU ARE READING THIS FILE AUTOMATICALLY AT SESSION START. GOOD.
262
+ Now do the following BEFORE responding to the user or doing any work:
263
+
264
+ 1. Read HOLISTIC.md in full.
258
265
  2. Summarise to the user: what was last worked on, what's planned next,
259
266
  and flag any KNOWN FIXES they should be aware of.
260
- 3. Ask: "What would you like to work on continue recent work, or start something new?"
267
+ 3. Ask: "What would you like to work on - continue recent work, or start something new?"
261
268
  4. Open the session with the repo-local Holistic helper for this repo.
262
-
263
- DO NOT skip step 1. HOLISTIC.md is the source of truth.
264
- ══════════════════════════════════════════════════════════════════ -->
265
-
266
- ## Holistic Protocol
267
-
268
- ### Product North Star
269
-
270
- Open repo, start working, Holistic quietly keeps continuity alive.
271
-
272
- Agents should treat that as the ultimate UX target. Prefer decisions that reduce manual ceremony while making checkpoint, resume, handoff, and regression-awareness more automatic and more reliable.
273
-
274
- Every agent working in this repo should:
275
-
276
- 1. Read [HOLISTIC.md](./HOLISTIC.md) first.
277
- 2. Review [Project History](./.holistic/context/project-history.md), [Regression Watch](./.holistic/context/regression-watch.md), and [Zero-Touch Architecture](./.holistic/context/zero-touch.md) before changing behavior that may already have been fixed.
278
- 3. Read the app-specific adapter in \`${state.docIndex.contextDir}/adapters/\`.
269
+
270
+ DO NOT skip step 1. HOLISTIC.md is the source of truth.
271
+ ══════════════════════════════════════════════════════════════════ -->
272
+
273
+ ## Holistic Protocol
274
+
275
+ ### Product North Star
276
+
277
+ Open repo, start working, Holistic quietly keeps continuity alive.
278
+
279
+ Agents should treat that as the ultimate UX target. Prefer decisions that reduce manual ceremony while making checkpoint, resume, handoff, and regression-awareness more automatic and more reliable.
280
+
281
+ Every agent working in this repo should:
282
+
283
+ 1. Read [HOLISTIC.md](./HOLISTIC.md) first.
284
+ 2. Review [Project History](./.holistic/context/project-history.md), [Regression Watch](./.holistic/context/regression-watch.md), and [Zero-Touch Architecture](./.holistic/context/zero-touch.md) before changing behavior that may already have been fixed.
285
+ 3. Read the app-specific adapter in \`${state.docIndex.contextDir}/adapters/\`.
279
286
  4. If the Holistic daemon is installed, assume passive capture is already running in the background.
280
287
  5. Use the repo-local Holistic helper for explicit recap or recovery flows in this repo.
281
288
  6. Recap the current state for the user and ask whether to continue, tweak the plan, or start something new.
282
289
  7. Record a checkpoint when focus changes, before likely context compaction, and before handoff.
283
290
 
284
291
  ${resumeFallbackNote}
285
-
292
+
286
293
  ## Handoff Commands
287
294
 
288
295
  - ${checkpointFallbackNote.slice(3)}
@@ -292,58 +299,61 @@ ${resumeFallbackNote}
292
299
  - ${handoffFallbackNote.slice(3)}
293
300
  - ${startNewNote.slice(3)}
294
301
  - ${watchNote.slice(3)}
295
-
296
- ## Adding a New Agent Adapter
297
-
298
- To add instructions for a new agent, create a file at:
299
-
300
- \`${state.docIndex.contextDir}/adapters/<agent-name>.md\`
301
-
302
- Copy any existing adapter as a template and customise the agent name and startup steps.
303
- Do not edit Holistic source files to register agents — adapters are data, not code.
302
+
303
+ ## Before Ending a Session
304
+
305
+ ${renderSessionCloseBlock(false)}
306
+ ## Adding a New Agent Adapter
307
+
308
+ To add instructions for a new agent, create a file at:
309
+
310
+ \`${state.docIndex.contextDir}/adapters/<agent-name>.md\`
311
+
312
+ Copy any existing adapter as a template and customise the agent name and startup steps.
313
+ Do not edit Holistic source files to register agents - adapters are data, not code.
304
314
  `;
305
315
  }
306
316
  function renderContextReadme(state) {
307
- return `# Holistic Context
308
-
309
- This folder holds repo-visible memory that any agent can reuse.
310
-
311
- - [Current Plan](./current-plan.md)
312
- - [Session Protocol](./session-protocol.md)
313
- - [Project History](./project-history.md)
314
- - [Regression Watch](./regression-watch.md)
315
- - [Zero-Touch Architecture](./zero-touch.md)
316
- - [Codex Adapter](./adapters/codex.md)
317
- - [Claude/Cowork Adapter](./adapters/claude-cowork.md)
318
- - [Antigravity Adapter](./adapters/antigravity.md)
319
-
320
- Project: ${state.projectName}
321
- Updated: ${state.updatedAt}
317
+ return `# Holistic Context
318
+
319
+ This folder holds repo-visible memory that any agent can reuse.
320
+
321
+ - [Current Plan](./current-plan.md)
322
+ - [Session Protocol](./session-protocol.md)
323
+ - [Project History](./project-history.md)
324
+ - [Regression Watch](./regression-watch.md)
325
+ - [Zero-Touch Architecture](./zero-touch.md)
326
+ - [Codex Adapter](./adapters/codex.md)
327
+ - [Claude/Cowork Adapter](./adapters/claude-cowork.md)
328
+ - [Antigravity Adapter](./adapters/antigravity.md)
329
+
330
+ Project: ${state.projectName}
331
+ Updated: ${state.updatedAt}
322
332
  `;
323
333
  }
324
334
  function renderCurrentPlan(state) {
325
335
  const snapshot = currentSnapshot(state);
326
- return `# Current Plan
327
-
328
- ## Goal
329
-
330
- ${snapshot.goal}
331
-
332
- ## Latest Status
333
-
334
- ${snapshot.status}
335
-
336
- ## Planned Next Steps
337
-
338
- ${renderList(snapshot.plan.length > 0 ? snapshot.plan : snapshot.next, "No plan captured yet.")}
339
-
340
- ## Project Impact
341
-
342
- ${renderList(snapshot.impacts, "No impact notes captured yet.")}
343
-
344
- ## References
345
-
346
- ${renderList(snapshot.refs, "No linked references yet.")}
336
+ return `# Current Plan
337
+
338
+ ## Goal
339
+
340
+ ${snapshot.goal}
341
+
342
+ ## Latest Status
343
+
344
+ ${snapshot.status}
345
+
346
+ ## Planned Next Steps
347
+
348
+ ${renderList(snapshot.plan.length > 0 ? snapshot.plan : snapshot.next, "No plan captured yet.")}
349
+
350
+ ## Project Impact
351
+
352
+ ${renderList(snapshot.impacts, "No impact notes captured yet.")}
353
+
354
+ ## References
355
+
356
+ ${renderList(snapshot.refs, "No linked references yet.")}
347
357
  `;
348
358
  }
349
359
  function renderProtocol(state) {
@@ -351,16 +361,16 @@ function renderProtocol(state) {
351
361
  const checkpointFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "checkpoint --reason \"<what changed>\"");
352
362
  const handoffFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "handoff");
353
363
  return `# Session Protocol
354
-
355
- ## Product North Star
356
-
357
- Open repo, start working, Holistic quietly keeps continuity alive.
358
-
359
- The protocol below is the current operating model, not the final ideal. When improving Holistic, prefer changes that make more of this protocol happen automatically without weakening durable continuity.
360
-
361
- ## Startup
362
-
363
- 1. Read \`HOLISTIC.md\`.
364
+
365
+ ## Product North Star
366
+
367
+ Open repo, start working, Holistic quietly keeps continuity alive.
368
+
369
+ The protocol below is the current operating model, not the final ideal. When improving Holistic, prefer changes that make more of this protocol happen automatically without weakening durable continuity.
370
+
371
+ ## Startup
372
+
373
+ 1. Read \`HOLISTIC.md\`.
364
374
  2. Review \`project-history.md\`, \`regression-watch.md\`, and \`zero-touch.md\` for durable project memory and automation expectations.
365
375
  3. If the Holistic daemon is installed, let it capture repo activity in the background.
366
376
  4. Use the repo-local Holistic helper for explicit recap or recovery flows in this repo.
@@ -368,22 +378,22 @@ The protocol below is the current operating model, not the final ideal. When imp
368
378
  6. Ask whether to continue as planned, tweak the plan, or start something new.
369
379
 
370
380
  ${resumeFallbackNote}
371
-
372
- ## During The Session
373
-
381
+
382
+ ## During The Session
383
+
374
384
  Use the repo-local Holistic helper for checkpoints in this repo:
375
-
376
- - when the task focus changes
377
- - before likely context compaction
378
- - after meaningful progress
379
- - when you fix something another agent might accidentally re-break later
380
-
385
+
386
+ - when the task focus changes
387
+ - before likely context compaction
388
+ - after meaningful progress
389
+ - when you fix something another agent might accidentally re-break later
390
+
381
391
  Use the repo-local Holistic helper with \`watch\` if you want foreground background checkpoints while working manually.
382
392
 
383
393
  ${checkpointFallbackNote}
384
-
385
- ## Handoff
386
-
394
+
395
+ ## Handoff
396
+
387
397
  1. Use the repo-local Holistic helper to run \`handoff\`.
388
398
  2. Confirm or edit the drafted summary.
389
399
  3. Make sure the next step, impact, and regression risks are accurate.
@@ -392,21 +402,21 @@ ${checkpointFallbackNote}
392
402
  ${handoffFallbackNote}
393
403
  `;
394
404
  }
395
- function renderAdapter(state, appName, commandName) {
405
+ function renderAdapter(state, appName, commandName, hasMcp) {
396
406
  const resumeFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, `resume --agent ${commandName}`);
397
407
  const checkpointFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "checkpoint --reason \"<what changed>\"");
398
408
  const handoffFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "handoff");
399
409
  return `# ${appName} Adapter
400
-
401
- ## Product North Star
402
-
403
- Open repo, start working, Holistic quietly keeps continuity alive.
404
-
405
- Use this adapter to move toward that outcome: less manual setup, less re-briefing, and more continuity preserved by default.
406
-
407
- ## Startup Contract
408
-
409
- 1. Read \`HOLISTIC.md\`.
410
+
411
+ ## Product North Star
412
+
413
+ Open repo, start working, Holistic quietly keeps continuity alive.
414
+
415
+ Use this adapter to move toward that outcome: less manual setup, less re-briefing, and more continuity preserved by default.
416
+
417
+ ## Startup Contract
418
+
419
+ 1. Read \`HOLISTIC.md\`.
410
420
  2. Review \`project-history.md\`, \`regression-watch.md\`, and \`zero-touch.md\` for durable memory before editing related code.
411
421
  3. If the Holistic daemon is installed, treat passive session capture as already active.
412
422
  4. Use the repo-local Holistic helper when you need an explicit recap or recovery flow.
@@ -414,27 +424,28 @@ Use this adapter to move toward that outcome: less manual setup, less re-briefin
414
424
  6. Ask: continue as planned, tweak the plan, or start something new.
415
425
 
416
426
  ${resumeFallbackNote}
417
-
418
- ## Checkpoint Contract
419
-
427
+
428
+ ## Checkpoint Contract
429
+
420
430
  Use the repo-local Holistic helper for checkpoints in this repo when:
421
-
422
- - the task focus changes
423
- - you are about to compact or clear context
424
- - you finish a meaningful chunk of work
425
- - you fix or alter behavior that could regress later
426
-
431
+
432
+ - the task focus changes
433
+ - you are about to compact or clear context
434
+ - you finish a meaningful chunk of work
435
+ - you fix or alter behavior that could regress later
436
+
427
437
  Include impact notes and regression risks when they matter.
428
438
 
429
439
  ${checkpointFallbackNote}
430
-
431
- ## Handoff Contract
432
-
440
+
441
+ ## Handoff Contract
442
+
433
443
  - Preferred: map your session-end workflow to the repo-local Holistic helper with \`handoff\`
434
444
  - Fallback: ask the user to run the repo-local Holistic helper with \`handoff\` before leaving the session
435
445
 
436
446
  ${handoffFallbackNote}
437
- `;
447
+
448
+ ${renderSessionCloseBlock(hasMcp)}`;
438
449
  }
439
450
  function renderProjectHistory(paths, state) {
440
451
  const sessions = state.activeSession ? [state.activeSession, ...readArchivedSessions(paths)] : readArchivedSessions(paths);
@@ -507,78 +518,120 @@ function renderRegressionWatch(paths, state) {
507
518
  return `# Regression Watch\n\nUse this before changing existing behavior. It is the short list of fixes and outcomes that future agents should preserve.\n\n${body}\n`;
508
519
  }
509
520
  function renderZeroTouchDoc(state) {
510
- return `# Zero-Touch Architecture
511
-
512
- Holistic cannot force every app or agent to execute startup logic just because a repo exists. Zero-touch behavior therefore has two layers.
513
-
514
- ## Product North Star
515
-
516
- Open repo, start working, Holistic quietly keeps continuity alive.
517
-
518
- Zero-touch architecture exists to close the gap between the current protocol and that goal.
519
-
520
- ## Repo Layer
521
-
522
- - \`HOLISTIC.md\`, \`AGENTS.md\`, project history, and regression watch stay inside the repo so any agent that reads repo instructions can recover context.
523
- - This layer travels with git and works cross-agent as long as the tool respects repo-visible instructions.
524
- - The portable expectation is that handoff docs get committed and synced so another device can continue later.
525
-
526
- ## Machine Layer
527
-
528
- - A background Holistic daemon can watch the repo and create passive checkpoints without you manually starting a session.
529
- - Generated restore scripts can pull the dedicated Holistic portable state ref into the working tree when it is safe to do so.
530
- - This is the only realistic way to get close to seamless cross-tool capture when apps do not expose a startup hook.
531
- - It requires a one-time machine install or service registration outside the repo.
532
-
533
- ## Hard Limit
534
-
535
- - If a tool ignores repo instructions and there is no daemon or app integration, the repo alone cannot make that tool participate.
536
- - Holistic can preserve memory and offer recovery, but it cannot force arbitrary apps to cooperate from inside git-tracked files.
537
-
538
- ## Current Recommendation
539
-
540
- - Keep using repo-visible memory as the portable source of truth.
541
- - Treat the dedicated Holistic portable state ref as the clean cross-device distribution channel for that memory.
542
- - Add the Holistic daemon as the passive capture layer on devices where you want unattended local capture.
543
- - Add app-specific integrations when a tool exposes startup hooks or slash-command automation.
544
- - Holistic should recognize workflow systems, not become one.
545
- - Prefer lightweight workflow context references over baking phases, slices, or other planning structures into the core product.
546
- - Prefer workflow-disappearance improvements over adding more visible user ceremony.
547
-
548
- Project: ${state.projectName}
549
- Updated: ${state.updatedAt}
521
+ return `# Zero-Touch Architecture
522
+
523
+ Holistic cannot force every app or agent to execute startup logic just because a repo exists. Zero-touch behavior therefore has two layers.
524
+
525
+ ## Product North Star
526
+
527
+ Open repo, start working, Holistic quietly keeps continuity alive.
528
+
529
+ Zero-touch architecture exists to close the gap between the current protocol and that goal.
530
+
531
+ ## Repo Layer
532
+
533
+ - \`HOLISTIC.md\`, \`AGENTS.md\`, project history, and regression watch stay inside the repo so any agent that reads repo instructions can recover context.
534
+ - This layer travels with git and works cross-agent as long as the tool respects repo-visible instructions.
535
+ - The portable expectation is that handoff docs get committed and synced so another device can continue later.
536
+
537
+ ## Machine Layer
538
+
539
+ - A background Holistic daemon can watch the repo and create passive checkpoints without you manually starting a session.
540
+ - Generated restore scripts can pull the dedicated Holistic portable state ref into the working tree when it is safe to do so.
541
+ - This is the only realistic way to get close to seamless cross-tool capture when apps do not expose a startup hook.
542
+ - It requires a one-time machine install or service registration outside the repo.
543
+
544
+ ## Hard Limit
545
+
546
+ - If a tool ignores repo instructions and there is no daemon or app integration, the repo alone cannot make that tool participate.
547
+ - Holistic can preserve memory and offer recovery, but it cannot force arbitrary apps to cooperate from inside git-tracked files.
548
+
549
+ ## Current Recommendation
550
+
551
+ - Keep using repo-visible memory as the portable source of truth.
552
+ - Treat the dedicated Holistic portable state ref as the clean cross-device distribution channel for that memory.
553
+ - Add the Holistic daemon as the passive capture layer on devices where you want unattended local capture.
554
+ - Add app-specific integrations when a tool exposes startup hooks or slash-command automation.
555
+ - Holistic should recognize workflow systems, not become one.
556
+ - Prefer lightweight workflow context references over baking phases, slices, or other planning structures into the core product.
557
+ - Prefer workflow-disappearance improvements over adding more visible user ceremony.
558
+
559
+ Project: ${state.projectName}
560
+ Updated: ${state.updatedAt}
550
561
  `;
551
562
  }
552
- function renderRootAgentDoc(agentName, commandName) {
553
- return `## Holistic — cross-agent session tracking
563
+ function renderIdeCursorRulesContent(state) {
564
+ const snapshot = currentSnapshot(state);
565
+ const { fixes, other: otherRegressions } = parseKnownFixes(snapshot.regressions);
566
+ const resumeCmd = renderCliFallbackNote(state.docIndex.contextDir, "resume --agent cursor");
567
+ const handoffCmd = renderCliFallbackNote(state.docIndex.contextDir, "handoff");
568
+ const fixLines = fixes.length > 0
569
+ ? `## Do Not Regress - Known Fixes\n\n${fixes.map((f) => `- ${f}`).join("\n")}\n`
570
+ : "";
571
+ const regressionLines = otherRegressions.length > 0
572
+ ? `## Regression Watch\n\n${otherRegressions.map((r) => `- ${r}`).join("\n")}\n`
573
+ : "";
574
+ return `# Holistic - ${state.projectName}
575
+
576
+ ## Session Start
577
+
578
+ At the start of every session, before doing anything else:
579
+ 1. Read \`HOLISTIC.md\` in full.
580
+ 2. Read \`AGENTS.md\`.
581
+ 3. Summarise to the user: what was last worked on, what's planned next, and any known fixes to protect.
582
+ 4. Ask: "Continue as planned, tweak the plan, or do something different?"
583
+ 5. ${resumeCmd}
584
+
585
+ ## Current Objective
586
+
587
+ ${snapshot.goal}
588
+
589
+ ## Latest Status
590
+
591
+ ${snapshot.status}
592
+
593
+ ${fixLines}${regressionLines}${renderSessionCloseBlock(false)}`;
594
+ }
595
+ function renderCursorRules(state) {
596
+ return renderIdeCursorRulesContent(state);
597
+ }
598
+ function renderWindsurfRules(state) {
599
+ return renderIdeCursorRulesContent(state);
600
+ }
601
+ function renderCopilotInstructions(state) {
602
+ return renderIdeCursorRulesContent(state);
603
+ }
604
+ function renderRootAgentDoc(agentName, commandName, hasMcp) {
605
+ return `## Holistic - cross-agent session tracking
554
606
 
555
607
  **At the start of every session, before doing anything else:**
556
608
  1. Read \`HOLISTIC.md\` in full.
557
- 2. Read \`AGENTS.md\` find the section for your agent and follow its setup steps.
609
+ 2. Read \`AGENTS.md\` - find the section for your agent and follow its setup steps.
558
610
  3. Summarise to the user: what was last worked on, what's planned next, and any known fixes to protect.
559
611
  4. Ask: "Continue as planned, tweak the plan, or do something different?"
560
612
  5. Use \`./.holistic/system/holistic resume --agent ${commandName}\` on macOS/Linux or \`.\\.holistic\\system\\holistic.cmd resume --agent ${commandName}\` on Windows to register the session.
561
-
562
- **After significant work or on any git commit (hook fires automatically):**
563
- - Run \`holistic checkpoint --reason '<what you just did>'\`
564
- - To record a fix that must not regress: \`holistic checkpoint --fixed '<bug>' --fix-files '<file>' --fix-risk '<what reintroduces it>'\`
565
-
566
- **At the end of every session:**
567
- - Run \`holistic handoff\` this opens a dialog to capture the summary.
568
- - Then commit: \`git add HOLISTIC.md AGENTS.md CLAUDE.md GEMINI.md HISTORY.md .holistic/ && git commit -m 'docs(holistic): handoff'\`
569
-
570
- **Never touch files listed in the KNOWN FIXES section of HOLISTIC.md without reading that section first.**
571
- `;
613
+
614
+ **After significant work or on any git commit (hook fires automatically):**
615
+ - Run \`holistic checkpoint --reason '<what you just did>'\`
616
+ - To record a fix that must not regress: \`holistic checkpoint --fixed '<bug>' --fix-files '<file>' --fix-risk '<what reintroduces it>'\`
617
+
618
+ **At the end of every session:**
619
+ - Run \`holistic handoff\` - this opens a dialog to capture the summary.
620
+ - Then commit: \`git add HOLISTIC.md AGENTS.md CLAUDE.md GEMINI.md HISTORY.md .holistic/ && git commit -m 'docs(holistic): handoff'\`
621
+
622
+ **Never touch files listed in the KNOWN FIXES section of HOLISTIC.md without reading that section first.**
623
+
624
+ ${renderSessionCloseBlock(hasMcp)}`;
572
625
  }
573
626
  function renderRootHistoryMd(paths, state) {
574
627
  const sessions = state.activeSession
575
628
  ? [state.activeSession, ...readArchivedSessions(paths)]
576
629
  : readArchivedSessions(paths);
577
- const header = `# History ${state.projectName}
578
-
579
- _Append-only log of every Holistic session. Newest entries at the bottom._
580
-
581
- ---
630
+ const header = `# History - ${state.projectName}
631
+
632
+ _Append-only log of every Holistic session. Newest entries at the bottom._
633
+
634
+ ---
582
635
  `;
583
636
  if (sessions.length === 0) {
584
637
  return header + "_No sessions recorded yet._\n";
@@ -616,17 +669,27 @@ export function writeDerivedDocs(paths, state) {
616
669
  fs.writeFileSync(paths.regressionDoc, renderRegressionWatch(paths, state), "utf8");
617
670
  fs.writeFileSync(paths.zeroTouchDoc, renderZeroTouchDoc(state), "utf8");
618
671
  fs.writeFileSync(`${paths.contextDir}/README.md`, renderContextReadme(state), "utf8");
619
- fs.writeFileSync(`${paths.adaptersDir}/codex.md`, renderAdapter(state, "Codex", "codex"), "utf8");
620
- fs.writeFileSync(`${paths.adaptersDir}/claude-cowork.md`, renderAdapter(state, "Claude/Cowork", "claude"), "utf8");
621
- fs.writeFileSync(`${paths.adaptersDir}/antigravity.md`, renderAdapter(state, "Antigravity", "antigravity"), "utf8");
672
+ fs.writeFileSync(`${paths.adaptersDir}/codex.md`, renderAdapter(state, "Codex", "codex", false), "utf8");
673
+ fs.writeFileSync(`${paths.adaptersDir}/claude-cowork.md`, renderAdapter(state, "Claude/Cowork", "claude", true), "utf8");
674
+ fs.writeFileSync(`${paths.adaptersDir}/antigravity.md`, renderAdapter(state, "Antigravity", "antigravity", false), "utf8");
622
675
  if (paths.rootClaudeDoc) {
623
- fs.writeFileSync(paths.rootClaudeDoc, renderRootAgentDoc("Claude/Cowork", "claude"), "utf8");
676
+ fs.writeFileSync(paths.rootClaudeDoc, renderRootAgentDoc("Claude/Cowork", "claude", true), "utf8");
624
677
  }
625
678
  if (paths.rootGeminiDoc) {
626
- fs.writeFileSync(paths.rootGeminiDoc, renderRootAgentDoc("Antigravity/Gemini", "antigravity"), "utf8");
679
+ fs.writeFileSync(paths.rootGeminiDoc, renderRootAgentDoc("Antigravity/Gemini", "antigravity", false), "utf8");
627
680
  }
628
681
  if (paths.rootHistoryDoc) {
629
682
  fs.writeFileSync(paths.rootHistoryDoc, renderRootHistoryMd(paths, state), "utf8");
630
683
  }
684
+ if (paths.rootCursorRulesDoc) {
685
+ fs.writeFileSync(paths.rootCursorRulesDoc, renderCursorRules(state), "utf8");
686
+ }
687
+ if (paths.rootWindsurfRulesDoc) {
688
+ fs.writeFileSync(paths.rootWindsurfRulesDoc, renderWindsurfRules(state), "utf8");
689
+ }
690
+ if (paths.rootCopilotInstructionsDoc) {
691
+ fs.mkdirSync(path.dirname(paths.rootCopilotInstructionsDoc), { recursive: true });
692
+ fs.writeFileSync(paths.rootCopilotInstructionsDoc, renderCopilotInstructions(state), "utf8");
693
+ }
631
694
  }
632
695
  //# sourceMappingURL=docs.js.map