gsd-lite 0.7.0 → 0.7.3

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 (57) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.mcp.json +0 -0
  4. package/README.md +2 -2
  5. package/agents/debugger.md +0 -0
  6. package/agents/executor.md +0 -0
  7. package/agents/researcher.md +0 -0
  8. package/agents/reviewer.md +0 -0
  9. package/commands/doctor.md +17 -10
  10. package/commands/prd.md +0 -0
  11. package/commands/resume.md +0 -0
  12. package/commands/start.md +0 -0
  13. package/commands/status.md +1 -0
  14. package/commands/stop.md +0 -0
  15. package/hooks/context-monitor.js +0 -0
  16. package/hooks/gsd-auto-update.cjs +0 -0
  17. package/hooks/gsd-context-monitor.cjs +0 -0
  18. package/hooks/gsd-session-init.cjs +0 -0
  19. package/hooks/gsd-session-stop.cjs +0 -0
  20. package/hooks/gsd-statusline.cjs +0 -0
  21. package/hooks/hooks.json +0 -0
  22. package/hooks/lib/gsd-finder.cjs +0 -0
  23. package/hooks/lib/semver-sort.cjs +0 -0
  24. package/hooks/lib/statusline-composite.cjs +50 -2
  25. package/install.js +0 -0
  26. package/launcher.js +0 -0
  27. package/package.json +5 -1
  28. package/references/anti-rationalization-full.md +0 -0
  29. package/references/evidence-spec.md +0 -0
  30. package/references/execution-loop.md +0 -0
  31. package/references/git-worktrees.md +0 -0
  32. package/references/questioning.md +0 -0
  33. package/references/review-classification.md +0 -0
  34. package/references/state-diagram.md +0 -0
  35. package/references/testing-patterns.md +0 -0
  36. package/src/schema.js +0 -0
  37. package/src/server.js +0 -0
  38. package/src/tools/orchestrator/debugger.js +0 -0
  39. package/src/tools/orchestrator/executor.js +0 -0
  40. package/src/tools/orchestrator/helpers.js +0 -0
  41. package/src/tools/orchestrator/index.js +0 -0
  42. package/src/tools/orchestrator/researcher.js +0 -0
  43. package/src/tools/orchestrator/resume.js +2 -2
  44. package/src/tools/orchestrator/reviewer.js +0 -0
  45. package/src/tools/state/constants.js +0 -0
  46. package/src/tools/state/crud.js +6 -6
  47. package/src/tools/state/index.js +0 -0
  48. package/src/tools/state/logic.js +1 -1
  49. package/src/tools/verify.js +0 -0
  50. package/src/utils.js +0 -0
  51. package/uninstall.js +0 -0
  52. package/workflows/debugging.md +0 -0
  53. package/workflows/deviation-rules.md +0 -0
  54. package/workflows/execution-flow.md +0 -0
  55. package/workflows/research.md +0 -0
  56. package/workflows/review-cycle.md +0 -0
  57. package/workflows/tdd-cycle.md +0 -0
@@ -13,7 +13,7 @@
13
13
  "name": "gsd",
14
14
  "source": "./",
15
15
  "description": "AI orchestration tool — GSD management shell + Superpowers quality core. 5 commands, 4 agents, 5 workflows, MCP server, context monitoring.",
