specdx 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/.claude-plugin/plugin.json +2 -2
  2. package/README.md +43 -3
  3. package/dist/{check-PHXXA7VY.js → check-5EA2MTNN.js} +121 -27
  4. package/dist/check-5EA2MTNN.js.map +1 -0
  5. package/dist/{chunk-3YXRWQGX.js → chunk-2UUQJ2ER.js} +242 -53
  6. package/dist/chunk-2UUQJ2ER.js.map +1 -0
  7. package/dist/{chunk-NAWYG4VV.js → chunk-5XOWCPP2.js} +2 -2
  8. package/dist/{chunk-2BZIG7OE.js → chunk-BZL2XXMA.js} +14 -14
  9. package/dist/{chunk-SNQNQ2MP.js → chunk-JGD3BOPH.js} +16 -6
  10. package/dist/chunk-JGD3BOPH.js.map +1 -0
  11. package/dist/{chunk-YRQPY5NF.js → chunk-MOYYF7Q6.js} +2 -2
  12. package/dist/{chunk-OVIKIIR4.js → chunk-QAJZCJUJ.js} +4 -3
  13. package/dist/chunk-QAJZCJUJ.js.map +1 -0
  14. package/dist/{chunk-LJTLNXGV.js → chunk-VVZUJ6H4.js} +353 -4
  15. package/dist/chunk-VVZUJ6H4.js.map +1 -0
  16. package/dist/{chunk-HCJDCS26.js → chunk-XRWLPU24.js} +10 -1
  17. package/dist/chunk-XRWLPU24.js.map +1 -0
  18. package/dist/{diff-6C5LJ7SH.js → diff-ZT6HXHK5.js} +4 -4
  19. package/dist/dist-6WDWUOCV.js +26 -0
  20. package/dist/{dist-PK52GA7M.js → dist-A3CWALDC.js} +76 -16
  21. package/dist/dist-A3CWALDC.js.map +1 -0
  22. package/dist/{generate-K72WD455.js → generate-M6YKXUDE.js} +5 -5
  23. package/dist/{generate-story-NUCNYL3I.js → generate-story-BXGNKWC6.js} +4 -4
  24. package/dist/{generate-test-plan-Z46W3N3B.js → generate-test-plan-PZUNCNN3.js} +3 -3
  25. package/dist/{graph-4RNURBNP.js → graph-GKXD2IGW.js} +3 -3
  26. package/dist/index.d.ts +38 -0
  27. package/dist/index.js +463 -26
  28. package/dist/index.js.map +1 -1
  29. package/dist/{lint-2VZPNLE3.js → lint-GZX5C5EQ.js} +93 -14
  30. package/dist/lint-GZX5C5EQ.js.map +1 -0
  31. package/dist/main.js +3 -3
  32. package/dist/{mcp-E6PJWBDQ.js → mcp-VQAYNJQ7.js} +3 -3
  33. package/dist/{migrate-FKFC7UAO.js → migrate-VASWPA3L.js} +3 -3
  34. package/dist/{pack-DE4UBTCC.js → pack-DFUCNWVR.js} +4 -4
  35. package/dist/{ready-K74SLQ24.js → ready-5OFSV2OD.js} +5 -5
  36. package/dist/{status-IAE3BB77.js → status-5MDODW4N.js} +5 -5
  37. package/dist/{update-UFOHZEAK.js → update-NFXC45UT.js} +4 -4
  38. package/dist/{validate-EZHUB5TW.js → validate-LWRLZR3H.js} +3 -3
  39. package/package.json +5 -4
  40. package/skills/core/specdx-author-spec/SKILL.md +33 -0
  41. package/skills/core/specdx-author-spec/references/spec-type-reference.md +57 -0
  42. package/skills/core/specdx-author-spec/references/step-01-frontmatter.md +66 -0
  43. package/skills/core/specdx-author-spec/references/step-02-sections.md +111 -0
  44. package/skills/core/specdx-author-spec/references/step-03-finalize.md +48 -0
  45. package/skills/core/specdx-onboard/SKILL.md +54 -0
  46. package/skills/core/specdx-plan-from-spec/SKILL.md +76 -0
  47. package/skills/core/specdx-pre-commit/SKILL.md +70 -0
  48. package/skills/core/specdx-review-spec/SKILL.md +81 -0
  49. package/skills/core/specdx-router/SKILL.md +67 -0
  50. package/skills/core/specdx-sprint-review/SKILL.md +73 -0
  51. package/skills/core/specdx-start-task/SKILL.md +62 -0
  52. package/skills/experimental/specdx-check-drift/SKILL.md +77 -0
  53. package/skills/experimental/specdx-verify/SKILL.md +85 -0
  54. package/dist/check-PHXXA7VY.js.map +0 -1
  55. package/dist/chunk-3YXRWQGX.js.map +0 -1
  56. package/dist/chunk-HCJDCS26.js.map +0 -1
  57. package/dist/chunk-LJTLNXGV.js.map +0 -1
  58. package/dist/chunk-OVIKIIR4.js.map +0 -1
  59. package/dist/chunk-SNQNQ2MP.js.map +0 -1
  60. package/dist/dist-PK52GA7M.js.map +0 -1
  61. package/dist/dist-ROHCFKYT.js +0 -16
  62. package/dist/lint-2VZPNLE3.js.map +0 -1
  63. /package/dist/{chunk-NAWYG4VV.js.map → chunk-5XOWCPP2.js.map} +0 -0
  64. /package/dist/{chunk-2BZIG7OE.js.map → chunk-BZL2XXMA.js.map} +0 -0
  65. /package/dist/{chunk-YRQPY5NF.js.map → chunk-MOYYF7Q6.js.map} +0 -0
  66. /package/dist/{diff-6C5LJ7SH.js.map → diff-ZT6HXHK5.js.map} +0 -0
  67. /package/dist/{dist-ROHCFKYT.js.map → dist-6WDWUOCV.js.map} +0 -0
  68. /package/dist/{generate-K72WD455.js.map → generate-M6YKXUDE.js.map} +0 -0
  69. /package/dist/{generate-story-NUCNYL3I.js.map → generate-story-BXGNKWC6.js.map} +0 -0
  70. /package/dist/{generate-test-plan-Z46W3N3B.js.map → generate-test-plan-PZUNCNN3.js.map} +0 -0
  71. /package/dist/{graph-4RNURBNP.js.map → graph-GKXD2IGW.js.map} +0 -0
  72. /package/dist/{mcp-E6PJWBDQ.js.map → mcp-VQAYNJQ7.js.map} +0 -0
  73. /package/dist/{migrate-FKFC7UAO.js.map → migrate-VASWPA3L.js.map} +0 -0
  74. /package/dist/{pack-DE4UBTCC.js.map → pack-DFUCNWVR.js.map} +0 -0
  75. /package/dist/{ready-K74SLQ24.js.map → ready-5OFSV2OD.js.map} +0 -0
  76. /package/dist/{status-IAE3BB77.js.map → status-5MDODW4N.js.map} +0 -0
  77. /package/dist/{update-UFOHZEAK.js.map → update-NFXC45UT.js.map} +0 -0
  78. /package/dist/{validate-EZHUB5TW.js.map → validate-LWRLZR3H.js.map} +0 -0
