specdx 0.3.0-alpha.2 → 0.4.0-alpha.1

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 (64) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/{changelog-URU2TFNM.js → changelog-OUP2RXWN.js} +4 -4
  3. package/dist/check-3XQYO3HU.js +109 -0
  4. package/dist/check-3XQYO3HU.js.map +1 -0
  5. package/dist/{pack-OJAC7JF2.js → chunk-4THCEWAK.js} +53 -169
  6. package/dist/chunk-4THCEWAK.js.map +1 -0
  7. package/dist/chunk-6BWZEAST.js +1051 -0
  8. package/dist/chunk-6BWZEAST.js.map +1 -0
  9. package/dist/{chunk-LU6M5O63.js → chunk-DDFLMRPC.js} +2 -2
  10. package/dist/chunk-HMXUNURD.js +490 -0
  11. package/dist/chunk-HMXUNURD.js.map +1 -0
  12. package/dist/{chunk-276J7LR6.js → chunk-PHR7AV6I.js} +2 -2
  13. package/dist/{chunk-XLEN6ZYM.js → chunk-ZX4HVL5M.js} +92 -4
  14. package/dist/chunk-ZX4HVL5M.js.map +1 -0
  15. package/dist/{diff-55PTEVB3.js → diff-275PLXYH.js} +4 -4
  16. package/dist/dist-PQCG2XXF.js +11 -0
  17. package/dist/dist-PQCG2XXF.js.map +1 -0
  18. package/dist/dist-QXLX77XG.js +279 -0
  19. package/dist/dist-QXLX77XG.js.map +1 -0
  20. package/dist/{explain-YXUILNEA.js → explain-I7AQMEEH.js} +3 -3
  21. package/dist/generate-PC7BIB7G.js +13 -0
  22. package/dist/generate-PC7BIB7G.js.map +1 -0
  23. package/dist/generate-story-7WHPPFHY.js +192 -0
  24. package/dist/generate-story-7WHPPFHY.js.map +1 -0
  25. package/dist/generate-test-plan-U5LMWGKX.js +154 -0
  26. package/dist/generate-test-plan-U5LMWGKX.js.map +1 -0
  27. package/dist/{graph-OWQJWVSN.js → graph-RCAPF55A.js} +3 -3
  28. package/dist/index.js +390 -16
  29. package/dist/index.js.map +1 -1
  30. package/dist/{lint-U7VLGS75.js → lint-XPAFMLZN.js} +4 -4
  31. package/dist/main.js +23 -14
  32. package/dist/main.js.map +1 -1
  33. package/dist/mcp-6RCSHMXD.js +17 -0
  34. package/dist/mcp-6RCSHMXD.js.map +1 -0
  35. package/dist/migrate-L7W5RHSS.js +56 -0
  36. package/dist/migrate-L7W5RHSS.js.map +1 -0
  37. package/dist/pack-QCOXMURY.js +167 -0
  38. package/dist/pack-QCOXMURY.js.map +1 -0
  39. package/dist/{ready-3OIF4QHM.js → ready-ZXG74W7Y.js} +5 -5
  40. package/dist/skills/specdx-check-drift.md +71 -0
  41. package/dist/skills/specdx-review-spec.md +77 -0
  42. package/dist/skills/specdx-verify.md +70 -0
  43. package/dist/{skills-XJYTWGDK.js → skills-3GBBWZW2.js} +5 -2
  44. package/dist/skills-3GBBWZW2.js.map +1 -0
  45. package/dist/{status-LYZUO6AJ.js → status-EKWK47O5.js} +5 -5
  46. package/dist/update-HIWDDEZQ.js +132 -0
  47. package/dist/update-HIWDDEZQ.js.map +1 -0
  48. package/dist/{validate-DOZZEZFC.js → validate-N2WSG75W.js} +3 -3
  49. package/package.json +3 -1
  50. package/dist/chunk-ATLVRGHI.js +0 -237
  51. package/dist/chunk-ATLVRGHI.js.map +0 -1
  52. package/dist/chunk-XLEN6ZYM.js.map +0 -1
  53. package/dist/pack-OJAC7JF2.js.map +0 -1
  54. package/dist/skills-XJYTWGDK.js.map +0 -1
  55. /package/dist/{changelog-URU2TFNM.js.map → changelog-OUP2RXWN.js.map} +0 -0
  56. /package/dist/{chunk-LU6M5O63.js.map → chunk-DDFLMRPC.js.map} +0 -0
  57. /package/dist/{chunk-276J7LR6.js.map → chunk-PHR7AV6I.js.map} +0 -0
  58. /package/dist/{diff-55PTEVB3.js.map → diff-275PLXYH.js.map} +0 -0
  59. /package/dist/{explain-YXUILNEA.js.map → explain-I7AQMEEH.js.map} +0 -0
  60. /package/dist/{graph-OWQJWVSN.js.map → graph-RCAPF55A.js.map} +0 -0
  61. /package/dist/{lint-U7VLGS75.js.map → lint-XPAFMLZN.js.map} +0 -0
  62. /package/dist/{ready-3OIF4QHM.js.map → ready-ZXG74W7Y.js.map} +0 -0
  63. /package/dist/{status-LYZUO6AJ.js.map → status-EKWK47O5.js.map} +0 -0
  64. /package/dist/{validate-DOZZEZFC.js.map → validate-N2WSG75W.js.map} +0 -0
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: specdx-verify
3
+ description: "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
+ allowed-tools: Bash(npx specdx *), Read
5
+ ---
6
+
7
+ # Verify Implementation Against Specs
8
+
9
+ Run static analysis to check if the implementation matches the specs, then review each finding.
10
+
11
+ ## Workflow
12
+
13
+ ### Step 1: Run spec-to-implementation check
14
+
15
+ ```bash
16
+ npx specdx check --format json
17
+ ```
18
+
19
+ If the command fails with "ts-morph is required", tell the user to install it: `pnpm add -D ts-morph`.
20
+
21
+ If it fails with "No spec.config.yaml found", the project isn't set up with specdx. Stop and inform the user.
22
+
23
+ ### Step 2: Load spec context
24
+
25
+ ```bash
26
+ npx specdx pack --task "$ARGUMENTS" --format xml
27
+ ```
28
+
29
+ This gives you the spec content to compare findings against.
30
+
31
+ ### Step 3: Review each finding
32
+
33
+ For each finding in the check output:
34
+
35
+ | Finding Type | Action |
36
+ |---|---|
37
+ | `missing` (error) | Check if the spec requirement is genuinely unimplemented, or if the static analysis missed it (different naming, different file location). Report your assessment. |
38
+ | `extra` (info) | Check if the code addition is intentional (feature beyond spec) or accidental scope creep. Note it but don't flag as an issue unless it contradicts a Non-Goal. |
39
+ | `mismatch` (warn) | Compare the spec expectation against the code. Determine if the deviation is intentional (spec needs updating) or a bug (code needs fixing). |
40
+
41
+ ### Step 4: Present structured report
42
+
43
+ ```
44
+ ## Verification Report
45
+
46
+ **Score:** X% implementation coverage
47
+
48
+ ### Real Issues
49
+ - [finding] — [why it's a real issue] — [suggested fix]
50
+
51
+ ### False Positives
52
+ - [finding] — [why it's not actually an issue]
53
+
54
+ ### Recommendations
55
+ - [any spec updates needed]
56
+ - [any additional tests suggested]
57
+ ```
58
+
59
+ <HARD-GATE>
60
+ Do NOT skip Step 1. Always run `npx specdx check` before reviewing. Do not rely on your knowledge of the code alone — the static analysis catches things you might miss.
61
+ </HARD-GATE>
62
+
63
+ ## Rationalizations to Resist
64
+
65
+ | Thought | Reality |
66
+ |---------|---------|
67
+ | "I already know the code matches the spec" | Static analysis catches structural mismatches you can't see. Run the check. |
68
+ | "There are too many findings to review" | Group by category, prioritize errors over warnings. Review all errors. |
69
+ | "The check failed, so skip it" | Report the failure. Partial results are still valuable. |
70
+ | "The user didn't ask for verification" | If you just finished implementing, verify. It's part of the job. |
@@ -13,7 +13,10 @@ var SKILL_NAMES = [
13
13
  "specdx-pre-commit",
14
14
  "specdx-sprint-review",
15
15
  "specdx-plan-from-spec",
16
- "specdx-onboard"
16
+ "specdx-onboard",
17
+ "specdx-verify",
18
+ "specdx-review-spec",
19
+ "specdx-check-drift"
17
20
  ];