16
- "version": "0.7.0",
16
+ "version": "0.7.3",
17
17
  "keywords": [
18
18
  "orchestration",
19
19
  "mcp",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsd",
3
- "version": "0.7.0",
3
+ "version": "0.7.3",
4
4
  "description": "AI orchestration tool for Claude Code — GSD management shell + Superpowers quality core",
5
5
  "author": {
6
6
  "name": "sdsrss",
package/.mcp.json CHANGED
File without changes
package/README.md CHANGED
@@ -291,7 +291,7 @@ gsd-lite/
291
291
  │ ├── gsd-session-stop.cjs # Graceful shutdown with crash markers
292
292
  │ ├── gsd-statusline.cjs # StatusLine display (composite-aware)
293
293
  │ └── lib/ # Shared hook utilities (gsd-finder, composite statusline, semver)
294
- ├── tests/ # 909 tests (unit + simulation + E2E integration)
294
+ ├── tests/ # 966 tests (unit + simulation + E2E integration)
295
295
  ├── cli.js # Install/uninstall CLI entry
296
296
  ├── install.js # Installation script (plugin-aware, idempotent)
297
297
  └── uninstall.js # Uninstall script
@@ -300,7 +300,7 @@ gsd-lite/
300
300
  ## Testing
301
301
 
302
302
  ```bash
303
- npm test # Run all 909 tests
303
+ npm test # Run all 966 tests
304
304
  npm run test:coverage # Tests + coverage report (94%+ lines, 83%+ branches)
305
305
  npm run lint # Biome lint
306
306
  node --test tests/file.js # Run a single test file
File without changes
File without changes
File without changes
File without changes
@@ -28,18 +28,25 @@ Call the `health` MCP tool:
28
28
 
29
29
  Check if GSD hooks are registered in Claude settings:
30
30
  - Read `~/.claude/settings.json` (or `~/.claude/settings.local.json`)
31
- - StatusLine check (check BOTH paths):
32
- 1. Direct: `statusLine` entry containing `gsd-statusline`
33
- 2. Composite: read `~/.cache/code-graph/statusline-registry.json` — if any entry's `command` contains `gsd-statusline`, it is registered through the composite statusline system
34
- - Either path present: StatusLine = registered
35
- - Check for `PostToolUse` hook entry containing `gsd-context-monitor`
36
- - Both present: record PASS
37
- - Partial: record WARN with which hook is missing
38
- - Neither: record FAIL "No GSD hooks registered"
39
-
40
- Also verify the hook files exist on disk:
31
+ - StatusLine check (registered if ANY path matches):
32
+ 1. Direct: `statusLine.command` contains `gsd-statusline`
33
+ 2. Composite cache registry: `~/.cache/code-graph/statusline-registry.json` — any entry whose `command` contains `gsd-statusline`
34
+ 3. Composite backup mirror: `~/.claude/statusline-providers.json` same match rule (durable mirror written by code-graph's chain CLI)
35
+ - Any path present: StatusLine = registered
36
+ - Check the three hook arrays in `settings.hooks`:
37
+ - `PostToolUse` entry referencing `gsd-context-monitor`
38
+ - `SessionStart` entry referencing `gsd-session-init`
39
+ - `Stop` entry referencing `gsd-session-stop`
40
+ - All four (statusLine + three hooks) present: record PASS
41
+ - Partial: record WARN naming each missing hook
42
+ - None: record FAIL "No GSD hooks registered"
43
+
44
+ Also verify the hook files exist on disk (install.js copies all five):
41
45
  - `~/.claude/hooks/gsd-statusline.cjs`
42
46
  - `~/.claude/hooks/gsd-context-monitor.cjs`
47
+ - `~/.claude/hooks/gsd-session-init.cjs`
48
+ - `~/.claude/hooks/gsd-session-stop.cjs`
49
+ - `~/.claude/hooks/gsd-auto-update.cjs`
43
50
  - Files missing but settings present: record WARN "Hook registered but file missing"
44
51
 
45
52
  ## STEP 4: Lock File Check
package/commands/prd.md CHANGED
File without changes
File without changes
package/commands/start.md CHANGED
File without changes
@@ -91,6 +91,7 @@ Blocked 任务:
91
91
 
92
92
  | workflow_mode | 建议 |
93
93
  |---|---|
94
+ | planning | "仍在计划阶段,运行 /gsd:start 或 /gsd:prd 重新启动计划" |
94
95
  | executing_task | "自动执行中,等待完成" |
95
96
  | reviewing_task | "L2 审查进行中" |
96
97
  | reviewing_phase | "L1 阶段审查进行中" |
package/commands/stop.md CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/hooks/hooks.json CHANGED
File without changes
File without changes
File without changes
@@ -1,14 +1,26 @@
1
1
  'use strict';
2
2
  // Detect and register with composite statusline systems (e.g., code-graph).
3
3
  // Used by install.js, gsd-session-init.cjs, and uninstall.js.
4
+ //
5
+ // Preferred path (code-graph ≥ shipping statusline-chain.js): invoke that CLI
6
+ // with `register gsd <cmd> --stdin` / `unregister gsd`. The CLI owns both the
7
+ // primary cache registry and the ~/.claude/statusline-providers.json backup
8
+ // mirror, so we do not have to know their layout.
9
+ // Fallback path (older code-graph without the CLI): write the cache registry
10
+ // directly, same as the original behavior.
4
11
 
5
12
  const fs = require('node:fs');
6
13
  const path = require('node:path');
7
14
  const os = require('node:os');
15
+ const { execFileSync } = require('node:child_process');
16
+ const { semverSortComparator } = require('./semver-sort.cjs');
8
17
 
9
- // Known composite statusline registry paths
18
+ const CLAUDE_DIR = process.env.CLAUDE_CONFIG_DIR || path.join(os.homedir(), '.claude');
19
+
20
+ // Known composite statusline registry paths (fallback-only — chain CLI is preferred).
10
21
  const REGISTRY_PATHS = [
11
22
  path.join(os.homedir(), '.cache', 'code-graph', 'statusline-registry.json'),
23
+ path.join(CLAUDE_DIR, 'statusline-providers.json'),
12
24
  ];
13
25
 
14
26
  function isCompositeStatusLine(command) {
@@ -22,13 +34,46 @@ function findCompositeRegistry() {
22
34
  return null;
23
35
  }
24
36
 
37
+ /**
38
+ * Find code-graph's statusline-chain.js in the plugin cache (newest semver).
39
+ * Returns absolute path or null if the CLI hasn't shipped yet.
40
+ */
41
+ function findChainScript() {
42
+ const base = path.join(CLAUDE_DIR, 'plugins', 'cache', 'code-graph-mcp', 'code-graph-mcp');
43
+ if (!fs.existsSync(base)) return null;
44
+ let versions;
45
+ try {
46
+ versions = fs.readdirSync(base).filter(v => /^\d+\.\d+\.\d+/.test(v));
47
+ } catch { return null; }
48
+ versions.sort(semverSortComparator).reverse();
49
+ for (const v of versions) {
50
+ const p = path.join(base, v, 'scripts', 'statusline-chain.js');
51
+ if (fs.existsSync(p)) return p;
52
+ }
53
+ return null;
54
+ }
55
+
56
+ function runChainCLI(args) {
57
+ const chainScript = findChainScript();
58
+ if (!chainScript) return false;
59
+ try {
60
+ execFileSync(process.execPath, [chainScript, ...args], { stdio: 'pipe', timeout: 5000 });
61
+ return true;
62
+ } catch { return false; }
63
+ }
64
+
25
65
  /**
26
66
  * Register GSD as a provider in the composite statusline registry.
67
+ * Prefers code-graph's statusline-chain.js CLI when available; falls back to
68
+ * writing the cache registry directly for older code-graph versions.
27
69
  * Idempotent: updates existing entry or inserts before code-graph.
28
70
  * @param {string} statuslineScriptPath - Absolute path to gsd-statusline.cjs
29
71
  * @returns {boolean} true if registered/updated
30
72
  */
31
73
  function registerProvider(statuslineScriptPath) {
74
+ const command = `node ${JSON.stringify(statuslineScriptPath)}`;
75
+ if (runChainCLI(['register', 'gsd', command, '--stdin'])) return true;
76
+
32
77
  let registryPath = findCompositeRegistry();
33
78
 
34
79
  // If composite statusLine is configured but registry file is missing,
@@ -54,7 +99,6 @@ function registerProvider(statuslineScriptPath) {
54
99
  }
55
100
  if (!Array.isArray(registry)) return false;
56
101
 
57
- const command = `node ${JSON.stringify(statuslineScriptPath)}`;
58
102
  const provider = { id: 'gsd', command, needsStdin: true };
59
103
 
60
104
  // Find existing GSD entry (by id or command)
@@ -82,9 +126,13 @@ function registerProvider(statuslineScriptPath) {
82
126
 
83
127
  /**
84
128
  * Remove GSD entry from composite statusline registry.
129
+ * Prefers code-graph's statusline-chain.js CLI when available; falls back to
130
+ * rewriting the cache registry directly for older code-graph versions.
85
131
  * @returns {boolean} true if an entry was removed
86
132
  */
87
133
  function removeProvider() {
134
+ if (runChainCLI(['unregister', 'gsd'])) return true;
135
+
88
136
  const registryPath = findCompositeRegistry();
89
137
  if (!registryPath) return false;
90
138
 
package/install.js CHANGED
File without changes
package/launcher.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsd-lite",
3
- "version": "0.7.0",
3
+ "version": "0.7.3",
4
4
  "description": "AI orchestration tool for Claude Code — GSD management shell + Superpowers quality core",
5
5
  "type": "module",
6
6
  "bin": {
@@ -50,6 +50,10 @@
50
50
  "dependencies": {
51
51
  "@modelcontextprotocol/sdk": "^1.27.1"
52
52
  },
53
+ "overrides": {
54
+ "hono": "^4.12.14",
55
+ "@hono/node-server": "^1.19.14"
56
+ },
53
57
  "devDependencies": {
54
58
  "@biomejs/biome": "^2.4.6",
55
59
  "c8": "^11.0.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/schema.js CHANGED
File without changes
package/src/server.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -493,8 +493,8 @@ export async function resumeWorkflow({ basePath = process.cwd(), _depth = 0, unb
493
493
  success: true,
494
494
  action: 'await_manual_intervention',
495
495
  workflow_mode: state.workflow_mode,
496
- guidance: 'Complete planning and call state-init to initialize the project',
497
- message: 'Project is in planning mode; complete the plan and initialize with state-init',
496
+ guidance: 'Plan is being revised. Run /gsd:start or /gsd:prd to continue planning, or state-update workflow_mode back to executing_task when ready.',
497
+ message: 'Project is in planning mode (plan revision). Finish the plan then set workflow_mode back to executing_task.',
498
498
  };
499
499
  break;
500
500
  case 'reconcile_workspace': {
File without changes
File without changes
@@ -156,7 +156,7 @@ export async function init({ project, phases, research, force = false, basePath
156
156
  export async function read({ fields, basePath = process.cwd(), validate = false } = {}) {
157
157
  const statePath = await getStatePath(basePath);
158
158
  if (!statePath) {
159
- return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No .gsd directory found' };
159
+ return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No GSD project found (.gsd directory missing). Run /gsd:start or /gsd:prd to begin.' };
160
160
  }
161
161
 
162
162
  const result = await readJson(statePath);
@@ -207,7 +207,7 @@ export async function update({ updates, basePath = process.cwd(), expectedVersio
207
207
 
208
208
  const statePath = await getStatePath(basePath);
209
209
  if (!statePath) {
210
- return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No .gsd directory found' };
210
+ return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No GSD project found (.gsd directory missing). Run /gsd:start or /gsd:prd to begin.' };
211
211
  }
212
212
  ensureLockPathFromStatePath(statePath);
213
213
 
@@ -425,7 +425,7 @@ export async function phaseComplete({
425
425
  }
426
426
  const statePath = await getStatePath(basePath);
427
427
  if (!statePath) {
428
- return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No .gsd directory found' };
428
+ return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No GSD project found (.gsd directory missing). Run /gsd:start or /gsd:prd to begin.' };
429
429
  }
430
430
  ensureLockPathFromStatePath(statePath);
431
431
 
@@ -612,7 +612,7 @@ export async function addEvidence({ id, data, basePath = process.cwd() }) {
612
612
 
613
613
  const statePath = await getStatePath(basePath);
614
614
  if (!statePath) {
615
- return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No .gsd directory found' };
615
+ return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No GSD project found (.gsd directory missing). Run /gsd:start or /gsd:prd to begin.' };
616
616
  }
617
617
  ensureLockPathFromStatePath(statePath);
618
618
 
@@ -693,7 +693,7 @@ export async function pruneEvidence({ currentPhase, basePath = process.cwd() })
693
693
  }
694
694
  const statePath = await getStatePath(basePath);
695
695
  if (!statePath) {
696
- return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No .gsd directory found' };
696
+ return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No GSD project found (.gsd directory missing). Run /gsd:start or /gsd:prd to begin.' };
697
697
  }
698
698
  ensureLockPathFromStatePath(statePath);
699
699
 
@@ -733,7 +733,7 @@ export async function patchPlan({ operations, basePath = process.cwd() } = {}) {
733
733
 
734
734
  const statePath = await getStatePath(basePath);
735
735
  if (!statePath) {
736
- return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No .gsd directory found' };
736
+ return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No GSD project found (.gsd directory missing). Run /gsd:start or /gsd:prd to begin.' };
737
737
  }
738
738
  ensureLockPathFromStatePath(statePath);
739
739
 
File without changes
@@ -430,7 +430,7 @@ export async function storeResearch({ result, artifacts, decision_index, basePat
430
430
 
431
431
  const statePath = await getStatePath(basePath);
432
432
  if (!statePath) {
433
- return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No .gsd directory found' };
433
+ return { error: true, code: ERROR_CODES.NO_PROJECT_DIR, message: 'No GSD project found (.gsd directory missing). Run /gsd:start or /gsd:prd to begin.' };
434
434
  }
435
435
  ensureLockPathFromStatePath(statePath);
436
436
 
File without changes
package/src/utils.js CHANGED
File without changes
package/uninstall.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes