specdx 0.4.0-alpha.17 → 0.4.0-alpha.19

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 (74) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +477 -0
  3. package/dist/{check-Q3QKTN2D.js → check-PRQNMBOE.js} +5 -5
  4. package/dist/{chunk-PEC5LAVE.js → chunk-5MYELBKF.js} +56 -21
  5. package/dist/chunk-5MYELBKF.js.map +1 -0
  6. package/dist/{chunk-V7JOVK6D.js → chunk-BD6UDHYW.js} +194 -39
  7. package/dist/chunk-BD6UDHYW.js.map +1 -0
  8. package/dist/{chunk-TJPPBM24.js → chunk-ERRUYMZO.js} +21 -18
  9. package/dist/chunk-ERRUYMZO.js.map +1 -0
  10. package/dist/{chunk-Z77VQUZ3.js → chunk-MM325DR6.js} +2 -2
  11. package/dist/chunk-RDNEANZB.js +103 -0
  12. package/dist/chunk-RDNEANZB.js.map +1 -0
  13. package/dist/{chunk-4HPWTWBL.js → chunk-RY5CDUNN.js} +12 -7
  14. package/dist/chunk-RY5CDUNN.js.map +1 -0
  15. package/dist/{chunk-TF7WSPFV.js → chunk-T232GZ2L.js} +2 -2
  16. package/dist/{chunk-SJCIM4TC.js → chunk-ZIPGRLYE.js} +3 -1
  17. package/dist/chunk-ZIPGRLYE.js.map +1 -0
  18. package/dist/{diff-IEN6W4OG.js → diff-PHEX3HUT.js} +4 -4
  19. package/dist/{dist-DVROIZAO.js → dist-M7X5RJB3.js} +19 -11
  20. package/dist/dist-M7X5RJB3.js.map +1 -0
  21. package/dist/{dist-SWJSMLIP.js → dist-X4CSVKKR.js} +2 -2
  22. package/dist/{generate-GQPOLFP7.js → generate-FIMBI2NW.js} +5 -5
  23. package/dist/{generate-story-UJS37FHA.js → generate-story-5TPTJA7B.js} +41 -18
  24. package/dist/generate-story-5TPTJA7B.js.map +1 -0
  25. package/dist/{generate-test-plan-RQTSGQLR.js → generate-test-plan-XBAFJKJI.js} +58 -9
  26. package/dist/generate-test-plan-XBAFJKJI.js.map +1 -0
  27. package/dist/{graph-OKUMHR3Q.js → graph-UZJMLX4J.js} +3 -3
  28. package/dist/index.d.ts +171 -0
  29. package/dist/index.js +201 -41
  30. package/dist/index.js.map +1 -1
  31. package/dist/{lint-VB5PV32N.js → lint-PUAQ2UL6.js} +4 -4
  32. package/dist/main.js +5 -90
  33. package/dist/main.js.map +1 -1
  34. package/dist/{mcp-DADOVCEV.js → mcp-WTO5PDIS.js} +6 -3
  35. package/dist/mcp-WTO5PDIS.js.map +1 -0
  36. package/dist/{migrate-LAMRDT3V.js → migrate-DEFCNOAH.js} +18 -7
  37. package/dist/migrate-DEFCNOAH.js.map +1 -0
  38. package/dist/{pack-B3KYRKUR.js → pack-PNLD5AYW.js} +4 -4
  39. package/dist/{ready-C6YXJ47W.js → ready-XIO2IPRE.js} +15 -6
  40. package/dist/ready-XIO2IPRE.js.map +1 -0
  41. package/dist/skills/core/specdx-author-spec/SKILL.md +1 -1
  42. package/dist/skills/core/specdx-author-spec/references/step-02-sections.md +41 -0
  43. package/dist/skills/core/specdx-router/SKILL.md +2 -2
  44. package/dist/skills/experimental/specdx-check-drift/SKILL.md +1 -1
  45. package/dist/skills/experimental/specdx-verify/SKILL.md +1 -1
  46. package/dist/{status-BRLCD7NY.js → status-BXOYBOH6.js} +5 -5
  47. package/dist/{update-P6TQUI6H.js → update-ELXABLVS.js} +4 -4
  48. package/dist/{validate-WIB246IE.js → validate-FXD5WS4C.js} +3 -3
  49. package/hooks/hooks.json +1 -1
  50. package/hooks/session-start +35 -3
  51. package/package.json +19 -6
  52. package/dist/chunk-4HPWTWBL.js.map +0 -1
  53. package/dist/chunk-PEC5LAVE.js.map +0 -1
  54. package/dist/chunk-SJCIM4TC.js.map +0 -1
  55. package/dist/chunk-TJPPBM24.js.map +0 -1
  56. package/dist/chunk-V7JOVK6D.js.map +0 -1
  57. package/dist/dist-DVROIZAO.js.map +0 -1
  58. package/dist/generate-story-UJS37FHA.js.map +0 -1
  59. package/dist/generate-test-plan-RQTSGQLR.js.map +0 -1
  60. package/dist/mcp-DADOVCEV.js.map +0 -1
  61. package/dist/migrate-LAMRDT3V.js.map +0 -1
  62. package/dist/ready-C6YXJ47W.js.map +0 -1
  63. /package/dist/{check-Q3QKTN2D.js.map → check-PRQNMBOE.js.map} +0 -0
  64. /package/dist/{chunk-Z77VQUZ3.js.map → chunk-MM325DR6.js.map} +0 -0
  65. /package/dist/{chunk-TF7WSPFV.js.map → chunk-T232GZ2L.js.map} +0 -0
  66. /package/dist/{diff-IEN6W4OG.js.map → diff-PHEX3HUT.js.map} +0 -0
  67. /package/dist/{dist-SWJSMLIP.js.map → dist-X4CSVKKR.js.map} +0 -0
  68. /package/dist/{generate-GQPOLFP7.js.map → generate-FIMBI2NW.js.map} +0 -0
  69. /package/dist/{graph-OKUMHR3Q.js.map → graph-UZJMLX4J.js.map} +0 -0
  70. /package/dist/{lint-VB5PV32N.js.map → lint-PUAQ2UL6.js.map} +0 -0
  71. /package/dist/{pack-B3KYRKUR.js.map → pack-PNLD5AYW.js.map} +0 -0
  72. /package/dist/{status-BRLCD7NY.js.map → status-BXOYBOH6.js.map} +0 -0
  73. /package/dist/{update-P6TQUI6H.js.map → update-ELXABLVS.js.map} +0 -0
  74. /package/dist/{validate-WIB246IE.js.map → validate-FXD5WS4C.js.map} +0 -0