18
21
  function getSkillSourceDir() {
19
22
  const bundledPath = join(__dirname, "skills");
@@ -87,4 +90,4 @@ var skills_default = defineCommand({
87
90
  export {
88
91
  skills_default as default
89
92
  };
90
- //# sourceMappingURL=skills-XJYTWGDK.js.map
93
+ //# sourceMappingURL=skills-3GBBWZW2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/skills.ts","../../skills/src/install.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport { installSkills } from \"@specdx/skills\";\n\nexport default defineCommand({\n meta: { name: \"skills\", description: \"Manage specdx skills for AI coding tools\" },\n subCommands: {\n install: defineCommand({\n meta: { name: \"install\", description: \"Install Claude Code skill files\" },\n args: {\n dir: {\n type: \"string\",\n description: \"Target directory (default: current directory)\",\n default: \".\",\n },\n },\n async run({ args }) {\n try {\n const result = await installSkills(args.dir);\n if (result.installed.length === 0 && result.updated.length === 0) {\n console.log(\" No skill files to install.\");\n return;\n }\n for (const file of result.installed) console.log(` ✓ Installed ${file}`);\n for (const file of result.updated) console.log(` ✓ Updated ${file}`);\n console.log(`\\n Skills installed to .claude/commands/`);\n } catch (err) {\n console.error(`\\n ✗ ${(err as Error).message}\\n`);\n process.exit(1);\n }\n },\n }),\n },\n});\n","import { mkdir, writeFile, readFile, stat } from \"node:fs/promises\";\nimport { statSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n/** Skill file names (without .md extension) */\nexport const SKILL_NAMES = [\n \"specdx-start-task\",\n \"specdx-author-spec\",\n \"specdx-pre-commit\",\n \"specdx-sprint-review\",\n \"specdx-plan-from-spec\",\n \"specdx-onboard\",\n \"specdx-verify\",\n \"specdx-review-spec\",\n \"specdx-check-drift\",\n];\n\nexport interface InstallResult {\n installed: string[];\n updated: string[];\n}\n\nfunction getSkillSourceDir(): string {\n // When bundled: skills at __dirname/skills (sibling of bundle)\n // In dev: skills at __dirname/../skills (sibling of src/)\n const bundledPath = join(__dirname, \"skills\");\n try {\n statSync(bundledPath);\n return bundledPath;\n } catch {\n return join(__dirname, \"..\", \"skills\");\n }\n}\n\nexport async function installSkills(projectDir: string): Promise<InstallResult> {\n const sourceDir = getSkillSourceDir();\n const commandsDir = join(projectDir, \".claude\", \"commands\");\n const installed: string[] = [];\n const updated: string[] = [];\n\n await mkdir(commandsDir, { recursive: true });\n\n for (const skillName of SKILL_NAMES) {\n const sourcePath = join(sourceDir, `${skillName}.md`);\n const targetPath = join(commandsDir, `${skillName}.md`);\n\n const content = await readFile(sourcePath, \"utf-8\");\n\n // Check if target already exists\n let exists = false;\n try {\n await stat(targetPath);\n exists = true;\n } catch {\n // File doesn't exist\n }\n\n await writeFile(targetPath, content, \"utf-8\");\n\n if (exists) {\n updated.push(skillName);\n } else {\n installed.push(skillName);\n }\n }\n\n return { installed, updated };\n}\n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AAA,UACH,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,MAAM,IAAI,EAAE,KAAK,GAAG;AAClB,YAAI;AACF,gBAAM,SAAS,MAAM,cAAc,KAAK,GAAG;AAC3C,cAAI,OAAO,UAAU,WAAW,KAAK,OAAO,QAAQ,WAAW,GAAG;AAChE,oBAAQ,IAAI,8BAA8B;AAC1C;AAAA,UACF;AACA,qBAAW,QAAQ,OAAO,UAAW,SAAQ,IAAI,sBAAiB,IAAI,EAAE;AACxE,qBAAW,QAAQ,OAAO,QAAS,SAAQ,IAAI,oBAAe,IAAI,EAAE;AACpE,kBAAQ,IAAI;AAAA,wCAA2C;AAAA,QACzD,SAAS,KAAK;AACZ,kBAAQ,MAAM;AAAA,WAAU,IAAc,OAAO;AAAA,CAAI;AACjD,kBAAQ,KAAK,CAAC;AAAA,QAChB;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF,CAAC;","names":[]}
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  createLintEngine,
3
3
  getPreset
4
- } from "./chunk-ATLVRGHI.js";
4
+ } from "./chunk-HMXUNURD.js";
5
5
  import {
6
6
  DEFAULT_DIFF_CONFIG
7
- } from "./chunk-LU6M5O63.js";
7
+ } from "./chunk-DDFLMRPC.js";
8
8
  import {
9
9
  buildGraph,
10
10
  loadConfig,
11
11
  parseSpec,
12
12
  resolveGlob
13
- } from "./chunk-276J7LR6.js";
14
- import "./chunk-XLEN6ZYM.js";
13
+ } from "./chunk-PHR7AV6I.js";
14
+ import "./chunk-ZX4HVL5M.js";
15
15
 
16
16
  // src/commands/status.ts
17
17
  import { defineCommand } from "citty";
@@ -142,4 +142,4 @@ export {
142
142
  status_default as default,
143
143
  runStatus
144
144
  };
