holistic 0.2.3 → 0.4.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,74 +378,260 @@ 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.
390
- 4. Let Holistic write the docs and create the handoff commit.\n5. Holistic sync helpers should push the current branch and mirror portable state to the dedicated portable state ref.\n6. If you continue on another device, pull or restore the latest portable state before starting work.
400
+ 4. Let Holistic write the docs and prepare the handoff commit.
401
+ 5. If you want the handoff docs committed, make that git commit explicitly.
402
+ 6. Holistic sync helpers should mirror portable state to the dedicated portable state ref without pushing your working branch.
403
+ 7. If you continue on another device, pull or restore the latest portable state before starting work.
391
404
 
392
405
  ${handoffFallbackNote}
393
406
  `;
394
407
  }
395
- function renderAdapter(state, appName, commandName) {
408
+ function renderAdapter(state, profile) {
409
+ const { appName, commandName, hasMcp, toolingNotes, startupNotes, checkpointNotes, handoffNotes } = profile;
396
410
  const resumeFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, `resume --agent ${commandName}`);
397
411
  const checkpointFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "checkpoint --reason \"<what changed>\"");
398
412
  const handoffFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "handoff");
399
413
  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\`.
414
+
415
+ ## Product North Star
416
+
417
+ Open repo, start working, Holistic quietly keeps continuity alive.
418
+
419
+ Use this adapter to move toward that outcome: less manual setup, less re-briefing, and more continuity preserved by default.
420
+
421
+ ## Tool-Specific Notes
422
+
423
+ ${renderList(toolingNotes, "No tool-specific notes recorded.")}
424
+
425
+ ## Startup Contract
426
+
427
+ 1. Read \`HOLISTIC.md\`.
410
428
  2. Review \`project-history.md\`, \`regression-watch.md\`, and \`zero-touch.md\` for durable memory before editing related code.
411
429
  3. If the Holistic daemon is installed, treat passive session capture as already active.
412
430
  4. Use the repo-local Holistic helper when you need an explicit recap or recovery flow.
413
431
  5. Recap the current state for the user in the first 30 seconds.
414
432
  6. Ask: continue as planned, tweak the plan, or start something new.
415
433
 
434
+ ### Startup Notes For ${appName}
435
+
436
+ ${renderList(startupNotes, "Use the default startup contract.")}
437
+
416
438
  ${resumeFallbackNote}
417
-
418
- ## Checkpoint Contract
419
-
439
+
440
+ ## Checkpoint Contract
441
+
420
442
  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
-
443
+
444
+ - the task focus changes
445
+ - you are about to compact or clear context
446
+ - you finish a meaningful chunk of work
447
+ - you fix or alter behavior that could regress later
448
+
427
449
  Include impact notes and regression risks when they matter.
428
450
 
451
+ ### Checkpoint Notes For ${appName}
452
+
453
+ ${renderList(checkpointNotes, "Use the default checkpoint contract.")}
454
+
429
455
  ${checkpointFallbackNote}
430
-
431
- ## Handoff Contract
432
-
456
+
457
+ ## Handoff Contract
458
+
433
459
  - Preferred: map your session-end workflow to the repo-local Holistic helper with \`handoff\`
434
460
  - Fallback: ask the user to run the repo-local Holistic helper with \`handoff\` before leaving the session
435
461
 
462
+ ### Handoff Notes For ${appName}
463
+
464
+ ${renderList(handoffNotes, "Use the default handoff contract.")}
465
+
436
466
  ${handoffFallbackNote}
437
- `;
467
+
468
+ ${renderSessionCloseBlock(hasMcp)}`;
438
469
  }
470
+ const ADAPTER_PROFILES = [
471
+ {
472
+ appName: "Codex",
473
+ commandName: "codex",
474
+ hasMcp: false,
475
+ toolingNotes: [
476
+ "Codex is usually repo-instruction driven, so the first prompt matters more than custom app hooks.",
477
+ "Prefer explicit Holistic recap commands before large context shifts or fresh chat starts.",
478
+ ],
479
+ startupNotes: [
480
+ "Use the repo-local resume helper early in a fresh Codex chat so the recap lands before implementation starts.",
481
+ "If the chat is already deep, checkpoint first before asking Codex to compact or pivot.",
482
+ ],
483
+ checkpointNotes: [
484
+ "Checkpoint before asking Codex to refactor broadly or touch multiple subsystems in one pass.",
485
+ ],
486
+ handoffNotes: [
487
+ "Treat the handoff as the durable replacement for a long final Codex recap message.",
488
+ ],
489
+ },
490
+ {
491
+ appName: "Claude/Cowork",
492
+ commandName: "claude",
493
+ hasMcp: true,
494
+ toolingNotes: [
495
+ "Claude/Cowork can use Holistic through MCP-style tool calls when available.",
496
+ "When MCP is active, prefer Holistic tools over free-form summaries for startup and session close.",
497
+ ],
498
+ startupNotes: [
499
+ "Use \`holistic_resume\` or the mapped startup hook instead of manually reconstructing prior work.",
500
+ "Let the initial recap shape the first answer before editing code.",
501
+ ],
502
+ checkpointNotes: [
503
+ "Checkpoint after meaningful implementation slices, especially before asking Claude to branch into analysis-heavy discussion.",
504
+ ],
505
+ handoffNotes: [
506
+ "Prefer \`holistic_handoff\` when the tool is available so the handoff fields stay structured.",
507
+ ],
508
+ },
509
+ {
510
+ appName: "Antigravity",
511
+ commandName: "antigravity",
512
+ hasMcp: false,
513
+ toolingNotes: [
514
+ "Antigravity sessions tend to benefit from concise startup context and explicit next-step framing.",
515
+ ],
516
+ startupNotes: [
517
+ "Read the Holistic recap before steering Antigravity toward a new plan or implementation pass.",
518
+ ],
519
+ checkpointNotes: [
520
+ "Checkpoint before switching from exploration to execution so the inferred next step stays current.",
521
+ ],
522
+ handoffNotes: [
523
+ "Keep handoffs concrete: summary, next step, and regression risk are more useful than a long narrative.",
524
+ ],
525
+ },
526
+ {
527
+ appName: "Gemini",
528
+ commandName: "gemini",
529
+ hasMcp: false,
530
+ toolingNotes: [
531
+ "Gemini should use repo-visible docs first: \`HOLISTIC.md\`, \`GEMINI.md\`, and the Holistic context folder.",
532
+ "Treat \`GEMINI.md\` as the app-local companion to the shared Holistic memory.",
533
+ ],
534
+ startupNotes: [
535
+ "Open with the shared Holistic recap, then align Gemini-specific behavior from \`GEMINI.md\`.",
536
+ ],
537
+ checkpointNotes: [
538
+ "Checkpoint when Gemini is about to pivot from research to edits or from one subsystem to another.",
539
+ ],
540
+ handoffNotes: [
541
+ "Use the handoff to leave a crisp resume point for the next non-Gemini agent too, not just Gemini.",
542
+ ],
543
+ },
544
+ {
545
+ appName: "GitHub Copilot",
546
+ commandName: "copilot",
547
+ hasMcp: false,
548
+ toolingNotes: [
549
+ "Copilot should pick up repo guidance from \`.github/copilot-instructions.md\` alongside the shared Holistic docs.",
550
+ "Keep Holistic as the continuity layer and Copilot instructions as the tool-specific behavior layer.",
551
+ ],
552
+ startupNotes: [
553
+ "Review \`.github/copilot-instructions.md\` after the Holistic recap so Copilot gets both continuity and local coding rules.",
554
+ ],
555
+ checkpointNotes: [
556
+ "Checkpoint after multi-file edits so Copilot sessions do not lose why a change set exists.",
557
+ ],
558
+ handoffNotes: [
559
+ "End with a real handoff instead of relying on editor chat history surviving between Copilot sessions.",
560
+ ],
561
+ },
562
+ {
563
+ appName: "Cursor",
564
+ commandName: "cursor",
565
+ hasMcp: false,
566
+ toolingNotes: [
567
+ "Cursor should combine Holistic repo memory with project-level editor rules from \`.cursorrules\`.",
568
+ "Use Holistic for continuity and \`.cursorrules\` for Cursor-specific operating guidance.",
569
+ ],
570
+ startupNotes: [
571
+ "Read the Holistic recap before acting on workspace-wide Cursor suggestions or agent mode plans.",
572
+ ],
573
+ checkpointNotes: [
574
+ "Checkpoint before large agent-mode edits so the repo keeps a durable explanation of intent.",
575
+ ],
576
+ handoffNotes: [
577
+ "Do not assume Cursor chat history is enough; finish with a Holistic handoff when ending the session.",
578
+ ],
579
+ },
580
+ {
581
+ appName: "Goose",
582
+ commandName: "goose",
583
+ hasMcp: false,
584
+ toolingNotes: [
585
+ "Goose is terminal-first, so explicit repo-local commands fit naturally here.",
586
+ "Prefer concrete CLI invocations over implicit editor state when refreshing continuity.",
587
+ ],
588
+ startupNotes: [
589
+ "Run the repo-local resume helper early in the shell session so Goose starts from the shared recap.",
590
+ ],
591
+ checkpointNotes: [
592
+ "Checkpoint after command-driven milestones, especially before longer shell sequences or tool handoffs.",
593
+ ],
594
+ handoffNotes: [
595
+ "Use the handoff before closing the shell or moving to another machine so command history is not the only trace.",
596
+ ],
597
+ },
598
+ {
599
+ appName: "GSD",
600
+ commandName: "gsd",
601
+ hasMcp: false,
602
+ toolingNotes: [
603
+ "GSD has its own planning and workflow artifacts; Holistic should complement them, not replace them.",
604
+ "Use Holistic for cross-agent continuity and GSD for execution structure inside a session.",
605
+ ],
606
+ startupNotes: [
607
+ "Start from the Holistic recap, then align against any active GSD milestone, slice, or task files.",
608
+ ],
609
+ checkpointNotes: [
610
+ "Checkpoint when a GSD slice changes direction or when work crosses from one task context into another.",
611
+ ],
612
+ handoffNotes: [
613
+ "Keep the handoff focused on what the next agent needs to resume, even if fuller detail exists in GSD artifacts.",
614
+ ],
615
+ },
616
+ {
617
+ appName: "GSD2",
618
+ commandName: "gsd2",
619
+ hasMcp: false,
620
+ toolingNotes: [
621
+ "GSD2 should be treated as a distinct workflow surface, not an alias of GSD.",
622
+ "Use Holistic as the shared continuity layer across GSD2 sessions and across non-GSD2 agents touching the same repo.",
623
+ ],
624
+ startupNotes: [
625
+ "Load Holistic context first, then reconcile it with any GSD2-native state or workflow entrypoint.",
626
+ ],
627
+ checkpointNotes: [
628
+ "Checkpoint when GSD2 changes execution mode, task boundary, or planned next step.",
629
+ ],
630
+ handoffNotes: [
631
+ "Write handoffs for the next agent, not just for the next GSD2 runtime instance.",
632
+ ],
633
+ },
634
+ ];
439
635
  function renderProjectHistory(paths, state) {
440
636
  const sessions = state.activeSession ? [state.activeSession, ...readArchivedSessions(paths)] : readArchivedSessions(paths);
441
637
  const body = sessions.length === 0
@@ -507,78 +703,120 @@ function renderRegressionWatch(paths, state) {
507
703
  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
704
  }
509
705
  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}
706
+ return `# Zero-Touch Architecture
707
+
708
+ Holistic cannot force every app or agent to execute startup logic just because a repo exists. Zero-touch behavior therefore has two layers.
709
+
710
+ ## Product North Star
711
+
712
+ Open repo, start working, Holistic quietly keeps continuity alive.
713
+
714
+ Zero-touch architecture exists to close the gap between the current protocol and that goal.
715
+
716
+ ## Repo Layer
717
+
718
+ - \`HOLISTIC.md\`, \`AGENTS.md\`, project history, and regression watch stay inside the repo so any agent that reads repo instructions can recover context.
719
+ - This layer travels with git and works cross-agent as long as the tool respects repo-visible instructions.
720
+ - The portable expectation is that handoff docs get committed and synced so another device can continue later.
721
+
722
+ ## Machine Layer
723
+
724
+ - A background Holistic daemon can watch the repo and create passive checkpoints without you manually starting a session.
725
+ - Generated restore scripts can pull the dedicated Holistic portable state ref into the working tree when it is safe to do so.
726
+ - This is the only realistic way to get close to seamless cross-tool capture when apps do not expose a startup hook.
727
+ - It requires a one-time machine install or service registration outside the repo.
728
+
729
+ ## Hard Limit
730
+
731
+ - If a tool ignores repo instructions and there is no daemon or app integration, the repo alone cannot make that tool participate.
732
+ - Holistic can preserve memory and offer recovery, but it cannot force arbitrary apps to cooperate from inside git-tracked files.
733
+
734
+ ## Current Recommendation
735
+
736
+ - Keep using repo-visible memory as the portable source of truth.
737
+ - Treat the dedicated Holistic portable state ref as the clean cross-device distribution channel for that memory.
738
+ - Add the Holistic daemon as the passive capture layer on devices where you want unattended local capture.
739
+ - Add app-specific integrations when a tool exposes startup hooks or slash-command automation.
740
+ - Holistic should recognize workflow systems, not become one.
741
+ - Prefer lightweight workflow context references over baking phases, slices, or other planning structures into the core product.
742
+ - Prefer workflow-disappearance improvements over adding more visible user ceremony.
743
+
744
+ Project: ${state.projectName}
745
+ Updated: ${state.updatedAt}
550
746
  `;