@@ -4,15 +4,15 @@ import {
4
4
  import {
5
5
  createLintEngine,
6
6
  getPreset
7
- } from "./chunk-V7JOVK6D.js";
7
+ } from "./chunk-BD6UDHYW.js";
8
8
  import {
9
9
  buildGraph,
10
10
  createLogger,
11
11
  loadConfig,
12
12
  parseSpec,
13
13
  resolveGlob
14
- } from "./chunk-Z77VQUZ3.js";
15
- import "./chunk-SJCIM4TC.js";
14
+ } from "./chunk-MM325DR6.js";
15
+ import "./chunk-ZIPGRLYE.js";
16
16
  import "./chunk-5WRI5ZAA.js";
17
17
 
18
18
  // src/commands/core/lint.ts
@@ -120,4 +120,4 @@ export {
120
120
  lint_default as default,
121
121
  runLint
122
122
  };
123
- //# sourceMappingURL=lint-VB5PV32N.js.map
123
+ //# sourceMappingURL=lint-PUAQ2UL6.js.map
package/dist/main.js CHANGED
@@ -1,100 +1,15 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ package_default
4
+ } from "./chunk-RDNEANZB.js";
2
5
  import {
3
6
  subCommands
4
- } from "./chunk-TJPPBM24.js";
5
- import "./chunk-SJCIM4TC.js";
7
+ } from "./chunk-ERRUYMZO.js";
8
+ import "./chunk-ZIPGRLYE.js";
6
9
  import "./chunk-5WRI5ZAA.js";
7
10
 
8
11
  // src/main.ts
9
12
  import { defineCommand, runMain } from "citty";