145
- //# sourceMappingURL=status-LYZUO6AJ.js.map
145
+ //# sourceMappingURL=status-EKWK47O5.js.map
@@ -0,0 +1,132 @@
1
+ import {
2
+ runCheck
3
+ } from "./chunk-6BWZEAST.js";
4
+ import {
5
+ sharedArgs
6
+ } from "./chunk-GAM4MXPC.js";
7
+ import {
8
+ createLogger,
9
+ loadConfig,
10
+ parseSpec,
11
+ resolveGlob
12
+ } from "./chunk-PHR7AV6I.js";
13
+ import "./chunk-ZX4HVL5M.js";
14
+
15
+ // src/commands/update.ts
16
+ import { defineCommand } from "citty";
17
+ function buildRouteAddition(actual) {
18
+ const parts = actual.trim().split(/\s+/);
19
+ const method = parts[0] ?? "GET";
20
+ const path = parts[1] ?? actual;
21
+ return `### ${method} ${path}
22
+ Description placeholder.`;
23
+ }
24
+ function buildTypeAddition(actual) {
25
+ return `- ${actual}`;
26
+ }
27
+ function buildTestAddition(actual) {
28
+ return `- ${actual}`;
29
+ }
30
+ function generateUpdates({ findings }) {
31
+ const suggestions = [];
32
+ for (const finding of findings) {
33
+ if (finding.type !== "extra") continue;
34
+ const actual = finding.actual ?? "";
35
+ if (finding.category === "route") {
36
+ suggestions.push({
37
+ specId: finding.specId,
38
+ section: "Endpoints",
39
+ addition: buildRouteAddition(actual),
40
+ reason: `Route ${actual} exists in code but is not documented in the spec.`
41
+ });
42
+ } else if (finding.category === "type") {
43
+ suggestions.push({
44
+ specId: finding.specId,
45
+ section: "Data Model",
46
+ addition: buildTypeAddition(actual),
47
+ reason: `${actual} exists in code but is not documented in the spec.`
48
+ });
49
+ } else if (finding.category === "test") {
50
+ suggestions.push({
51
+ specId: finding.specId,
52
+ section: "Test Cases",
53
+ addition: buildTestAddition(actual),
54
+ reason: `Test case "${actual}" exists in code but is not listed in the spec.`
55
+ });
56
+ }
57
+ }
58
+ return { suggestions };
59
+ }
60
+ function printSuggestionsPretty(suggestions) {
61
+ if (suggestions.length === 0) {
62
+ console.log("\n sdx update \u2014 no spec updates suggested\n");
63
+ return;
64
+ }
65
+ console.log(`
66
+ sdx update \u2014 ${suggestions.length} suggested spec update(s)
67
+ `);
68
+ const bySpec = /* @__PURE__ */ new Map();
69
+ for (const s of suggestions) {
70
+ const list = bySpec.get(s.specId) ?? [];
71
+ list.push(s);
72
+ bySpec.set(s.specId, list);
73
+ }
74
+ for (const [specId, items] of bySpec) {
75
+ console.log(` ${specId}:`);
76
+ for (const item of items) {
77
+ console.log(` [${item.section}] ${item.reason}`);
78
+ console.log(` Add:
79
+ ${item.addition.replace(/\n/g, "\n ")}`);
80
+ }
81
+ console.log();
82
+ }
83
+ console.log(" Note: --apply is not implemented in v1. Apply changes manually.\n");
84
+ }
85
+ var update_default = defineCommand({
86
+ meta: {
87
+ name: "update",
88
+ description: "Suggest spec updates based on sdx check findings (--from-code)"
89
+ },
90
+ args: {
91
+ ...sharedArgs,
92
+ "from-code": {
93
+ type: "boolean",
94
+ description: "Generate suggestions from code drift (sdx check findings)",
95
+ default: true
96
+ },
97
+ spec: { type: "string", description: "Limit to a specific spec ID" },
98
+ framework: { type: "string", description: "Framework override: express, hono, nextjs" }
99
+ },
100
+ async run({ args }) {
101
+ const logger = createLogger({ quiet: args.quiet, verbose: args.verbose });
102
+ const configDir = process.cwd();
103
+ const config = await loadConfig(void 0, configDir);
104
+ logger.debug("Loading specs...");
105
+ const specs = [];
106
+ for (const [, entry] of Object.entries(config.specs)) {
107
+ const paths = await resolveGlob(entry.path, configDir);
108
+ for (const p of paths) {
109
+ const spec = await parseSpec(p);
110
+ if (args.spec && spec.frontmatter.id !== args.spec) continue;
111
+ specs.push(spec);
112
+ }
113
+ }
114
+ logger.debug(`Running check on ${specs.length} specs...`);
115
+ const checkConfig = {
116
+ ...config.check,
117
+ ...args.framework ? { framework: args.framework } : {}
118
+ };
119
+ const checkResult = await runCheck(specs, configDir, checkConfig);
120
+ const { suggestions } = generateUpdates({ findings: checkResult.findings });
121
+ if (args.format === "json") {
122
+ console.log(JSON.stringify({ suggestions }, null, 2));
123
+ } else {
124
+ printSuggestionsPretty(suggestions);
125
+ }
126
+ }
127
+ });
128
+ export {
129
+ update_default as default,
130
+ generateUpdates
131
+ };
132
+ //# sourceMappingURL=update-HIWDDEZQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/update.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport { loadConfig, parseSpec, resolveGlob, createLogger } from \"@specdx/core\";\nimport { runCheck } from \"@specdx/check\";\nimport type { Finding } from \"@specdx/check\";\nimport type { ParsedSpec } from \"@specdx/core\";\nimport { sharedArgs } from \"../shared-args.js\";\n\nexport interface UpdateSuggestion {\n specId: string;\n section: string;\n addition: string;\n reason: string;\n}\n\nexport interface GenerateUpdatesInput {\n findings: Finding[];\n}\n\nexport interface GenerateUpdatesResult {\n suggestions: UpdateSuggestion[];\n}\n\nfunction buildRouteAddition(actual: string): string {\n const parts = actual.trim().split(/\\s+/);\n const method = parts[0] ?? \"GET\";\n const path = parts[1] ?? actual;\n return `### ${method} ${path}\\nDescription placeholder.`;\n}\n\nfunction buildTypeAddition(actual: string): string {\n return `- ${actual}`;\n}\n\nfunction buildTestAddition(actual: string): string {\n return `- ${actual}`;\n}\n\nexport function generateUpdates({ findings }: GenerateUpdatesInput): GenerateUpdatesResult {\n const suggestions: UpdateSuggestion[] = [];\n\n for (const finding of findings) {\n // Only act on extra findings — code has something the spec doesn't know about.\n // missing = code is wrong, spec is correct → skip.\n // mismatch = ambiguous → skip for now, let the user decide.\n if (finding.type !== \"extra\") continue;\n\n const actual = finding.actual ?? \"\";\n\n if (finding.category === \"route\") {\n suggestions.push({\n specId: finding.specId,\n section: \"Endpoints\",\n addition: buildRouteAddition(actual),\n reason: `Route ${actual} exists in code but is not documented in the spec.`,\n });\n } else if (finding.category === \"type\") {\n suggestions.push({\n specId: finding.specId,\n section: \"Data Model\",\n addition: buildTypeAddition(actual),\n reason: `${actual} exists in code but is not documented in the spec.`,\n });\n } else if (finding.category === \"test\") {\n suggestions.push({\n specId: finding.specId,\n section: \"Test Cases\",\n addition: buildTestAddition(actual),\n reason: `Test case \"${actual}\" exists in code but is not listed in the spec.`,\n });\n }\n }\n\n return { suggestions };\n}\n\nfunction printSuggestionsPretty(suggestions: UpdateSuggestion[]): void {\n if (suggestions.length === 0) {\n console.log(\"\\n sdx update — no spec updates suggested\\n\");\n return;\n }\n\n console.log(`\\n sdx update — ${suggestions.length} suggested spec update(s)\\n`);\n\n // Group by specId\n const bySpec = new Map<string, UpdateSuggestion[]>();\n for (const s of suggestions) {\n const list = bySpec.get(s.specId) ?? [];\n list.push(s);\n bySpec.set(s.specId, list);\n }\n\n for (const [specId, items] of bySpec) {\n console.log(` ${specId}:`);\n for (const item of items) {\n console.log(` [${item.section}] ${item.reason}`);\n console.log(` Add:\\n ${item.addition.replace(/\\n/g, \"\\n \")}`);\n }\n console.log();\n }\n\n console.log(\" Note: --apply is not implemented in v1. Apply changes manually.\\n\");\n}\n\nexport default defineCommand({\n meta: {\n name: \"update\",\n description: \"Suggest spec updates based on sdx check findings (--from-code)\",\n },\n args: {\n ...sharedArgs,\n \"from-code\": {\n type: \"boolean\",\n description: \"Generate suggestions from code drift (sdx check findings)\",\n default: true,\n },\n spec: { type: \"string\", description: \"Limit to a specific spec ID\" },\n framework: { type: \"string\", description: \"Framework override: express, hono, nextjs\" },\n },\n async run({ args }) {\n const logger = createLogger({ quiet: args.quiet, verbose: args.verbose });\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n\n logger.debug(\"Loading specs...\");\n\n const specs: ParsedSpec[] = [];\n for (const [, 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 if (args.spec && spec.frontmatter.id !== args.spec) continue;\n specs.push(spec);\n }\n }\n\n logger.debug(`Running check on ${specs.length} specs...`);\n\n const checkConfig = {\n ...config.check,\n ...(args.framework\n ? { framework: args.framework as \"auto\" | \"express\" | \"hono\" | \"nextjs\" }\n : {}),\n };\n\n const checkResult = await runCheck(specs, configDir, checkConfig);\n const { suggestions } = generateUpdates({ findings: checkResult.findings });\n\n if (args.format === \"json\") {\n console.log(JSON.stringify({ suggestions }, null, 2));\n } else {\n printSuggestion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Y,MAAM,MAAM,SAAS;AACrD,iBAAW,KAAK,OAAO;AACrB,cAAM,OAAO,MAAM,UAAU,CAAC;AAC9B,YAAI,KAAK,QAAQ,KAAK,YAAY,OAAO,KAAK,KAAM;AACpD,cAAM,KAAK,IAAI;AAAA,MACjB;AAAA,IACF;AAEA,WAAO,MAAM,oBAAoB,MAAM,MAAM,WAAW;AAExD,UAAM,cAAc;AAAA,MAClB,GAAG,OAAO;AAAA,MACV,GAAI,KAAK,YACL,EAAE,WAAW,KAAK,UAAoD,IACtE,CAAC;AAAA,IACP;AAEA,UAAM,cAAc,MAAM,SAAS,OAAO,WAAW,WAAW;AAChE,UAAM,EAAE,YAAY,IAAI,gBAAgB,EAAE,UAAU,YAAY,SAAS,CAAC;AAE1E,QAAI,KAAK,WAAW,QAAQ;AAC1B,cAAQ,IAAI,KAAK,UAAU,EAAE,YAAY,GAAG,MAAM,CAAC,CAAC;AAAA,IACtD,OAAO;AACL,6BAAuB,WAAW;AAAA,IACpC;AAAA,EACF;AACF,CAAC;","names":[]}
@@ -4,8 +4,8 @@ import {
4
4
  import {
5
5
  ConfigError,
6
6
  loadConfig
7
- } from "./chunk-276J7LR6.js";
8
- import "./chunk-XLEN6ZYM.js";
7
+ } from "./chunk-PHR7AV6I.js";
8
+ import "./chunk-ZX4HVL5M.js";
9
9
 