@@ -1,7 +1,9 @@
1
1
  import {
2
2
  createLintEngine,
3
+ lintAgentFiles,
4
+ lintAgentFilesWithoutConfig,
3
5
  resolveLintConfig
4
- } from "./chunk-LJTLNXGV.js";
6
+ } from "./chunk-VVZUJ6H4.js";
5
7
  import {
6
8
  createOutput
7
9
  } from "./chunk-NHD44ZYN.js";
@@ -10,13 +12,15 @@ import {
10
12
  sharedArgs
11
13
  } from "./chunk-DMGABJ6T.js";
12
14
  import {
15
+ ConfigError,
13
16
  buildGraph,
14
17
  createLogger,
18
+ findConfig,
15
19
  loadConfig,
16
20
  parseSpec,
17
21
  resolveGlob
18
- } from "./chunk-SNQNQ2MP.js";
19
- import "./chunk-HCJDCS26.js";
22
+ } from "./chunk-JGD3BOPH.js";
23
+ import "./chunk-XRWLPU24.js";
20
24
  import "./chunk-5WRI5ZAA.js";
21
25
 
22
26
  // src/commands/core/lint.ts
@@ -52,7 +56,28 @@ async function runLint(options) {
52
56
  if (!options.configDir) {
53
57
  throw new TypeError("runLint requires `configDir` \u2014 the directory holding spec.config.yaml.");
54
58
  }
55
- const config = await loadConfig(void 0, options.configDir);
59
+ const configPath = await findConfig(options.configDir);
60
+ if (!configPath) {
61
+ if (options.specPath) {
62
+ throw new ConfigError(
63
+ `No spec.config.yaml at or above this directory, so "${options.specPath}" was not linted as a spec. Run \`specdx lint\` with no path to lint AGENTS.md and CLAUDE.md, or \`specdx init\` to add a spec suite.`
64
+ );
65
+ }
66
+ const agentResults = await lintAgentFilesWithoutConfig(options.configDir);
67
+ if (!agentResults) {
68
+ throw new ConfigError("No spec.config.yaml found. Run 'specdx init' to create one.");
69
+ }
70
+ return {
71
+ diagnostics: agentResults.diagnostics,
72
+ hasErrors: agentResults.diagnostics.some((d) => d.severity === "error"),
73
+ hasWarnings: agentResults.diagnostics.some((d) => d.severity === "warn"),
74
+ specFiles: 0,
75
+ assessed: false,
76
+ agentFiles: agentResults.filesLinted,
77
+ specSuite: false
78
+ };
79
+ }
80
+ const config = await loadConfig(configPath, options.configDir);
56
81
  const preset = options.preset ?? config.lint?.extends ?? "recommended";
57
82
  const { rules, ignore } = await resolveLintConfig({
58
83
  config,
@@ -75,9 +100,10 @@ async function runLint(options) {
75
100
  }
76
101
  const engine = createLintEngine({ rules, config, graph, ignore });
77
102
  const results = engine.lint(specs);
78
- if (options.specPath) {
79
- const specPath = options.specPath;
80
- results.diagnostics = results.diagnostics.filter((d) => d.filePath.includes(specPath));
103
+ const { specPath } = options;
104
+ const selects = (filePath) => specPath === void 0 || filePath.includes(specPath);
105
+ if (specPath !== void 0) {
106
+ results.diagnostics = results.diagnostics.filter((d) => selects(d.filePath));
81
107
  results.hasErrors = results.diagnostics.some((d) => d.severity === "error");
82
108
  results.hasWarnings = results.diagnostics.some((d) => d.severity === "warn");
83
109
  }
@@ -90,9 +116,56 @@ async function runLint(options) {
90
116
  });
91
117
  results.hasErrors = true;
92
118
  }
119
+ let agentFiles = 0;
120
+ if (config.agents) {
121
+ const agentResults = await lintAgentFiles({ config, configDir: options.configDir });
122
+ agentFiles = agentResults.filesLinted;
123
+ if (!agentResults.assessed) {
124
+ const patterns = config.agents.paths ?? ["AGENTS.md", "CLAUDE.md"];
125
+ results.diagnostics.push({
126
+ ruleId: "agents/paths-match-nothing",
127
+ severity: "error",
128
+ message: `agents.paths matched no files (${patterns.join(", ")}), so no agent instruction file was linted. Remove the \`agents\` key or fix the paths.`,
129
+ filePath: "spec.config.yaml"
130
+ });
131
+ results.hasErrors = true;
132
+ }
133
+ for (const diagnostic of agentResults.diagnostics) {
134
+ if (!selects(diagnostic.filePath)) continue;
135
+ results.diagnostics.push(diagnostic);
136
+ if (diagnostic.severity === "error") results.hasErrors = true;
137
+ if (diagnostic.severity === "warn") results.hasWarnings = true;
138
+ }
139
+ }
93
140
  const ignored = new Set(ignore);
94
- const linted = specs.filter((spec) => !ignored.has(spec.filePath));
95
- return { ...results, specFiles: linted.length, assessed: linted.length > 0 };
141
+ const linted = specs.filter((spec) => !ignored.has(spec.filePath) && selects(spec.filePath));
142
+ return {
143
+ ...results,
144
+ specFiles: linted.length,
145
+ assessed: linted.length > 0,
146
+ agentFiles,
147
+ specSuite: true
148
+ };
149
+ }
150
+ function noSpecSuiteNotice(configDir) {
151
+ return {
152
+ ruleId: "agents/no-spec-suite",
153
+ severity: "info",
154
+ message: "No spec.config.yaml at or above this directory, so no specs were checked \u2014 only agent instruction files. Run `specdx init` to add a spec suite.",
155
+ filePath: configDir
156
+ };
157
+ }
158
+ function cleanRunMessage(results) {
159
+ const agentPart = `${results.agentFiles} agent ${results.agentFiles === 1 ? "file" : "files"}`;
160
+ if (!results.specSuite) {
161
+ return ` \u2713 ${agentPart} checked, no problems found.
162
+ No spec.config.yaml here, so no specs were checked. Run \`specdx init\` to add a spec suite.
163
+ `;
164
+ }
165
+ const parts = [`${results.specFiles} ${results.specFiles === 1 ? "spec" : "specs"}`];
166
+ if (results.agentFiles > 0) parts.push(agentPart);
167
+ return ` \u2713 ${parts.join(" and ")} checked, no problems found.
168
+ `;
96
169
  }
97
170
  var lint_default = defineCommand({
98
171
  meta: { name: "lint", description: "Lint all specs in the suite" },
@@ -122,15 +195,19 @@ var lint_default = defineCommand({
122
195
  preset: args.preset
123
196
  });
124
197
  const formatter = format.format === "json" ? formatJson : format.format === "github" ? formatGithub : formatPretty;
125
- if (!results.assessed) {
198
+ if (!results.assessed && results.specSuite) {
126
199
  console.error(
127
- "\n \u26A0 No specs were linted. Check the spec paths in spec.config.yaml, and whether `lint.ignore` excludes them all.\n"
200
+ args.path ? `
201
+ \u26A0 No specs matched path "${args.path}", so nothing was linted. Check it against the specs declared in spec.config.yaml.
202
+ ` : "\n \u26A0 No specs were linted. Check the spec paths in spec.config.yaml, and whether `lint.ignore` excludes them all.\n"
128
203
  );
129
204
  process.exit(3);
130
205
  }
131
- const rendered = formatter(results.diagnostics);
206
+ const rendered = formatter(
207
+ results.specSuite ? results.diagnostics : [noSpecSuiteNotice(process.cwd()), ...results.diagnostics]
208
+ );
132
209
  if (format.format === "pretty" && results.diagnostics.length === 0) {
133
- output.info(rendered);
210
+ output.info(cleanRunMessage(results));
134
211
  } else {
135
212
  output.out(rendered);
136
213
  }
@@ -144,7 +221,9 @@ var lint_default = defineCommand({
144
221
  }
145
222
  });
146
223
  export {
224
+ cleanRunMessage,
147
225
  lint_default as default,
226
+ noSpecSuiteNotice,
148
227
  runLint
149
228
  };
150
- //# sourceMappingURL=lint-2VZPNLE3.js.map
229
+ //# sourceMappingURL=lint-GZX5C5EQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/core/lint.ts","../src/formatters/pretty.ts","../src/formatters/json.ts","../src/formatters/github.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport {\n loadConfig,\n findConfig,\n ConfigError,\n parseSpec,\n resolveGlob,\n buildGraph,\n createLogger,\n} from \"@specdx/core\";\nimport {\n createLintEngine,\n resolveLintConfig,\n lintAgentFiles,\n lintAgentFilesWithoutConfig,\n type LintResults,\n type Diagnostic,\n} from \"@specdx/lint\";\nimport type { ParsedSpec } from \"@specdx/core\";\nimport { sharedArgs, resolveFormat } from \"../../shared-args.js\";\nimport { createOutput } from \"../../output.js\";\nimport { formatPretty } from \"../../formatters/pretty.js\";\nimport { formatJson } from \"../../formatters/json.js\";\nimport { formatGithub } from \"../../formatters/github.js\";\n\nconst FORMATS = [\"pretty\", \"json\", \"github\"] as const;\n\nexport interface RunLintOptions {\n configDir: string;\n specPath?: string;\n preset?: \"minimal\" | \"recommended\" | \"strict\";\n}\n\n/** Lint results plus whether anything was actually linted (vacuous-pass audit). */\nexport interface RunLintResults extends LintResults {\n /** Number of spec files linted. Named for what it counts, not \"count\". */\n specFiles: number;\n /** False when no specs resolved — \"no diagnostics\" is then not a pass. */\n assessed: boolean;\n /**\n * Agent instruction files linted. Zero when `agents` is not configured, which\n * is not a failure — the feature is opt-in. A configured `agents.paths` that\n * matches nothing is reported as an error diagnostic instead, because that\n * is a config promising a check that is not running.\n */\n agentFiles: number;\n /**\n * False when there is no `spec.config.yaml` and only agent instruction files\n * were linted. The zero-config on-ramp: a project with a CLAUDE.md and no\n * spec suite gets a useful answer instead of \"run specdx init\".\n *\n * `assessed` keeps meaning \"specs were assessed\", so the vacuous-pass guard\n * it exists for is unweakened; callers check this flag to know that a\n * `specFiles: 0` is expected here rather than a suite that resolved to\n * nothing.\n */\n specSuite: boolean;\n}\n\nexport async function runLint(options: RunLintOptions): Promise<RunLintResults> {\n // A JS caller omitting the option otherwise dies as ERR_INVALID_ARG_TYPE\n // deep inside path.join, with no mention of what was missing.\n if (!options.configDir) {\n throw new TypeError(\"runLint requires `configDir` — the directory holding spec.config.yaml.\");\n }\n // No spec suite is not automatically an error: a project may have a\n // CLAUDE.md and nothing else, and that is the on-ramp this supports.\n //\n // The presence check runs *before* `loadConfig`, deliberately. A missing\n // config and a malformed one both surface as `ConfigError`, and degrading on\n // the second would turn a YAML typo into a narrower check reported as a\n // pass — the vacuous-pass shape, one level up. Only genuine absence\n // degrades; anything else still throws.\n const configPath = await findConfig(options.configDir);\n if (!configPath) {\n // A caller who named a spec file asked for something this directory cannot\n // give. Linting the agent files instead and exiting 0 would report a pass\n // for a file nobody looked at — #53's defect through a new door, and the\n // guard below cannot catch it because it is scoped to a real suite.\n if (options.specPath) {\n throw new ConfigError(\n `No spec.config.yaml at or above this directory, so \"${options.specPath}\" was not linted as a spec. ` +\n `Run \\`specdx lint\\` with no path to lint AGENTS.md and CLAUDE.md, or \\`specdx init\\` to add a spec suite.`,\n );\n }\n const agentResults = await lintAgentFilesWithoutConfig(options.configDir);\n if (!agentResults) {\n // Nothing to lint at all. The original guidance is still the right one.\n throw new ConfigError(\"No spec.config.yaml found. Run 'specdx init' to create one.\");\n }\n return {\n diagnostics: agentResults.diagnostics,\n hasErrors: agentResults.diagnostics.some((d) => d.severity === \"error\"),\n hasWarnings: agentResults.diagnostics.some((d) => d.severity === \"warn\"),\n specFiles: 0,\n assessed: false,\n agentFiles: agentResults.filesLinted,\n specSuite: false,\n };\n }\n\n // Pass the path `findConfig` already resolved rather than making `loadConfig`\n // walk the tree a second time.\n const config = await loadConfig(configPath, options.configDir);\n const preset = options.preset ?? config.lint?.extends ?? \"recommended\";\n const { rules, ignore } = await resolveLintConfig({\n config,\n preset,\n configDir: options.configDir,\n });\n\n // Always parse the full suite so cross-reference rules have complete\n // context; a single-file lint filters the *diagnostics*, not the suite.\n const specs: ParsedSpec[] = [];\n for (const [, entry] of Object.entries(config.specs)) {\n const files = await resolveGlob(entry.path, options.configDir);\n for (const file of files) {\n specs.push(await parseSpec(file));\n }\n }\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, ignore });\n const results = engine.lint(specs);\n\n // One definition of \"does --path select this file\", shared by the diagnostic\n // filter below and the assessed count further down. Two copies of this\n // predicate would be free to disagree, and a count that disagrees with the\n // filter is exactly how the vacuous pass got in: `--path` filtered the\n // diagnostics to nothing while the count still described the whole suite, so\n // a path matching no spec rendered as \"All specs pass lint checks\", exit 0.\n const { specPath } = options;\n const selects = (filePath: string) => specPath === undefined || filePath.includes(specPath);\n\n if (specPath !== undefined) {\n results.diagnostics = results.diagnostics.filter((d) => selects(d.filePath));\n results.hasErrors = results.diagnostics.some((d) => d.severity === \"error\");\n results.hasWarnings = results.diagnostics.some((d) => d.severity === \"warn\");\n }\n\n if (graphError) {\n results.diagnostics.push({\n ruleId: \"structure/no-circular-deps\",\n severity: \"error\",\n message: graphError,\n filePath: \"spec.config.yaml\",\n });\n results.hasErrors = true;\n }\n\n // Agent instruction files — AGENTS.md, CLAUDE.md. Opt-in via the `agents`\n // key, so upgrading specdx never adds diagnostics to a suite that did not\n // ask for them, and `lint.extends: strict` cannot promote someone's CLAUDE.md\n // findings to build failures. These are not specs: they are absent from\n // `allSpecs`, the graph, and every `--path` calculation above.\n let agentFiles = 0;\n if (config.agents) {\n const agentResults = await lintAgentFiles({ config, configDir: options.configDir });\n agentFiles = agentResults.filesLinted;\n\n if (!agentResults.assessed) {\n // A config that promises agent linting and inspects nothing is the\n // vacuous-pass shape again — silence here would read as \"your agent\n // files are fine\". An error diagnostic rather than exit 3, because the\n // specs above *were* assessed, and machine formats must show it.\n const patterns = config.agents.paths ?? [\"AGENTS.md\", \"CLAUDE.md\"];\n results.diagnostics.push({\n ruleId: \"agents/paths-match-nothing\",\n severity: \"error\",\n message: `agents.paths matched no files (${patterns.join(\", \")}), so no agent instruction file was linted. Remove the \\`agents\\` key or fix the paths.`,\n filePath: \"spec.config.yaml\",\n });\n results.hasErrors = true;\n }\n\n // A single-file lint narrows agent diagnostics the same way it narrows\n // spec ones; anything else would leak findings from files the user did\n // not ask about. Through the same `selects` predicate, not a second copy\n // of it — a second copy is precisely the bug #53 fixed.\n for (const diagnostic of agentResults.diagnostics) {\n if (!selects(diagnostic.filePath)) continue;\n results.diagnostics.push(diagnostic);\n if (diagnostic.severity === \"error\") results.hasErrors = true;\n if (diagnostic.severity === \"warn\") results.hasWarnings = true;\n }\n }\n\n // Count what was actually linted, not what resolved. `lint.ignore` excluding\n // every spec produces no diagnostics, and reporting that as a pass is the\n // vacuous-pass shape one config key over: \"0 problems\" because nothing was\n // looked at reads identically to \"0 problems\" because nothing was wrong.\n // `--path` narrows the same way, so it has to narrow this count too.\n const ignored = new Set(ignore);\n const linted = specs.filter((spec) => !ignored.has(spec.filePath) && selects(spec.filePath));\n\n return {\n ...results,\n specFiles: linted.length,\n assessed: linted.length > 0,\n agentFiles,\n specSuite: true,\n };\n}\n\n/**\n * The marker that says \"no specs were checked here, and that is expected\".\n *\n * `cleanRunMessage` says this in prose, but only on a clean pretty run. A CI\n * job reading `--format json` in a tree whose `spec.config.yaml` was never\n * checked out would otherwise get `[]` and exit 0 — byte-identical to a clean\n * suite, with the whole suite unexamined. Same shape as\n * `agents/paths-match-nothing` above: the fact has to reach machine formats,\n * and a diagnostic is the channel they have.\n *\n * Info severity, so it cannot fail a build. Agent-only mode is a supported\n * outcome, not a fault.\n */\nexport function noSpecSuiteNotice(configDir: string): Diagnostic {\n return {\n ruleId: \"agents/no-spec-suite\",\n severity: \"info\",\n message:\n \"No spec.config.yaml at or above this directory, so no specs were checked — only agent instruction files. Run `specdx init` to add a spec suite.\",\n filePath: configDir,\n };\n}\n\n/**\n * What a clean run says it checked.\n *\n * Exported for tests: this string is the only thing a passing run shows a\n * user, so it is the thing worth asserting on.\n */\nexport function cleanRunMessage(\n results: Pick<RunLintResults, \"specFiles\" | \"agentFiles\" | \"specSuite\">,\n): string {\n const agentPart = `${results.agentFiles} agent ${results.agentFiles === 1 ? \"file\" : \"files\"}`;\n\n // Agent-only mode. Never claim specs were checked when there were none to\n // check, and say why — someone in the wrong directory needs to be able to\n // tell this apart from a healthy run.\n if (!results.specSuite) {\n return ` ✓ ${agentPart} checked, no problems found.\\n No spec.config.yaml here, so no specs were checked. Run \\`specdx init\\` to add a spec suite.\\n`;\n }\n\n const parts = [`${results.specFiles} ${results.specFiles === 1 ? \"spec\" : \"specs\"}`];\n if (results.agentFiles > 0) parts.push(agentPart);\n return ` ✓ ${parts.join(\" and \")} checked, no problems found.\\n`;\n}\n\nexport default defineCommand({\n meta: { name: \"lint\", description: \"Lint all specs in the suite\" },\n args: {\n ...sharedArgs(FORMATS),\n fix: { type: \"boolean\", description: \"Auto-fix issues where possible\" },\n path: { type: \"positional\", description: \"Lint a specific spec file\", required: false },\n preset: { type: \"string\", description: \"Lint preset (minimal, recommended, strict)\" },\n },\n async run({ args }) {\n const logger = createLogger({ quiet: args.quiet, verbose: args.verbose });\n const output = createOutput({ quiet: args.quiet });\n\n const format = resolveFormat(args.format, FORMATS);\n if (!format.ok) {\n console.error(`\\n ✗ ${format.message}\\n`);\n process.exit(1);\n }\n\n if (args.fix) {\n logger.info(\"No auto-fixable issues supported yet.\");\n }\n\n try {\n const results = await runLint({\n configDir: process.cwd(),\n specPath: args.path,\n preset: args.preset as \"minimal\" | \"recommended\" | \"strict\" | undefined,\n });\n\n const formatter =\n format.format === \"json\"\n ? formatJson\n : format.format === \"github\"\n ? formatGithub\n : formatPretty;\n // \"No diagnostics\" over an empty selection is not a pass (vacuous-pass\n // audit). Name the actual cause: sending someone to spec.config.yaml when\n // they mistyped `--path` is a worse hint than no hint.\n // `assessed` is about the spec suite. In agent-only mode there is no\n // suite to assess and `specFiles: 0` is the expected answer, not a\n // vacuous pass — `runLint` has already refused the case where neither a\n // suite nor an agent file exists.\n if (!results.assessed && results.specSuite) {\n console.error(\n args.path\n ? `\\n ⚠ No specs matched path \"${args.path}\", so nothing was linted. Check it against the specs declared in spec.config.yaml.\\n`\n : \"\\n ⚠ No specs were linted. Check the spec paths in spec.config.yaml, and whether `lint.ignore` excludes them all.\\n\",\n );\n process.exit(3);\n }\n\n // Agent-only mode has to be visible in every format. The prose notice in\n // `cleanRunMessage` covers exactly one of three, and only when the run is\n // clean; prepending the marker covers the other two and the pretty runs\n // that do have diagnostics. The clean check below stays on the unprefixed\n // array, so the `✓` message is still what a clean agent-only run shows.\n const rendered = formatter(\n results.specSuite\n ? results.diagnostics\n : [noSpecSuiteNotice(process.cwd()), ...results.diagnostics],\n );\n // A clean pretty run is chrome; diagnostics and machine formats are not.\n if (format.format === \"pretty\" && results.diagnostics.length === 0) {\n // Say what was assessed, not just that nothing was wrong. With agent\n // linting configured, \"All specs pass\" is silent about whether the\n // agent files were looked at — and a clean run that skipped them\n // reads identically to one that checked them.\n output.info(cleanRunMessage(results));\n } else {\n output.out(rendered);\n }\n\n if (results.hasErrors) process.exit(1);\n } catch (err) {\n console.error(`\\n ✗ ${(err as Error).message}\\n`);\n process.exit(1);\n }\n },\n});\n","import type { Diagnostic } from \"@specdx/lint\";\n\nexport function formatPretty(diagnostics: Diagnostic[]): string {\n if (diagnostics.length === 0) return \" ✓ All specs pass lint checks.\\n\";\n return diagnostics\n .map((d) => {\n const icon = d.severity === \"error\" ? \"✗\" : d.severity === \"warn\" ? \"⚠\" : \"ℹ\";\n return ` ${icon} ${d.severity} ${d.message} (${d.ruleId})\\n ${d.filePath}${d.line ? `:${d.line}` : \"\"}`;\n })\n .join(\"\\n\");\n}\n","import type { Diagnostic } from \"@specdx/lint\";\nexport function formatJson(diagnostics: Diagnostic[]): string {\n return JSON.stringify(diagnostics, null, 2);\n}\n","import type { Diagnostic } from \"@specdx/lint\";\n\n/**\n * GitHub workflow-command annotations.\n *\n * Info-severity diagnostics map to `::notice`, not `::warning`. Rendering an\n * advisory as a warning put five warnings in the Actions log for a suite that\n * was clean and exited 0 — the ambiguity advisory in particular, which is info\n * precisely so it cannot fail a build (audit run 5, F5).\n */\nexport function formatGithub(diagnostics: Diagnostic[]): string {\n return diagnostics\n .map((d) => {\n const level = d.severity === \"error\" ? \"error\" : d.severity === \"warn\" ? \"warning\" : \"notice\";\n const line = d.line ? `,line=${d.line}` : \"\";\n return `::${level} file=${d.filePath}${line}::${d.message} (${d.ruleId})`;\n })\n .join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,qBAAqB;;;ACEvB,SAAS,aAAa,aAAmC;AAC9D,MAAI,YAAY,WAAW,EAAG,QAAO;AACrC,SAAO,YACJ,IAAI,CAAC,MAAM;AACV,UAAM,OAAO,EAAE,aAAa,UAAU,WAAM,EAAE,aAAa,SAAS,WAAM;AAC1E,WAAO,KAAK,IAAI,IAAI,EAAE,QAAQ,KAAK,EAAE,OAAO,MAAM,EAAE,MAAM;AAAA,MAAU,EAAE,QAAQ,GAAG,EAAE,OAAO,IAAI,EAAE,IAAI,KAAK,EAAE;AAAA,EAC7G,CAAC,EACA,KAAK,IAAI;AACd;;;ACTO,SAAS,WAAW,aAAmC;AAC5D,SAAO,KAAK,UAAU,aAAa,MAAM,CAAC;AAC5C;;;ACOO,SAAS,aAAa,aAAmC;AAC9D,SAAO,YACJ,IAAI,CAAC,MAAM;AACV,UAAM,QAAQ,EAAE,aAAa,UAAU,UAAU,EAAE,aAAa,SAAS,YAAY;AACrF,UAAM,OAAO,EAAE,OAAO,SAAS,EAAE,IAAI,KAAK;AAC1C,WAAO,KAAK,KAAK,SAAS,EAAE,QAA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@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  package_default
4
- } from "./chunk-OVIKIIR4.js";
4
+ } from "./chunk-QAJZCJUJ.js";
5
5
  import {
6
6
  subCommands
7
- } from "./chunk-2BZIG7OE.js";
8
- import "./chunk-HCJDCS26.js";
7
+ } from "./chunk-BZL2XXMA.js";
8
+ import "./chunk-XRWLPU24.js";
9
9
  import "./chunk-5WRI5ZAA.js";