10
-
11
- // package.json
12
- var package_default = {
13
- name: "specdx",
14
- version: "0.4.0-alpha.17",
15
- description: "Spec-driven development toolchain. Validate, lint, pack, and ship specs for LLM-assisted workflows.",
16
- type: "module",
17
- license: "MIT",
18
- author: "Umar Gora (https://github.com/umxr)",
19
- repository: {
20
- type: "git",
21
- url: "https://github.com/umxr/specdx.git",
22
- directory: "packages/cli"
23
- },
24
- homepage: "https://github.com/umxr/specdx#readme",
25
- bugs: {
26
- url: "https://github.com/umxr/specdx/issues"
27
- },
28
- keywords: [
29
- "spec",
30
- "specification",
31
- "prd",
32
- "technical-design",
33
- "api-contract",
34
- "lint",
35
- "validation",
36
- "llm",
37
- "ai",
38
- "context-packing",
39
- "spec-driven-development",
40
- "claude-code"
41
- ],
42
- engines: {
43
- node: ">=18.0.0"
44
- },
45
- bin: {
46
- specdx: "./dist/main.js"
47
- },
48
- exports: {
49
- ".": {
50
- import: "./dist/index.js",
51
- types: "./dist/index.d.ts"
52
- }
53
- },
54
- files: [
55
- "dist",
56
- ".claude-plugin",
57
- "hooks"
58
- ],
59
- scripts: {
60
- build: "tsup",
61
- typecheck: "tsc --noEmit",
62
- test: "vitest run",
63
- clean: "rm -rf dist *.tsbuildinfo"
64
- },
65
- dependencies: {
66
- "@modelcontextprotocol/sdk": "^1.27.0",
67
- ajv: "^8.18.0",
68
- "ajv-formats": "^3.0.1",
69
- citty: "^0.2.1",
70
- consola: "^3.4.0",
71
- "gray-matter": "^4.0.3",
72
- "js-tiktoken": "^1.0.18",
73
- "remark-parse": "^11.0.0",
74
- tinyglobby: "^0.2.12",
75
- unified: "^11.0.0",
76
- "unist-util-visit": "^5.0.0",
77
- yaml: "^2.7.0",
78
- zod: "^3.23.0"
79
- },
80
- devDependencies: {
81
- "@specdx/check": "workspace:*",
82
- "@specdx/core": "workspace:*",
83
- "@specdx/diff": "workspace:*",
84
- "@specdx/lint": "workspace:*",
85
- "@specdx/mcp": "workspace:*",
86
- "@specdx/pack": "workspace:*",
87
- "@specdx/schema": "workspace:*",
88
- "@specdx/skills": "workspace:*",
89
- tsup: "^8.5.1",
90
- typescript: "^5.7.0"
91
- },
92
- publishConfig: {
93
- access: "public"
94
- }
95
- };
96
-
97
- // src/main.ts
98
13
  var main = defineCommand({
99
14
  meta: { name: "specdx", version: package_default.version, description: "specdx \u2014 Spec Developer Experience" },
100
15
  subCommands
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main.ts","../package.json"],"sourcesContent":["#!/usr/bin/env node\nimport { defineCommand, runMain } from \"citty\";\nimport pkg from \"../package.json\" with { type: \"json\" };\nimport { subCommands } from \"./commands/registry.js\";\n\nconst main = defineCommand({\n meta: { name: \"specdx\", version: pkg.version, description: \"specdx — Spec Developer Experience\" },\n subCommands,\n});\n\nrunMain(main).catch((err: Error) => {\n console.error(`\\n ✗ ${err.message}\\n`);\n process.exit(1);\n});\n","{\n \"name\": \"specdx\",\n \"version\": \"0.4.0-alpha.17\",\n \"description\": \"Spec-driven development toolchain. Validate, lint, pack, and ship specs for LLM-assisted workflows.\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"author\": \"Umar Gora (https://github.com/umxr)\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/umxr/specdx.git\",\n \"directory\": \"packages/cli\"\n },\n \"homepage\": \"https://github.com/umxr/specdx#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/umxr/specdx/issues\"\n },\n \"keywords\": [\n \"spec\",\n \"specification\",\n \"prd\",\n \"technical-design\",\n \"api-contract\",\n \"lint\",\n \"validation\",\n \"llm\",\n \"ai\",\n \"context-packing\",\n \"spec-driven-development\",\n \"claude-code\"\n ],\n \"engines\": {\n \"node\": \">=18.0.0\"\n },\n \"bin\": {\n \"specdx\": \"./dist/main.js\"\n },\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\"\n }\n },\n \"files\": [\n \"dist\",\n \".claude-plugin\",\n \"hooks\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run\",\n \"clean\": \"rm -rf dist *.tsbuildinfo\"\n },\n \"dependencies\": {\n \"@modelcontextprotocol/sdk\": \"^1.27.0\",\n \"ajv\": \"^8.18.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"citty\": \"^0.2.1\",\n \"consola\": \"^3.4.0\",\n \"gray-matter\": \"^4.0.3\",\n \"js-tiktoken\": \"^1.0.18\",\n \"remark-parse\": \"^11.0.0\",\n \"tinyglobby\": \"^0.2.12\",\n \"unified\": \"^11.0.0\",\n \"unist-util-visit\": \"^5.0.0\",\n \"yaml\": \"^2.7.0\",\n \"zod\": \"^3.23.0\"\n },\n \"devDependencies\": {\n \"@specdx/check\": \"workspace:*\",\n \"@specdx/core\": \"workspace:*\",\n \"@specdx/diff\": \"workspace:*\",\n \"@specdx/lint\": \"workspace:*\",\n \"@specdx/mcp\": \"workspace:*\",\n \"@specdx/pack\": \"workspace:*\",\n \"@specdx/schema\": \"workspace:*\",\n \"@specdx/skills\": \"workspace:*\",\n \"tsup\": \"^8.5.1\",\n \"typescript\": \"^5.7.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n"],"mappings":";;;;;;;;AAC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AAAA,IACR,YAAc;AAAA,EAChB;AAAA,EACA,eAAiB;AAAA,IACf,QAAU;AAAA,EACZ;AACF;;;AD9EA,IAAM,OAAO,cAAc;AAAA,EACzB,MAAM,EAAE,MAAM,UAAU,SAAS,gBAAI,SAAS,aAAa,0CAAqC;AAAA,EAChG;AACF,CAAC;AAED,QAAQ,IAAI,EAAE,MAAM,CAAC,QAAe;AAClC,UAAQ,MAAM;AAAA,WAAS,IAAI,OAAO;AAAA,CAAI;AACtC,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/main.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { defineCommand, runMain } from \"citty\";\nimport pkg from \"../package.json\" with { type: \"json\" };\nimport { subCommands } from \"./commands/registry.js\";\n\nconst main = defineCommand({\n meta: { name: \"specdx\", version: pkg.version, description: \"specdx — Spec Developer Experience\" },\n subCommands,\n});\n\nrunMain(main).catch((err: Error) => {\n console.error(`\\n ✗ ${err.message}\\n`);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;AACA,SAAS,eAAe,eAAe;AAIvC,IAAM,OAAO,cAAc;AAAA,EACzB,MAAM,EAAE,MAAM,UAAU,SAAS,gBAAI,SAAS,aAAa,0CAAqC;AAAA,EAChG;AACF,CAAC;AAED,QAAQ,IAAI,EAAE,MAAM,CAAC,QAAe;AAClC,UAAQ,MAAM;AAAA,WAAS,IAAI,OAAO;AAAA,CAAI;AACtC,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
@@ -1,3 +1,6 @@
1
+ import {
2
+ package_default
3
+ } from "./chunk-RDNEANZB.js";
1
4
  import "./chunk-5WRI5ZAA.js";
2
5
 
3
6
  // src/commands/core/mcp.ts
@@ -9,7 +12,7 @@ var mcp_default = defineCommand({
9
12
  let mcp;
10
13
  let stdio;
11
14
  try {
12
- mcp = await import("./dist-DVROIZAO.js");
15
+ mcp = await import("./dist-M7X5RJB3.js");
13
16
  stdio = await import("@modelcontextprotocol/sdk/server/stdio.js");
14
17
  } catch (err) {
15
18
  const missing = err.message.includes("zod") ? "zod" : "@modelcontextprotocol/sdk";
@@ -22,11 +25,11 @@ var mcp_default = defineCommand({
22
25
  );
23
26
  process.exit(1);
24
27
  }
25
- const server = mcp.createMcpServer();
28
+ const server = mcp.createMcpServer(package_default.version);
26
29
  await server.connect(new stdio.StdioServerTransport());
27
30
  }
28
31
  });
29
32
  export {
30
33
  mcp_default as default
31
34
  };
32
- //# sourceMappingURL=mcp-DADOVCEV.js.map
35
+ //# sourceMappingURL=mcp-WTO5PDIS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/core/mcp.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport pkg from \"../../../package.json\" with { type: \"json\" };\n\nexport default defineCommand({\n meta: { name: \"mcp\", description: \"Start the specdx MCP server (stdio transport)\" },\n args: {},\n async run() {\n // The MCP SDK and zod are dependencies of specdx, not bundled into it. A\n // broken or partial install should say so rather than surface a raw\n // ERR_MODULE_NOT_FOUND stack trace on stdout, which is also the transport.\n let mcp: typeof import(\"@specdx/mcp\");\n let stdio: typeof import(\"@modelcontextprotocol/sdk/server/stdio.js\");\n try {\n mcp = await import(\"@specdx/mcp\");\n stdio = await import(\"@modelcontextprotocol/sdk/server/stdio.js\");\n } catch (err) {\n const missing = (err as Error).message.includes(\"zod\") ? \"zod\" : \"@modelcontextprotocol/sdk\";\n console.error(\n `\\n ✗ Cannot start the MCP server: ${missing} is not installed.\\n` +\n ` It ships as a dependency of specdx, so this usually means a partial install.\\n` +\n ` Try reinstalling specdx, or add it directly: npm install ${missing}\\n`,\n );\n process.exit(1);\n }\n\n const server = mcp.createMcpServer(pkg.version);\n await server.connect(new stdio.StdioServerTransport());\n },\n});\n"],"mappings":";;;;;;AAAA,SAAS,qBAAqB;AAG9B,IAAO,cAAQ,cAAc;AAAA,EAC3B,MAAM,EAAE,MAAM,OAAO,aAAa,gDAAgD;AAAA,EAClF,MAAM,CAAC;AAAA,EACP,MAAM,MAAM;AAIV,QAAI;AACJ,QAAI;AACJ,QAAI;AACF,YAAM,MAAM,OAAO,oBAAa;AAChC,cAAQ,MAAM,OAAO,2CAA2C;AAAA,IAClE,SAAS,KAAK;AACZ,YAAM,UAAW,IAAc,QAAQ,SAAS,KAAK,IAAI,QAAQ;AACjE,cAAQ;AAAA,QACN;AAAA,wCAAsC,OAAO;AAAA;AAAA,+DAEqB,OAAO;AAAA;AAAA,MAC3E;AACA,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,UAAM,SAAS,IAAI,gBAAgB,gBAAI,OAAO;AAC9C,UAAM,OAAO,QAAQ,IAAI,MAAM,qBAAqB,CAAC;AAAA,EACvD;AACF,CAAC;","names":[]}
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  createLogger,
3
3
  loadConfig
4
- } from "./chunk-Z77VQUZ3.js";
4
+ } from "./chunk-MM325DR6.js";
5
5
  import {
6
- SPEC_TYPES
7
- } from "./chunk-SJCIM4TC.js";
6
+ SPEC_TYPES,
7
+ SUPPORTED_CONFIG_VERSION
8
+ } from "./chunk-ZIPGRLYE.js";
8
9
  import "./chunk-5WRI5ZAA.js";
9
10
 
10
11
  // src/commands/experimental/migrate.ts
