holistic 0.2.2 → 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/CHANGELOG.md +20 -0
- package/dist/__tests__/mcp-notification.test.d.ts.map +1 -1
- package/dist/__tests__/mcp-notification.test.js +1 -2
- package/dist/__tests__/mcp-notification.test.js.map +1 -1
- package/dist/cli.js +43 -9
- package/dist/cli.js.map +1 -1
- package/dist/core/cli-fallback.d.ts +1 -0
- package/dist/core/cli-fallback.d.ts.map +1 -1
- package/dist/core/cli-fallback.js +5 -2
- package/dist/core/cli-fallback.js.map +1 -1
- package/dist/core/docs.d.ts.map +1 -1
- package/dist/core/docs.js +361 -302
- package/dist/core/docs.js.map +1 -1
- package/dist/core/git-hooks.d.ts +1 -0
- package/dist/core/git-hooks.d.ts.map +1 -1
- package/dist/core/git-hooks.js +3 -9
- package/dist/core/git-hooks.js.map +1 -1
- package/dist/core/setup.d.ts +2 -0
- package/dist/core/setup.d.ts.map +1 -1
- package/dist/core/setup.js +191 -0
- package/dist/core/setup.js.map +1 -1
- package/dist/core/state.d.ts.map +1 -1
- package/dist/core/state.js +21 -4
- package/dist/core/state.js.map +1 -1
- package/dist/core/sync.d.ts.map +1 -1
- package/dist/core/sync.js +4 -1
- package/dist/core/sync.js.map +1 -1
- package/dist/core/types.d.ts +4 -0
- package/dist/core/types.d.ts.map +1 -1
- package/package.json +1 -1
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
|
|
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,212 +148,212 @@ 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
|
|
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
|
|
154
|
-
5.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
4. Ask: "What would you like to work on - continue recent work, or start something new?"
|
|
161
|
+
5. Open the session with the repo-local Holistic helper for this repo.
|
|
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
|
+
|
|
161
167
|
## Start Here
|
|
162
168
|
|
|
163
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.
|
|
164
170
|
|
|
165
171
|
${resumeFallbackNote}
|
|
166
|
-
|
|
167
|
-
## Product North Star
|
|
168
|
-
|
|
169
|
-
Open repo, start working, Holistic quietly keeps continuity alive.
|
|
170
|
-
|
|
171
|
-
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.
|
|
172
|
-
|
|
173
|
-
${knownFixesBlock}## Current Objective
|
|
174
|
-
|
|
175
|
-
**${snapshot.title}**
|
|
176
|
-
|
|
177
|
-
${snapshot.goal}
|
|
178
|
-
|
|
179
|
-
## Latest Work Status
|
|
180
|
-
|
|
181
|
-
${snapshot.status}
|
|
182
|
-
|
|
183
|
-
## What Was Tried
|
|
184
|
-
|
|
185
|
-
${renderList(snapshot.tried, "Nothing recorded yet.")}
|
|
186
|
-
|
|
187
|
-
## What To Try Next
|
|
188
|
-
|
|
189
|
-
${renderList(snapshot.next, "Ask the user what they'd like to work on.")}
|
|
190
|
-
|
|
191
|
-
## Active Plan
|
|
192
|
-
|
|
193
|
-
${renderList(snapshot.plan, "None yet
|
|
194
|
-
|
|
195
|
-
## Overall Impact So Far
|
|
196
|
-
|
|
197
|
-
${renderList(snapshot.impacts, "Nothing recorded yet.")}
|
|
198
|
-
|
|
199
|
-
## Regression Watch
|
|
200
|
-
|
|
201
|
-
${renderList(otherRegressions, "Review the regression watch document before changing related behavior.")}
|
|
202
|
-
|
|
203
|
-
## Key Assumptions
|
|
204
|
-
|
|
205
|
-
${renderList(snapshot.assumptions, "None recorded.")}
|
|
206
|
-
|
|
207
|
-
## Blockers
|
|
208
|
-
|
|
209
|
-
${renderList(snapshot.blockers, "None.")}
|
|
210
|
-
|
|
211
|
-
## Changed Files In Current Session
|
|
212
|
-
|
|
213
|
-
${renderList(snapshot.changedFiles, "No repo changes detected for the active session.")}
|
|
214
|
-
|
|
215
|
-
## Pending Work Queue
|
|
216
|
-
|
|
217
|
-
${pendingPreview.length === 0 ? "- None." : pendingPreview.map((item) => `- ${item.title}: ${item.recommendedNextStep}`).join("\n")}
|
|
218
|
-
|
|
219
|
-
## Long-Term Memory
|
|
220
|
-
|
|
221
|
-
- Project history: [${state.docIndex.historyDoc}](${state.docIndex.historyDoc})
|
|
222
|
-
- Regression watch: [${state.docIndex.regressionDoc}](${state.docIndex.regressionDoc})
|
|
223
|
-
- Zero-touch architecture: [${state.docIndex.zeroTouchDoc}](${state.docIndex.zeroTouchDoc})
|
|
224
|
-
- Portable sync model: handoffs are intended to be committed and synced so any device with repo access can continue.
|
|
225
|
-
|
|
226
|
-
## Supporting Documents
|
|
227
|
-
|
|
228
|
-
- State file: [${state.docIndex.stateFile}](${state.docIndex.stateFile})
|
|
229
|
-
- Current plan: [${state.docIndex.currentPlanDoc}](${state.docIndex.currentPlanDoc})
|
|
230
|
-
- Session protocol: [${state.docIndex.protocolDoc}](${state.docIndex.protocolDoc})
|
|
231
|
-
- Session archive: [${state.docIndex.sessionsDir}](${state.docIndex.sessionsDir})
|
|
232
|
-
- Adapter docs:
|
|
233
|
-
${adapterLinks}
|
|
234
|
-
|
|
235
|
-
## Historical Memory
|
|
236
|
-
|
|
237
|
-
- Last updated: ${state.updatedAt}
|
|
238
|
-
- Last handoff: ${state.lastHandoff ? `${state.lastHandoff.summary}` : "None yet."}
|
|
239
|
-
- 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}
|
|
240
246
|
`;
|
|
241
247
|
}
|
|
242
248
|
function renderAgentsMd(state) {
|
|
243
249
|
const resumeFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "resume --agent <your-agent-name>");
|
|
244
250
|
const checkpointFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "checkpoint --reason \"<why>\"");
|
|
251
|
+
const checkpointFixNote = renderCliFallbackNote(state.docIndex.contextDir, "checkpoint --fixed \"<bug>\" --fix-files \"<file>\" --fix-risk \"<what would reintroduce it>\"");
|
|
245
252
|
const handoffFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "handoff");
|
|
253
|
+
const startNewNote = renderCliFallbackNote(state.docIndex.contextDir, "start-new --goal \"<goal>\"");
|
|
254
|
+
const watchNote = renderCliFallbackNote(state.docIndex.contextDir, "watch");
|
|
246
255
|
return `# AGENTS
|
|
247
|
-
|
|
248
|
-
<!-- ═══════════════════════════════════════════════════════════════════
|
|
249
|
-
AGENT AUTO-START INSTRUCTIONS
|
|
250
|
-
═══════════════════════════════════════════════════════════════════
|
|
251
|
-
|
|
252
|
-
YOU ARE READING THIS FILE AUTOMATICALLY AT SESSION START. GOOD.
|
|
253
|
-
Now do the following BEFORE responding to the user or doing any work:
|
|
254
|
-
|
|
255
|
-
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.
|
|
256
265
|
2. Summarise to the user: what was last worked on, what's planned next,
|
|
257
266
|
and flag any KNOWN FIXES they should be aware of.
|
|
258
|
-
3. Ask: "What would you like to work on
|
|
259
|
-
4.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
3. Read the app-specific adapter in \`${state.docIndex.contextDir}/adapters/\`.
|
|
267
|
+
3. Ask: "What would you like to work on - continue recent work, or start something new?"
|
|
268
|
+
4. Open the session with the repo-local Holistic helper for this repo.
|
|
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/\`.
|
|
278
286
|
4. If the Holistic daemon is installed, assume passive capture is already running in the background.
|
|
279
|
-
5.
|
|
287
|
+
5. Use the repo-local Holistic helper for explicit recap or recovery flows in this repo.
|
|
280
288
|
6. Recap the current state for the user and ask whether to continue, tweak the plan, or start something new.
|
|
281
289
|
7. Record a checkpoint when focus changes, before likely context compaction, and before handoff.
|
|
282
290
|
|
|
283
291
|
${resumeFallbackNote}
|
|
284
|
-
|
|
285
|
-
## Handoff Commands
|
|
286
|
-
|
|
287
|
-
- \`holistic checkpoint --reason "<why>"\`
|
|
288
|
-
- \`holistic checkpoint --fixed "<bug>" --fix-files "<file>" --fix-risk "<what would reintroduce it>"\`
|
|
289
|
-
- \`holistic set-phase --phase "<id>" --name "<name>" --goal "<goal>"\`
|
|
290
|
-
- \`holistic complete-phase --phase "<id>" --next-phase "<id>" --next-name "<name>" --next-goal "<goal>"\`
|
|
291
|
-
- \`holistic handoff\`
|
|
292
|
-
- \`holistic start-new --goal "<goal>"\`
|
|
293
|
-
- \`holistic watch\`
|
|
294
|
-
|
|
295
|
-
Fallbacks when PATH is missing:
|
|
292
|
+
|
|
293
|
+
## Handoff Commands
|
|
294
|
+
|
|
296
295
|
- ${checkpointFallbackNote.slice(3)}
|
|
296
|
+
- ${checkpointFixNote.slice(3)}
|
|
297
|
+
- \`holistic set-phase --phase "<id>" --name "<name>" --goal "<goal>"\`
|
|
298
|
+
- \`holistic complete-phase --phase "<id>" --next-phase "<id>" --next-name "<name>" --next-goal "<goal>"\`
|
|
297
299
|
- ${handoffFallbackNote.slice(3)}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
300
|
+
- ${startNewNote.slice(3)}
|
|
301
|
+
- ${watchNote.slice(3)}
|
|
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.
|
|
307
314
|
`;
|
|
308
315
|
}
|
|
309
316
|
function renderContextReadme(state) {
|
|
310
|
-
return `# Holistic Context
|
|
311
|
-
|
|
312
|
-
This folder holds repo-visible memory that any agent can reuse.
|
|
313
|
-
|
|
314
|
-
- [Current Plan](./current-plan.md)
|
|
315
|
-
- [Session Protocol](./session-protocol.md)
|
|
316
|
-
- [Project History](./project-history.md)
|
|
317
|
-
- [Regression Watch](./regression-watch.md)
|
|
318
|
-
- [Zero-Touch Architecture](./zero-touch.md)
|
|
319
|
-
- [Codex Adapter](./adapters/codex.md)
|
|
320
|
-
- [Claude/Cowork Adapter](./adapters/claude-cowork.md)
|
|
321
|
-
- [Antigravity Adapter](./adapters/antigravity.md)
|
|
322
|
-
|
|
323
|
-
Project: ${state.projectName}
|
|
324
|
-
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}
|
|
325
332
|
`;
|
|
326
333
|
}
|
|
327
334
|
function renderCurrentPlan(state) {
|
|
328
335
|
const snapshot = currentSnapshot(state);
|
|
329
|
-
return `# Current Plan
|
|
330
|
-
|
|
331
|
-
## Goal
|
|
332
|
-
|
|
333
|
-
${snapshot.goal}
|
|
334
|
-
|
|
335
|
-
## Latest Status
|
|
336
|
-
|
|
337
|
-
${snapshot.status}
|
|
338
|
-
|
|
339
|
-
## Planned Next Steps
|
|
340
|
-
|
|
341
|
-
${renderList(snapshot.plan.length > 0 ? snapshot.plan : snapshot.next, "No plan captured yet.")}
|
|
342
|
-
|
|
343
|
-
## Project Impact
|
|
344
|
-
|
|
345
|
-
${renderList(snapshot.impacts, "No impact notes captured yet.")}
|
|
346
|
-
|
|
347
|
-
## References
|
|
348
|
-
|
|
349
|
-
${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.")}
|
|
350
357
|
`;
|
|
351
358
|
}
|
|
352
359
|
function renderProtocol(state) {
|
|
@@ -354,40 +361,40 @@ function renderProtocol(state) {
|
|
|
354
361
|
const checkpointFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "checkpoint --reason \"<what changed>\"");
|
|
355
362
|
const handoffFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "handoff");
|
|
356
363
|
return `# Session Protocol
|
|
357
|
-
|
|
358
|
-
## Product North Star
|
|
359
|
-
|
|
360
|
-
Open repo, start working, Holistic quietly keeps continuity alive.
|
|
361
|
-
|
|
362
|
-
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.
|
|
363
|
-
|
|
364
|
-
## Startup
|
|
365
|
-
|
|
366
|
-
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\`.
|
|
367
374
|
2. Review \`project-history.md\`, \`regression-watch.md\`, and \`zero-touch.md\` for durable project memory and automation expectations.
|
|
368
375
|
3. If the Holistic daemon is installed, let it capture repo activity in the background.
|
|
369
|
-
4.
|
|
376
|
+
4. Use the repo-local Holistic helper for explicit recap or recovery flows in this repo.
|
|
370
377
|
5. Recap the work state to the user.
|
|
371
378
|
6. Ask whether to continue as planned, tweak the plan, or start something new.
|
|
372
379
|
|
|
373
380
|
${resumeFallbackNote}
|
|
374
|
-
|
|
375
|
-
## During The Session
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
- when the task focus changes
|
|
380
|
-
- before likely context compaction
|
|
381
|
-
- after meaningful progress
|
|
382
|
-
- when you fix something another agent might accidentally re-break later
|
|
383
|
-
|
|
384
|
-
Use \`
|
|
381
|
+
|
|
382
|
+
## During The Session
|
|
383
|
+
|
|
384
|
+
Use the repo-local Holistic helper for checkpoints in this repo:
|
|
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
|
+
|
|
391
|
+
Use the repo-local Holistic helper with \`watch\` if you want foreground background checkpoints while working manually.
|
|
385
392
|
|
|
386
393
|
${checkpointFallbackNote}
|
|
387
|
-
|
|
388
|
-
## Handoff
|
|
389
|
-
|
|
390
|
-
1.
|
|
394
|
+
|
|
395
|
+
## Handoff
|
|
396
|
+
|
|
397
|
+
1. Use the repo-local Holistic helper to run \`handoff\`.
|
|
391
398
|
2. Confirm or edit the drafted summary.
|
|
392
399
|
3. Make sure the next step, impact, and regression risks are accurate.
|
|
393
400
|
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.
|
|
@@ -395,49 +402,50 @@ ${checkpointFallbackNote}
|
|
|
395
402
|
${handoffFallbackNote}
|
|
396
403
|
`;
|
|
397
404
|
}
|
|
398
|
-
function renderAdapter(state, appName, commandName) {
|
|
405
|
+
function renderAdapter(state, appName, commandName, hasMcp) {
|
|
399
406
|
const resumeFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, `resume --agent ${commandName}`);
|
|
400
407
|
const checkpointFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "checkpoint --reason \"<what changed>\"");
|
|
401
408
|
const handoffFallbackNote = renderCliFallbackNote(state.docIndex.contextDir, "handoff");
|
|
402
409
|
return `# ${appName} Adapter
|
|
403
|
-
|
|
404
|
-
## Product North Star
|
|
405
|
-
|
|
406
|
-
Open repo, start working, Holistic quietly keeps continuity alive.
|
|
407
|
-
|
|
408
|
-
Use this adapter to move toward that outcome: less manual setup, less re-briefing, and more continuity preserved by default.
|
|
409
|
-
|
|
410
|
-
## Startup Contract
|
|
411
|
-
|
|
412
|
-
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\`.
|
|
413
420
|
2. Review \`project-history.md\`, \`regression-watch.md\`, and \`zero-touch.md\` for durable memory before editing related code.
|
|
414
421
|
3. If the Holistic daemon is installed, treat passive session capture as already active.
|
|
415
|
-
4.
|
|
422
|
+
4. Use the repo-local Holistic helper when you need an explicit recap or recovery flow.
|
|
416
423
|
5. Recap the current state for the user in the first 30 seconds.
|
|
417
424
|
6. Ask: continue as planned, tweak the plan, or start something new.
|
|
418
425
|
|
|
419
426
|
${resumeFallbackNote}
|
|
420
|
-
|
|
421
|
-
## Checkpoint Contract
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
- the task focus changes
|
|
426
|
-
- you are about to compact or clear context
|
|
427
|
-
- you finish a meaningful chunk of work
|
|
428
|
-
- you fix or alter behavior that could regress later
|
|
429
|
-
|
|
427
|
+
|
|
428
|
+
## Checkpoint Contract
|
|
429
|
+
|
|
430
|
+
Use the repo-local Holistic helper for checkpoints in this repo when:
|
|
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
|
+
|
|
430
437
|
Include impact notes and regression risks when they matter.
|
|
431
438
|
|
|
432
439
|
${checkpointFallbackNote}
|
|
433
|
-
|
|
434
|
-
## Handoff Contract
|
|
435
|
-
|
|
436
|
-
- Preferred: map your session-end workflow to \`
|
|
437
|
-
- Fallback: ask the user to run \`
|
|
440
|
+
|
|
441
|
+
## Handoff Contract
|
|
442
|
+
|
|
443
|
+
- Preferred: map your session-end workflow to the repo-local Holistic helper with \`handoff\`
|
|
444
|
+
- Fallback: ask the user to run the repo-local Holistic helper with \`handoff\` before leaving the session
|
|
438
445
|
|
|
439
446
|
${handoffFallbackNote}
|
|
440
|
-
|
|
447
|
+
|
|
448
|
+
${renderSessionCloseBlock(hasMcp)}`;
|
|
441
449
|
}
|
|
442
450
|
function renderProjectHistory(paths, state) {
|
|
443
451
|
const sessions = state.activeSession ? [state.activeSession, ...readArchivedSessions(paths)] : readArchivedSessions(paths);
|
|
@@ -510,79 +518,120 @@ function renderRegressionWatch(paths, state) {
|
|
|
510
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`;
|
|
511
519
|
}
|
|
512
520
|
function renderZeroTouchDoc(state) {
|
|
513
|
-
return `# Zero-Touch Architecture
|
|
514
|
-
|
|
515
|
-
Holistic cannot force every app or agent to execute startup logic just because a repo exists. Zero-touch behavior therefore has two layers.
|
|
516
|
-
|
|
517
|
-
## Product North Star
|
|
518
|
-
|
|
519
|
-
Open repo, start working, Holistic quietly keeps continuity alive.
|
|
520
|
-
|
|
521
|
-
Zero-touch architecture exists to close the gap between the current protocol and that goal.
|
|
522
|
-
|
|
523
|
-
## Repo Layer
|
|
524
|
-
|
|
525
|
-
- \`HOLISTIC.md\`, \`AGENTS.md\`, project history, and regression watch stay inside the repo so any agent that reads repo instructions can recover context.
|
|
526
|
-
- This layer travels with git and works cross-agent as long as the tool respects repo-visible instructions.
|
|
527
|
-
- The portable expectation is that handoff docs get committed and synced so another device can continue later.
|
|
528
|
-
|
|
529
|
-
## Machine Layer
|
|
530
|
-
|
|
531
|
-
- A background Holistic daemon can watch the repo and create passive checkpoints without you manually starting a session.
|
|
532
|
-
- Generated restore scripts can pull the dedicated Holistic portable state ref into the working tree when it is safe to do so.
|
|
533
|
-
- This is the only realistic way to get close to seamless cross-tool capture when apps do not expose a startup hook.
|
|
534
|
-
- It requires a one-time machine install or service registration outside the repo.
|
|
535
|
-
|
|
536
|
-
## Hard Limit
|
|
537
|
-
|
|
538
|
-
- If a tool ignores repo instructions and there is no daemon or app integration, the repo alone cannot make that tool participate.
|
|
539
|
-
- Holistic can preserve memory and offer recovery, but it cannot force arbitrary apps to cooperate from inside git-tracked files.
|
|
540
|
-
|
|
541
|
-
## Current Recommendation
|
|
542
|
-
|
|
543
|
-
- Keep using repo-visible memory as the portable source of truth.
|
|
544
|
-
- Treat the dedicated Holistic portable state ref as the clean cross-device distribution channel for that memory.
|
|
545
|
-
- Add the Holistic daemon as the passive capture layer on devices where you want unattended local capture.
|
|
546
|
-
- Add app-specific integrations when a tool exposes startup hooks or slash-command automation.
|
|
547
|
-
- Holistic should recognize workflow systems, not become one.
|
|
548
|
-
- Prefer lightweight workflow context references over baking phases, slices, or other planning structures into the core product.
|
|
549
|
-
- Prefer workflow-disappearance improvements over adding more visible user ceremony.
|
|
550
|
-
|
|
551
|
-
Project: ${state.projectName}
|
|
552
|
-
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}
|
|
553
561
|
`;
|
|
554
562
|
}
|
|
555
|
-
function
|
|
556
|
-
|
|
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
|
|
557
606
|
|
|
558
607
|
**At the start of every session, before doing anything else:**
|
|
559
608
|
1. Read \`HOLISTIC.md\` in full.
|
|
560
|
-
2. Read \`AGENTS.md\`
|
|
609
|
+
2. Read \`AGENTS.md\` - find the section for your agent and follow its setup steps.
|
|
561
610
|
3. Summarise to the user: what was last worked on, what's planned next, and any known fixes to protect.
|
|
562
611
|
4. Ask: "Continue as planned, tweak the plan, or do something different?"
|
|
563
|
-
5.
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
`;
|
|
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.
|
|
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)}`;
|
|
576
625
|
}
|
|
577
626
|
function renderRootHistoryMd(paths, state) {
|
|
578
627
|
const sessions = state.activeSession
|
|
579
628
|
? [state.activeSession, ...readArchivedSessions(paths)]
|
|
580
629
|
: readArchivedSessions(paths);
|
|
581
|
-
const header = `# History
|
|
582
|
-
|
|
583
|
-
_Append-only log of every Holistic session. Newest entries at the bottom._
|
|
584
|
-
|
|
585
|
-
---
|
|
630
|
+
const header = `# History - ${state.projectName}
|
|
631
|
+
|
|
632
|
+
_Append-only log of every Holistic session. Newest entries at the bottom._
|
|
633
|
+
|
|
634
|
+
---
|
|
586
635
|
`;
|
|
587
636
|
if (sessions.length === 0) {
|
|
588
637
|
return header + "_No sessions recorded yet._\n";
|
|
@@ -620,17 +669,27 @@ export function writeDerivedDocs(paths, state) {
|
|
|
620
669
|
fs.writeFileSync(paths.regressionDoc, renderRegressionWatch(paths, state), "utf8");
|
|
621
670
|
fs.writeFileSync(paths.zeroTouchDoc, renderZeroTouchDoc(state), "utf8");
|
|
622
671
|
fs.writeFileSync(`${paths.contextDir}/README.md`, renderContextReadme(state), "utf8");
|
|
623
|
-
fs.writeFileSync(`${paths.adaptersDir}/codex.md`, renderAdapter(state, "Codex", "codex"), "utf8");
|
|
624
|
-
fs.writeFileSync(`${paths.adaptersDir}/claude-cowork.md`, renderAdapter(state, "Claude/Cowork", "claude"), "utf8");
|
|
625
|
-
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");
|
|
626
675
|
if (paths.rootClaudeDoc) {
|
|
627
|
-
fs.writeFileSync(paths.rootClaudeDoc, renderRootAgentDoc("Claude/Cowork", "claude"), "utf8");
|
|
676
|
+
fs.writeFileSync(paths.rootClaudeDoc, renderRootAgentDoc("Claude/Cowork", "claude", true), "utf8");
|
|
628
677
|
}
|
|
629
678
|
if (paths.rootGeminiDoc) {
|
|
630
|
-
fs.writeFileSync(paths.rootGeminiDoc, renderRootAgentDoc("Antigravity/Gemini", "antigravity"), "utf8");
|
|
679
|
+
fs.writeFileSync(paths.rootGeminiDoc, renderRootAgentDoc("Antigravity/Gemini", "antigravity", false), "utf8");
|
|
631
680
|
}
|
|
632
681
|
if (paths.rootHistoryDoc) {
|
|
633
682
|
fs.writeFileSync(paths.rootHistoryDoc, renderRootHistoryMd(paths, state), "utf8");
|
|
634
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
|
+
}
|
|
635
694
|
}
|
|
636
695
|
//# sourceMappingURL=docs.js.map
|