10
10
 
11
11
  // src/main.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "./chunk-OVIKIIR4.js";
3
+ } from "./chunk-QAJZCJUJ.js";
4
4
  import "./chunk-5WRI5ZAA.js";
5
5
 
6
6
  // src/commands/core/mcp.ts
@@ -12,7 +12,7 @@ var mcp_default = defineCommand({
12
12
  let mcp;
13
13
  let stdio;
14
14
  try {
15
- mcp = await import("./dist-PK52GA7M.js");
15
+ mcp = await import("./dist-A3CWALDC.js");
16
16
  stdio = await import("@modelcontextprotocol/sdk/server/stdio.js");
17
17
  } catch (err) {
18
18
  const missing = err.message.includes("zod") ? "zod" : "@modelcontextprotocol/sdk";
@@ -32,4 +32,4 @@ var mcp_default = defineCommand({
32
32
  export {
33
33
  mcp_default as default
34
34
  };
35
- //# sourceMappingURL=mcp-E6PJWBDQ.js.map
35
+ //# sourceMappingURL=mcp-VQAYNJQ7.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createLogger,
3
3
  loadConfig
4
- } from "./chunk-SNQNQ2MP.js";
4
+ } from "./chunk-JGD3BOPH.js";
5
5
  import {
6
6
  SPEC_TYPES,
7
7
  SUPPORTED_CONFIG_VERSION
8
- } from "./chunk-HCJDCS26.js";
8
+ } from "./chunk-XRWLPU24.js";
9
9
  import "./chunk-5WRI5ZAA.js";
10
10
 
11
11
  // src/commands/experimental/migrate.ts
@@ -65,4 +65,4 @@ var migrate_default = defineCommand({
65
65
  export {
66
66
  migrate_default as default
67
67
  };
68
- //# sourceMappingURL=migrate-FKFC7UAO.js.map
68
+ //# sourceMappingURL=migrate-VASWPA3L.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pack
3
- } from "./chunk-YRQPY5NF.js";
3
+ } from "./chunk-MOYYF7Q6.js";
4
4
  import {
5
5
  quietArg,
6
6
  verboseArg
@@ -11,8 +11,8 @@ import {
11
11
  loadConfig,
12
12
  parseSpec,
13
13
  resolveGlob
14
- } from "./chunk-SNQNQ2MP.js";
15
- import "./chunk-HCJDCS26.js";
14
+ } from "./chunk-JGD3BOPH.js";
15
+ import "./chunk-XRWLPU24.js";
16
16
  import "./chunk-5WRI5ZAA.js";
17
17
 
18
18
  // src/commands/core/pack.ts
@@ -193,4 +193,4 @@ export {
193
193
  emptyPackReason,
194
194
  runPack
195
195
  };
196
- //# sourceMappingURL=pack-DE4UBTCC.js.map
196
+ //# sourceMappingURL=pack-DFUCNWVR.js.map
@@ -2,10 +2,10 @@ import {
2
2
  createLintEngine,
3
3
  parseFeatures,
4
4
  resolveLintConfig
5
- } from "./chunk-LJTLNXGV.js";
5
+ } from "./chunk-VVZUJ6H4.js";
6
6
  import {
7
7
  DEFAULT_DIFF_CONFIG
8
- } from "./chunk-NAWYG4VV.js";
8
+ } from "./chunk-5XOWCPP2.js";
9
9
  import {
10
10
  resolveFormat,
11
11
  sharedArgs
@@ -16,8 +16,8 @@ import {
16
16
  loadConfig,
17
17
  parseSpec,
18
18
  resolveGlob
19
- } from "./chunk-SNQNQ2MP.js";
20
- import "./chunk-HCJDCS26.js";
19
+ } from "./chunk-JGD3BOPH.js";
20
+ import "./chunk-XRWLPU24.js";
21
21
  import "./chunk-5WRI5ZAA.js";