@@ -22,6 +23,7 @@ var migrate_default = defineCommand({
22
23
  logger.info(`
23
24
  Config version: ${config.version}`);
24
25
  logger.info(` Supported spec types: ${SPEC_TYPES.join(", ")}`);
26
+ const versionMismatch = config.version !== SUPPORTED_CONFIG_VERSION;
25
27
  const unknownTypes = [];
26
28
  for (const [key, entry] of Object.entries(config.specs)) {
27
29
  if (!SPEC_TYPES.includes(entry.type)) {
@@ -38,11 +40,20 @@ var migrate_default = defineCommand({
38
40
  Update specdx to resolve.
39
41
  `);
40
42
  process.exit(1);
41
- } else {
42
- logger.info(`
43
+ }
44
+ if (versionMismatch) {
45
+ logger.info(
46
+ `
47
+ \u26A0 Config declares version "${config.version}", but this specdx supports "${SUPPORTED_CONFIG_VERSION}".
48
+ Every spec type is recognised, so nothing needs migrating \u2014
49
+ set version: "${SUPPORTED_CONFIG_VERSION}" in spec.config.yaml to match.
50
+ `
51
+ );
52
+ return;
53
+ }
54
+ logger.info(`
43
55
  \u2713 All spec types are recognized. No migration needed.
44
56
  `);
45
- }
46
57
  } catch (err) {
47
58
  console.error(`
48
59
  \u2717 ${err.message}
@@ -54,4 +65,4 @@ var migrate_default = defineCommand({
54
65
  export {
55
66
  migrate_default as default
56
67
  };
57
- //# sourceMappingURL=migrate-LAMRDT3V.js.map
68
+ //# sourceMappingURL=migrate-DEFCNOAH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/experimental/migrate.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport { loadConfig, createLogger } from \"@specdx/core\";\nimport { SPEC_TYPES, SUPPORTED_CONFIG_VERSION } from \"@specdx/schema\";\n\nexport default defineCommand({\n meta: { name: \"migrate\", description: \"Check and migrate spec suite schema\" },\n args: {\n quiet: { type: \"boolean\", description: \"Suppress output\" },\n },\n async run({ args }) {\n const logger = createLogger({ quiet: args.quiet });\n const configDir = process.cwd();\n\n try {\n const config = await loadConfig(undefined, configDir);\n logger.info(`\\n Config version: ${config.version}`);\n logger.info(` Supported spec types: ${SPEC_TYPES.join(\", \")}`);\n\n // Printing the version and then ignoring it made the field decorative:\n // a config declaring 0.9 was reported as needing no migration, which is\n // the one question this command exists to answer.\n const versionMismatch = config.version !== SUPPORTED_CONFIG_VERSION;\n\n const unknownTypes: string[] = [];\n for (const [key, entry] of Object.entries(config.specs)) {\n if (!SPEC_TYPES.includes(entry.type as (typeof SPEC_TYPES)[number])) {\n unknownTypes.push(`${key}: ${entry.type}`);\n }\n }\n\n if (unknownTypes.length > 0) {\n logger.info(`\\n Unknown spec types found:`);\n for (const ut of unknownTypes) {\n logger.info(` - ${ut}`);\n }\n logger.info(`\\n Update specdx to resolve.\\n`);\n process.exit(1);\n }\n\n if (versionMismatch) {\n logger.info(\n `\\n ⚠ Config declares version \"${config.version}\", but this specdx supports \"${SUPPORTED_CONFIG_VERSION}\".` +\n `\\n Every spec type is recognised, so nothing needs migrating —` +\n `\\n set version: \"${SUPPORTED_CONFIG_VERSION}\" in spec.config.yaml to match.\\n`,\n );\n return;\n }\n\n logger.info(`\\n ✓ All spec types are recognized. No migration needed.\\n`);\n } catch (err) {\n console.error(`\\n ✗ ${(err as Error).message}\\n`);\n process.exit(1);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,qBAAqB;AAI9B,IAAO,kBAAQ,cAAc;AAAA,EAC3B,MAAM,EAAE,MAAM,WAAW,aAAa,sCAAsC;AAAA,EAC5E,MAAM;AAAA,IACJ,OAAO,EAAE,MAAM,WAAW,aAAa,kBAAkB;AAAA,EAC3D;AAAA,EACA,MAAM,IAAI,EAAE,KAAK,GAAG;AAClB,UAAM,SAAS,aAAa,EAAE,OAAO,KAAK,MAAM,CAAC;AACjD,UAAM,YAAY,QAAQ,IAAI;AAE9B,QAAI;AACF,YAAM,SAAS,MAAM,WAAW,QAAW,SAAS;AACpD,aAAO,KAAK;AAAA,oBAAuB,OAAO,OAAO,EAAE;AACnD,aAAO,KAAK,2BAA2B,WAAW,KAAK,IAAI,CAAC,EAAE;AAK9D,YAAM,kBAAkB,OAAO,YAAY;AAE3C,YAAM,eAAyB,CAAC;AAChC,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,KAAK,GAAG;AACvD,YAAI,CAAC,WAAW,SAAS,MAAM,IAAmC,GAAG;AACnE,uBAAa,KAAK,GAAG,GAAG,KAAK,MAAM,IAAI,EAAE;AAAA,QAC3C;AAAA,MACF;AAEA,UAAI,aAAa,SAAS,GAAG;AAC3B,eAAO,KAAK;AAAA,4BAA+B;AAC3C,mBAAW,MAAM,cAAc;AAC7B,iBAAO,KAAK,SAAS,EAAE,EAAE;AAAA,QAC3B;AACA,eAAO,KAAK;AAAA;AAAA,CAAiC;AAC7C,gBAAQ,KAAK,CAAC;AAAA,MAChB;AAEA,UAAI,iBAAiB;AACnB,eAAO;AAAA,UACL;AAAA,oCAAkC,OAAO,OAAO,gCAAgC,wBAAwB;AAAA;AAAA,oBAE/E,wBAAwB;AAAA;AAAA,QACnD;AACA;AAAA,MACF;AAEA,aAAO,KAAK;AAAA;AAAA,CAA6D;AAAA,IAC3E,SAAS,KAAK;AACZ,cAAQ,MAAM;AAAA,WAAU,IAAc,OAAO;AAAA,CAAI;AACjD,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AACF,CAAC;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pack
3
- } from "./chunk-TF7WSPFV.js";
3
+ } from "./chunk-T232GZ2L.js";
4
4
  import {
5
5
  sharedArgs
6
6
  } from "./chunk-GAM4MXPC.js";
@@ -10,8 +10,8 @@ import {
10
10
  loadConfig,
11
11
  parseSpec,
12
12
  resolveGlob
13
- } from "./chunk-Z77VQUZ3.js";
14
- import "./chunk-SJCIM4TC.js";
13
+ } from "./chunk-MM325DR6.js";
14
+ import "./chunk-ZIPGRLYE.js";
15
15
  import "./chunk-5WRI5ZAA.js";
16
16
 
17
17
  // src/commands/core/pack.ts
@@ -189,4 +189,4 @@ export {
189
189
  emptyPackReason,
190
190
  runPack
191
191
  };
192
- //# sourceMappingURL=pack-B3KYRKUR.js.map
192
+ //# sourceMappingURL=pack-PNLD5AYW.js.map
@@ -3,19 +3,20 @@ import {
3
3
  } from "./chunk-GAM4MXPC.js";
4
4
  import {
5
5
  createLintEngine,
6
- getPreset
7
- } from "./chunk-V7JOVK6D.js";
6
+ getPreset,
7
+ parseFeatures
8
+ } from "./chunk-BD6UDHYW.js";
8
9
  import {
9
10
  DEFAULT_DIFF_CONFIG
10
- } from "./chunk-4HPWTWBL.js";
11
+ } from "./chunk-RY5CDUNN.js";
11
12
  import {
12
13
  buildGraph,
13
14
  createLogger,
14
15
  loadConfig,
15
16
  parseSpec,
16
17
  resolveGlob
17
- } from "./chunk-Z77VQUZ3.js";
18
- import "./chunk-SJCIM4TC.js";
18
+ } from "./chunk-MM325DR6.js";
19
+ import "./chunk-ZIPGRLYE.js";
19
20
  import "./chunk-5WRI5ZAA.js";
20
21
 
21
22
  // src/commands/core/ready.ts
@@ -179,6 +180,7 @@ async function runReady() {
179
180
  const storyCoverageErrors = lintResults.diagnostics.filter(
180
181
  (d) => d.ruleId === "completeness/story-coverage"
181
182
  );
183
+ const featureCount = specs.filter((s) => s.spec.frontmatter.type === "prd").reduce((sum, s) => sum + parseFeatures(s.spec.content).length, 0);
182
184
  if (!hasPrd) {
183
185
  checks.push({
184
186
  name: "Story coverage",
@@ -186,6 +188,13 @@ async function runReady() {
186
188
  skipped: true,
187
189
  details: "skipped (no PRD in suite)"
188
190
  });
191
+ } else if (featureCount === 0) {
192
+ checks.push({
193
+ name: "Story coverage",
194
+ passed: true,
195
+ skipped: true,
196
+ details: "skipped (no features declared in the PRD)"
197
+ });
189
198
  } else {
190
199
  checks.push({
191
200
  name: "Story coverage",
@@ -245,4 +254,4 @@ export {
245
254
  ready_default as default,
246
255
  runReady
247
256
  };
248
- //# sourceMappingURL=ready-C6YXJ47W.js.map
257
+ //# sourceMappingURL=ready-XIO2IPRE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/core/ready.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport { loadConfig, parseSpec, resolveGlob, buildGraph, createLogger } from \"@specdx/core\";\nimport { createLintEngine, getPreset, parseFeatures } from \"@specdx/lint\";\nimport type { ParsedSpec } from \"@specdx/core\";\nimport { DEFAULT_DIFF_CONFIG } from \"@specdx/diff\";\nimport { sharedArgs } from \"../../shared-args.js\";\n\nexport interface ReadyCheck {\n name: string;\n passed: boolean;\n /** True when the check had nothing to verify — reported as skipped, not as a pass. */\n skipped?: boolean;\n details: string;\n}\n\nexport interface ReadyResult {\n project: string;\n ready: boolean;\n checks: ReadyCheck[];\n}\n\nexport async function runReady(): Promise<ReadyResult> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n\n const checks: ReadyCheck[] = [];\n\n // Resolve and parse all specs\n const specs: {\n spec: ParsedSpec;\n key: string;\n entry: { path: string; required?: boolean; owner?: string };\n }[] = [];\n for (const [key, entry] of Object.entries(config.specs)) {\n const paths = await resolveGlob(entry.path, configDir);\n for (const p of paths) {\n const spec = await parseSpec(p);\n specs.push({\n spec,\n key,\n entry: entry as { path: string; required?: boolean; owner?: string },\n });\n }\n }\n\n // Check 0: The suite has specs at all. Without this, every check below\n // ticks over an empty set and READY means nothing (vacuous-pass audit).\n checks.push({\n name: \"Spec suite non-empty\",\n passed: specs.length > 0,\n details:\n specs.length > 0\n ? `${specs.length} specs resolved`\n : \"no spec files resolved — check the spec paths in spec.config.yaml\",\n });\n\n // Check 1: Required specs exist\n const requiredEntries = Object.entries(config.specs).filter(\n ([, entry]) => (entry as { required?: boolean }).required,\n );\n const missingRequired: string[] = [];\n for (const [key, entry] of requiredEntries) {\n const paths = await resolveGlob(entry.path, configDir);\n if (paths.length === 0) {\n missingRequired.push(key);\n }\n }\n if (requiredEntries.length === 0) {\n checks.push({\n name: \"Required specs present\",\n passed: true,\n skipped: true,\n details: \"skipped (no specs marked required in config)\",\n });\n } else {\n checks.push({\n name: \"Required specs present\",\n passed: missingRequired.length === 0,\n details:\n missingRequired.length === 0\n ? `All ${requiredEntries.length} required specs found`\n : `Missing: ${missingRequired.join(\", \")}`,\n });\n }\n\n // Check 2: Lint health (no errors)\n const presetName = config.lint?.extends ?? \"recommended\";\n const rules = getPreset(presetName);\n\n let graph;\n let graphError: string | undefined;\n try {\n graph = buildGraph(config);\n } catch (err) {\n graphError = (err as Error).message;\n }\n\n const engine = createLintEngine({ rules, config, graph });\n const lintResults = engine.lint(specs.map((s) => s.spec));\n\n if (graphError) {\n lintResults.diagnostics.push({\n ruleId: \"structure/no-circular-deps\",\n severity: \"error\",\n message: graphError,\n filePath: \"spec.config.yaml\",\n });\n lintResults.hasErrors = true;\n }\n\n const errors = lintResults.diagnostics.filter((d) => d.severity === \"error\").length;\n const warnings = lintResults.diagnostics.filter((d) => d.severity === \"warn\").length;\n if (specs.length === 0) {\n checks.push({\n name: \"Lint health\",\n passed: true,\n skipped: true,\n details: \"skipped (no specs to lint)\",\n });\n } else {\n checks.push({\n name: \"Lint health\",\n passed: errors === 0,\n details: `${errors} errors, ${warnings} warnings`,\n });\n }\n\n // Check 2b: specs actually say something. A scaffolded suite passes every\n // structural check while every section is still a placeholder, so without\n // this a brand new project is declared ready to implement (issue #24).\n const placeholderDiagnostics = lintResults.diagnostics.filter(\n (d) => d.ruleId === \"completeness/no-placeholder-sections\",\n );\n const placeholderFiles = new Set(placeholderDiagnostics.map((d) => d.filePath));\n if (specs.length === 0) {\n checks.push({\n name: \"Specs have content\",\n passed: true,\n skipped: true,\n details: \"skipped (no specs to assess)\",\n });\n } else {\n checks.push({\n name: \"Specs have content\",\n passed: placeholderFiles.size === 0,\n details:\n placeholderFiles.size === 0\n ? \"No placeholder sections\"\n : `${placeholderDiagnostics.length} placeholder section(s) across ${placeholderFiles.size} spec(s)`,\n });\n }\n\n // Check 3: No integrity issues (broken refs, circular deps)\n const integrityIssues: string[] = [];\n if (graphError) {\n integrityIssues.push(graphError);\n }\n const refErrors = lintResults.diagnostics.filter(\n (d) => d.ruleId === \"structure/valid-references\",\n );\n for (const d of refErrors) {\n integrityIssues.push(d.message);\n }\n const hasDeclaredRelations =\n specs.some((s) => {\n const refs = s.spec.frontmatter.references;\n return Array.isArray(refs) && refs.length > 0;\n }) ||\n Object.values(config.specs).some(\n (entry) => ((entry as { requires?: string[] }).requires?.length ?? 0) > 0,\n );\n if (integrityIssues.length === 0 && !hasDeclaredRelations) {\n checks.push({\n name: \"No integrity issues\",\n passed: true,\n skipped: true,\n details: \"skipped (no references or dependencies declared)\",\n });\n } else {\n checks.push({\n name: \"No integrity issues\",\n passed: integrityIssues.length === 0,\n details:\n integrityIssues.length === 0\n ? \"References and dependencies valid\"\n : integrityIssues.join(\"; \"),\n });\n }\n\n // Check 4: No stale specs\n const thresholdDays =\n config.diff?.staleness_threshold_days ?? DEFAULT_DIFF_CONFIG.staleness_threshold_days;\n const now = Date.now();\n const staleSpecs: { specId: string; days: number }[] = [];\n for (const { spec } of specs) {\n const dateStr =\n (spec.frontmatter.updated as string | undefined) ||\n (spec.frontmatter.created as string | undefined);\n if (dateStr) {\n const days = Math.floor((now - new Date(dateStr).getTime()) / (1000 * 60 * 60 * 24));\n if (days > thresholdDays) {\n staleSpecs.push({ specId: spec.frontmatter.id as string, days });\n }\n }\n }\n if (specs.length === 0) {\n checks.push({\n name: \"No stale specs\",\n passed: true,\n skipped: true,\n details: \"skipped (no specs to date-check)\",\n });\n } else {\n checks.push({\n name: \"No stale specs\",\n passed: staleSpecs.length === 0,\n details:\n staleSpecs.length === 0\n ? `All specs within ${thresholdDays}-day threshold`\n : staleSpecs.map((s) => `${s.specId} (${s.days}d)`).join(\", \"),\n });\n }\n\n // Check 5: Story coverage — every PRD feature has a user story\n const hasPrd = specs.some((s) => s.spec.frontmatter.type === \"prd\");\n const storyCoverageErrors = lintResults.diagnostics.filter(\n (d) => d.ruleId === \"completeness/story-coverage\",\n );\n // A PRD with no parseable features has nothing to be covered, so asserting\n // that every feature has a story is a claim about an empty set -- the same\n // vacuous pass the suite-level checks were fixed for.\n const featureCount = specs\n .filter((s) => s.spec.frontmatter.type === \"prd\")\n .reduce((sum, s) => sum + parseFeatures(s.spec.content).length, 0);\n\n if (!hasPrd) {\n checks.push({\n name: \"Story coverage\",\n passed: true,\n skipped: true,\n details: \"skipped (no PRD in suite)\",\n });\n } else if (featureCount === 0) {\n checks.push({\n name: \"Story coverage\",\n passed: true,\n skipped: true,\n details: \"skipped (no features declared in the PRD)\",\n });\n } else {\n checks.push({\n name: \"Story coverage\",\n passed: storyCoverageErrors.length === 0,\n details:\n storyCoverageErrors.length === 0\n ? \"All PRD features have corresponding stories\"\n : storyCoverageErrors.map((d) => d.message).join(\"; \"),\n });\n }\n\n const ready = checks.every((c) => c.passed);\n return { project: config.project?.name ?? \"project\", ready, checks };\n}\n\nexport default defineCommand({\n meta: { name: \"ready\", description: \"Check if spec suite is ready for implementation\" },\n args: {\n ...sharedArgs,\n },\n async run({ args }) {\n try {\n const logger = createLogger({ quiet: args.quiet, verbose: args.verbose });\n logger.debug(\"Running readiness checks...\");\n\n const result = await runReady();\n\n if (args.format === \"json\") {\n console.log(JSON.stringify(result, null, 2));\n if (!result.ready) process.exit(1);\n return;\n }\n\n // Pretty format\n const icon = result.ready ? \"✓\" : \"✗\";\n const label = result.ready ? \"ready for implementation\" : \"not ready for implementation\";\n\n console.log(`\\n ${icon} ${result.project} — ${label}\\n`);\n\n for (const check of result.checks) {\n const checkIcon = check.skipped ? \"–\" : check.passed ? \"✓\" : \"✗\";\n console.log(` ${checkIcon} ${check.name}: ${check.details}`);\n }\n\n const failCount = result.checks.filter((c) => !c.passed).length;\n if (failCount > 0) {\n console.log(\n `\\n Verdict: NOT READY — ${failCount} issue${failCount > 1 ? \"s\" : \"\"} to resolve\\n`,\n );\n } else {\n console.log(`\\n Verdict: READY\\n`);\n }\n\n if (!result.ready) process.exit(1);\n } catch (err) {\n console.error(`\\n ✗ ${(err as Error).message}\\n`);\n process.exit(1);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,qBAAqB;AAqB9B,eAAsB,WAAiC;AACrD,QAAM,YAAY,QAAQ,IAAI;AAC9B,QAAM,SAAS,MAAM,WAAW,QAAW,SAAS;AAEpD,QAAM,SAAuB,CAAC;AAG9B,QAAM,QAIA,CAAC;AACP,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,KAAK,GAAG;AACvD,UAAM,QAAQ,MAAM,YAAY,MAAM,MAAM,SAAS;AACrD,eAAW,KAAK,OAAO;AACrB,YAAM,OAAO,MAAM,UAAU,CAAC;AAC9B,YAAM,KAAK;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EAC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AK,OAAO,SAAS,KAAK,QAAQ,CAAC;AACxE,aAAO,MAAM,6BAA6B;AAE1C,YAAM,SAAS,MAAM,SAAS;AAE9B,UAAI,KAAK,WAAW,QAAQ;AAC1B,gBAAQ,IAAI,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AAC3C,YAAI,CAAC,OAAO,MAAO,SAAQ,KAAK,CAAC;AACjC;AAAA,MACF;AAGA,YAAM,OAAO,OAAO,QAAQ,WAAM;AAClC,YAAM,QAAQ,OAAO,QAAQ,6BAA6B;AAE1D,cAAQ,IAAI;AAAA,IAAO,IAAI,IAAI,OAAO,OAAO,WAAM,KAAK;AAAA,CAAI;AAExD,iBAAW,SAAS,OAAO,QAAQ;AACjC,cAAM,YAAY,MAAM,UAAU,WAAM,MAAM,SAAS,WAAM;AAC7D,gBAAQ,IAAI,OAAO,SAAS,IAAI,MAAM,IAAI,KAAK,MAAM,OAAO,EAAE;AAAA,MAChE;AAEA,YAAM,YAAY,OAAO,OAAO,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE;AACzD,UAAI,YAAY,GAAG;AACjB,gBAAQ;AAAA,UACN;AAAA,8BAA4B,SAAS,SAAS,YAAY,IAAI,MAAM,EAAE;AAAA;AAAA,QACxE;AAAA,MACF,OAAO;AACL,gBAAQ,IAAI;AAAA;AAAA,CAAsB;AAAA,MACpC;AAEA,UAAI,CAAC,OAAO,MAAO,SAAQ,KAAK,CAAC;AAAA,IACnC,SAAS,KAAK;AACZ,cAAQ,MAAM;AAAA,WAAU,IAAc,OAAO;AAAA,CAAI;AACjD,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AACF,CAAC;","names":[]}
@@ -30,4 +30,4 @@ For detailed reference on spec types and their fields, see `references/spec-type
30
30
 
31
31
  ## It's working if
32
32
 
33
- The spec lints clean *and* a reader who was not in the conversation could build from it. If you finished the steps but every section is one vague line, the skill ran and the spec still fails its job — `sdx lint` will now flag placeholder sections, so an empty pass means real content.
33
+ The spec lints clean *and* a reader who was not in the conversation could build from it. If you finished the steps but every section is one vague line, the skill ran and the spec still fails its job — `specdx lint` will now flag placeholder sections, so an empty pass means real content.
@@ -57,6 +57,47 @@ Do NOT skip the lint step between sections. Run `npx specdx lint --path <file>`
57
57
  after every 2-3 sections. Do NOT write the entire spec and lint at the end.
58
58
  </HARD-GATE>
59
59
 
60
+ ## Sections `specdx check` parses
61
+
62
+ Three sections are read by `specdx check` and compared against code. Prose in
63
+ them is fine, but the entries themselves must take one of these shapes or the
64
+ section is reported as not assessed — which silently removes it from the
65
+ coverage score.
66
+
67
+ **`## Endpoints`** (api-contract) — a bullet per endpoint, a `###` heading per
68
+ endpoint, or both:
69
+
70
+ ```markdown
71
+ - `GET /invoices` — list invoices
72
+ - POST /invoices — create an invoice
73
+
74
+ ### DELETE /invoices/:id
75
+
76
+ Void an invoice.
77
+ ```
78
+
79
+ **`## Data Model`** (technical-design) — a `###` heading per type, one field per
80
+ line as `- name: type`. Backticks are optional. The heading must be a single
81
+ identifier: `### Notes on the model` is read as prose, not as a type.
82
+
83
+ ```markdown
84
+ ### Invoice
85
+
86
+ - id: string
87
+ - `amountCents`: number
88
+ - paidAt?: Date
89
+ ```
90
+
91
+ **`## Test Cases`** (test-plan) — one bullet per case, optionally grouped under
92
+ `###` headings:
93
+
94
+ ```markdown
95
+ ### Invoices
96
+
97
+ - creates an invoice with a valid payload
98
+ - rejects an invoice with a negative amount
99
+ ```
100
+
60
101
  ## Rationalizations to Resist
61
102
 
62
103
  | Thought | Reality |
@@ -39,7 +39,7 @@ or step 3.
39
39
  | Wondering if the code still matches the specs | `specdx-verify` (experimental) |
40
40
  | Wondering if the specs still match the code | `specdx-check-drift` (experimental) |
41
41
 
42
- The last two are experimental: they are built on `sdx check`, whose static
42
+ The last two are experimental: they are built on `specdx check`, whose static
43
43
  analysis is noisy on prose-heavy specs. Treat their findings as prompts to look,
44
44
  not as failures.
45
45
 
@@ -51,7 +51,7 @@ not as failures.
51
51
  - **`specdx-verify` vs `specdx-check-drift`** — turns on which side you suspect.
52
52
  `verify` asks "did I build what the spec said". `check-drift` asks "have the
53
53
  specs fallen behind the code".
54
- - **`specdx-review-spec` vs `sdx lint`** — turns on what kind of problem.
54
+ - **`specdx-review-spec` vs `specdx lint`** — turns on what kind of problem.
55
55
  `lint` catches structural and mechanical faults. `review-spec` judges whether
56
56
  the content is decision-ready.
57
57
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: specdx-check-drift
3
- description: "[experimental — built on sdx check, whose static analysis can be noisy] Use when the user says 'check drift', 'did I drift from spec', 'am I still aligned', or as part of a pre-commit check. Compares recent code changes against spec definitions."
3
+ description: "[experimental — built on specdx check, whose static analysis can be noisy] Use when the user says 'check drift', 'did I drift from spec', 'am I still aligned', or as part of a pre-commit check. Compares recent code changes against spec definitions."
4
4
  allowed-tools: Bash(npx specdx:*) Read
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: specdx-verify
3
- description: "[experimental — built on sdx check, whose static analysis can be noisy] Use when the user says 'verify', 'check against spec', 'does this match the spec', 'review implementation', or after completing a feature. Runs spec-to-implementation analysis and reviews findings."
3
+ description: "[experimental — built on specdx check, whose static analysis can be noisy] Use when the user says 'verify', 'check against spec', 'does this match the spec', 'review implementation', or after completing a feature. Runs spec-to-implementation analysis and reviews findings."
4
4
  allowed-tools: Bash(npx specdx:*) Read
5
5
  ---
6
6
 
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  createLintEngine,
3
3
  getPreset
4
- } from "./chunk-V7JOVK6D.js";
4
+ } from "./chunk-BD6UDHYW.js";
5
5
  import {
6
6
  DEFAULT_DIFF_CONFIG
7
- } from "./chunk-4HPWTWBL.js";
7
+ } from "./chunk-RY5CDUNN.js";
8
8
  import {
9
9
  buildGraph,
10
10
  loadConfig,
11
11
  parseSpec,
12
12
  resolveGlob
13
- } from "./chunk-Z77VQUZ3.js";
14
- import "./chunk-SJCIM4TC.js";
13
+ } from "./chunk-MM325DR6.js";
14
+ import "./chunk-ZIPGRLYE.js";
15
15
  import "./chunk-5WRI5ZAA.js";
16
16
 
17
17
  // src/commands/core/status.ts
@@ -158,4 +158,4 @@ export {
158
158
  status_default as default,
159
159
  runStatus
160
160
  };
161
- //# sourceMappingURL=status-BRLCD7NY.js.map
161
+ //# sourceMappingURL=status-BXOYBOH6.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runCheck
3
- } from "./chunk-PEC5LAVE.js";
3
+ } from "./chunk-5MYELBKF.js";
4
4
  import {
5
5
  sharedArgs
6
6
  } from "./chunk-GAM4MXPC.js";
