grounder 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/README.md +21 -20
  2. package/dist/agents/claude.d.ts +4 -4
  3. package/dist/agents/claude.d.ts.map +1 -1
  4. package/dist/agents/claude.js +158 -179
  5. package/dist/agents/claude.js.map +1 -1
  6. package/dist/agents/cursor.d.ts +3 -3
  7. package/dist/agents/cursor.d.ts.map +1 -1
  8. package/dist/agents/cursor.js +97 -144
  9. package/dist/agents/cursor.js.map +1 -1
  10. package/dist/agents/home-skills.d.ts +46 -0
  11. package/dist/agents/home-skills.d.ts.map +1 -0
  12. package/dist/agents/home-skills.js +83 -0
  13. package/dist/agents/home-skills.js.map +1 -0
  14. package/dist/agents/hook-fragment.d.ts +52 -0
  15. package/dist/agents/hook-fragment.d.ts.map +1 -0
  16. package/dist/agents/hook-fragment.js +76 -0
  17. package/dist/agents/hook-fragment.js.map +1 -0
  18. package/dist/agents/hook-install.d.ts +62 -0
  19. package/dist/agents/hook-install.d.ts.map +1 -0
  20. package/dist/agents/hook-install.js +74 -0
  21. package/dist/agents/hook-install.js.map +1 -0
  22. package/dist/agents/hook-runtime.d.ts +77 -10
  23. package/dist/agents/hook-runtime.d.ts.map +1 -1
  24. package/dist/agents/hook-runtime.js +274 -70
  25. package/dist/agents/hook-runtime.js.map +1 -1
  26. package/dist/agents/index.d.ts +8 -14
  27. package/dist/agents/index.d.ts.map +1 -1
  28. package/dist/agents/index.js +13 -19
  29. package/dist/agents/index.js.map +1 -1
  30. package/dist/agents/types.d.ts +56 -16
  31. package/dist/agents/types.d.ts.map +1 -1
  32. package/dist/cli.js +4 -0
  33. package/dist/cli.js.map +1 -1
  34. package/dist/commands/apply.d.ts +69 -0
  35. package/dist/commands/apply.d.ts.map +1 -0
  36. package/dist/commands/apply.js +238 -0
  37. package/dist/commands/apply.js.map +1 -0
  38. package/dist/commands/doctor.d.ts.map +1 -1
  39. package/dist/commands/doctor.js +190 -97
  40. package/dist/commands/doctor.js.map +1 -1
  41. package/dist/commands/handoff/peek.d.ts +1 -1
  42. package/dist/commands/handoff/peek.d.ts.map +1 -1
  43. package/dist/commands/handoff/peek.js +28 -12
  44. package/dist/commands/handoff/peek.js.map +1 -1
  45. package/dist/commands/install-drift.d.ts +34 -0
  46. package/dist/commands/install-drift.d.ts.map +1 -0
  47. package/dist/commands/install-drift.js +72 -0
  48. package/dist/commands/install-drift.js.map +1 -0
  49. package/dist/commands/migrate.d.ts +11 -3
  50. package/dist/commands/migrate.d.ts.map +1 -1
  51. package/dist/commands/migrate.js +67 -33
  52. package/dist/commands/migrate.js.map +1 -1
  53. package/dist/commands/overview.d.ts +33 -0
  54. package/dist/commands/overview.d.ts.map +1 -0
  55. package/dist/commands/overview.js +150 -0
  56. package/dist/commands/overview.js.map +1 -0
  57. package/dist/commands/render-artifact-table.d.ts +85 -0
  58. package/dist/commands/render-artifact-table.d.ts.map +1 -0
  59. package/dist/commands/render-artifact-table.js +232 -0
  60. package/dist/commands/render-artifact-table.js.map +1 -0
  61. package/dist/commands/search.d.ts.map +1 -1
  62. package/dist/commands/search.js +15 -4
  63. package/dist/commands/search.js.map +1 -1
  64. package/dist/commands/setup.d.ts.map +1 -1
  65. package/dist/commands/setup.js +86 -13
  66. package/dist/commands/setup.js.map +1 -1
  67. package/dist/commands/status.d.ts +7 -0
  68. package/dist/commands/status.d.ts.map +1 -1
  69. package/dist/commands/status.js +269 -88
  70. package/dist/commands/status.js.map +1 -1
  71. package/dist/connector/ledger-migrations.d.ts +55 -0
  72. package/dist/connector/ledger-migrations.d.ts.map +1 -0
  73. package/dist/connector/ledger-migrations.js +94 -0
  74. package/dist/connector/ledger-migrations.js.map +1 -0
  75. package/dist/connector/state.d.ts +96 -59
  76. package/dist/connector/state.d.ts.map +1 -1
  77. package/dist/connector/state.js +165 -107
  78. package/dist/connector/state.js.map +1 -1
  79. package/dist/help.d.ts +1 -1
  80. package/dist/help.d.ts.map +1 -1
  81. package/dist/help.js +27 -5
  82. package/dist/help.js.map +1 -1
  83. package/dist/reconcile/apply.d.ts +31 -0
  84. package/dist/reconcile/apply.d.ts.map +1 -0
  85. package/dist/reconcile/apply.js +97 -0
  86. package/dist/reconcile/apply.js.map +1 -0
  87. package/dist/reconcile/core.d.ts +82 -0
  88. package/dist/reconcile/core.d.ts.map +1 -0
  89. package/dist/reconcile/core.js +163 -0
  90. package/dist/reconcile/core.js.map +1 -0
  91. package/dist/reconcile/disk.d.ts +13 -0
  92. package/dist/reconcile/disk.d.ts.map +1 -0
  93. package/dist/reconcile/disk.js +28 -0
  94. package/dist/reconcile/disk.js.map +1 -0
  95. package/dist/util/fs.d.ts +14 -0
  96. package/dist/util/fs.d.ts.map +1 -1
  97. package/dist/util/fs.js +27 -1
  98. package/dist/util/fs.js.map +1 -1
  99. package/dist/util/merge-json.d.ts +13 -2
  100. package/dist/util/merge-json.d.ts.map +1 -1
  101. package/dist/util/merge-json.js +24 -10
  102. package/dist/util/merge-json.js.map +1 -1
  103. package/dist/vault/list-handoffs.d.ts +13 -3
  104. package/dist/vault/list-handoffs.d.ts.map +1 -1
  105. package/dist/vault/list-handoffs.js +28 -13
  106. package/dist/vault/list-handoffs.js.map +1 -1
  107. package/dist/vault/list-notes.d.ts +12 -3
  108. package/dist/vault/list-notes.d.ts.map +1 -1
  109. package/dist/vault/list-notes.js +13 -7
  110. package/dist/vault/list-notes.js.map +1 -1
  111. package/dist/vault/list-plans.d.ts +12 -3
  112. package/dist/vault/list-plans.d.ts.map +1 -1
  113. package/dist/vault/list-plans.js +13 -7
  114. package/dist/vault/list-plans.js.map +1 -1
  115. package/dist/vault/search.d.ts.map +1 -1
  116. package/dist/vault/search.js +128 -24
  117. package/dist/vault/search.js.map +1 -1
  118. package/package.json +2 -2
  119. package/templates/agents/claude/skills/grounder-handoff/SKILL.md +73 -0
  120. package/templates/agents/claude/{commands/grounder-note.md → skills/grounder-note/SKILL.md} +6 -0
  121. package/templates/agents/claude/skills/grounder-overview/SKILL.md +21 -0
  122. package/templates/agents/claude/{commands/grounder-plan.md → skills/grounder-plan/SKILL.md} +6 -0
  123. package/templates/agents/claude/skills/grounder-recall/SKILL.md +34 -0
  124. package/templates/agents/claude/{commands/grounder-search.md → skills/grounder-search/SKILL.md} +16 -8
  125. package/templates/agents/cursor/skills/grounder-handoff/SKILL.md +73 -0
  126. package/templates/agents/cursor/{commands/grounder-note.md → skills/grounder-note/SKILL.md} +6 -0
  127. package/templates/agents/cursor/skills/grounder-overview/SKILL.md +21 -0
  128. package/templates/agents/cursor/{commands/grounder-plan.md → skills/grounder-plan/SKILL.md} +6 -0
  129. package/templates/agents/cursor/skills/grounder-recall/SKILL.md +34 -0
  130. package/templates/agents/cursor/{commands/grounder-search.md → skills/grounder-search/SKILL.md} +16 -8
  131. package/templates/vault/plan.md +1 -1
  132. package/templates/vault/session-handoff.md +2 -1
  133. package/dist/agents/install-command.d.ts +0 -35
  134. package/dist/agents/install-command.d.ts.map +0 -1
  135. package/dist/agents/install-command.js +0 -65
  136. package/dist/agents/install-command.js.map +0 -1
  137. package/dist/commands/apply-agent-installs.d.ts +0 -34
  138. package/dist/commands/apply-agent-installs.d.ts.map +0 -1
  139. package/dist/commands/apply-agent-installs.js +0 -137
  140. package/dist/commands/apply-agent-installs.js.map +0 -1
  141. package/templates/agents/claude/commands/grounder-task-handoff.md +0 -58
  142. package/templates/agents/claude/commands/grounder-task.md +0 -22
  143. package/templates/agents/cursor/commands/grounder-task-handoff.md +0 -58
  144. package/templates/agents/cursor/commands/grounder-task.md +0 -22