22
22
 
23
23
  // src/commands/core/ready.ts
@@ -267,4 +267,4 @@ export {
267
267
  ready_default as default,
268
268
  runReady
269
269
  };
270
- //# sourceMappingURL=ready-K74SLQ24.js.map
270
+ //# sourceMappingURL=ready-5OFSV2OD.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createLintEngine,
3
3
  resolveLintConfig
4
- } from "./chunk-LJTLNXGV.js";
4
+ } from "./chunk-VVZUJ6H4.js";
5
5
  import {
6
6
  DEFAULT_DIFF_CONFIG
7
- } from "./chunk-NAWYG4VV.js";
7
+ } from "./chunk-5XOWCPP2.js";
8
8
  import {
9
9
  createOutput
10
10
  } from "./chunk-NHD44ZYN.js";
@@ -17,8 +17,8 @@ import {
17
17
  loadConfig,
18
18
  parseSpec,
19
19
  resolveGlob
20
- } from "./chunk-SNQNQ2MP.js";
21
- import "./chunk-HCJDCS26.js";
20
+ } from "./chunk-JGD3BOPH.js";
21
+ import "./chunk-XRWLPU24.js";
22
22
  import "./chunk-5WRI5ZAA.js";
23
23
 
24
24
  // src/commands/core/status.ts