@@ -9,8 +9,8 @@ import {
9
9
  loadConfig,
10
10
  parseSpec,
11
11
  resolveGlob
12
- } from "./chunk-Z77VQUZ3.js";
13
- import "./chunk-SJCIM4TC.js";
12
+ } from "./chunk-MM325DR6.js";
13
+ import "./chunk-ZIPGRLYE.js";
14
14
  import "./chunk-5WRI5ZAA.js";
15
15
 
16
16
  // src/commands/experimental/update.ts
@@ -130,4 +130,4 @@ export {
130
130
  update_default as default,
131
131
  generateUpdates
132
132
  };
133
- //# sourceMappingURL=update-P6TQUI6H.js.map
133
+ //# sourceMappingURL=update-ELXABLVS.js.map
@@ -7,8 +7,8 @@ import {
7
7
  buildGraph,
8
8
  loadConfig,
9
9
  resolveGlob
10
- } from "./chunk-Z77VQUZ3.js";
11
- import "./chunk-SJCIM4TC.js";
10
+ } from "./chunk-MM325DR6.js";
11
+ import "./chunk-ZIPGRLYE.js";
12
12
  import "./chunk-5WRI5ZAA.js";
13
13
 
14
14
  // src/commands/core/validate.ts
@@ -84,4 +84,4 @@ export {
84
84
  validate_default as default,
85
85
  runValidate
86
86
  };