@@ -1,65 +0,0 @@
1
- import { mkdir, readFile, writeFile } from "node:fs/promises";
2
- import path from "node:path";
3
- import { readGrounderState, recordAgentInstall, recordedFileHash } from "../connector/state.js";
4
- import { VERSION } from "../index.js";
5
- import { fileExists } from "../util/fs.js";
6
- import { hashContent } from "../util/hash.js";
7
- import { runtimeInvocation } from "./hook-runtime.js";
8
- /**
9
- * Install one slash-command markdown file with chezmoi-style drift detection.
10
- *
11
- * When the file already exists and `--force` is off:
12
- * - on-disk hash matches the ledger → safe to refresh to the new template
13
- * - no ledger hash, or on-disk hash differs → treat as user-edited (`modified`)
14
- */
15
- export async function installCommandFile(opts) {
16
- const dest = path.join(opts.commandsDir, opts.filename);
17
- const existed = await fileExists(dest);
18
- const template = await readFile(path.join(opts.templateDir, opts.filename), "utf8");
19
- const rendered = template.replaceAll("{{GROUNDER_CLI}}", runtimeInvocation(opts.homeDir));
20
- const renderedHash = hashContent(rendered);
21
- if (existed && !opts.force) {
22
- const onDisk = await readFile(dest, "utf8");
23
- const onDiskHash = hashContent(onDisk);
24
- const state = await readGrounderState(opts.homeDir);
25
- const recorded = recordedFileHash(state, opts.agentId, dest);
26
- if (recorded !== undefined && recorded === onDiskHash) {
27
- // Untouched since Grounder last wrote it — safe to auto-update.
28
- if (onDiskHash === renderedHash) {
29
- return { dest, status: "skipped", hash: renderedHash };
30
- }
31
- if (!opts.dryRun) {
32
- await writeFile(dest, rendered);
33
- }
34
- return { dest, status: "overwritten", hash: renderedHash };
35
- }
36
- // Legacy (no hash) or user-edited — protect content.
37
- return { dest, status: "modified" };
38
- }
39
- if (!opts.dryRun) {
40
- await mkdir(path.dirname(dest), { recursive: true });
41
- await writeFile(dest, rendered);
42
- }
43
- return {
44
- dest,
45
- status: existed ? "overwritten" : "created",
46
- hash: renderedHash,
47
- };
48
- }
49
- /**
50
- * Persist per-file hashes after a command install. No-op when `files` is empty
51
- * or `dryRun` is set.
52
- */
53
- export async function recordCommandFileHashes(opts) {
54
- if (opts.dryRun || Object.keys(opts.files).length === 0) {
55
- return;
56
- }
57
- await recordAgentInstall({
58
- agentId: opts.agentId,
59
- commandsSchema: opts.commandsSchema,
60
- files: opts.files,
61
- grounderVersion: VERSION,
62
- homeDir: opts.homeDir,
63
- });
64
- }
65
- //# sourceMappingURL=install-command.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install-command.js","sourceRoot":"","sources":["../../src/agents/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AE,IAAI,CAAC,OAAO;QACrB,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,eAAe,EAAE,OAAO;QACxB,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAC,CAAC;AACL,CAAC"}
@@ -1,34 +0,0 @@
1
- import type { AgentAdapter, AgentInstallResult, ArtifactStatus } from "../agents/types.js";
2
- export interface ApplyAgentInstallsOptions {
3
- agents: AgentAdapter[];
4
- force?: boolean;
5
- /** Explicitly install/refresh session hooks (setup --hooks / migrate --hooks). */
6
- hooks?: boolean;
7
- /**
8
- * When true (migrate), also refresh hooks that were previously recorded or
9
- * already present on disk — without installing hooks for agents that never
10
- * opted in.
11
- */
12
- refreshInstalledHooks?: boolean;
13
- dryRun?: boolean;
14
- homeDir?: string;
15
- }
16
- export interface AgentApplyResult {
17
- agent: AgentAdapter;
18
- commands: AgentInstallResult;
19
- hooks?: AgentInstallResult;
20
- }
21
- export interface ApplyAgentInstallsResult {
22
- runtime?: {
23
- cliPath: string;
24
- status: ArtifactStatus;
25
- mode: "symlink" | "copy";
26
- };
27
- agents: AgentApplyResult[];
28
- }
29
- /**
30
- * Materialize runtime + install/refresh agent command (and optional hook)
31
- * artifacts. Shared by `grounder setup` and `grounder migrate`.
32
- */
33
- export declare function applyAgentInstalls(opts: ApplyAgentInstallsOptions): Promise<ApplyAgentInstallsResult>;
34
- //# sourceMappingURL=apply-agent-installs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apply-agent-installs.d.ts","sourceRoot":"","sources":["../../src/commands/apply-agent-installs.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAS3F,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC5B;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAA;KAAE,CAAC;IAChF,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AA+DD;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,wBAAwB,CAAC,CA6FnC"}
@@ -1,137 +0,0 @@
1
- import { hookFileHasGrounderEntry, installHookRuntime, runtimeCliPath, } from "../agents/hook-runtime.js";
2
- import { recordAgentInstallState } from "../agents/index.js";
3
- import { assertAgentSchemasSupported, readGrounderState, recordedHooksSchema, statePath, } from "../connector/state.js";
4
- async function agentHasInstalledHooks(agent, homeDir) {
5
- if (!agent.expectedHookArtifacts) {
6
- return false;
7
- }
8
- const paths = agent.expectedHookArtifacts(homeDir);
9
- for (const p of paths) {
10
- if (await hookFileHasGrounderEntry(p)) {
11
- return true;
12
- }
13
- }
14
- return false;
15
- }
16
- async function shouldInstallHooks(agent, opts, state) {
17
- if (!agent.installHooks) {
18
- return false;
19
- }
20
- if (opts.hooks) {
21
- return true;
22
- }
23
- if (!opts.refreshInstalledHooks) {
24
- return false;
25
- }
26
- if (recordedHooksSchema(state, agent.id) > 0) {
27
- return true;
28
- }
29
- return agentHasInstalledHooks(agent, opts.homeDir);
30
- }
31
- function commandLabel(status, artifactPath, dryRun) {
32
- switch (status) {
33
- case "skipped":
34
- return dryRun ? "would skip (already current)" : "already current (skipped)";
35
- case "modified":
36
- return dryRun
37
- ? `would skip locally modified (needs --force): ${artifactPath}`
38
- : `locally modified (skipped — use --force): ${artifactPath}`;
39
- case "created":
40
- return dryRun ? `would install: ${artifactPath}` : `installed: ${artifactPath}`;
41
- case "overwritten":
42
- return dryRun ? `would update: ${artifactPath}` : `updated: ${artifactPath}`;
43
- }
44
- }
45
- function hookLabel(status, artifactPath, dryRun) {
46
- switch (status) {
47
- case "skipped":
48
- return dryRun ? "would skip (already current)" : "already exists (skipped)";
49
- case "created":
50
- return dryRun ? `would install: ${artifactPath}` : `installed: ${artifactPath}`;
51
- case "overwritten":
52
- return dryRun ? `would update: ${artifactPath}` : `updated: ${artifactPath}`;
53
- case "modified":
54
- return dryRun ? `would skip: ${artifactPath}` : `skipped: ${artifactPath}`;
55
- }
56
- }
57
- /**
58
- * Materialize runtime + install/refresh agent command (and optional hook)
59
- * artifacts. Shared by `grounder setup` and `grounder migrate`.
60
- */
61
- export async function applyAgentInstalls(opts) {
62
- const force = opts.force ?? false;
63
- const dryRun = opts.dryRun ?? false;
64
- const homeDir = opts.homeDir;
65
- const agents = opts.agents;
66
- const state = await readGrounderState(homeDir);
67
- assertAgentSchemasSupported(state, agents);
68
- let runtime;
69
- if (agents.length > 0) {
70
- if (dryRun) {
71
- process.stdout.write(`✓ Grounder runtime would refresh: ${runtimeCliPath(homeDir)}\n`);
72
- }
73
- else {
74
- runtime = await installHookRuntime({ homeDir });
75
- const runtimeLabel = runtime.status === "skipped"
76
- ? "already exists (skipped)"
77
- : `installed (${runtime.mode}): ${runtime.cliPath}`;
78
- process.stdout.write(`✓ Grounder runtime ${runtimeLabel}\n`);
79
- }
80
- }
81
- const results = [];
82
- for (const agent of agents) {
83
- const commands = await agent.install({ force, dryRun, homeDir });
84
- for (const [artifactPath, status] of Object.entries(commands.artifacts)) {
85
- process.stdout.write(`✓ ${agent.name} command ${commandLabel(status, artifactPath, dryRun)}\n`);
86
- }
87
- if (Object.keys(commands.artifacts).length === 0) {
88
- process.stdout.write(`✓ ${agent.name}: no artifacts to install yet\n`);
89
- }
90
- let hooksResult;
91
- let hooksInstalled = false;
92
- if (await shouldInstallHooks(agent, opts, state)) {
93
- const installHooks = agent.installHooks;
94
- if (installHooks) {
95
- hooksResult = await installHooks({ force, dryRun, homeDir });
96
- hooksInstalled = true;
97
- for (const [artifactPath, status] of Object.entries(hooksResult.artifacts)) {
98
- process.stdout.write(`✓ ${agent.name} hook ${hookLabel(status, artifactPath, dryRun)}\n`);
99
- }
100
- }
101
- }
102
- if (!dryRun) {
103
- const statuses = Object.values(commands.artifacts);
104
- // Only bump the commands version in state when at least one file was
105
- // written or already up to date. If every file was skipped as locally
106
- // edited (or from before Grounder tracked hashes), do not mark state as
107
- // current — otherwise plain migrate would silence doctor while leaving
108
- // those old command files untouched.
109
- const advanceCommandsSchema = statuses.length === 0 || statuses.some((status) => status !== "modified");
110
- await recordAgentInstallState(agent, {
111
- hooksInstalled,
112
- homeDir,
113
- advanceCommandsSchema,
114
- });
115
- }
116
- results.push({ agent, commands, hooks: hooksResult });
117
- }
118
- if (agents.length > 0) {
119
- const ledger = statePath(homeDir);
120
- if (dryRun) {
121
- process.stdout.write(state
122
- ? `✓ Install state would update: ${ledger}\n`
123
- : `✓ Install state would create: ${ledger}\n`);
124
- }
125
- else {
126
- process.stdout.write(state ? `✓ Install state updated: ${ledger}\n` : `✓ Install state created: ${ledger}\n`);
127
- }
128
- }
129
- const modifiedWithoutForce = !force &&
130
- results.some((r) => Object.values(r.commands.artifacts).some((s) => s === "modified"));
131
- if (modifiedWithoutForce) {
132
- process.stdout.write("\nNote: some command files were left alone (local edits, or an install from before Grounder 0.3).\n" +
133
- " To refresh them: grounder migrate --force\n");
134
- }
135
- return { runtime, agents: results };
136
- }
137
- //# sourceMappingURL=apply-agent-installs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apply-agent-installs.js","sourceRoot":"","sources":["../../src/commands/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AqB;aACtB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,KAAK;gBACH,CAAC,CAAC,iCAAiC,MAAM,IAAI;gBAC7C,CAAC,CAAC,iCAAiC,MAAM,IAAI,CAChD,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,KAAK,CAAC,CAAC,CAAC,4BAA4B,MAAM,IAAI,CAAC,CAAC,CAAC,4BAA4B,MAAM,IAAI,CACxF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,oBAAoB,GACxB,CAAC,KAAK;QACN,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC;IACzF,IAAI,oBAAoB,EAAE,CAAC;QACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,qGAAqG;YACnG,+CAA+C,CAClD,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACtC,CAAC"}
@@ -1,58 +0,0 @@
1
- Write a session handoff checkpoint to the markdown vault for this project.
2
-
3
- Summarize the session into a structured handoff — not a chat transcript.
4
- Do not dump tool traces, full conversation, or false starts.
5
-
6
- Build a markdown body with these sections (lean; roughly half a screen to one screen):
7
-
8
- ```markdown
9
- # Handoff: <short label>
10
-
11
- ## Done
12
- - …
13
-
14
- ## Next
15
- 1. … # ordered; most important section for resume — required
16
- 2. …
17
-
18
- ## Blockers
19
- - None | …
20
-
21
- ## Decisions
22
- - … # include rejected alternatives / pitfalls when useful
23
-
24
- ## Files
25
- - path/to/relevant.ts
26
- ```
27
-
28
- Rules:
29
- - **Next is mandatory and ordered** — if only one section is read, this is it
30
- - Empty sections are OK (`Blockers: None` beats omission)
31
- - Few concrete file paths, not an exhaustive diff
32
-
33
- Then run from the linked project folder or any subdirectory beneath it:
34
-
35
- {{GROUNDER_CLI}} handoff "<body>"
36
-
37
- Optional short title slug (filename + frontmatter):
38
-
39
- {{GROUNDER_CLI}} handoff --title <slug> "<body>"
40
-
41
- Always include `--topics` with 3-5 comma-separated lowercase keywords that capture the session's core concepts (e.g. `--topics "auth,middleware,jwt,session"`). Pick terms a future search would use — concrete nouns and technical terms, not verbs or filler:
42
-
43
- {{GROUNDER_CLI}} handoff --topics "keyword1,keyword2,keyword3" "<body>"
44
-
45
- For multi-line bodies, prefer a shell heredoc so quoting does not break:
46
-
47
- ```bash
48
- {{GROUNDER_CLI}} handoff "$(cat <<'EOF'
49
- # Handoff: …
50
-
51
- EOF
52
- )"
53
- ```
54
-
55
- The vault is outside the workspace — grant shell permissions if Claude Code prompts you.
56
-
57
- Do not compute vault paths or write files yourself — the CLI handles it.
58
- Report the CLI output path from stdout to the user.
@@ -1,22 +0,0 @@
1
- Hydrate this session from the latest vault handoff and repo truth.
2
-
3
- Read-only — do not write to the vault. Do not invent vault paths.
4
-
5
- **Special case: the instruction asks to view existing handoffs, not hydrate** (`list`, `list 3 oldest`, `show handoffs`, etc.) → run `{{GROUNDER_CLI}} handoff list --limit <N> --markdown` (N = count named, else 5; ignore order words like "oldest" — output is always newest-first, never resort or relabel it) and stop — no hydrate, no `AGENTS.md`, no “start work.” Relay the CLI stdout as-is (it already includes the count header; title lines are clickable `[relativePath](fileUri)` links).
6
-
7
- Otherwise, from the linked project folder or any subdirectory beneath it:
8
-
9
- 1. Get the current handoff (skips empty/unreadable files, same pick as the session-start teaser):
10
-
11
- {{GROUNDER_CLI}} handoff list --head
12
-
13
- 2. If empty: tell the user there are no handoffs yet, then read repo `AGENTS.md` only and proceed.
14
-
15
- 3. Otherwise, read that file. If the user names a specific session instead: `{{GROUNDER_CLI}} handoff list --limit 5 --markdown` → match name/index to the indented absolute path in *this* listing (positional, not a stable id). Miss → once with `--limit 50 --markdown` (*that* listing only). Still miss → tell the user and stop — no guessed hydrate.
16
-
17
- 4. Read repo `AGENTS.md` (project conventions and constraints).
18
-
19
- 5. Summarize briefly what is next (from the handoff `## Next` section when present), then start work.
20
-
21
- The vault is outside the workspace — grant shell permissions if Claude Code prompts you.
22
- Use free-text after `/grounder-task` as optional focus (session name, index, or task hint).
@@ -1,58 +0,0 @@
1
- Write a session handoff checkpoint to the markdown vault for this project.
2
-
3
- Summarize the session into a structured handoff — not a chat transcript.
4
- Do not dump tool traces, full conversation, or false starts.
5
-
6
- Build a markdown body with these sections (lean; roughly half a screen to one screen):
7
-
8
- ```markdown
9
- # Handoff: <short label>
10
-
11
- ## Done
12
- - …
13
-
14
- ## Next
15
- 1. … # ordered; most important section for resume — required
16
- 2. …
17
-
18
- ## Blockers
19
- - None | …
20
-
21
- ## Decisions
22
- - … # include rejected alternatives / pitfalls when useful
23
-
24
- ## Files
25
- - path/to/relevant.ts
26
- ```
27
-
28
- Rules:
29
- - **Next is mandatory and ordered** — if only one section is read, this is it
30
- - Empty sections are OK (`Blockers: None` beats omission)
31
- - Few concrete file paths, not an exhaustive diff
32
-
33
- Then run from the linked project folder or any subdirectory beneath it:
34
-
35
- {{GROUNDER_CLI}} handoff "<body>"
36
-
37
- Optional short title slug (filename + frontmatter):
38
-
39
- {{GROUNDER_CLI}} handoff --title <slug> "<body>"
40
-
41
- Always include `--topics` with 3-5 comma-separated lowercase keywords that capture the session's core concepts (e.g. `--topics "auth,middleware,jwt,session"`). Pick terms a future search would use — concrete nouns and technical terms, not verbs or filler:
42
-
43
- {{GROUNDER_CLI}} handoff --topics "keyword1,keyword2,keyword3" "<body>"
44
-
45
- For multi-line bodies, prefer a shell heredoc so quoting does not break:
46
-
47
- ```bash
48
- {{GROUNDER_CLI}} handoff "$(cat <<'EOF'
49
- # Handoff: …
50
-
51
- EOF
52
- )"
53
- ```
54
-
55
- Run {{GROUNDER_CLI}} with `required_permissions: ["all"]` (vault is outside the workspace).
56
-
57
- Do not compute vault paths or write files yourself — the CLI handles it.
58
- Report the CLI output path from stdout to the user.
@@ -1,22 +0,0 @@
1
- Hydrate this session from the latest vault handoff and repo truth.
2
-
3
- Read-only — do not write to the vault. Do not invent vault paths.
4
-
5
- **Special case: the instruction asks to view existing handoffs, not hydrate** (`list`, `list 3 oldest`, `show handoffs`, etc.) → run `{{GROUNDER_CLI}} handoff list --limit <N> --markdown` (N = count named, else 5; ignore order words like "oldest" — output is always newest-first, never resort or relabel it) and stop — no hydrate, no `AGENTS.md`, no “start work.” Relay the CLI stdout as-is (it already includes the count header; title lines are clickable `[relativePath](fileUri)` links).
6
-
7
- Otherwise, from the linked project folder or any subdirectory beneath it:
8
-
9
- 1. Get the current handoff (skips empty/unreadable files, same pick as the session-start teaser):
10
-
11
- {{GROUNDER_CLI}} handoff list --head
12
-
13
- 2. If empty: tell the user there are no handoffs yet, then read repo `AGENTS.md` only and proceed.
14
-
15
- 3. Otherwise, read that file. If the user names a specific session instead: `{{GROUNDER_CLI}} handoff list --limit 5 --markdown` → match name/index to the indented absolute path in *this* listing (positional, not a stable id). Miss → once with `--limit 50 --markdown` (*that* listing only). Still miss → tell the user and stop — no guessed hydrate.
16
-
17
- 4. Read repo `AGENTS.md` (project conventions and constraints).
18
-
19
- 5. Summarize briefly what is next (from the handoff `## Next` section when present), then start work.
20
-
21
- Run {{GROUNDER_CLI}} with `required_permissions: ["all"]` (vault is outside the workspace).
22
- Use free-text after `/grounder-task` as optional focus (session name, index, or task hint).