551
747
  }
552
- function renderRootAgentDoc(agentName, commandName) {
553
- return `## Holistic — cross-agent session tracking
748
+ function renderIdeCursorRulesContent(state) {
749
+ const snapshot = currentSnapshot(state);
750
+ const { fixes, other: otherRegressions } = parseKnownFixes(snapshot.regressions);
751
+ const resumeCmd = renderCliFallbackNote(state.docIndex.contextDir, "resume --agent cursor");
752
+ const handoffCmd = renderCliFallbackNote(state.docIndex.contextDir, "handoff");
753
+ const fixLines = fixes.length > 0
754
+ ? `## Do Not Regress - Known Fixes\n\n${fixes.map((f) => `- ${f}`).join("\n")}\n`
755
+ : "";
756
+ const regressionLines = otherRegressions.length > 0
757
+ ? `## Regression Watch\n\n${otherRegressions.map((r) => `- ${r}`).join("\n")}\n`
758
+ : "";
759
+ return `# Holistic - ${state.projectName}
760
+
761
+ ## Session Start
762
+
763
+ At the start of every session, before doing anything else:
764
+ 1. Read \`HOLISTIC.md\` in full.
765
+ 2. Read \`AGENTS.md\`.
766
+ 3. Summarise to the user: what was last worked on, what's planned next, and any known fixes to protect.
767
+ 4. Ask: "Continue as planned, tweak the plan, or do something different?"
768
+ 5. ${resumeCmd}
769
+
770
+ ## Current Objective
771
+
772
+ ${snapshot.goal}
773
+
774
+ ## Latest Status
775
+
776
+ ${snapshot.status}
777
+
778
+ ${fixLines}${regressionLines}${renderSessionCloseBlock(false)}`;
779
+ }
780
+ function renderCursorRules(state) {
781
+ return renderIdeCursorRulesContent(state);
782
+ }
783
+ function renderWindsurfRules(state) {
784
+ return renderIdeCursorRulesContent(state);
785
+ }
786
+ function renderCopilotInstructions(state) {
787
+ return renderIdeCursorRulesContent(state);
788
+ }
789
+ function renderRootAgentDoc(agentName, commandName, hasMcp) {
790
+ return `## Holistic - cross-agent session tracking
554
791
 
555
792
  **At the start of every session, before doing anything else:**
556
793
  1. Read \`HOLISTIC.md\` in full.
557
- 2. Read \`AGENTS.md\` find the section for your agent and follow its setup steps.
794
+ 2. Read \`AGENTS.md\` - find the section for your agent and follow its setup steps.
558
795
  3. Summarise to the user: what was last worked on, what's planned next, and any known fixes to protect.
559
796
  4. Ask: "Continue as planned, tweak the plan, or do something different?"
560
797
  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
- `;
798
+
799
+ **After significant work or on any git commit (hook fires automatically):**
800
+ - Run \`holistic checkpoint --reason '<what you just did>'\`
801
+ - To record a fix that must not regress: \`holistic checkpoint --fixed '<bug>' --fix-files '<file>' --fix-risk '<what reintroduces it>'\`
802
+
803
+ **At the end of every session:**
804
+ - Run \`holistic handoff\` - this opens a dialog to capture the summary and prepares a pending handoff commit.
805
+ - If you want the Holistic files committed, make that git commit explicitly.
806
+
807
+ **Never touch files listed in the KNOWN FIXES section of HOLISTIC.md without reading that section first.**
808
+
809
+ ${renderSessionCloseBlock(hasMcp)}`;
572
810
  }