87
- //# sourceMappingURL=validate-WIB246IE.js.map
87
+ //# sourceMappingURL=validate-FXD5WS4C.js.map
package/hooks/hooks.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "hooks": [
6
6
  {
7
7
  "type": "command",
8
- "command": "\"${CLAUDE_PLUGIN_ROOT}\"/hooks/session-start"
8
+ "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start"
9
9
  }
10
10
  ]
11
11
  }
@@ -30,8 +30,25 @@ escape_for_json() {
30
30
  printf '%s' "$s"
31
31
  }
32
32
 
33
- # Determine specdx invocation: prefer local binary, fall back to npx
34
- if command -v specdx >/dev/null 2>&1; then
33
+ # Determine the specdx invocation.
34
+ #
35
+ # Order matters. Resolving `specdx` from PATH first meant the plugin ran
36
+ # whatever version happened to be installed globally -- a stale one reported
37
+ # the project's config as invalid, and that answer was injected into the
38
+ # session as fact. A plugin ships with its own CLI; it must run that one.
39
+ #
40
+ # 1. the CLI bundled in this very package (${CLAUDE_PLUGIN_ROOT}/dist/main.js)
41
+ # 2. the project's own devDependency, so a pinned version wins
42
+ # 3. PATH
43
+ # 4. npx, which resolves the registry's `latest` and needs the network
44
+ PLUGIN_MAIN="${CLAUDE_PLUGIN_ROOT:-${SCRIPT_ROOT:-}}"
45
+ [ -z "$PLUGIN_MAIN" ] && PLUGIN_MAIN="$(cd "$(dirname "$0")/.." && pwd)"
46
+
47
+ if [ -f "${PLUGIN_MAIN}/dist/main.js" ] && command -v node >/dev/null 2>&1; then
48
+ SPECDX="node ${PLUGIN_MAIN}/dist/main.js"
49
+ elif [ -x "${PROJECT_ROOT}/node_modules/.bin/specdx" ]; then
50
+ SPECDX="${PROJECT_ROOT}/node_modules/.bin/specdx"
51
+ elif command -v specdx >/dev/null 2>&1; then
35
52
  SPECDX="specdx"
