specdx 0.4.0-alpha.18 → 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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +42 -0
- package/dist/{check-PQQGR4KP.js → check-PRQNMBOE.js} +5 -5
- package/dist/{chunk-RI2SFGMR.js → chunk-5MYELBKF.js} +44 -17
- package/dist/chunk-5MYELBKF.js.map +1 -0
- package/dist/{chunk-FX4NRQHE.js → chunk-BD6UDHYW.js} +58 -10
- package/dist/chunk-BD6UDHYW.js.map +1 -0
- package/dist/{chunk-33FELECG.js → chunk-ERRUYMZO.js} +21 -18
- package/dist/chunk-ERRUYMZO.js.map +1 -0
- package/dist/{chunk-Z77VQUZ3.js → chunk-MM325DR6.js} +2 -2
- package/dist/chunk-RDNEANZB.js +103 -0
- package/dist/chunk-RDNEANZB.js.map +1 -0
- package/dist/{chunk-AXCGMUU7.js → chunk-RY5CDUNN.js} +2 -2
- package/dist/{chunk-TF7WSPFV.js → chunk-T232GZ2L.js} +2 -2
- package/dist/{chunk-SJCIM4TC.js → chunk-ZIPGRLYE.js} +3 -1
- package/dist/chunk-ZIPGRLYE.js.map +1 -0
- package/dist/{diff-IOBAJMKU.js → diff-PHEX3HUT.js} +4 -4
- package/dist/{dist-HRY2V5MO.js → dist-M7X5RJB3.js} +12 -10
- package/dist/dist-M7X5RJB3.js.map +1 -0
- package/dist/{dist-WXT4UJ55.js → dist-X4CSVKKR.js} +2 -2
- package/dist/{generate-NSTYQOAV.js → generate-FIMBI2NW.js} +5 -5
- package/dist/{generate-story-RFAPULQY.js → generate-story-5TPTJA7B.js} +13 -15
- package/dist/generate-story-5TPTJA7B.js.map +1 -0
- package/dist/{generate-test-plan-M22PCW73.js → generate-test-plan-XBAFJKJI.js} +51 -12
- package/dist/generate-test-plan-XBAFJKJI.js.map +1 -0
- package/dist/{graph-OKUMHR3Q.js → graph-UZJMLX4J.js} +3 -3
- package/dist/index.d.ts +171 -0
- package/dist/index.js +72 -22
- package/dist/index.js.map +1 -1
- package/dist/{lint-ADR7L6AP.js → lint-PUAQ2UL6.js} +4 -4
- package/dist/main.js +5 -103
- package/dist/main.js.map +1 -1
- package/dist/{mcp-A6CCWSS2.js → mcp-WTO5PDIS.js} +6 -3
- package/dist/mcp-WTO5PDIS.js.map +1 -0
- package/dist/{migrate-LAMRDT3V.js → migrate-DEFCNOAH.js} +18 -7
- package/dist/migrate-DEFCNOAH.js.map +1 -0
- package/dist/{pack-B3KYRKUR.js → pack-PNLD5AYW.js} +4 -4
- package/dist/{ready-GH4YKVOX.js → ready-XIO2IPRE.js} +5 -5
- package/dist/skills/core/specdx-author-spec/SKILL.md +1 -1
- package/dist/skills/core/specdx-author-spec/references/step-02-sections.md +41 -0
- package/dist/skills/core/specdx-router/SKILL.md +2 -2
- package/dist/skills/experimental/specdx-check-drift/SKILL.md +1 -1
- package/dist/skills/experimental/specdx-verify/SKILL.md +1 -1
- package/dist/{status-PQKPTDP5.js → status-BXOYBOH6.js} +5 -5
- package/dist/{update-VAC6XV5E.js → update-ELXABLVS.js} +4 -4
- package/dist/{validate-WIB246IE.js → validate-FXD5WS4C.js} +3 -3
- package/hooks/session-start +35 -3
- package/package.json +5 -5
- package/dist/chunk-33FELECG.js.map +0 -1
- package/dist/chunk-FX4NRQHE.js.map +0 -1
- package/dist/chunk-RI2SFGMR.js.map +0 -1
- package/dist/chunk-SJCIM4TC.js.map +0 -1
- package/dist/dist-HRY2V5MO.js.map +0 -1
- package/dist/generate-story-RFAPULQY.js.map +0 -1
- package/dist/generate-test-plan-M22PCW73.js.map +0 -1
- package/dist/mcp-A6CCWSS2.js.map +0 -1
- package/dist/migrate-LAMRDT3V.js.map +0 -1
- /package/dist/{check-PQQGR4KP.js.map → check-PRQNMBOE.js.map} +0 -0
- /package/dist/{chunk-Z77VQUZ3.js.map → chunk-MM325DR6.js.map} +0 -0
- /package/dist/{chunk-AXCGMUU7.js.map → chunk-RY5CDUNN.js.map} +0 -0
- /package/dist/{chunk-TF7WSPFV.js.map → chunk-T232GZ2L.js.map} +0 -0
- /package/dist/{diff-IOBAJMKU.js.map → diff-PHEX3HUT.js.map} +0 -0
- /package/dist/{dist-WXT4UJ55.js.map → dist-X4CSVKKR.js.map} +0 -0
- /package/dist/{generate-NSTYQOAV.js.map → generate-FIMBI2NW.js.map} +0 -0
- /package/dist/{graph-OKUMHR3Q.js.map → graph-UZJMLX4J.js.map} +0 -0
- /package/dist/{lint-ADR7L6AP.js.map → lint-PUAQ2UL6.js.map} +0 -0
- /package/dist/{pack-B3KYRKUR.js.map → pack-PNLD5AYW.js.map} +0 -0
- /package/dist/{ready-GH4YKVOX.js.map → ready-XIO2IPRE.js.map} +0 -0
- /package/dist/{status-PQKPTDP5.js.map → status-BXOYBOH6.js.map} +0 -0
- /package/dist/{update-VAC6XV5E.js.map → update-ELXABLVS.js.map} +0 -0
- /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-
|
|
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-
|
|
15
|
-
import "./chunk-
|
|
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-
|
|
123
|
+
//# sourceMappingURL=lint-PUAQ2UL6.js.map
|
package/dist/main.js
CHANGED
|
@@ -1,113 +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-
|
|
5
|
-
import "./chunk-
|
|
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.18",
|
|
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
|
-
"README.md"
|
|
59
|
-
],
|
|
60
|
-
scripts: {
|
|
61
|
-
build: "tsup",
|
|
62
|
-
typecheck: "tsc --noEmit",
|
|
63
|
-
test: "vitest run",
|
|
64
|
-
clean: "rm -rf dist *.tsbuildinfo"
|
|
65
|
-
},
|
|
66
|
-
dependencies: {
|
|
67
|
-
"@modelcontextprotocol/sdk": "^1.27.0",
|
|
68
|
-
ajv: "^8.18.0",
|
|
69
|
-
"ajv-formats": "^3.0.1",
|
|
70
|
-
citty: "^0.2.1",
|
|
71
|
-
consola: "^3.4.0",
|
|
72
|
-
"gray-matter": "^4.0.3",
|
|
73
|
-
"js-tiktoken": "^1.0.18",
|
|
74
|
-
"remark-parse": "^11.0.0",
|
|
75
|
-
tinyglobby: "^0.2.12",
|
|
76
|
-
unified: "^11.0.0",
|
|
77
|
-
"unist-util-visit": "^5.0.0",
|
|
78
|
-
yaml: "^2.7.0",
|
|
79
|
-
zod: "^3.23.0"
|
|
80
|
-
},
|
|
81
|
-
devDependencies: {
|
|
82
|
-
"@specdx/check": "workspace:*",
|
|
83
|
-
"@specdx/core": "workspace:*",
|
|
84
|
-
"@specdx/diff": "workspace:*",
|
|
85
|
-
"@specdx/lint": "workspace:*",
|
|
86
|
-
"@specdx/mcp": "workspace:*",
|
|
87
|
-
"@specdx/pack": "workspace:*",
|
|
88
|
-
"@specdx/schema": "workspace:*",
|
|
89
|
-
"@specdx/skills": "workspace:*",
|
|
90
|
-
tsup: "^8.5.1",
|
|
91
|
-
typescript: "^5.7.0"
|
|
92
|
-
},
|
|
93
|
-
publishConfig: {
|
|
94
|
-
access: "public"
|
|
95
|
-
},
|
|
96
|
-
peerDependencies: {
|
|
97
|
-
"ts-morph": ">=20",
|
|
98
|
-
"@anthropic-ai/sdk": ">=0.30"
|
|
99
|
-
},
|
|
100
|
-
peerDependenciesMeta: {
|
|
101
|
-
"ts-morph": {
|
|
102
|
-
optional: true
|
|
103
|
-
},
|
|
104
|
-
"@anthropic-ai/sdk": {
|
|
105
|
-
optional: true
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// src/main.ts
|
|
111
13
|
var main = defineCommand({
|
|
112
14
|
meta: { name: "specdx", version: package_default.version, description: "specdx \u2014 Spec Developer Experience" },
|
|
113
15
|
subCommands
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.ts"
|
|
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-
|
|
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-
|
|
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-
|
|
4
|
+
} from "./chunk-MM325DR6.js";
|
|
5
5
|
import {
|
|
6
|
-
SPEC_TYPES
|
|
7
|
-
|
|
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
|
-
}
|
|
42
|
-
|
|
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-
|
|
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,Y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11
11
|
parseSpec,
|
|
12
12
|
resolveGlob
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
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-
|
|
192
|
+
//# sourceMappingURL=pack-PNLD5AYW.js.map
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
createLintEngine,
|
|
6
6
|
getPreset,
|
|
7
7
|
parseFeatures
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BD6UDHYW.js";
|
|
9
9
|
import {
|
|
10
10
|
DEFAULT_DIFF_CONFIG
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RY5CDUNN.js";
|
|
12
12
|
import {
|
|
13
13
|
buildGraph,
|
|
14
14
|
createLogger,
|
|
15
15
|
loadConfig,
|
|
16
16
|
parseSpec,
|
|
17
17
|
resolveGlob
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-MM325DR6.js";
|
|
19
|
+
import "./chunk-ZIPGRLYE.js";
|
|
20
20
|
import "./chunk-5WRI5ZAA.js";
|
|
21
21
|
|
|
22
22
|
// src/commands/core/ready.ts
|
|
@@ -254,4 +254,4 @@ export {
|
|
|
254
254
|
ready_default as default,
|
|
255
255
|
runReady
|
|
256
256
|
};
|
|
257
|
-
//# sourceMappingURL=ready-
|
|
257
|
+
//# sourceMappingURL=ready-XIO2IPRE.js.map
|
|
@@ -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 — `
|
|
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 `
|
|
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 `
|
|
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
|
|
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
|
|
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-
|
|
4
|
+
} from "./chunk-BD6UDHYW.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_DIFF_CONFIG
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RY5CDUNN.js";
|
|
8
8
|
import {
|
|
9
9
|
buildGraph,
|
|
10
10
|
loadConfig,
|
|
11
11
|
parseSpec,
|
|
12
12
|
resolveGlob
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
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-
|
|
161
|
+
//# sourceMappingURL=status-BXOYBOH6.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runCheck
|
|
3
|
-
} from "./chunk-
|
|
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-
|
|
13
|
-
import "./chunk-
|
|
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-
|
|
133
|
+
//# sourceMappingURL=update-ELXABLVS.js.map
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
buildGraph,
|
|
8
8
|
loadConfig,
|
|
9
9
|
resolveGlob
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
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-
|
|
87
|
+
//# sourceMappingURL=validate-FXD5WS4C.js.map
|
package/hooks/session-start
CHANGED
|
@@ -30,8 +30,25 @@ escape_for_json() {
|
|
|
30
30
|
printf '%s' "$s"
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
# Determine specdx invocation
|
|
34
|
-
|
|
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
|
|
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.
|
|
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,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"exports": {
|
|
38
38
|
".": {
|
|
39
|
-
"
|
|
40
|
-
"
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"import": "./dist/index.js"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"files": [
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"@specdx/lint": "0.0.0",
|
|
70
70
|
"@specdx/diff": "0.0.0",
|
|
71
71
|
"@specdx/mcp": "0.0.0",
|
|
72
|
-
"@specdx/pack": "0.0.0",
|
|
73
72
|
"@specdx/schema": "0.0.0",
|
|
74
|
-
"@specdx/skills": "0.0.0"
|
|
73
|
+
"@specdx/skills": "0.0.0",
|
|
74
|
+
"@specdx/pack": "0.0.0"
|
|
75
75
|
},
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/core/init.ts","../src/commands/registry.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { REQUIRED_SECTIONS } from \"@specdx/schema\";\n\nexport type Template = \"lightweight\" | \"bmad\" | \"api-first\" | \"quick\" | \"context\";\n\ninterface ScaffoldOptions {\n projectName: string;\n template: Template;\n targetDir: string;\n}\n\nconst TEMPLATE_SPECS: Record<\n Template,\n Array<{ filename: string; type: keyof typeof REQUIRED_SECTIONS }>\n> = {\n lightweight: [\n { filename: \"prd.md\", type: \"prd\" },\n { filename: \"technical-design.md\", type: \"technical-design\" },\n ],\n bmad: [\n { filename: \"prd.md\", type: \"prd\" },\n { filename: \"technical-design.md\", type: \"technical-design\" },\n { filename: \"test-plan.md\", type: \"test-plan\" },\n ],\n \"api-first\": [\n { filename: \"technical-design.md\", type: \"technical-design\" },\n { filename: \"api-contract.md\", type: \"api-contract\" },\n { filename: \"test-plan.md\", type: \"test-plan\" },\n ],\n quick: [{ filename: \"quick-spec.md\", type: \"quick-spec\" }],\n context: [{ filename: \"project-context.md\", type: \"project-context\" }],\n};\n\nconst TEMPLATE_EXTRA_DIRS: Record<Template, string[]> = {\n lightweight: [],\n bmad: [\"specs/stories\", \"specs/adr\"],\n \"api-first\": [],\n quick: [],\n context: [],\n};\n\nfunction specIdFromFilename(filename: string): string {\n return filename.replace(/\\.md$/, \"\");\n}\n\nfunction specTitleFromType(type: string): string {\n return type\n .split(\"-\")\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \");\n}\n\nfunction buildSpecFile(\n filename: string,\n type: keyof typeof REQUIRED_SECTIONS,\n projectName: string,\n today: string,\n): string {\n const id = specIdFromFilename(filename);\n const title = `${specTitleFromType(type)} — ${projectName}`;\n const sections = REQUIRED_SECTIONS[type];\n\n const frontmatter = [\n \"---\",\n `id: ${id}`,\n `type: ${type}`,\n `title: \"${title}\"`,\n `status: draft`,\n `version: \"0.1\"`,\n `created: \"${today}\"`,\n `authors: [\"author\"]`,\n \"---\",\n ].join(\"\\n\");\n\n const body = sections.map((section) => `\\n## ${section}\\n\\n<!-- placeholder -->`).join(\"\\n\");\n\n return `${frontmatter}\\n${body}\\n`;\n}\n\nfunction buildConfigYaml(\n projectName: string,\n specs: Array<{ filename: string; type: string }>,\n): string {\n const specEntries = specs\n .map(({ filename, type }) => {\n const key = specIdFromFilename(filename);\n return ` ${key}:\\n path: specs/${filename}\\n type: ${type}`;\n })\n .join(\"\\n\");\n\n return (\n [`version: \"1.0\"`, `project:`, ` name: \"${projectName}\"`, `specs:`, specEntries].join(\"\\n\") +\n \"\\n\"\n );\n}\n\nexport async function scaffoldProject({\n projectName,\n template,\n targetDir,\n}: ScaffoldOptions): Promise<void> {\n const today = new Date().toISOString().slice(0, 10);\n const specsDir = join(targetDir, \"specs\");\n\n // Create specs/ directory\n await mkdir(specsDir, { recursive: true });\n\n // Create extra template dirs (e.g., bmad needs stories/ and adr/)\n for (const extraDir of TEMPLATE_EXTRA_DIRS[template]) {\n await mkdir(join(targetDir, extraDir), { recursive: true });\n }\n\n const specs = TEMPLATE_SPECS[template];\n\n // Write spec files\n for (const { filename, type } of specs) {\n const content = buildSpecFile(filename, type, projectName, today);\n await writeFile(join(specsDir, filename), content, \"utf-8\");\n }\n\n // Write spec.config.yaml\n const configContent = buildConfigYaml(projectName, specs);\n await writeFile(join(targetDir, \"spec.config.yaml\"), configContent, \"utf-8\");\n}\n\nexport default defineCommand({\n meta: {\n name: \"init\",\n description: \"Initialize a new specdx project with spec scaffolding\",\n },\n args: {\n name: {\n type: \"string\",\n description: \"Project name\",\n required: true,\n },\n template: {\n type: \"string\",\n description: \"Template to use (lightweight, bmad, api-first)\",\n default: \"lightweight\",\n },\n dir: {\n type: \"string\",\n description: \"Target directory\",\n default: \".\",\n },\n },\n async run({ args }) {\n const { name, template, dir } = args;\n const validTemplates: Template[] = [\"lightweight\", \"bmad\", \"api-first\", \"quick\", \"context\"];\n if (!validTemplates.includes(template as Template)) {\n console.error(`Unknown template: ${template}. Choose from: ${validTemplates.join(\", \")}`);\n process.exit(1);\n }\n console.log(`Scaffolding \"${name}\" with template \"${template}\" in ${dir}...`);\n await scaffoldProject({ projectName: name, template: template as Template, targetDir: dir });\n console.log(`Done! Project \"${name}\" scaffolded successfully.`);\n },\n});\n","import type { ArgsDef, CommandDef, SubCommandsDef } from \"citty\";\nimport initCommand from \"./core/init.js\";\n\n/**\n * Promoted commands — the set `--help` presents without a caveat.\n *\n * Promotion is the directory a command lives in, not an adjective someone\n * remembered to type into its description. `explain` and `changelog` both\n * drifted into the core surface precisely because the marker was a string.\n * Sub-commands are spelled the way a user types them.\n */\nexport const CORE_COMMANDS = [\n \"init\",\n \"lint\",\n \"validate\",\n \"graph\",\n \"skills\",\n \"pack\",\n \"diff\",\n \"status\",\n \"ready\",\n \"generate\",\n \"generate story\",\n \"mcp\",\n] as const;\n\n/** Commands whose output is not yet trusted enough to promote. */\nexport const EXPERIMENTAL_COMMANDS = [\"check\", \"update\", \"migrate\", \"generate test-plan\"] as const;\n\n/** Every command that ships, promoted or not. */\nexport const COMMAND_NAMES = [...CORE_COMMANDS, ...EXPERIMENTAL_COMMANDS];\n\nexport type CommandName = (typeof COMMAND_NAMES)[number];\n\n/** Bucket directory a command lives in, under `commands/`. */\nexport function bucketOf(name: string): \"core\" | \"experimental\" {\n return (EXPERIMENTAL_COMMANDS as readonly string[]).includes(name) ? \"experimental\" : \"core\";\n}\n\n/** Module path for a command, relative to `commands/`. */\nexport function moduleOf(name: string): string {\n return `${bucketOf(name)}/${name.replace(/ /g, \"-\")}.ts`;\n}\n\n/**\n * Prefix an experimental command's description with its caveat.\n *\n * Derived from the bucket, so no description in the tree spells `[experimental]`\n * itself and the two can never disagree.\n */\nexport function labelled<T extends ArgsDef>(name: string, cmd: CommandDef<T>): CommandDef<T> {\n if (bucketOf(name) === \"core\") return cmd;\n const meta = cmd.meta;\n // citty allows meta to be a function or promise. Ours are all plain objects,\n // and the conformance test asserts every experimental command renders the\n // caveat -- so a command that adopts lazy meta fails loudly rather than\n // shipping unlabelled.\n if (typeof meta !== \"object\" || meta === null || \"then\" in meta) return cmd;\n return {\n ...cmd,\n meta: { ...meta, description: `[experimental] ${meta.description ?? \"\"}`.trim() },\n };\n}\n\n/** Lazily load a command module and label it according to its bucket. */\nfunction bucketed<T extends ArgsDef>(\n name: string,\n load: () => Promise<CommandDef<T>>,\n): () => Promise<CommandDef<T>> {\n return () => load().then((cmd) => labelled(name, cmd));\n}\n\n/**\n * The `subCommands` map citty registers, keyed by the top-level names above.\n *\n * Typed as citty's own `SubCommandsDef` rather than a `Record<CommandName, ...>`:\n * `CommandDef` is invariant in its args, so a narrower annotation rejects every\n * command that declares args. The conformance test asserts the keys instead.\n */\nexport const subCommands: SubCommandsDef = {\n init: initCommand,\n lint: bucketed(\"lint\", () => import(\"./core/lint.js\").then((m) => m.default)),\n validate: bucketed(\"validate\", () => import(\"./core/validate.js\").then((m) => m.default)),\n graph: bucketed(\"graph\", () => import(\"./core/graph.js\").then((m) => m.default)),\n skills: bucketed(\"skills\", () => import(\"./core/skills.js\").then((m) => m.default)),\n pack: bucketed(\"pack\", () => import(\"./core/pack.js\").then((m) => m.default)),\n diff: bucketed(\"diff\", () => import(\"./core/diff.js\").then((m) => m.default)),\n status: bucketed(\"status\", () => import(\"./core/status.js\").then((m) => m.default)),\n check: bucketed(\"check\", () => import(\"./experimental/check.js\").then((m) => m.default)),\n ready: bucketed(\"ready\", () => import(\"./core/ready.js\").then((m) => m.default)),\n update: bucketed(\"update\", () => import(\"./experimental/update.js\").then((m) => m.default)),\n generate: bucketed(\"generate\", () => import(\"./core/generate.js\").then((m) => m.default)),\n migrate: bucketed(\"migrate\", () => import(\"./experimental/migrate.js\").then((m) => m.default)),\n mcp: bucketed(\"mcp\", () => import(\"./core/mcp.js\").then((m) => m.default)),\n};\n"],"mappings":";;;;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,OAAO,iBAAiB;AACjC,SAAS,YAAY;AAWrB,IAAM,iBAGF;AAAA,EACF,aAAa;AAAA,IACX,EAAE,UAAU,UAAU,MAAM,MAAM;AAAA,IAClC,EAAE,UAAU,uBAAuB,MAAM,mBAAmB;AAAA,EAC9D;AAAA,EACA,MAAM;AAAA,IACJ,EAAE,UAAU,UAAU,MAAM,MAAM;AAAA,IAClC,EAAE,UAAU,uBAAuB,MAAM,mBAAmB;AAAA,IAC5D,EAAE,UAAU,gBAAgB,MAAM,YAAY;AAAA,EAChD;AAAA,EACA,aAAa;AAAA,IACX,EAAE,UAAU,uBAAuB,MAAM,mBA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