@@ -188,4 +188,4 @@ export {
188
188
  status_default as default,
189
189
  runStatus
190
190
  };
191
- //# sourceMappingURL=status-IAE3BB77.js.map
191
+ //# sourceMappingURL=status-5MDODW4N.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runCheck
3
- } from "./chunk-3YXRWQGX.js";
3
+ } from "./chunk-2UUQJ2ER.js";
4
4
  import {
5
5
  resolveFormat,
6
6
  sharedArgs
@@ -10,8 +10,8 @@ import {
10
10
  loadConfig,
11
11
  parseSpec,
12
12
  resolveGlob
13
- } from "./chunk-SNQNQ2MP.js";
14
- import "./chunk-HCJDCS26.js";
13
+ } from "./chunk-JGD3BOPH.js";
14
+ import "./chunk-XRWLPU24.js";
15
15
  import "./chunk-5WRI5ZAA.js";
16
16
 
17
17
  // src/commands/experimental/update.ts
@@ -139,4 +139,4 @@ export {
139
139
  update_default as default,
140
140
  generateUpdates
141
141
  };
142
- //# sourceMappingURL=update-UFOHZEAK.js.map
142
+ //# sourceMappingURL=update-NFXC45UT.js.map
@@ -11,8 +11,8 @@ import {
11
11
  buildGraph,
12
12
  loadConfig,
13
13
  resolveGlob
14
- } from "./chunk-SNQNQ2MP.js";
15
- import "./chunk-HCJDCS26.js";
14
+ } from "./chunk-JGD3BOPH.js";
15
+ import "./chunk-XRWLPU24.js";
16
16
  import "./chunk-5WRI5ZAA.js";