36
53
  elif command -v npx >/dev/null 2>&1; then
37
54
  SPECDX="npx --yes specdx"
@@ -46,8 +63,23 @@ run_specdx() {
46
63
  (cd "$1" && $SPECDX "${@:2}" 2>&1) | grep -v '^npm warn' || true
47
64
  }
48
65
 
66
+ # Keep the injected block bounded. `graph` grows with the suite -- one line per
67
+ # spec, plus one per reference edge, plus the "not reflected in config requires"
68
+ # advice -- so a large suite would silently spend a large part of the context
69
+ # window on a session summary. The cap is stated in lines rather than tokens
70
+ # because that is what this script can count.
71
+ MAX_GRAPH_LINES=40
72
+
73
+ truncate_lines() {
74
+ awk -v max="$1" '
75
+ NR <= max { print }
76
+ END { if (NR > max) printf " … %d more line(s) — run `specdx graph` for the rest\n", NR - max }
77
+ '
78
+ }
79
+
49
80
  validate_out="$(run_specdx "$PROJECT_ROOT" validate)" || validate_out="(validate failed)"
50
- graph_out="$(run_specdx "$PROJECT_ROOT" graph)" || graph_out="(graph failed)"
81
+ graph_out="$(run_specdx "$PROJECT_ROOT" graph | truncate_lines "$MAX_GRAPH_LINES")" ||
82
+ graph_out="(graph failed)"
51
83
 
