pi-gsd 1.3.3 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -241,7 +241,9 @@ export default function (pi: ExtensionAPI) {
241
241
  lines.push(` → /gsd-discuss-phase ${n} Gather context first`);
242
242
  lines.push(` → /gsd-plan-phase ${n} Jump straight to planning`);
243
243
  } else if (next.summaries < next.plans) {
244
- lines.push(` → /gsd-execute-phase ${n} ${next.summaries}/${next.plans} plans done`);
244
+ lines.push(
245
+ ` → /gsd-execute-phase ${n} ${next.summaries}/${next.plans} plans done`,
246
+ );
245
247
  } else {
246
248
  lines.push(` → /gsd-verify-work ${n} All plans done, verify UAT`);
247
249
  }
@@ -254,10 +256,15 @@ export default function (pi: ExtensionAPI) {
254
256
  return lines;
255
257
  };
256
258
 
257
- const formatProgress = (cwd: string): { text: string; data: GsdProgress | null } => {
259
+ const formatProgress = (
260
+ cwd: string,
261
+ ): { text: string; data: GsdProgress | null } => {
258
262
  const data = runJson<GsdProgress>("progress json", cwd);
259
263
  if (!data)
260
- return { text: "❌ No GSD project found. Run /gsd-new-project to initialise.", data: null };
264
+ return {
265
+ text: "❌ No GSD project found. Run /gsd-new-project to initialise.",
266
+ data: null,
267
+ };
261
268
 
262
269
  const done = data.phases.filter((p) => p.status === "Complete").length;
263
270
  const total = data.phases.length;
@@ -279,16 +286,21 @@ export default function (pi: ExtensionAPI) {
279
286
  return { text: lines.join("\n"), data };
280
287
  };
281
288
 
282
- const formatStats = (cwd: string): { text: string; data: GsdStats | null } => {
289
+ const formatStats = (
290
+ cwd: string,
291
+ ): { text: string; data: GsdStats | null } => {
283
292
  const data = runJson<GsdStats>("stats json", cwd);
284
293
  if (!data)
285
- return { text: "❌ No GSD project found. Run /gsd-new-project to initialise.", data: null };
294
+ return {
295
+ text: "❌ No GSD project found. Run /gsd-new-project to initialise.",
296
+ data: null,
297
+ };
286
298
 
287
299
  const reqPct =
288
300
  data.requirements_total > 0
289
301
  ? Math.round(
290
- (data.requirements_complete / data.requirements_total) * 100,
291
- )
302
+ (data.requirements_complete / data.requirements_total) * 100,
303
+ )
292
304
  : 0;
293
305
 
294
306
  const lines = [
@@ -386,10 +398,15 @@ export default function (pi: ExtensionAPI) {
386
398
  pi.registerCommand("gsd-health", {
387
399
  description: "Check .planning/ integrity (instant)",
388
400
  handler: async (args, ctx) => {
389
- ctx.ui.notify(formatHealth(ctx.cwd, !!args?.includes("--repair")), "info");
401
+ ctx.ui.notify(
402
+ formatHealth(ctx.cwd, !!args?.includes("--repair")),
403
+ "info",
404
+ );
390
405
  },
391
406
  getArgumentCompletions: (prefix) => {
392
- const options = [{ value: "--repair", label: "--repair Auto-fix issues" }];
407
+ const options = [
408
+ { value: "--repair", label: "--repair Auto-fix issues" },
409
+ ];
393
410
  return options.filter((o) => o.value.startsWith(prefix));
394
411
  },
395
412
  });
@@ -445,7 +462,9 @@ export default function (pi: ExtensionAPI) {
445
462
  `⏩ ${reason}`,
446
463
  `→ ${action}`,
447
464
  ...(pending.length > 1
448
- ? [` (${pending.length - 1} more phase${pending.length > 2 ? "s" : ""} pending after this)`]
465
+ ? [
466
+ ` (${pending.length - 1} more phase${pending.length > 2 ? "s" : ""} pending after this)`,
467
+ ]
449
468
  : []),
450
469
  `━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
451
470
  ].join("\n"),
@@ -471,6 +490,8 @@ export default function (pi: ExtensionAPI) {
471
490
  " /gsd-validate-phase N Validate completion",
472
491
  " /gsd-next Auto-advance",
473
492
  " /gsd-autonomous Run all phases",
493
+ " /gsd-plan-milestone Plan all phases at once",
494
+ " /gsd-execute-milestone Execute all phases with gates",
474
495
  "",
475
496
  "Quick:",
476
497
  " /gsd-quick <task> Tracked ad-hoc task",
@@ -482,6 +503,7 @@ export default function (pi: ExtensionAPI) {
482
503
  " /gsd-progress Progress + next steps",
483
504
  " /gsd-stats Full statistics",
484
505
  " /gsd-health [--repair] .planning/ integrity",
506
+ " /gsd-milestone Milestone status dashboard",
485
507
  " /gsd-help This list",
486
508
  "",
487
509
  "Management:",
@@ -496,8 +518,73 @@ export default function (pi: ExtensionAPI) {
496
518
  },
497
519
  });
498
520
 
521
+ pi.registerCommand("gsd-milestone", {
522
+ description:
523
+ "Milestone status dashboard — plan vs execute routing (instant)",
524
+ handler: async (_args, ctx) => {
525
+ const progress = runJson<GsdProgress>("progress json", ctx.cwd);
526
+ if (!progress) {
527
+ ctx.ui.notify(
528
+ "❌ No GSD project found. Run /gsd-new-project to initialise.",
529
+ "error",
530
+ );
531
+ ctx.ui.setEditorText("/gsd-new-project");
532
+ return;
533
+ }
534
+
535
+ const phases = progress.phases;
536
+ const total = phases.length;
537
+ const done = phases.filter((p) => p.status === "Complete").length;
538
+ const unplanned = phases.filter(
539
+ (p) => p.status !== "Complete" && p.plans === 0,
540
+ ).length;
541
+ const planned = phases.filter(
542
+ (p) => p.status !== "Complete" && p.plans > 0,
543
+ ).length;
544
+ const phasePct = total > 0 ? Math.round((done / total) * 100) : 0;
545
+
546
+ // Determine recommended next milestone-level action
547
+ let recommendation: string;
548
+ let action: string;
549
+ if (total === 0) {
550
+ recommendation = "No phases defined yet";
551
+ action = "/gsd-new-project";
552
+ } else if (done === total) {
553
+ recommendation = "All phases complete — ready to audit";
554
+ action = "/gsd-audit-milestone";
555
+ } else if (unplanned > 0 && planned === 0) {
556
+ recommendation = `${unplanned} unplanned phase${unplanned > 1 ? "s" : ""} — plan the milestone first`;
557
+ action = "/gsd-plan-milestone";
558
+ } else if (unplanned > 0) {
559
+ recommendation = `${planned} planned, ${unplanned} still unplanned — finish planning first`;
560
+ action = "/gsd-plan-milestone";
561
+ } else {
562
+ recommendation = `${planned} phase${planned > 1 ? "s" : ""} ready to execute`;
563
+ action = "/gsd-execute-milestone";
564
+ }
565
+
566
+ const lines = [
567
+ `━━ GSD Milestone ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
568
+ `🎯 ${progress.milestone_name} (${progress.milestone_version})`,
569
+ ``,
570
+ `Phases ${bar(phasePct)} ${done}/${total} (${phasePct}%)`,
571
+ ``,
572
+ `🟢 Complete: ${done}`,
573
+ `🟡 Planned: ${planned}`,
574
+ `🔴 Unplanned: ${unplanned}`,
575
+ ``,
576
+ `⚡ ${recommendation}`,
577
+ `→ ${action}`,
578
+ ``,
579
+ `━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`,
580
+ ];
581
+
582
+ ctx.ui.notify(lines.join("\n"), "info");
583
+ ctx.ui.setEditorText(action);
584
+ },
585
+ });
499
586
 
500
- // ── tool_result: context usage monitor ───────────────────────────────────
587
+ // ── tool_result: context usage monitor ───────────────────────────────────
501
588
  const WARNING_THRESHOLD = 35; // warn when remaining % ≤ 35
502
589
  const CRITICAL_THRESHOLD = 25; // critical when remaining % ≤ 25
503
590
  const DEBOUNCE_CALLS = 5; // minimum tool uses between repeated warnings
package/README.md CHANGED
@@ -117,28 +117,33 @@ Switch profile: `/gsd-set-profile <profile>`
117
117
 
118
118
  ## Comparison with GSD v1.30.0
119
119
 
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 | ❌ | ⚠️ | Zod schemas defined; ~25 loose `any` casts remain in lib modules |
137
- | Runtime validation (Zod) | ❌ | ⚠️ | Zod schemas for all `.planning/` types; wired to `config.json` + `validate health` full coverage in progress |
138
- | Smarter `--repair` | ❌ | | Schema-driven repair not yet implemented |
139
- | Instant commands (no LLM cost) | ❌ | ✔️ | `/gsd-progress`, `/gsd-stats`, `/gsd-health`, `/gsd-help`, `/gsd-next` — zero LLM, editor pivot |
140
- | `/gsd-next` auto-advance | ❌ | ✔️ | Deterministic phase routing, pre-fills editor with the correct next command |
141
- | Prompt-dispatch for all skills | ❌ | ✔️ | 54 pi prompt templates — clean autocomplete, arg hints, direct workflow dispatch |
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 prompt dispatcher (replaces skill system) |
127
+ | Different skills paths for pi | ✔️ | ⚡ | All 57 skills moved to `.pi/gsd/` to enable advanced pi-gsd-tools integration |
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 | ❌ | ✔️ | Full TypeScript only `FrontmatterObject` root type retains `any` (intentional, documented) |
137
+ | Runtime validation (Zod) | ❌ | ✔️ | Zod schemas for all `.planning/` types; `validate health` checks `config.json` (W005) + `STATE.md` (W011) |
138
+ | Smarter `--repair` | ❌ | ✔️ | Schema defaults fill missing `config.json` fields; W011 STATE.md issues trigger regeneration |
139
+ | Instant commands (no LLM cost) | ❌ | ✔️ | `/gsd-progress`, `/gsd-stats`, `/gsd-health`, `/gsd-help`, `/gsd-next` — zero LLM, editor pivot |
140
+ | `/gsd-next` auto-advance | ❌ | ✔️ | Deterministic phase routing, pre-fills editor with the correct next command |
141
+ | Prompt-dispatch for all skills | ❌ | ✔️ | 54 pi prompt templates — clean autocomplete, arg hints, direct workflow dispatch |
142
+ | `/gsd-plan-milestone` command | ❌ | ✔️ | Plan all phases at once — one mode question, scope pre-check, context-safe checkpointing |
143
+ | `/gsd-execute-milestone` command | ❌ | ✔️ | Execute all phases with scope guardian, UAT gates, recovery loop, worktree isolation |
144
+ | `/gsd-milestone` instant command | ❌ | ✔️ | Milestone dashboard — plan vs execute routing, pre-fills editor with correct next command |
145
+
146
+ Legend: ✔️ done · ⚡ enhanced · ⚠️ in progress · 📃 planned · ❌ not available
142
147
 
143
148
  ---
144
149