17
17
 
18
18
  // src/commands/core/validate.ts
@@ -102,4 +102,4 @@ export {
102
102
  validate_default as default,
103
103
  runValidate
104
104
  };
105
- //# sourceMappingURL=validate-EZHUB5TW.js.map
105
+ //# sourceMappingURL=validate-LWRLZR3H.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specdx",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
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",
@@ -42,6 +42,7 @@
42
42
  },
43
43
  "files": [
44
44
  "dist",
45
+ "skills",
45
46
  ".claude-plugin",
46
47
  "hooks",
47
48
  "README.md"
@@ -64,11 +65,11 @@
64
65
  "devDependencies": {
65
66
  "tsup": "^8.5.1",
66
67
  "typescript": "^5.7.0",
67
- "@specdx/check": "0.0.1",
68
68
  "@specdx/core": "0.0.1",
69
69
  "@specdx/diff": "0.0.1",
70
- "@specdx/lint": "0.1.0",
71
70
  "@specdx/mcp": "0.0.1",
71
+ "@specdx/lint": "0.1.0",
72
+ "@specdx/check": "0.0.1",
72
73
  "@specdx/pack": "0.0.1",
73
74
  "@specdx/schema": "0.0.1",
74
75
  "@specdx/skills": "0.0.1"
@@ -89,7 +90,7 @@
89
90
  }
90
91
  },
