pi-gsd 1.1.0 → 1.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/.gsd/extensions/gsd-hooks.ts +270 -12
- package/README.md +45 -44
- package/dist/{gsd-tools.js → pi-gsd-tools.js} +54 -54
- package/package.json +11 -7
- package/prompts/gsd-add-backlog.md +6 -0
- package/prompts/gsd-add-phase.md +6 -0
- package/prompts/gsd-add-tests.md +6 -0
- package/prompts/gsd-add-todo.md +6 -0
- package/prompts/gsd-audit-milestone.md +6 -0
- package/prompts/gsd-audit-uat.md +6 -0
- package/prompts/gsd-autonomous.md +6 -0
- package/prompts/gsd-check-todos.md +6 -0
- package/prompts/gsd-cleanup.md +6 -0
- package/prompts/gsd-complete-milestone.md +6 -0
- package/prompts/gsd-debug.md +6 -0
- package/prompts/gsd-discuss-phase.md +6 -0
- package/prompts/gsd-do.md +6 -0
- package/prompts/gsd-execute-phase.md +6 -0
- package/prompts/gsd-fast.md +6 -0
- package/prompts/gsd-forensics.md +6 -0
- package/prompts/gsd-insert-phase.md +6 -0
- package/prompts/gsd-join-discord.md +6 -0
- package/prompts/gsd-list-phase-assumptions.md +6 -0
- package/prompts/gsd-list-workspaces.md +6 -0
- package/prompts/gsd-manager.md +6 -0
- package/prompts/gsd-map-codebase.md +6 -0
- package/prompts/gsd-milestone-summary.md +6 -0
- package/prompts/gsd-new-milestone.md +6 -0
- package/prompts/gsd-new-project.md +6 -0
- package/prompts/gsd-new-workspace.md +6 -0
- package/prompts/gsd-next.md +6 -0
- package/prompts/gsd-note.md +6 -0
- package/prompts/gsd-pause-work.md +6 -0
- package/prompts/gsd-plan-milestone-gaps.md +6 -0
- package/prompts/gsd-plan-phase.md +6 -0
- package/prompts/gsd-plant-seed.md +6 -0
- package/prompts/gsd-pr-branch.md +6 -0
- package/prompts/gsd-profile-user.md +6 -0
- package/prompts/gsd-quick.md +6 -0
- package/prompts/gsd-reapply-patches.md +6 -0
- package/prompts/gsd-remove-phase.md +6 -0
- package/prompts/gsd-remove-workspace.md +6 -0
- package/prompts/gsd-research-phase.md +6 -0
- package/prompts/gsd-resume-work.md +6 -0
- package/prompts/gsd-review-backlog.md +6 -0
- package/prompts/gsd-review.md +6 -0
- package/prompts/gsd-session-report.md +6 -0
- package/prompts/gsd-set-profile.md +6 -0
- package/prompts/gsd-settings.md +6 -0
- package/prompts/gsd-setup-pi.md +6 -0
- package/prompts/gsd-ship.md +6 -0
- package/prompts/gsd-thread.md +6 -0
- package/prompts/gsd-ui-phase.md +6 -0
- package/prompts/gsd-ui-review.md +6 -0
- package/prompts/gsd-update.md +6 -0
- package/prompts/gsd-validate-phase.md +6 -0
- package/prompts/gsd-verify-work.md +6 -0
- package/prompts/gsd-workstreams.md +6 -0
- package/scripts/postinstall.js +32 -57
- package/skills/gsd-add-backlog/SKILL.md +3 -3
- package/skills/gsd-add-phase/SKILL.md +2 -2
- package/skills/gsd-add-tests/SKILL.md +2 -2
- package/skills/gsd-add-todo/SKILL.md +2 -2
- package/skills/gsd-audit-milestone/SKILL.md +2 -2
- package/skills/gsd-audit-uat/SKILL.md +1 -1
- package/skills/gsd-autonomous/SKILL.md +4 -4
- package/skills/gsd-check-todos/SKILL.md +2 -2
- package/skills/gsd-cleanup/SKILL.md +2 -2
- package/skills/gsd-complete-milestone/SKILL.md +2 -2
- package/skills/gsd-debug/SKILL.md +2 -2
- package/skills/gsd-discuss-phase/SKILL.md +6 -6
- package/skills/gsd-do/SKILL.md +3 -3
- package/skills/gsd-execute-phase/SKILL.md +4 -4
- package/skills/gsd-fast/SKILL.md +2 -2
- package/skills/gsd-forensics/SKILL.md +2 -2
- package/skills/gsd-health/SKILL.md +4 -4
- package/skills/gsd-help/SKILL.md +2 -2
- package/skills/gsd-insert-phase/SKILL.md +2 -2
- package/skills/gsd-list-phase-assumptions/SKILL.md +1 -1
- package/skills/gsd-list-workspaces/SKILL.md +3 -3
- package/skills/gsd-manager/SKILL.md +4 -4
- package/skills/gsd-map-codebase/SKILL.md +1 -1
- package/skills/gsd-milestone-summary/SKILL.md +2 -2
- package/skills/gsd-new-milestone/SKILL.md +6 -6
- package/skills/gsd-new-project/SKILL.md +6 -6
- package/skills/gsd-new-workspace/SKILL.md +3 -3
- package/skills/gsd-next/SKILL.md +2 -2
- package/skills/gsd-note/SKILL.md +3 -3
- package/skills/gsd-pause-work/SKILL.md +2 -2
- package/skills/gsd-plan-milestone-gaps/SKILL.md +2 -2
- package/skills/gsd-plan-phase/SKILL.md +3 -3
- package/skills/gsd-plant-seed/SKILL.md +2 -2
- package/skills/gsd-pr-branch/SKILL.md +2 -2
- package/skills/gsd-profile-user/SKILL.md +2 -2
- package/skills/gsd-progress/SKILL.md +4 -4
- package/skills/gsd-quick/SKILL.md +2 -2
- package/skills/gsd-remove-phase/SKILL.md +2 -2
- package/skills/gsd-remove-workspace/SKILL.md +3 -3
- package/skills/gsd-research-phase/SKILL.md +3 -3
- package/skills/gsd-resume-work/SKILL.md +2 -2
- package/skills/gsd-review/SKILL.md +2 -2
- package/skills/gsd-review-backlog/SKILL.md +2 -2
- package/skills/gsd-session-report/SKILL.md +2 -2
- package/skills/gsd-set-profile/SKILL.md +1 -1
- package/skills/gsd-settings/SKILL.md +2 -2
- package/skills/gsd-setup-pi/SKILL.md +15 -13
- package/skills/gsd-ship/SKILL.md +2 -2
- package/skills/gsd-stats/SKILL.md +4 -4
- package/skills/gsd-thread/SKILL.md +2 -2
- package/skills/gsd-ui-phase/SKILL.md +3 -3
- package/skills/gsd-ui-review/SKILL.md +3 -3
- package/skills/gsd-update/SKILL.md +2 -2
- package/skills/gsd-validate-phase/SKILL.md +2 -2
- package/skills/gsd-verify-work/SKILL.md +3 -3
- package/skills/gsd-workstreams/SKILL.md +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* gsd-hooks.ts
|
|
2
|
+
* gsd-hooks.ts - GSD pi Extension
|
|
3
3
|
* gsd-extension-version: 1.30.0
|
|
4
4
|
*
|
|
5
5
|
* Pi lifecycle extension for the Get Shit Done (GSD) workflow framework.
|
|
@@ -49,10 +49,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
// Cache is fresh
|
|
52
|
+
// Cache is fresh - skip network check
|
|
53
53
|
if (ageSeconds < CACHE_TTL_SECONDS) return;
|
|
54
54
|
} catch {
|
|
55
|
-
// Corrupt cache
|
|
55
|
+
// Corrupt cache - fall through to fresh check
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -64,8 +64,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
64
64
|
// Resolve installed version from project or global GSD install
|
|
65
65
|
let installed = "0.0.0";
|
|
66
66
|
const versionPaths = [
|
|
67
|
-
join(ctx.cwd, ".pi", "
|
|
68
|
-
join(homedir(), ".pi", "
|
|
67
|
+
join(ctx.cwd, ".pi", "gsd", "VERSION"),
|
|
68
|
+
join(homedir(), ".pi", "gsd", "VERSION"),
|
|
69
69
|
];
|
|
70
70
|
for (const vp of versionPaths) {
|
|
71
71
|
if (existsSync(vp)) {
|
|
@@ -106,7 +106,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
106
106
|
}
|
|
107
107
|
}, 3_000);
|
|
108
108
|
} catch {
|
|
109
|
-
/* silent fail
|
|
109
|
+
/* silent fail - never throw from session_start */
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
|
|
@@ -145,20 +145,278 @@ export default function (pi: ExtensionAPI) {
|
|
|
145
145
|
return undefined;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
// Advisory only
|
|
148
|
+
// Advisory only - never block tool execution
|
|
149
149
|
const fileName = filePath.split("/").pop() ?? filePath;
|
|
150
150
|
ctx.ui.notify(
|
|
151
151
|
`⚠️ GSD: Editing ${fileName} outside a GSD workflow. Consider /gsd-fast or /gsd-quick to maintain state tracking.`,
|
|
152
152
|
"info",
|
|
153
153
|
);
|
|
154
154
|
} catch {
|
|
155
|
-
/* silent fail
|
|
155
|
+
/* silent fail - never block tool execution */
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
return undefined;
|
|
159
159
|
});
|
|
160
160
|
|
|
161
|
-
// ──
|
|
161
|
+
// ── Instant commands (zero LLM, deterministic output) ────────────────────
|
|
162
|
+
|
|
163
|
+
// JSON shapes returned by pi-gsd-tools
|
|
164
|
+
interface GsdPhase {
|
|
165
|
+
number: string;
|
|
166
|
+
name: string;
|
|
167
|
+
plans: number;
|
|
168
|
+
summaries: number;
|
|
169
|
+
status: string;
|
|
170
|
+
}
|
|
171
|
+
interface GsdProgress {
|
|
172
|
+
milestone_version: string;
|
|
173
|
+
milestone_name: string;
|
|
174
|
+
phases: GsdPhase[];
|
|
175
|
+
total_plans: number;
|
|
176
|
+
total_summaries: number;
|
|
177
|
+
percent: number;
|
|
178
|
+
}
|
|
179
|
+
interface GsdStats extends GsdProgress {
|
|
180
|
+
phases_completed: number;
|
|
181
|
+
phases_total: number;
|
|
182
|
+
plan_percent: number;
|
|
183
|
+
requirements_total: number;
|
|
184
|
+
requirements_complete: number;
|
|
185
|
+
git_commits: number;
|
|
186
|
+
git_first_commit_date: string;
|
|
187
|
+
last_activity: string;
|
|
188
|
+
}
|
|
189
|
+
interface GsdState {
|
|
190
|
+
milestone: string;
|
|
191
|
+
milestone_name: string;
|
|
192
|
+
status: string;
|
|
193
|
+
last_activity: string;
|
|
194
|
+
progress: {
|
|
195
|
+
total_phases: string;
|
|
196
|
+
completed_phases: string;
|
|
197
|
+
total_plans: string;
|
|
198
|
+
completed_plans: string;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
interface GsdHealth {
|
|
202
|
+
status: string;
|
|
203
|
+
errors: Array<{ code: string; message: string; repair?: string }>;
|
|
204
|
+
warnings: Array<{ code: string; message: string }>;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const runJson = <T>(args: string, cwd: string): T | null => {
|
|
208
|
+
try {
|
|
209
|
+
const raw = execSync(
|
|
210
|
+
`pi-gsd-tools ${args} --raw --cwd ${JSON.stringify(cwd)}`,
|
|
211
|
+
{ encoding: "utf8", timeout: 10_000, windowsHide: true },
|
|
212
|
+
).trim();
|
|
213
|
+
return JSON.parse(raw) as T;
|
|
214
|
+
} catch {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const bar = (pct: number, width = 20): string => {
|
|
220
|
+
const filled = Math.round((pct / 100) * width);
|
|
221
|
+
return "█".repeat(filled) + "░".repeat(width - filled);
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
const cap = (s: string, max = 42): string =>
|
|
225
|
+
s.length > max ? s.slice(0, max - 1) + "…" : s;
|
|
226
|
+
|
|
227
|
+
/** Derive the next GSD action from phase data — no LLM needed. */
|
|
228
|
+
const nextSteps = (phases: GsdPhase[]): string[] => {
|
|
229
|
+
const pending = phases.filter((p) => p.status !== "Complete");
|
|
230
|
+
if (pending.length === 0) {
|
|
231
|
+
return [
|
|
232
|
+
" ✅ All phases complete!",
|
|
233
|
+
" → /gsd-audit-milestone Review before archiving",
|
|
234
|
+
" → /gsd-complete-milestone Archive and start next",
|
|
235
|
+
];
|
|
236
|
+
}
|
|
237
|
+
const next = pending[0];
|
|
238
|
+
const n = next.number;
|
|
239
|
+
const lines: string[] = [` ⏳ Phase ${n}: ${cap(next.name)}`];
|
|
240
|
+
if (next.plans === 0) {
|
|
241
|
+
lines.push(` → /gsd-discuss-phase ${n} Gather context first`);
|
|
242
|
+
lines.push(` → /gsd-plan-phase ${n} Jump straight to planning`);
|
|
243
|
+
} else if (next.summaries < next.plans) {
|
|
244
|
+
lines.push(` → /gsd-execute-phase ${n} ${next.summaries}/${next.plans} plans done`);
|
|
245
|
+
} else {
|
|
246
|
+
lines.push(` → /gsd-verify-work ${n} All plans done, verify UAT`);
|
|
247
|
+
}
|
|
248
|
+
lines.push(` → /gsd-next Auto-advance`);
|
|
249
|
+
if (pending.length > 1) {
|
|
250
|
+
lines.push(
|
|
251
|
+
` (+ ${pending.length - 1} more phase${pending.length > 2 ? "s" : ""} pending)`,
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
return lines;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
const formatProgress = (cwd: string): string => {
|
|
258
|
+
const data = runJson<GsdProgress>("progress json", cwd);
|
|
259
|
+
if (!data)
|
|
260
|
+
return "❌ No GSD project found. Run /gsd-new-project to initialise.";
|
|
261
|
+
|
|
262
|
+
const phasePct = data.percent ?? 0;
|
|
263
|
+
const planPct =
|
|
264
|
+
data.total_plans > 0
|
|
265
|
+
? Math.round((data.total_summaries / data.total_plans) * 100)
|
|
266
|
+
: 0;
|
|
267
|
+
const done = data.phases.filter((p) => p.status === "Complete").length;
|
|
268
|
+
const total = data.phases.length;
|
|
269
|
+
|
|
270
|
+
const lines = [
|
|
271
|
+
`━━ GSD Progress ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
272
|
+
`📋 ${data.milestone_name} (${data.milestone_version})`,
|
|
273
|
+
``,
|
|
274
|
+
`Phases ${bar(phasePct)} ${done}/${total} (${phasePct}%)`,
|
|
275
|
+
`Plans ${bar(planPct)} ${data.total_summaries}/${data.total_plans} (${planPct}%)`,
|
|
276
|
+
``,
|
|
277
|
+
`Next steps:`,
|
|
278
|
+
...nextSteps(data.phases),
|
|
279
|
+
``,
|
|
280
|
+
`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
281
|
+
];
|
|
282
|
+
return lines.join("\n");
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
const formatStats = (cwd: string): string => {
|
|
286
|
+
const data = runJson<GsdStats>("stats json", cwd);
|
|
287
|
+
if (!data)
|
|
288
|
+
return "❌ No GSD project found. Run /gsd-new-project to initialise.";
|
|
289
|
+
|
|
290
|
+
const reqPct =
|
|
291
|
+
data.requirements_total > 0
|
|
292
|
+
? Math.round(
|
|
293
|
+
(data.requirements_complete / data.requirements_total) * 100,
|
|
294
|
+
)
|
|
295
|
+
: 0;
|
|
296
|
+
|
|
297
|
+
const lines = [
|
|
298
|
+
`━━ GSD Stats ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
299
|
+
`📋 ${data.milestone_name} (${data.milestone_version})`,
|
|
300
|
+
``,
|
|
301
|
+
`Phases ${bar(data.percent)} ${data.phases_completed}/${data.phases_total} (${data.percent}%)`,
|
|
302
|
+
`Plans ${bar(data.plan_percent)} ${data.total_summaries}/${data.total_plans} (${data.plan_percent}%)`,
|
|
303
|
+
`Reqs ${bar(reqPct)} ${data.requirements_complete}/${data.requirements_total} (${reqPct}%)`,
|
|
304
|
+
``,
|
|
305
|
+
`🗂 Git commits: ${data.git_commits}`,
|
|
306
|
+
`📅 Started: ${data.git_first_commit_date}`,
|
|
307
|
+
`📅 Last activity: ${data.last_activity}`,
|
|
308
|
+
``,
|
|
309
|
+
`Next steps:`,
|
|
310
|
+
...nextSteps(data.phases),
|
|
311
|
+
``,
|
|
312
|
+
`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
313
|
+
];
|
|
314
|
+
return lines.join("\n");
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
const formatHealth = (cwd: string, repair: boolean): string => {
|
|
318
|
+
const data = runJson<GsdHealth>(
|
|
319
|
+
`validate health${repair ? " --repair" : ""}`,
|
|
320
|
+
cwd,
|
|
321
|
+
);
|
|
322
|
+
if (!data)
|
|
323
|
+
return "❌ No GSD project found. Run /gsd-new-project to initialise.";
|
|
324
|
+
|
|
325
|
+
const icon =
|
|
326
|
+
data.status === "ok" ? "✅" : data.status === "broken" ? "❌" : "⚠️";
|
|
327
|
+
const lines = [
|
|
328
|
+
`━━ GSD Health ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
|
|
329
|
+
`${icon} Status: ${data.status.toUpperCase()}`,
|
|
330
|
+
];
|
|
331
|
+
|
|
332
|
+
if (data.errors?.length) {
|
|
333
|
+
lines.push(``, `Errors (${data.errors.length}):`);
|
|
334
|
+
for (const e of data.errors) {
|
|
335
|
+
lines.push(` ✗ [${e.code}] ${e.message}`);
|
|
336
|
+
if (e.repair) lines.push(` fix: ${e.repair}`);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
if (data.warnings?.length) {
|
|
340
|
+
lines.push(``, `Warnings (${data.warnings.length}):`);
|
|
341
|
+
for (const w of data.warnings) {
|
|
342
|
+
lines.push(` ⚠ [${w.code}] ${w.message}`);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (data.status !== "ok" && !repair) {
|
|
346
|
+
lines.push(``, ` → /gsd-health --repair Auto-fix all issues`);
|
|
347
|
+
}
|
|
348
|
+
lines.push(``, `━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);
|
|
349
|
+
return lines.join("\n");
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
pi.registerCommand("gsd-progress", {
|
|
353
|
+
description: "Show project progress with next steps (instant)",
|
|
354
|
+
handler: async (_args, ctx) => {
|
|
355
|
+
ctx.ui.notify(formatProgress(ctx.cwd), "info");
|
|
356
|
+
},
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
pi.registerCommand("gsd-stats", {
|
|
360
|
+
description: "Show project statistics (instant)",
|
|
361
|
+
handler: async (_args, ctx) => {
|
|
362
|
+
ctx.ui.notify(formatStats(ctx.cwd), "info");
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
pi.registerCommand("gsd-health", {
|
|
367
|
+
description: "Check .planning/ integrity (instant)",
|
|
368
|
+
handler: async (args, ctx) => {
|
|
369
|
+
ctx.ui.notify(formatHealth(ctx.cwd, !!args?.includes("--repair")), "info");
|
|
370
|
+
},
|
|
371
|
+
getArgumentCompletions: (prefix) => {
|
|
372
|
+
const options = [{ value: "--repair", label: "--repair Auto-fix issues" }];
|
|
373
|
+
return options.filter((o) => o.value.startsWith(prefix));
|
|
374
|
+
},
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
pi.registerCommand("gsd-help", {
|
|
378
|
+
description: "List all GSD commands (instant)",
|
|
379
|
+
handler: async (_args, ctx) => {
|
|
380
|
+
ctx.ui.notify(
|
|
381
|
+
[
|
|
382
|
+
"━━ GSD Commands ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
|
|
383
|
+
"Lifecycle:",
|
|
384
|
+
" /gsd-new-project Initialise project",
|
|
385
|
+
" /gsd-new-milestone Start next milestone",
|
|
386
|
+
" /gsd-discuss-phase N Discuss before planning",
|
|
387
|
+
" /gsd-plan-phase N Create phase plan",
|
|
388
|
+
" /gsd-execute-phase N Execute phase",
|
|
389
|
+
" /gsd-verify-work N UAT testing",
|
|
390
|
+
" /gsd-validate-phase N Validate completion",
|
|
391
|
+
" /gsd-next Auto-advance",
|
|
392
|
+
" /gsd-autonomous Run all phases",
|
|
393
|
+
"",
|
|
394
|
+
"Quick:",
|
|
395
|
+
" /gsd-quick <task> Tracked ad-hoc task",
|
|
396
|
+
" /gsd-fast <task> Inline, no subagents",
|
|
397
|
+
" /gsd-do <text> Route automatically",
|
|
398
|
+
" /gsd-debug Debug session",
|
|
399
|
+
"",
|
|
400
|
+
"Instant (no LLM):",
|
|
401
|
+
" /gsd-progress Progress + next steps",
|
|
402
|
+
" /gsd-stats Full statistics",
|
|
403
|
+
" /gsd-health [--repair] .planning/ integrity",
|
|
404
|
+
" /gsd-help This list",
|
|
405
|
+
"",
|
|
406
|
+
"Management:",
|
|
407
|
+
" /gsd-setup-pi Wire pi extension",
|
|
408
|
+
" /gsd-set-profile <p> quality|balanced|budget",
|
|
409
|
+
" /gsd-settings Workflow toggles",
|
|
410
|
+
" /gsd-progress Roadmap overview",
|
|
411
|
+
"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
|
|
412
|
+
].join("\n"),
|
|
413
|
+
"info",
|
|
414
|
+
);
|
|
415
|
+
},
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
// ── tool_result: context usage monitor ───────────────────────────────────
|
|
162
420
|
const WARNING_THRESHOLD = 35; // warn when remaining % ≤ 35
|
|
163
421
|
const CRITICAL_THRESHOLD = 25; // critical when remaining % ≤ 25
|
|
164
422
|
const DEBOUNCE_CALLS = 5; // minimum tool uses between repeated warnings
|
|
@@ -174,7 +432,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
174
432
|
const usedPct = Math.round(usage.percent);
|
|
175
433
|
const remaining = 100 - usedPct;
|
|
176
434
|
|
|
177
|
-
// Below warning threshold
|
|
435
|
+
// Below warning threshold - just increment debounce counter
|
|
178
436
|
if (remaining > WARNING_THRESHOLD) {
|
|
179
437
|
callsSinceWarn++;
|
|
180
438
|
return undefined;
|
|
@@ -200,7 +458,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
200
458
|
|
|
201
459
|
callsSinceWarn++;
|
|
202
460
|
|
|
203
|
-
// Debounce
|
|
461
|
+
// Debounce - allow severity escalation (warning → critical bypasses debounce)
|
|
204
462
|
const severityEscalated =
|
|
205
463
|
currentLevel === "critical" && lastLevel === "warning";
|
|
206
464
|
if (
|
|
@@ -229,7 +487,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
229
487
|
|
|
230
488
|
ctx.ui.notify(msg, isCritical ? "error" : "info");
|
|
231
489
|
} catch {
|
|
232
|
-
/* silent fail
|
|
490
|
+
/* silent fail - never throw from tool_result */
|
|
233
491
|
}
|
|
234
492
|
|
|
235
493
|
return undefined;
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
[](#skills)
|
|
8
8
|
|
|
9
|
-
GSD is a structured software-delivery framework for AI coding agents. It wraps any AI coding session with a six-step phase lifecycle, 57 slash commands, 18 specialized subagents, background hooks, and model profiles
|
|
9
|
+
GSD is a structured software-delivery framework for AI coding agents. It wraps any AI coding session with a six-step phase lifecycle, 57 slash commands, 18 specialized subagents, background hooks, and model profiles - all backed by a git-committed `.planning/` directory that survives context resets.
|
|
10
10
|
|
|
11
11
|
This package installs GSD into your project for pi (and optionally Claude Code, Gemini CLI, Cursor, Windsurf, OpenCode, Codex, and GitHub Copilot) automatically on `npm install`.
|
|
12
12
|
|
|
@@ -39,7 +39,7 @@ After install, run your first GSD command:
|
|
|
39
39
|
| Artifact | Count | Description |
|
|
40
40
|
| ---------- | ----: | ----------------------------------------------------------------- |
|
|
41
41
|
| Skills | 57 | pi skill definitions (`/gsd-*`) loaded automatically |
|
|
42
|
-
| CLI binary | 1 | `gsd-tools`
|
|
42
|
+
| CLI binary | 1 | `pi-gsd-tools` - state management, scaffolding, model routing |
|
|
43
43
|
| Hooks | 5 | Background hooks (context monitor, workflow guard, statusline, …) |
|
|
44
44
|
|
|
45
45
|
---
|
|
@@ -56,7 +56,7 @@ After install, run your first GSD command:
|
|
|
56
56
|
└─► (next phase or /gsd-complete-milestone)
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
All project state lives in `.planning/`
|
|
59
|
+
All project state lives in `.planning/` - committed to git, survives `/clear` and context resets.
|
|
60
60
|
|
|
61
61
|
---
|
|
62
62
|
|
|
@@ -77,26 +77,26 @@ Run `/gsd-help` for the full list with descriptions.
|
|
|
77
77
|
|
|
78
78
|
---
|
|
79
79
|
|
|
80
|
-
## CLI: `gsd-tools`
|
|
80
|
+
## CLI: `pi-gsd-tools`
|
|
81
81
|
|
|
82
|
-
The `gsd-tools` binary is the runtime backbone called by GSD workflow files. It manages all `.planning/` state. You rarely need to call it directly, but it's available:
|
|
82
|
+
The `pi-gsd-tools` binary is the runtime backbone called by GSD workflow files. It manages all `.planning/` state. You rarely need to call it directly, but it's available:
|
|
83
83
|
|
|
84
84
|
```sh
|
|
85
|
-
gsd-tools state json # dump current STATE.md as JSON
|
|
86
|
-
gsd-tools state update <field> <value> # update a state field
|
|
87
|
-
gsd-tools find-phase <N> # locate a phase directory
|
|
88
|
-
gsd-tools roadmap analyze # analyse ROADMAP.md structure
|
|
89
|
-
gsd-tools validate health --repair # check and auto-repair .planning/
|
|
90
|
-
gsd-tools stats json # project statistics
|
|
91
|
-
gsd-tools progress json # progress summary
|
|
92
|
-
gsd-tools commit "message" --files a b c # commit with GSD tracking
|
|
85
|
+
pi-gsd-tools state json # dump current STATE.md as JSON
|
|
86
|
+
pi-gsd-tools state update <field> <value> # update a state field
|
|
87
|
+
pi-gsd-tools find-phase <N> # locate a phase directory
|
|
88
|
+
pi-gsd-tools roadmap analyze # analyse ROADMAP.md structure
|
|
89
|
+
pi-gsd-tools validate health --repair # check and auto-repair .planning/
|
|
90
|
+
pi-gsd-tools stats json # project statistics
|
|
91
|
+
pi-gsd-tools progress json # progress summary
|
|
92
|
+
pi-gsd-tools commit "message" --files a b c # commit with GSD tracking
|
|
93
93
|
|
|
94
94
|
# Output formatting (pi-native)
|
|
95
|
-
gsd-tools state json --output toon # pretty-print with toon renderer
|
|
96
|
-
gsd-tools state json --pick phase # extract a single field
|
|
95
|
+
pi-gsd-tools state json --output toon # pretty-print with toon renderer
|
|
96
|
+
pi-gsd-tools state json --pick phase # extract a single field
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
Run `gsd-tools --help` for the full command reference.
|
|
99
|
+
Run `pi-gsd-tools --help` for the full command reference.
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
@@ -106,8 +106,8 @@ GSD routes subagents to different models based on your active profile:
|
|
|
106
106
|
|
|
107
107
|
| Profile | Description |
|
|
108
108
|
| ---------- | ----------------------------------------------------- |
|
|
109
|
-
| `quality` | Maximum reasoning
|
|
110
|
-
| `balanced` | Default
|
|
109
|
+
| `quality` | Maximum reasoning - Opus/Pro for all decision agents |
|
|
110
|
+
| `balanced` | Default - Sonnet/Flash tier, good cost/quality ratio |
|
|
111
111
|
| `budget` | Cheapest available model per agent |
|
|
112
112
|
| `inherit` | Use the session's currently selected model everywhere |
|
|
113
113
|
|
|
@@ -117,35 +117,36 @@ Switch profile: `/gsd-set-profile <profile>`
|
|
|
117
117
|
|
|
118
118
|
## Comparison with GSD v1.30.0
|
|
119
119
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
142
|
-
|
|
|
120
|
+
| Feature | gsd v1.30 | pi-gsd | Details |
|
|
121
|
+
| -----------------------------------: | :-------: | :----: | :--------------------------------------------------------------------------------------------------- |
|
|
122
|
+
| `.planning/` data format | ✔️ | ✔️ | 100% compatible - projects are portable across tools |
|
|
123
|
+
| Workstreams | ✔️ | ✔️ | Full workstream isolation |
|
|
124
|
+
| 4 model profiles | ✔️ | ✔️ | quality / balanced / budget / inherit |
|
|
125
|
+
| 18 subagents | ✔️ | ✔️ | Identical agent definitions |
|
|
126
|
+
| 57 GSD skills | ✔️ | ✔️ | All commands available via pi ~~skill system~~ prompt dispatcher (_more details below_) |
|
|
127
|
+
| Different skills paths for pi | ✔️ | ⚡ | All 57 skills moved to `.pi/gsd/` to allow for advanced `pi-gsd-tools` usage (_more details below_) |
|
|
128
|
+
| pi harness (`.pi/`) | ❌ | ✔️ | New - GSD installs into pi's config dir |
|
|
129
|
+
| Background hooks (pi) | ❌ | ✔️ | TypeScript extension (`gsd-hooks.ts`) installed via postinstall |
|
|
130
|
+
| Pi session history ingestion | ❌ | ✔️ | `/gsd-profile-user` reads pi JSONL sessions from `~/.pi/agent/sessions/` |
|
|
131
|
+
| `/gsd-setup-pi` onboarding | ❌ | ✔️ | Setup skill for `bun install` where postinstall is skipped (default untrusted behavior) |
|
|
132
|
+
| `gsd-tools` →`pi-gsd-tools` CLI | ✔️ | ⚡ | Same commands basic signatures as original (`gsd-tools`) but enhanced |
|
|
133
|
+
| `[-o\|--output] [toon\|json]` output | ❌ | ⚡ | Token-efficient toon renderer output (or json, if LLM absolutely needs it...) |
|
|
134
|
+
| `[-p\|--pick] {JSONPath}` extraction | ❌ | ⚡ | Field extraction from CLI output |
|
|
135
|
+
| TypeScript source | ❌ | ⚡ | Full TS port of gsd-tools (~9k lines) |
|
|
136
|
+
| Compile-time type safety | ❌ | ⚡ | Fully typed - no `any`, only Zod-inferred types |
|
|
137
|
+
| Runtime validation (Zod) | ❌ | ⚡ | Schema-driven `validate health` with field-path errors |
|
|
138
|
+
| Smarter `--repair` | ❌ | ⚡ | Zod schema defaults fill all missing/invalid fields at once |
|
|
139
|
+
| Instant commands (no LLM cost) | ❌ | ✔️ | `/gsd-progress`, `/gsd-stats`, `/gsd-health`, `/gsd-help` — formatted output + deterministic next steps, zero LLM |
|
|
140
|
+
| Prompt-dispatch for all skills | ❌ | ✔️ | 54 pi prompt templates — clean autocomplete, arg hints, direct workflow dispatch |
|
|
141
|
+
|
|
142
|
+
<!-- | Pi harness config entry | ❌ | ✔️ | `HARNESS_CONFIG` pi entry - generates `AGENTS.md` via `/gsd-profile-user` | -->
|
|
143
|
+
<!-- | Toon output in skills | ❌ | ✔️ | `gsd-progress`, `gsd-stats`, `gsd-health` use `--output toon` | -->
|
|
143
144
|
|
|
144
145
|
---
|
|
145
146
|
|
|
146
147
|
## Data Format Compatibility
|
|
147
148
|
|
|
148
|
-
This package is a **faithful port** of GSD v1.30.0. The `.planning/` directory layout, all file formats (`STATE.md`, `ROADMAP.md`, `REQUIREMENTS.md`, `PLAN.md`, `SUMMARY.md`, `UAT.md`), frontmatter schemas, and `gsd-tools` command signatures are **byte-compatible** with the original `get-shit-done-cc` package.
|
|
149
|
+
This package is a **faithful port** of GSD v1.30.0. The `.planning/` directory layout, all file formats (`STATE.md`, `ROADMAP.md`, `REQUIREMENTS.md`, `PLAN.md`, `SUMMARY.md`, `UAT.md`), frontmatter schemas, and `pi-gsd-tools` command signatures are **byte-compatible** with the original `get-shit-done-cc` package.
|
|
149
150
|
|
|
150
151
|
Projects started with the original GSD work without migration.
|
|
151
152
|
|
|
@@ -157,7 +158,7 @@ Projects started with the original GSD work without migration.
|
|
|
157
158
|
# Type-check
|
|
158
159
|
npm run typecheck
|
|
159
160
|
|
|
160
|
-
# Build CLI (TypeScript → dist/gsd-tools.js)
|
|
161
|
+
# Build CLI (TypeScript → dist/pi-gsd-tools.js)
|
|
161
162
|
npm run build
|
|
162
163
|
|
|
163
164
|
# Validate integrity
|
|
@@ -168,4 +169,4 @@ node scripts/validate-model-profiles.cjs
|
|
|
168
169
|
|
|
169
170
|
## License
|
|
170
171
|
|
|
171
|
-
MIT
|
|
172
|
+
MIT - this is an unofficial port. Original GSD by [Get Shit Done](https://github.com/gsd-build/get-shit-done).
|