10
10
  // src/commands/validate.ts
11
11
  import { defineCommand } from "citty";
@@ -31,4 +31,4 @@ var validate_default = defineCommand({
31
31
  export {
32
32
  validate_default as default
33
33
  };
34
- //# sourceMappingURL=validate-DOZZEZFC.js.map
34
+ //# sourceMappingURL=validate-N2WSG75W.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specdx",
3
- "version": "0.3.0-alpha.2",
3
+ "version": "0.4.0-alpha.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "specdx": "./dist/main.js"
@@ -36,9 +36,11 @@
36
36
  "yaml": "^2.7.0"
37
37
  },
38
38
  "devDependencies": {
39
+ "@specdx/check": "workspace:*",
39
40
  "@specdx/core": "workspace:*",
40
41
  "@specdx/diff": "workspace:*",
41
42
  "@specdx/lint": "workspace:*",
43
+ "@specdx/mcp": "workspace:*",
42
44
  "@specdx/pack": "workspace:*",
43
45
  "@specdx/schema": "workspace:*",
44
46
  "@specdx/skills": "workspace:*",
@@ -1,237 +0,0 @@
1
- import {
2
- REQUIRED_SECTIONS
3
- } from "./chunk-XLEN6ZYM.js";
4
-
5
- // ../lint/dist/engine.js
6
- function createLintEngine(options) {
7
- return {
8
- lint(specs) {
9
- const diagnostics = [];
10
- for (const spec of specs) {
11
- for (const rule of options.rules) {
12
- const results = rule.run({
13
- spec,
14
- allSpecs: specs,
15
- config: options.config,
16
- graph: options.graph
17
- });
18
- diagnostics.push(...results);
19
- }
20
- }
21
- return {
22
- diagnostics,
23
- hasErrors: diagnostics.some((d) => d.severity === "error"),
24
- hasWarnings: diagnostics.some((d) => d.severity === "warn")
25
- };
26
- }
27
- };
28
- }
29
-
30
- // ../lint/dist/rules/valid-frontmatter.js
31
- var validFrontmatterRule = {
32
- id: "structure/valid-frontmatter",
33
- description: "Frontmatter matches the schema for the declared spec type",
34
- severity: "error",
35
- run(context) {
36
- if (context.spec.valid)
37
- return [];
38
- const errors = context.spec.validationErrors ?? [];
39
- return errors.map((err) => ({
40
- ruleId: "structure/valid-frontmatter",
41
- severity: "error",
42
- message: `Invalid frontmatter: ${err.message ?? JSON.stringify(err)}`,
43
- filePath: context.spec.filePath
44
- }));
45
- }
46
- };
47
-
48
- // ../lint/dist/rules/required-sections.js
49
- var requiredSectionsRule = {
50
- id: "structure/required-sections",
51
- description: "Spec body contains all required sections for its type",
52
- severity: "error",
53
- run(context) {
54
- const ext = context.spec.filePath.split(".").pop()?.toLowerCase();
55
- if (ext === "yaml" || ext === "yml")
56
- return [];
57
- const specType = context.spec.frontmatter.type;
58
- const required = REQUIRED_SECTIONS[specType];
59
- if (!required)
60
- return [];
61
- const missing = required.filter((s) => !context.spec.sections.includes(s));
62
- return missing.map((section) => ({
63
- ruleId: "structure/required-sections",
64
- severity: "error",
65
- message: `Missing required section: "${section}"`,
66
- filePath: context.spec.filePath,
67
- section
68
- }));
69
- }
70
- };
71
-
72
- // ../lint/dist/rules/valid-references.js
73
- var validReferencesRule = {
74
- id: "structure/valid-references",
75
- description: "All references in frontmatter point to specs that exist in the suite",
76
- severity: "error",
77
- run(context) {
78
- const refs = context.spec.frontmatter.references;
79
- if (!refs || refs.length === 0)
80
- return [];
81
- const allIds = new Set(context.allSpecs.map((s) => s.frontmatter.id));
82
- return refs.filter((ref) => !allIds.has(ref.id)).map((ref) => ({
83
- ruleId: "structure/valid-references",
84
- severity: "error",
85
- message: `Reference "${ref.id}" does not match any spec in the suite`,
86
- filePath: context.spec.filePath
87
- }));
88
- }
89
- };
90
-
91
- // ../lint/dist/rules/no-circular-deps.js
92
- var noCircularDepsRule = {
93
- id: "structure/no-circular-deps",
94
- description: "The dependency graph has no cycles",
95
- severity: "error",
96
- run() {
97
- return [];
98
- }
99
- };
100
-
101
- // ../lint/dist/rules/story-coverage.js
102
- var FEATURE_PATTERN = /\*\*F\d+\*\*:\s*(.+)/g;
103
- var storyCoverageRule = {
104
- id: "completeness/story-coverage",
105
- description: "Every feature listed in a PRD has at least one corresponding user story",
106
- severity: "warn",
107
- run(context) {
108
- if (context.spec.frontmatter.type !== "prd")
109
- return [];
110
- const features = [];
111
- let match;
112
- const re = new RegExp(FEATURE_PATTERN.source, "g");
113
- while ((match = re.exec(context.spec.content)) !== null) {
114
- features.push(match[1].trim());
115
- }
116
- if (features.length === 0)
117
- return [];
118
- const stories = context.allSpecs.filter((s) => s.frontmatter.type === "user-story");
119
- const storyContent = stories.map((s) => s.content + " " + s.frontmatter.title).join(" ");
120
- return features.filter((feature) => !storyContent.toLowerCase().includes(feature.toLowerCase())).map((feature) => ({
121
- ruleId: "completeness/story-coverage",
122
- severity: "warn",
123
- message: `Feature "${feature}" has no corresponding user story`,
124
- filePath: context.spec.filePath
125
- }));
126
- }
127
- };
128
-
129
- // ../lint/dist/rules/staleness-check.js
130
- var stalenessCheckRule = {
131
- id: "freshness/staleness-check",
132
- description: "Warns if a spec hasn't been updated since its upstream dependency changed",
133
- severity: "warn",
134
- run(context) {
135
- const refs = context.spec.frontmatter.references;
136
- if (!refs || refs.length === 0)
137
- return [];
138
- const specUpdated = context.spec.frontmatter.updated ?? context.spec.frontmatter.created;
139
- const specDate = new Date(specUpdated);
140
- const diagnostics = [];
141
- for (const ref of refs) {
142
- if (ref.relationship !== "depends-on" && ref.relationship !== "implemented-by")
143
- continue;
144
- const upstream = context.allSpecs.find((s) => s.frontmatter.id === ref.id);
145
- if (!upstream)
146
- continue;
147
- const upstreamUpdated = upstream.frontmatter.updated ?? upstream.frontmatter.created;
148
- const upstreamDate = new Date(upstreamUpdated);
149
- if (upstreamDate > specDate) {
150
- diagnostics.push({
151
- ruleId: "freshness/staleness-check",
152
- severity: "warn",
153
- message: `Potentially stale: upstream "${upstream.frontmatter.id}" was updated on ${upstreamUpdated}, but this spec was last updated on ${specUpdated}`,
154
- filePath: context.spec.filePath
155
- });
156
- }
157
- }
158
- return diagnostics;
159
- }
160
- };
161
-
162
- // ../lint/dist/rules/no-vague-language.js
163
- var DEFAULT_VAGUE_PATTERNS = [
164
- "as appropriate",
165
- "handle edge cases",
166
- "as needed",
167
- "etc\\.",
168
- "TBD",
169
- "TODO",
170
- "and so on",
171
- "various",
172
- "somehow",
173
- "straightforward",
174
- "obviously",
175
- "simply",
176
- "just need to"
177
- ];
178
- var noVagueLanguageRule = {
179
- id: "clarity/no-vague-language",
180
- description: "Flags known ambiguous phrases",
181
- severity: "warn",
182
- run(context) {
183
- if (!context.spec.content)
184
- return [];
185
- const diagnostics = [];
186
- for (const pattern of DEFAULT_VAGUE_PATTERNS) {
187
- const regex = new RegExp(`\\b${pattern}`, "gi");
188
- let match;
189
- while ((match = regex.exec(context.spec.content)) !== null) {
190
- diagnostics.push({
191
- ruleId: "clarity/no-vague-language",
192
- severity: "warn",
193
- message: `Vague language: "${match[0]}"`,
194
- filePath: context.spec.filePath
195
- });
196
- }
197
- }
198
- return diagnostics;
199
- }
200
- };
201
-
202
- // ../lint/dist/rules/index.js
203
- var structureRules = [
204
- validFrontmatterRule,
205
- requiredSectionsRule,
206
- validReferencesRule,
207
- noCircularDepsRule
208
- ];
209
- var contentRules = [
210
- storyCoverageRule,
211
- stalenessCheckRule,
212
- noVagueLanguageRule
213
- ];
214
- var allBuiltinRules = [...structureRules, ...contentRules];
215
-
216
- // ../lint/dist/presets.js
217
- function getPreset(name) {
218
- switch (name) {
219
- case "minimal":
220
- return structureRules;
221
- case "recommended":
222
- return allBuiltinRules;
223
- case "strict":
224
- return allBuiltinRules.map((rule) => ({ ...rule, severity: "error" }));
225
- default:
226
- throw new Error(`Unknown preset: "${name}". Use "minimal", "recommended", or "strict", or resolve external presets via resolvePreset() from @specdx/core.`);
227
- }
228
- }
229
-
230
- // ../lint/dist/custom-rule-loader.js
231
- import { pathToFileURL } from "url";
232
-
233
- export {
234
- createLintEngine,
235
- getPreset
236
- };
237
- //# sourceMappingURL=chunk-ATLVRGHI.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../lint/src/engine.ts","../../lint/src/rules/valid-frontmatter.ts","../../lint/src/rules/required-sections.ts","../../lint/src/rules/valid-references.ts","../../lint/src/rules/no-circular-deps.ts","../../lint/src/rules/story-coverage.ts","../../lint/src/rules/staleness-check.ts","../../lint/src/rules/no-vague-language.ts","../../lint/src/rules/index.ts","../../lint/src/presets.ts","../../lint/src/custom-rule-loader.ts"],"sourcesContent":["import type { ParsedSpec, DependencyGraph } from \"@specdx/core\";\nimport type { SdxConfig } from \"@specdx/schema\";\nimport type { LintRule, LintResults, Diagnostic } from \"./types.js\";\n\nexport interface LintEngineOptions {\n rules: LintRule[];\n config?: SdxConfig;\n graph?: DependencyGraph;\n}\n\nexport interface LintEngine {\n lint(specs: ParsedSpec[]): LintResults;\n}\n\nexport function createLintEngine(options: LintEngineOptions): LintEngine {\n return {\n lint(specs: ParsedSpec[]): LintResults {\n const diagnostics: Diagnostic[] = [];\n for (const spec of specs) {\n for (const rule of options.rules) {\n const results = rule.run({\n spec,\n allSpecs: specs,\n config: options.config,\n graph: options.graph,\n });\n diagnostics.push(...results);\n }\n }\n return {\n diagnostics,\n hasErrors: diagnostics.some((d) => d.severity === \"error\"),\n hasWarnings: diagnostics.some((d) => d.severity === \"warn\"),\n };\n },\n };\n}\n","import type { LintRule } from \"../types.js\";\n\nexport const validFrontmatterRule: LintRule = {\n id: \"structure/valid-frontmatter\",\n description: \"Frontmatter matches the schema for the declared spec type\",\n severity: \"error\",\n run(context) {\n if (context.spec.valid) return [];\n const errors = context.spec.validationErrors ?? [];\n return errors.map((err) => ({\n ruleId: \"structure/valid-frontmatter\",\n severity: \"error\" as const,\n message: `Invalid frontmatter: ${err.message ?? JSON.stringify(err)}`,\n filePath: context.spec.filePath,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\nimport { REQUIRED_SECTIONS } from \"@specdx/schema\";\nimport type { SpecType } from \"@specdx/schema\";\n\nexport const requiredSectionsRule: LintRule = {\n id: \"structure/required-sections\",\n description: \"Spec body contains all required sections for its type\",\n severity: \"error\",\n run(context) {\n // Skip YAML specs (no markdown body)\n const ext = context.spec.filePath.split(\".\").pop()?.toLowerCase();\n if (ext === \"yaml\" || ext === \"yml\") return [];\n\n const specType = context.spec.frontmatter.type as SpecType;\n const required = REQUIRED_SECTIONS[specType];\n if (!required) return [];\n\n const missing = required.filter((s) => !context.spec.sections.includes(s));\n return missing.map((section) => ({\n ruleId: \"structure/required-sections\",\n severity: \"error\" as const,\n message: `Missing required section: \"${section}\"`,\n filePath: context.spec.filePath,\n section,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const validReferencesRule: LintRule = {\n id: \"structure/valid-references\",\n description: \"All references in frontmatter point to specs that exist in the suite\",\n severity: \"error\",\n run(context) {\n const refs = context.spec.frontmatter.references;\n if (!refs || refs.length === 0) return [];\n const allIds = new Set(context.allSpecs.map((s) => s.frontmatter.id));\n return refs\n .filter((ref) => !allIds.has(ref.id))\n .map((ref) => ({\n ruleId: \"structure/valid-references\",\n severity: \"error\" as const,\n message: `Reference \"${ref.id}\" does not match any spec in the suite`,\n filePath: context.spec.filePath,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const noCircularDepsRule: LintRule = {\n id: \"structure/no-circular-deps\",\n description: \"The dependency graph has no cycles\",\n severity: \"error\",\n run() {\n // Cycle detection happens in buildGraph() — if graph construction succeeds, it's acyclic.\n // GraphErrors are surfaced as diagnostics by the lint command, not by this rule.\n return [];\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nconst FEATURE_PATTERN = /\\*\\*F\\d+\\*\\*:\\s*(.+)/g;\n\nexport const storyCoverageRule: LintRule = {\n id: \"completeness/story-coverage\",\n description: \"Every feature listed in a PRD has at least one corresponding user story\",\n severity: \"warn\",\n run(context) {\n if (context.spec.frontmatter.type !== \"prd\") return [];\n const features: string[] = [];\n let match;\n const re = new RegExp(FEATURE_PATTERN.source, \"g\");\n while ((match = re.exec(context.spec.content)) !== null) {\n features.push(match[1]!.trim());\n }\n if (features.length === 0) return [];\n const stories = context.allSpecs.filter((s) => s.frontmatter.type === \"user-story\");\n const storyContent = stories.map((s) => s.content + \" \" + s.frontmatter.title).join(\" \");\n return features\n .filter((feature) => !storyContent.toLowerCase().includes(feature.toLowerCase()))\n .map((feature) => ({\n ruleId: \"completeness/story-coverage\",\n severity: \"warn\" as const,\n message: `Feature \"${feature}\" has no corresponding user story`,\n filePath: context.spec.filePath,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const stalenessCheckRule: LintRule = {\n id: \"freshness/staleness-check\",\n description: \"Warns if a spec hasn't been updated since its upstream dependency changed\",\n severity: \"warn\",\n run(context) {\n const refs = context.spec.frontmatter.references;\n if (!refs || (refs as unknown[]).length === 0) return [];\n const specUpdated =\n (context.spec.frontmatter.updated as string | undefined) ??\n (context.spec.frontmatter.created as string);\n const specDate = new Date(specUpdated);\n const diagnostics = [];\n for (const ref of refs as Array<{ id: string; relationship: string }>) {\n if (ref.relationship !== \"depends-on\" && ref.relationship !== \"implemented-by\") continue;\n const upstream = context.allSpecs.find((s) => s.frontmatter.id === ref.id);\n if (!upstream) continue;\n const upstreamUpdated =\n (upstream.frontmatter.updated as string | undefined) ??\n (upstream.frontmatter.created as string);\n const upstreamDate = new Date(upstreamUpdated);\n if (upstreamDate > specDate) {\n diagnostics.push({\n ruleId: \"freshness/staleness-check\",\n severity: \"warn\" as const,\n message: `Potentially stale: upstream \"${upstream.frontmatter.id}\" was updated on ${upstreamUpdated}, but this spec was last updated on ${specUpdated}`,\n filePath: context.spec.filePath,\n });\n }\n }\n return diagnostics;\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nconst DEFAULT_VAGUE_PATTERNS = [\n \"as appropriate\",\n \"handle edge cases\",\n \"as needed\",\n \"etc\\\\.\",\n \"TBD\",\n \"TODO\",\n \"and so on\",\n \"various\",\n \"somehow\",\n \"straightforward\",\n \"obviously\",\n \"simply\",\n \"just need to\",\n];\n\nexport const noVagueLanguageRule: LintRule = {\n id: \"clarity/no-vague-language\",\n description: \"Flags known ambiguous phrases\",\n severity: \"warn\",\n run(context) {\n if (!context.spec.content) return [];\n const diagnostics = [];\n for (const pattern of DEFAULT_VAGUE_PATTERNS) {\n const regex = new RegExp(`\\\\b${pattern}`, \"gi\");\n let match;\n while ((match = regex.exec(context.spec.content)) !== null) {\n diagnostics.push({\n ruleId: \"clarity/no-vague-language\",\n severity: \"warn\" as const,\n message: `Vague language: \"${match[0]}\"`,\n filePath: context.spec.filePath,\n });\n }\n }\n return diagnostics;\n },\n};\n","import { validFrontmatterRule } from \"./valid-frontmatter.js\";\nimport { requiredSectionsRule } from \"./required-sections.js\";\nimport { validReferencesRule } from \"./valid-references.js\";\nimport { noCircularDepsRule } from \"./no-circular-deps.js\";\nimport { storyCoverageRule } from \"./story-coverage.js\";\nimport { stalenessCheckRule } from \"./staleness-check.js\";\nimport { noVagueLanguageRule } from \"./no-vague-language.js\";\nimport type { LintRule } from \"../types.js\";\n\nexport const structureRules: LintRule[] = [\n validFrontmatterRule,\n requiredSectionsRule,\n validReferencesRule,\n noCircularDepsRule,\n];\n\nexport const contentRules: LintRule[] = [\n storyCoverageRule,\n stalenessCheckRule,\n noVagueLanguageRule,\n];\n\nexport const allBuiltinRules: LintRule[] = [...structureRules, ...contentRules];\n\nexport {\n validFrontmatterRule,\n requiredSectionsRule,\n validReferencesRule,\n noCircularDepsRule,\n storyCoverageRule,\n stalenessCheckRule,\n noVagueLanguageRule,\n};\n","import type { LintRule } from \"./types.js\";\nimport { structureRules, allBuiltinRules } from \"./rules/index.js\";\n\nexport function getPreset(name: string): LintRule[] {\n switch (name) {\n case \"minimal\":\n return structureRules;\n case \"recommended\":\n return allBuiltinRules;\n case \"strict\":\n return allBuiltinRules.map((rule) => ({ ...rule, severity: \"error\" as const }));\n default:\n throw new Error(`Unknown preset: \"${name}\". Use \"minimal\", \"recommended\", or \"strict\", or resolve external presets via resolvePreset() from @specdx/core.`);\n }\n}\n","import { pathToFileURL } from \"node:url\";\nimport type { LintRule } from \"./types.js\";\n\nexport async function loadCustomRule(filePath: string): Promise<LintRule> {\n const module = await import(pathToFileURL(filePath).href);\n const rule = module.default ?? module.rule;\n if (!rule || !rule.id || !rule.run) {\n throw new Error(\n `Custom rule at ${filePath} must export a default LintRule with id and run function`,\n );\n }\n return rule as LintRule;\n}\n"],"mappings":";;;;;AAcM,SAAU,iBAAiB,SAA0B;AACzD,SAAO;IACL,KAAK,OAAmB;AACtB,YAAM,cAA4B,CAAA;AAClC,iBAAW,QAAQ,OAAO;AACxB,mBAAW,QAAQ,QAAQ,OAAO;AAChC,gBAAM,UAAU,KAAK,IAAI;YACvB;YACA,UAAU;YACV,QAAQ,QAAQ;YAChB,OAAO,QAAQ;WAChB;AACD,sBAAY,KAAK,GAAG,OAAO;QAC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AAC,GAAG,gBAAgB,GAAG,YAAY;;;ACnBxE,SAAU,UAAU,MAAY;AACpC,UAAQ,MAAM;IACZ,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO,gBAAgB,IAAI,CAAC,UAAU,EAAE,GAAG,MAAM,UAAU,QAAgB,EAAG;IAChF;AACE,YAAM,IAAI,MAAM,oBAAoB,IAAI,kHAAkH;EAC9J;AACF;;;ACdA,SAAS,qBAAqB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../schema/src/sections.ts","../../schema/src/validator.ts","../../schema/dist/schemas/base-spec.json","../../schema/dist/schemas/config.json","../../schema/dist/schemas/prd.json","../../schema/dist/schemas/technical-design.json","../../schema/dist/schemas/user-story.json","../../schema/dist/schemas/test-plan.json","../../schema/dist/schemas/adr.json","../../schema/dist/schemas/api-contract.json"],"sourcesContent":["import type { SpecType } from \"./types.js\";\n\nexport const REQUIRED_SECTIONS: Record<SpecType, string[]> = {\n prd: [\"Problem Statement\", \"Goals\", \"Non-Goals\", \"Features\", \"Success Criteria\"],\n \"technical-design\": [\n \"Overview\",\n \"Architecture\",\n \"Data Model\",\n \"API Design\",\n \"Dependencies\",\n \"Risks\",\n \"Open Questions\",\n ],\n \"user-story\": [\"Description\", \"Acceptance Criteria\", \"Dependencies\", \"Notes\"],\n \"test-plan\": [\"Scope\", \"Test Cases\", \"Coverage Matrix\", \"Edge Cases\"],\n adr: [\"Context\", \"Decision\", \"Status\", \"Consequences\"],\n \"api-contract\": [\"Endpoints\", \"Request/Response Schemas\", \"Auth\", \"Error Codes\"],\n};\n","import { Ajv as AjvClass, type ErrorObject } from \"ajv\";\nimport type { SpecType } from \"./types.js\";\n\nimport baseSpecSchema from \"./schemas/base-spec.json\" with { type: \"json\" };\nimport configSchema from \"./schemas/config.json\" with { type: \"json\" };\nimport prdSchema from \"./schemas/prd.json\" with { type: \"json\" };\nimport technicalDesignSchema from \"./schemas/technical-design.json\" with { type: \"json\" };\nimport userStorySchema from \"./schemas/user-story.json\" with { type: \"json\" };\nimport testPlanSchema from \"./schemas/test-plan.json\" with { type: \"json\" };\nimport adrSchema from \"./schemas/adr.json\" with { type: \"json\" };\nimport apiContractSchema from \"./schemas/api-contract.json\" with { type: \"json\" };\n\n// addFormats is CJS-only; access via the namespace default at runtime\n// The type cast is needed because TypeScript's NodeNext resolution exposes\n// the CJS module as a namespace without a callable default signature.\nimport * as addFormatsNs from \"ajv-formats\";\ntype AddFormatsPlugin = (ajv: AjvClass, formats?: unknown) => AjvClass;\nconst addFormats = ((addFormatsNs as unknown as { default?: AddFormatsPlugin }).default ??\n (addFormatsNs as unknown as AddFormatsPlugin)) as AddFormatsPlugin;\n\nexport interface ValidationResult {\n valid: boolean;\n errors: ErrorObject[] | null;\n}\n\nconst ajv = new AjvClass({ allErrors: true, strict: true });\naddFormats(ajv, [\"date\"]);\najv.addSchema(baseSpecSchema);\n\nconst specValidators: Record<string, ReturnType<typeof ajv.compile>> = {\n prd: ajv.compile(prdSchema),\n \"technical-design\": ajv.compile(technicalDesignSchema),\n \"user-story\": ajv.compile(userStorySchema),\n \"test-plan\": ajv.compile(testPlanSchema),\n adr: ajv.compile(adrSchema),\n \"api-contract\": ajv.compile(apiContractSchema),\n};\n\nconst configValidator = ajv.compile(configSchema);\n\nexport function validateSpec(type: SpecType, data: Record<string, unknown>): ValidationResult {\n const validate = specValidators[type];\n if (!validate) {\n return { valid: false, errors: [{ message: `Unknown spec type: \"${type}\"` } as ErrorObject] };\n }\n const valid = validate(data);\n return { valid: !!valid, errors: valid ? null : (validate.errors ?? null) };\n}\n\nexport function validateConfig(data: Record<string, unknown>): ValidationResult {\n const valid = configValidator(data);\n return { valid: !!valid, errors: valid ? null : (configValidator.errors ?? null) };\n}\n","{\n \"$id\": \"base-spec\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": { \"type\": \"string\", \"minLength\": 1 },\n \"type\": { \"type\": \"string\", \"enum\": [\"prd\", \"technical-design\", \"user-story\", \"test-plan\", \"adr\", \"api-contract\"] },\n \"title\": { \"type\": \"string\", \"minLength\": 1 },\n \"status\": { \"type\": \"string\", \"enum\": [\"draft\", \"review\", \"approved\", \"superseded\"] },\n \"version\": { \"type\": \"string\" },\n \"created\": { \"type\": \"string\", \"format\": \"date\" },\n \"updated\": { \"type\": \"string\", \"format\": \"date\" },\n \"authors\": { \"type\": \"array\", \"items\": { \"type\": \"string\" }, \"minItems\": 1 },\n \"tags\": { \"type\": \"array\", \"items\": { \"type\": \"string\" }, \"default\": [] },\n \"references\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": { \"type\": \"string\" },\n \"relationship\": { \"type\": \"string\", \"enum\": [\"implemented-by\", \"decomposed-into\", \"depends-on\", \"supersedes\", \"related-to\"] }\n },\n \"required\": [\"id\", \"relationship\"],\n \"additionalProperties\": false\n },\n \"default\": []\n }\n },\n \"required\": [\"id\", \"type\", \"title\", \"status\", \"version\", \"created\", \"authors\"],\n \"additionalProperties\": true\n}\n","{\n \"$id\": \"sdx-config\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"version\": { \"type\": \"string\" },\n \"project\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"description\": { \"type\": \"string\" }\n },\n \"additionalProperties\": false\n },\n \"specs\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": { \"type\": \"string\" },\n \"type\": { \"type\": \"string\", \"enum\": [\"prd\", \"technical-design\", \"user-story\", \"test-plan\", \"adr\", \"api-contract\"] },\n \"required\": { \"type\": \"boolean\", \"default\": false },\n \"requires\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"owner\": { \"type\": \"string\" }\n },\n \"required\": [\"path\", \"type\"],\n \"additionalProperties\": false\n }\n },\n \"lint\": {\n \"type\": \"object\",\n \"properties\": {\n \"extends\": { \"type\": \"string\" },\n \"rules\": { \"type\": \"object\" },\n \"ignore\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n },\n \"additionalProperties\": false\n },\n \"pack\": {\n \"type\": \"object\",\n \"properties\": {\n \"max_tokens\": { \"type\": \"integer\", \"minimum\": 1 },\n \"format\": { \"type\": \"string\", \"enum\": [\"xml\", \"markdown\", \"json\"] },\n \"compression\": {\n \"type\": \"object\",\n \"properties\": {\n \"strip_boilerplate\": { \"type\": \"boolean\" },\n \"stable_days\": { \"type\": \"integer\", \"minimum\": 0 },\n \"collapse_resolved_adrs\": { \"type\": \"boolean\" }\n },\n \"additionalProperties\": false\n },\n \"boilerplate_sections\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n },\n \"additionalProperties\": false\n },\n \"diff\": {\n \"type\": \"object\",\n \"properties\": {\n \"baseline_ref\": { \"type\": \"string\", \"default\": \"main\" },\n \"staleness_threshold_days\": { \"type\": \"integer\", \"minimum\": 1, \"default\": 14 },\n \"ignore_paths\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n },\n \"additionalProperties\": false\n },\n \"ci\": {\n \"type\": \"object\",\n \"properties\": {\n \"block_on\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\", \"enum\": [\"error\", \"warn\", \"info\"] }\n },\n \"post_comment\": { \"type\": \"boolean\", \"default\": true },\n \"update_badge\": { \"type\": \"boolean\", \"default\": true },\n \"trigger_paths\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n },\n \"additionalProperties\": false\n }\n },\n \"required\": [\"version\", \"specs\"],\n \"additionalProperties\": false\n}\n","{\n \"$id\": \"prd\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"prd\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"technical-design\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"technical-design\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"user-story\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n {\n \"type\": \"object\",\n \"properties\": {\n \"type\": { \"const\": \"user-story\" },\n \"story_id\": { \"type\": \"string\", \"minLength\": 1 },\n \"priority\": { \"type\": \"string\", \"enum\": [\"critical\", \"high\", \"medium\", \"low\"] },\n \"estimate\": { \"type\": \"string\" }\n },\n \"required\": [\"type\", \"story_id\", \"priority\", \"estimate\"]\n }\n ]\n}\n","{\n \"$id\": \"test-plan\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"test-plan\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"adr\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"adr\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"api-contract\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"api-contract\" } }, \"required\": [\"type\"] }\n ]\n}\n"],"mappings":";AAEO,IAAM,oBAAgD;EAC3D,KAAK,CAAC,qBAAqB,SAAS,aAAa,YAAY,kBAAkB;EAC/E,oBAAoB;IAClB;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,cAAc,CAAC,eAAe,uBAAuB,gBAAgB,OAAO;EAC5E,aAAa,CAAC,SAAS,cAAc,mBAAmB,YAAY;EACpE,KAAK,CAAC,WAAW,YAAY,U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