91
92
  "scripts": {
92
- "build": "tsup",
93
+ "build": "node ../../scripts/sync-plugin-skills.mjs && tsup",
93
94
  "typecheck": "tsc --noEmit",
94
95
  "test": "vitest run",
95
96
  "clean": "rm -rf dist *.tsbuildinfo"
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: specdx-author-spec
3
+ description: Use when the user wants to create a new spec, write a PRD, document a technical design, record an architecture decision, add a user story, or write a test plan. Guides spec authoring with iterative linting.
4
+ allowed-tools: Bash(npx specdx:*) Read Write Edit
5
+ ---
6
+
7
+ # Author a Spec
8
+
9
+ This skill follows a 3-step workflow. Load each step file as you reach it — this keeps the context focused and prevents bloat in long authoring sessions.
10
+
11
+ ## Steps
12
+
13
+ 1. **Frontmatter** — Read `references/step-01-frontmatter.md`
14
+ - Determine spec type, check existing specs, create file with frontmatter
15
+
16
+ 2. **Sections** — Read `references/step-02-sections.md`
17
+ - Write sections one at a time, lint after every 2-3 sections
18
+ - HARD GATE: Do NOT skip lint between sections
19
+
20
+ 3. **Finalize** — Read `references/step-03-finalize.md`
21
+ - Register in spec.config.yaml, run final validation
22
+
23
+ ## How to use
24
+
25
+ Start by reading `references/step-01-frontmatter.md` (relative to this file). Complete that step fully before moving to step 2.
26
+
27
+ Each step file is self-contained with its own instructions. Do NOT read ahead — load one step at a time.
28
+
29
+ For detailed reference on spec types and their fields, see `references/spec-type-reference.md`.
30
+
31
+ ## It's working if
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 — `specdx lint` will now flag placeholder sections, so an empty pass means real content.
@@ -0,0 +1,57 @@
1
+ # Spec Type Reference
2
+
3
+ ## Frontmatter Fields (all types)
4
+
5
+ | Field | Required | Type | Notes |
6
+ |-------|----------|------|-------|
7
+ | id | yes | string | Unique across spec suite |
8
+ | type | yes | SpecType | See types below |
9
+ | title | yes | string | Human-readable title |
10
+ | status | yes | "draft" \| "review" \| "approved" \| "superseded" | |
11
+ | version | yes | string | Semantic version |
12
+ | created | yes | string | ISO date, must be quoted in YAML |
13
+ | authors | yes | string[] | At least one entry |
14
+ | updated | no | string | ISO date |
15
+ | tags | no | string[] | Keywords for search/pack relevance |
16
+ | references | no | SpecReference[] | Cross-references to other specs |
17
+
18
+ ### Extra Fields for `user-story` type
19
+
20
+ | Field | Required | Type | Notes |
21
+ |-------|----------|------|-------|
22
+ | story_id | yes | string | Unique story identifier |
23
+ | priority | yes | "critical" \| "high" \| "medium" \| "low" | |
24
+ | estimate | yes | string | Story point or time estimate |
25
+
26
+ ## Required Sections by Type
27
+
28
+ | Type | Required Sections |
29
+ |------|-------------------|
30
+ | prd | Problem Statement, Goals, Non-Goals, Features, Success Criteria |
31
+ | technical-design | Overview, Architecture, Data Model, API Design, Dependencies, Risks, Open Questions |
32
+ | user-story | Description, Acceptance Criteria, Dependencies, Notes |
33
+ | test-plan | Scope, Test Cases, Coverage Matrix, Edge Cases |
34
+ | adr | Context, Decision, Status, Consequences |
35
+ | api-contract | Endpoints, Request/Response Schemas, Auth, Error Codes |
36
+
37
+ ## References Format
38
+
39
+ The `references` frontmatter field is an array of `SpecReference` objects:
40
+
41
+ ```yaml
42
+ references:
43
+ - id: "spec-id-here"
44
+ relationship: "depends-on"
45
+ - id: "another-spec-id"
46
+ relationship: "implemented-by"
47
+ ```
48
+
49
+ ### Relationship Values
50
+
51
+ | Value | Meaning |
52
+ |-------|---------|
53
+ | implemented-by | This spec is implemented by the referenced spec |
54
+ | decomposed-into | This spec breaks down into the referenced spec |
55
+ | depends-on | This spec depends on the referenced spec |
56
+ | supersedes | This spec replaces the referenced spec |
57
+ | related-to | General association with the referenced spec |
@@ -0,0 +1,66 @@
1
+ ---
2
+ step: 1
3
+ name: Frontmatter
4
+ description: Determine spec type, check existing specs, create file with frontmatter
5
+ ---
6
+
7
+ # Step 1: Frontmatter
8
+
9
+ ## Determine the type
10
+
11
+ Ask what kind of spec they need:
12
+
13
+ | Type | Use when | Required sections |
14
+ |---|---|---|
15
+ | `prd` | Defining what to build | Problem Statement, Goals, Non-Goals, Features, Success Criteria |
16
+ | `technical-design` | Describing how it works | Overview, Architecture, Data Model, API Design, Dependencies, Risks, Open Questions |
17
+ | `user-story` | Capturing a user workflow | Description, Acceptance Criteria, Dependencies, Notes |
18
+ | `test-plan` | Planning test coverage | Scope, Test Cases, Coverage Matrix, Edge Cases |
19
+ | `adr` | Recording a decision | Context, Decision, Status, Consequences |
20
+ | `api-contract` | Defining an API | Endpoints, Request/Response Schemas, Auth, Error Codes |
21
+
22
+ For detailed guidance on each type, read `spec-type-reference.md` in this directory.
23
+
24
+ ## Check existing specs
25
+
26
+ ```bash
27
+ npx specdx validate
28
+ npx specdx graph
29
+ ```
30
+
31
+ This shows what specs exist and their dependency relationships. Use this to determine where the new spec fits.
32
+
33
+ ## Create the file with frontmatter
34
+
35
+ ```yaml
36
+ ---
37
+ id: "<type>-<short-name>"
38
+ type: "<spec-type>"
39
+ title: "<clear title>"
40
+ status: "draft"
41
+ version: "0.1"
42
+ created: "<YYYY-MM-DD>"
43
+ authors: ["<name>"]
44
+ tags: ["<keyword>", "<keyword>"]
45
+ references:
46
+ - id: "<other-spec-id>"
47
+ relationship: "depends-on"
48
+ ---
49
+ ```
50
+
51
+ Rules:
52
+ - **Always quote dates**: `"2026-03-18"` — unquoted YAML dates fail validation
53
+ - **authors must have at least one entry** — `authors: []` fails validation
54
+ - **id** must be unique across the spec suite
55
+ - **type** must be one of: `prd`, `technical-design`, `user-story`, `test-plan`, `adr`, `api-contract`
56
+ - **status** must be one of: `draft`, `review`, `approved`, `superseded`
57
+ - **references.relationship** must be one of: `implemented-by`, `decomposed-into`, `depends-on`, `supersedes`, `related-to`
58
+
59
+ Run an initial lint to verify frontmatter:
60
+
61
+ ```bash
62
+ npx specdx lint --path <file>
63
+ ```
64
+
65
+ ---
66
+ **Next:** When frontmatter passes lint, read `step-02-sections.md` in this directory.