52
84
  # Build a compact summary (target: under 500 tokens)
53
85
  summary="<specdx-context>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specdx",
3
- "version": "0.4.0-alpha.17",
3
+ "version": "0.4.0-alpha.19",
4
4
  "description": "Spec-driven development toolchain. Validate, lint, pack, and ship specs for LLM-assisted workflows.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -36,14 +36,15 @@
36
36
  },
37
37
  "exports": {
38
38
  ".": {
39
- "import": "./dist/index.js",
40
- "types": "./dist/index.d.ts"
39
+ "types": "./dist/index.d.ts",
40
+ "import": "./dist/index.js"
41
41
  }
42
42
  },
43
43
  "files": [
44
44
  "dist",
45
45
  ".claude-plugin",
46
- "hooks"
46
+ "hooks",
47
+ "README.md"
47
48
  ],
48
49
  "dependencies": {
49
50
  "@modelcontextprotocol/sdk": "^1.27.0",
@@ -63,11 +64,11 @@
63
64
  "devDependencies": {
64
65
  "tsup": "^8.5.1",
65
66
  "typescript": "^5.7.0",
66
- "@specdx/core": "0.0.0",
67
67
  "@specdx/check": "0.0.0",
68
+ "@specdx/core": "0.0.0",
69
+ "@specdx/lint": "0.0.0",
68
70
  "@specdx/diff": "0.0.0",
69
71
  "@specdx/mcp": "0.0.0",
70
- "@specdx/lint": "0.0.0",
71
72
  "@specdx/schema": "0.0.0",
72
73
  "@specdx/skills": "0.0.0",
73
74
  "@specdx/pack": "0.0.0"
@@ -75,6 +76,18 @@
75
76
  "publishConfig": {
76
77
  "access": "public"
77
78
  },
79
+ "peerDependencies": {
80
+ "ts-morph": ">=20",
81
+ "@anthropic-ai/sdk": ">=0.30"
82
+ },
83
+ "peerDependenciesMeta": {
84
+ "ts-morph": {
85
+ "optional": true
86
+ },
87
+ "@anthropic-ai/sdk": {
88
+ "optional": true
89
+ }
90
+ },
78
91
  "scripts": {
79
92
  "build": "tsup",
80
93
  "typecheck": "tsc --noEmit",