573
811
  function renderRootHistoryMd(paths, state) {
574
812
  const sessions = state.activeSession
575
813
  ? [state.activeSession, ...readArchivedSessions(paths)]
576
814
  : readArchivedSessions(paths);
577
- const header = `# History ${state.projectName}
578
-
579
- _Append-only log of every Holistic session. Newest entries at the bottom._
580
-
581
- ---
815
+ const header = `# History - ${state.projectName}
816
+
817
+ _Append-only log of every Holistic session. Newest entries at the bottom._
818
+
819
+ ---
582
820
  `;
583
821
  if (sessions.length === 0) {
584
822
  return header + "_No sessions recorded yet._\n";
@@ -616,17 +854,28 @@ export function writeDerivedDocs(paths, state) {
616
854
  fs.writeFileSync(paths.regressionDoc, renderRegressionWatch(paths, state), "utf8");
617
855
  fs.writeFileSync(paths.zeroTouchDoc, renderZeroTouchDoc(state), "utf8");
618
856
  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");
857
+ for (const profile of ADAPTER_PROFILES) {
858
+ const fileName = profile.commandName === "claude" ? "claude-cowork.md" : `${profile.commandName}.md`;
859
+ fs.writeFileSync(path.join(paths.adaptersDir, fileName), renderAdapter(state, profile), "utf8");
860
+ }
622
861
  if (paths.rootClaudeDoc) {
623
- fs.writeFileSync(paths.rootClaudeDoc, renderRootAgentDoc("Claude/Cowork", "claude"), "utf8");
862
+ fs.writeFileSync(paths.rootClaudeDoc, renderRootAgentDoc("Claude/Cowork", "claude", true), "utf8");
624
863
  }
625
864
  if (paths.rootGeminiDoc) {
626
- fs.writeFileSync(paths.rootGeminiDoc, renderRootAgentDoc("Antigravity/Gemini", "antigravity"), "utf8");
865
+ fs.writeFileSync(paths.rootGeminiDoc, renderRootAgentDoc("Gemini", "gemini", false), "utf8");
627
866
  }
628
867
  if (paths.rootHistoryDoc) {
629
868
  fs.writeFileSync(paths.rootHistoryDoc, renderRootHistoryMd(paths, state), "utf8");
630
869
  }
870
+ if (paths.rootCursorRulesDoc) {
871
+ fs.writeFileSync(paths.rootCursorRulesDoc, renderCursorRules(state), "utf8");
872
+ }
873
+ if (paths.rootWindsurfRulesDoc) {
874
+ fs.writeFileSync(paths.rootWindsurfRulesDoc, renderWindsurfRules(state), "utf8");
875
+ }
876
+ if (paths.rootCopilotInstructionsDoc) {
877
+ fs.mkdirSync(path.dirname(paths.rootCopilotInstructionsDoc), { recursive: true });
878
+ fs.writeFileSync(paths.rootCopilotInstructionsDoc, renderCopilotInstructions(state), "utf8");
879
+ }
631
880
  }
632
881
  //# sourceMappingURL=docs.js.map