specdx 0.5.0 → 0.6.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.
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +70 -22
- package/dist/{check-RH5SCXWW.js → check-5EA2MTNN.js} +120 -26
- package/dist/check-5EA2MTNN.js.map +1 -0
- package/dist/{chunk-3YXRWQGX.js → chunk-2UUQJ2ER.js} +242 -53
- package/dist/chunk-2UUQJ2ER.js.map +1 -0
- package/dist/{chunk-6WFNZH7F.js → chunk-5XOWCPP2.js} +2 -2
- package/dist/{chunk-CQETLJTZ.js → chunk-6S2OQMUH.js} +8 -4
- package/dist/chunk-6S2OQMUH.js.map +1 -0
- package/dist/{chunk-BP3SB35W.js → chunk-JGD3BOPH.js} +15 -5
- package/dist/chunk-JGD3BOPH.js.map +1 -0
- package/dist/{chunk-BMOOLUPG.js → chunk-MOYYF7Q6.js} +2 -2
- package/dist/{chunk-ZIODMXST.js → chunk-VVZUJ6H4.js} +52 -14
- package/dist/{chunk-ZIODMXST.js.map → chunk-VVZUJ6H4.js.map} +1 -1
- package/dist/{chunk-6EQIDZ4D.js → chunk-WSLIO2ZD.js} +13 -13
- package/dist/{diff-QO7HMAK3.js → diff-ZT6HXHK5.js} +3 -3
- package/dist/dist-6WDWUOCV.js +26 -0
- package/dist/{dist-JPWHWMV2.js → dist-A3CWALDC.js} +30 -9
- package/dist/dist-A3CWALDC.js.map +1 -0
- package/dist/{generate-MS4BM7RU.js → generate-PTDHGDR2.js} +4 -4
- package/dist/{generate-story-OMM322L7.js → generate-story-BXGNKWC6.js} +3 -3
- package/dist/{generate-test-plan-75W7SZIO.js → generate-test-plan-PZUNCNN3.js} +2 -2
- package/dist/{graph-QOTMXENE.js → graph-GKXD2IGW.js} +2 -2
- package/dist/index.d.ts +11 -0
- package/dist/index.js +109 -22
- package/dist/index.js.map +1 -1
- package/dist/{lint-LPFLHVO4.js → lint-GZX5C5EQ.js} +55 -10
- package/dist/lint-GZX5C5EQ.js.map +1 -0
- package/dist/main.js +2 -2
- package/dist/{mcp-OEC43SPF.js → mcp-PIVG3LEF.js} +3 -3
- package/dist/{migrate-CBP2AVLH.js → migrate-VASWPA3L.js} +2 -2
- package/dist/{pack-X6FSWORJ.js → pack-DFUCNWVR.js} +3 -3
- package/dist/{ready-7MJWRGLT.js → ready-5OFSV2OD.js} +4 -4
- package/dist/{status-UUPZYX3J.js → status-5MDODW4N.js} +4 -4
- package/dist/{update-EI7IJRHG.js → update-NFXC45UT.js} +3 -3
- package/dist/{validate-HTTZLQWI.js → validate-LWRLZR3H.js} +2 -2
- package/package.json +10 -6
- package/skills/core/specdx-author-spec/SKILL.md +33 -0
- package/skills/core/specdx-author-spec/references/spec-type-reference.md +57 -0
- package/skills/core/specdx-author-spec/references/step-01-frontmatter.md +66 -0
- package/skills/core/specdx-author-spec/references/step-02-sections.md +111 -0
- package/skills/core/specdx-author-spec/references/step-03-finalize.md +48 -0
- package/skills/core/specdx-onboard/SKILL.md +54 -0
- package/skills/core/specdx-plan-from-spec/SKILL.md +76 -0
- package/skills/core/specdx-pre-commit/SKILL.md +70 -0
- package/skills/core/specdx-review-spec/SKILL.md +81 -0
- package/skills/core/specdx-router/SKILL.md +67 -0
- package/skills/core/specdx-sprint-review/SKILL.md +73 -0
- package/skills/core/specdx-start-task/SKILL.md +62 -0
- package/skills/experimental/specdx-check-drift/SKILL.md +77 -0
- package/skills/experimental/specdx-verify/SKILL.md +85 -0
- package/dist/check-RH5SCXWW.js.map +0 -1
- package/dist/chunk-3YXRWQGX.js.map +0 -1
- package/dist/chunk-BP3SB35W.js.map +0 -1
- package/dist/chunk-CQETLJTZ.js.map +0 -1
- package/dist/dist-JPWHWMV2.js.map +0 -1
- package/dist/dist-ROHCFKYT.js +0 -16
- package/dist/lint-LPFLHVO4.js.map +0 -1
- /package/dist/{chunk-6WFNZH7F.js.map → chunk-5XOWCPP2.js.map} +0 -0
- /package/dist/{chunk-BMOOLUPG.js.map → chunk-MOYYF7Q6.js.map} +0 -0
- /package/dist/{chunk-6EQIDZ4D.js.map → chunk-WSLIO2ZD.js.map} +0 -0
- /package/dist/{diff-QO7HMAK3.js.map → diff-ZT6HXHK5.js.map} +0 -0
- /package/dist/{dist-ROHCFKYT.js.map → dist-6WDWUOCV.js.map} +0 -0
- /package/dist/{generate-MS4BM7RU.js.map → generate-PTDHGDR2.js.map} +0 -0
- /package/dist/{generate-story-OMM322L7.js.map → generate-story-BXGNKWC6.js.map} +0 -0
- /package/dist/{generate-test-plan-75W7SZIO.js.map → generate-test-plan-PZUNCNN3.js.map} +0 -0
- /package/dist/{graph-QOTMXENE.js.map → graph-GKXD2IGW.js.map} +0 -0
- /package/dist/{mcp-OEC43SPF.js.map → mcp-PIVG3LEF.js.map} +0 -0
- /package/dist/{migrate-CBP2AVLH.js.map → migrate-VASWPA3L.js.map} +0 -0
- /package/dist/{pack-X6FSWORJ.js.map → pack-DFUCNWVR.js.map} +0 -0
- /package/dist/{ready-7MJWRGLT.js.map → ready-5OFSV2OD.js.map} +0 -0
- /package/dist/{status-UUPZYX3J.js.map → status-5MDODW4N.js.map} +0 -0
- /package/dist/{update-EI7IJRHG.js.map → update-NFXC45UT.js.map} +0 -0
- /package/dist/{validate-HTTZLQWI.js.map → validate-LWRLZR3H.js.map} +0 -0
|
@@ -163,23 +163,23 @@ function bucketed(name, load) {
|
|
|
163
163
|
}
|
|
164
164
|
var subCommands = {
|
|
165
165
|
init: init_default,
|
|
166
|
-
lint: bucketed("lint", () => import("./lint-
|
|
167
|
-
validate: bucketed("validate", () => import("./validate-
|
|
168
|
-
graph: bucketed("graph", () => import("./graph-
|
|
166
|
+
lint: bucketed("lint", () => import("./lint-GZX5C5EQ.js").then((m) => m.default)),
|
|
167
|
+
validate: bucketed("validate", () => import("./validate-LWRLZR3H.js").then((m) => m.default)),
|
|
168
|
+
graph: bucketed("graph", () => import("./graph-GKXD2IGW.js").then((m) => m.default)),
|
|
169
169
|
skills: bucketed("skills", () => import("./skills-36SRUEMR.js").then((m) => m.default)),
|
|
170
|
-
pack: bucketed("pack", () => import("./pack-
|
|
171
|
-
diff: bucketed("diff", () => import("./diff-
|
|
172
|
-
status: bucketed("status", () => import("./status-
|
|
173
|
-
check: bucketed("check", () => import("./check-
|
|
174
|
-
ready: bucketed("ready", () => import("./ready-
|
|
175
|
-
update: bucketed("update", () => import("./update-
|
|
176
|
-
generate: bucketed("generate", () => import("./generate-
|
|
177
|
-
migrate: bucketed("migrate", () => import("./migrate-
|
|
178
|
-
mcp: bucketed("mcp", () => import("./mcp-
|
|
170
|
+
pack: bucketed("pack", () => import("./pack-DFUCNWVR.js").then((m) => m.default)),
|
|
171
|
+
diff: bucketed("diff", () => import("./diff-ZT6HXHK5.js").then((m) => m.default)),
|
|
172
|
+
status: bucketed("status", () => import("./status-5MDODW4N.js").then((m) => m.default)),
|
|
173
|
+
check: bucketed("check", () => import("./check-5EA2MTNN.js").then((m) => m.default)),
|
|
174
|
+
ready: bucketed("ready", () => import("./ready-5OFSV2OD.js").then((m) => m.default)),
|
|
175
|
+
update: bucketed("update", () => import("./update-NFXC45UT.js").then((m) => m.default)),
|
|
176
|
+
generate: bucketed("generate", () => import("./generate-PTDHGDR2.js").then((m) => m.default)),
|
|
177
|
+
migrate: bucketed("migrate", () => import("./migrate-VASWPA3L.js").then((m) => m.default)),
|
|
178
|
+
mcp: bucketed("mcp", () => import("./mcp-PIVG3LEF.js").then((m) => m.default))
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
export {
|
|
182
182
|
labelled,
|
|
183
183
|
subCommands
|
|
184
184
|
};
|
|
185
|
-
//# sourceMappingURL=chunk-
|
|
185
|
+
//# sourceMappingURL=chunk-WSLIO2ZD.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DEFAULT_DIFF_CONFIG,
|
|
3
3
|
DiffError,
|
|
4
4
|
diffBetweenRefs
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5XOWCPP2.js";
|
|
6
6
|
import {
|
|
7
7
|
createOutput
|
|
8
8
|
} from "./chunk-NHD44ZYN.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-DMGABJ6T.js";
|
|
13
13
|
import {
|
|
14
14
|
loadConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JGD3BOPH.js";
|
|
16
16
|
import "./chunk-XRWLPU24.js";
|
|
17
17
|
import "./chunk-5WRI5ZAA.js";
|
|
18
18
|
|
|
@@ -197,4 +197,4 @@ export {
|
|
|
197
197
|
diff_default as default,
|
|
198
198
|
runDiff
|
|
199
199
|
};
|
|
200
|
-
//# sourceMappingURL=diff-
|
|
200
|
+
//# sourceMappingURL=diff-ZT6HXHK5.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
analyzeWithAi,
|
|
3
|
+
applyBaseline,
|
|
4
|
+
checkArtifacts,
|
|
5
|
+
createBaseline,
|
|
6
|
+
detectFramework,
|
|
7
|
+
fingerprint,
|
|
8
|
+
parseArtifacts,
|
|
9
|
+
parseBaseline,
|
|
10
|
+
runCheck,
|
|
11
|
+
serializeBaseline
|
|
12
|
+
} from "./chunk-2UUQJ2ER.js";
|
|
13
|
+
import "./chunk-5WRI5ZAA.js";
|
|
14
|
+
export {
|
|
15
|
+
analyzeWithAi,
|
|
16
|
+
applyBaseline,
|
|
17
|
+
checkArtifacts,
|
|
18
|
+
createBaseline,
|
|
19
|
+
detectFramework,
|
|
20
|
+
fingerprint,
|
|
21
|
+
parseArtifacts,
|
|
22
|
+
parseBaseline,
|
|
23
|
+
runCheck,
|
|
24
|
+
serializeBaseline
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=dist-6WDWUOCV.js.map
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runCheck
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2UUQJ2ER.js";
|
|
4
4
|
import {
|
|
5
5
|
pack
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MOYYF7Q6.js";
|
|
7
7
|
import {
|
|
8
8
|
createLintEngine,
|
|
9
9
|
lintAgentFiles,
|
|
10
|
+
lintAgentFilesWithoutConfig,
|
|
10
11
|
resolveLintConfig
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VVZUJ6H4.js";
|
|
12
13
|
import {
|
|
13
14
|
DEFAULT_DIFF_CONFIG,
|
|
14
15
|
DiffError,
|
|
15
16
|
diffBetweenRefs
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5XOWCPP2.js";
|
|
17
18
|
import {
|
|
18
19
|
ConfigError,
|
|
19
20
|
GraphError,
|
|
20
21
|
buildGraph,
|
|
21
22
|
collectReferenceEdges,
|
|
23
|
+
findConfig,
|
|
22
24
|
findUnreflectedReferences,
|
|
23
25
|
loadConfig,
|
|
24
26
|
parseSpec,
|
|
25
27
|
resolveGlob
|
|
26
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-JGD3BOPH.js";
|
|
27
29
|
import "./chunk-XRWLPU24.js";
|
|
28
30
|
import "./chunk-5WRI5ZAA.js";
|
|
29
31
|
|
|
@@ -61,7 +63,25 @@ async function handleValidate(params) {
|
|
|
61
63
|
// ../mcp/dist/tools/lint.js
|
|
62
64
|
async function handleLint(params) {
|
|
63
65
|
const configDir = process.cwd();
|
|
64
|
-
const
|
|
66
|
+
const configPath = await findConfig(configDir);
|
|
67
|
+
if (!configPath) {
|
|
68
|
+
if (params.specPath) {
|
|
69
|
+
throw new Error(`No spec.config.yaml at or above this directory, so "${params.specPath}" was not linted as a spec. Call sdx_lint with no specPath to lint AGENTS.md and CLAUDE.md, or run \`specdx init\` to add a spec suite.`);
|
|
70
|
+
}
|
|
71
|
+
const agentResults = await lintAgentFilesWithoutConfig(configDir);
|
|
72
|
+
if (agentResults) {
|
|
73
|
+
return JSON.stringify({
|
|
74
|
+
diagnostics: agentResults.diagnostics,
|
|
75
|
+
hasErrors: agentResults.diagnostics.some((d) => d.severity === "error"),
|
|
76
|
+
hasWarnings: agentResults.diagnostics.some((d) => d.severity === "warn"),
|
|
77
|
+
specsChecked: 0,
|
|
78
|
+
assessed: false,
|
|
79
|
+
specSuite: false,
|
|
80
|
+
agentFilesChecked: agentResults.filesLinted
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const config = await loadConfig(configPath, configDir);
|
|
65
85
|
const preset = params.preset ?? config.lint?.extends ?? "recommended";
|
|
66
86
|
const { rules, ignore } = await resolveLintConfig({
|
|
67
87
|
config,
|
|
@@ -125,6 +145,7 @@ async function handleLint(params) {
|
|
|
125
145
|
specsChecked: linted.length,
|
|
126
146
|
// False when nothing was selected — "no diagnostics" is then not a pass.
|
|
127
147
|
assessed: linted.length > 0,
|
|
148
|
+
specSuite: true,
|
|
128
149
|
agentFilesChecked: agentFiles
|
|
129
150
|
});
|
|
130
151
|
}
|
|
@@ -324,9 +345,9 @@ function createMcpServer(version = "0.0.0-unknown") {
|
|
|
324
345
|
server.tool("sdx_validate", "Validate the spec.config.yaml configuration file", { configPath: z.string().optional().describe("Path to config directory") }, async (params) => ({
|
|
325
346
|
content: [{ type: "text", text: await handleValidate(params) }]
|
|
326
347
|
}));
|
|
327
|
-
server.tool("sdx_lint", "Run lint rules against the spec suite", {
|
|
348
|
+
server.tool("sdx_lint", "Run lint rules against the spec suite, or against AGENTS.md and CLAUDE.md alone when there is no spec.config.yaml. Check `specSuite` in the result to tell the two apart.", {
|
|
328
349
|
preset: z.string().optional().describe("Lint preset: minimal, recommended, strict"),
|
|
329
|
-
specPath: z.string().optional().describe("Lint a specific spec file")
|
|
350
|
+
specPath: z.string().optional().describe("Lint a specific spec file. Requires a spec suite; errors when there is none.")
|
|
330
351
|
}, async (params) => ({
|
|
331
352
|
content: [{ type: "text", text: await handleLint(params) }]
|
|
332
353
|
}));
|
|
@@ -365,4 +386,4 @@ export {
|
|
|
365
386
|
handleLint,
|
|
366
387
|
handleStatus
|
|
367
388
|
};
|
|
368
|
-
//# sourceMappingURL=dist-
|
|
389
|
+
//# sourceMappingURL=dist-A3CWALDC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../mcp/src/server.ts","../../mcp/src/tools/validate.ts","../../mcp/src/tools/lint.ts","../../mcp/src/tools/pack.ts","../../mcp/src/tools/status.ts","../../mcp/src/tools/check.ts","../../mcp/src/tools/diff.ts","../../mcp/src/tools/graph.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { z } from \"zod\";\nimport { handleValidate } from \"./tools/validate.js\";\nimport { handleLint } from \"./tools/lint.js\";\nimport { handlePack } from \"./tools/pack.js\";\nimport { handleStatus } from \"./tools/status.js\";\nimport { handleCheck } from \"./tools/check.js\";\nimport { handleDiff } from \"./tools/diff.js\";\nimport { handleGraph } from \"./tools/graph.js\";\n\n/**\n * Build the MCP server.\n *\n * `version` is passed in rather than hardcoded: a literal here advertised\n * `0.4.0` from every prerelease build, so every MCP client logged a version\n * that was never published. The CLI owns the real number and hands it over.\n */\nexport function createMcpServer(version = \"0.0.0-unknown\"): McpServer {\n const server = new McpServer({\n name: \"specdx\",\n version,\n });\n\n server.tool(\n \"sdx_validate\",\n \"Validate the spec.config.yaml configuration file\",\n { configPath: z.string().optional().describe(\"Path to config directory\") },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handleValidate(params) }],\n }),\n );\n\n server.tool(\n \"sdx_lint\",\n \"Run lint rules against the spec suite, or against AGENTS.md and CLAUDE.md alone when there is no spec.config.yaml. Check `specSuite` in the result to tell the two apart.\",\n {\n preset: z.string().optional().describe(\"Lint preset: minimal, recommended, strict\"),\n specPath: z\n .string()\n .optional()\n .describe(\"Lint a specific spec file. Requires a spec suite; errors when there is none.\"),\n },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handleLint(params) }],\n }),\n );\n\n server.tool(\n \"sdx_pack\",\n \"Pack spec context for LLM consumption within a token budget\",\n {\n task: z.string().optional().describe(\"Task description for relevance scoring\"),\n format: z.string().optional().describe(\"Output format: xml, markdown, json\"),\n budget: z.number().optional().describe(\"Token budget (default: 12000)\"),\n },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handlePack(params) }],\n }),\n );\n\n server.tool(\n \"sdx_status\",\n \"Get spec suite health overview (lint health, staleness, integrity)\",\n {},\n async () => ({\n content: [{ type: \"text\" as const, text: await handleStatus() }],\n }),\n );\n\n server.tool(\n \"sdx_check\",\n \"Run spec-to-implementation drift analysis\",\n {\n framework: z.string().optional().describe(\"Framework: express, hono, nextjs\"),\n specId: z.string().optional().describe(\"Check a specific spec by ID\"),\n },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handleCheck(params) }],\n }),\n );\n\n server.tool(\n \"sdx_diff\",\n \"Show spec changes and downstream impact between git refs\",\n {\n base: z.string().optional().describe(\"Base git ref (default: main)\"),\n head: z.string().optional().describe(\"Head git ref (default: HEAD)\"),\n working: z\n .boolean()\n .optional()\n .describe(\n \"Compare the base ref against the working tree, including uncommitted and untracked specs (default: false)\",\n ),\n },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handleDiff(params) }],\n }),\n );\n\n server.tool(\n \"sdx_graph\",\n \"Get the spec dependency graph\",\n {\n format: z.string().optional().describe(\"Output format: json (default) or dot\"),\n },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handleGraph(params) }],\n }),\n );\n\n return server;\n}\n","import { loadConfig, buildGraph, resolveGlob, ConfigError, GraphError } from \"@specdx/core\";\n\nexport async function handleValidate(params: { configPath?: string }): Promise<string> {\n try {\n const configDir = params.configPath ?? process.cwd();\n const config = await loadConfig(undefined, configDir);\n // A cyclic or dangling requires chain is an invalid config (issue #13).\n buildGraph(config);\n // `specEntries` and `specFiles` are distinct: one glob entry can resolve to\n // many files. Reporting either as a bare `specCount` put this tool and\n // sdx_status in direct contradiction for the same project.\n let specFiles = 0;\n for (const entry of Object.values(config.specs)) {\n specFiles += (await resolveGlob(entry.path, configDir)).length;\n }\n\n return JSON.stringify({\n valid: true,\n specEntries: Object.keys(config.specs).length,\n specFiles,\n project: config.project?.name ?? \"unknown\",\n });\n } catch (err) {\n if (err instanceof ConfigError) {\n return JSON.stringify({ valid: false, error: err.message, details: err.errors });\n }\n if (err instanceof GraphError) {\n return JSON.stringify({ valid: false, error: err.message });\n }\n throw err;\n }\n}\n","import { loadConfig, findConfig, parseSpec, resolveGlob, buildGraph } from \"@specdx/core\";\nimport {\n createLintEngine,\n resolveLintConfig,\n lintAgentFiles,\n lintAgentFilesWithoutConfig,\n} from \"@specdx/lint\";\nimport type { ParsedSpec } from \"@specdx/core\";\nimport type { Diagnostic } from \"@specdx/lint\";\n\n/**\n * `sdx_lint` is a near-copy of `runLint`, not a caller of it — the CLI depends\n * on this package, so the dependency cannot run the other way. See\n * `packages/cli/src/lint-parity.test.ts`, which pins the two together.\n *\n * Two divergences were fixed here, both found while dogfooding on 2026-08-11:\n *\n * 1. `specPath` filtered the specs *before* linting, so a single-file lint had\n * no sight of the rest of the suite and cross-reference rules could not\n * fire. The CLI has always linted the whole suite and filtered the\n * resulting diagnostics; that is the correct behaviour and this now matches.\n * 2. A `specPath` matching no spec returned `hasErrors: false` with no signal\n * that nothing had been assessed, which reads to a caller as a clean pass.\n */\nexport async function handleLint(params: { preset?: string; specPath?: string }): Promise<string> {\n const configDir = process.cwd();\n\n // No spec suite: lint the agent instruction files alone, through the same\n // shared helper the CLI uses. Only genuine absence degrades — a malformed\n // config still throws, or a YAML typo would read as a narrower pass.\n const configPath = await findConfig(configDir);\n if (!configPath) {\n // Same refusal as the CLI. An agent that asked for one spec file must not\n // be handed `hasErrors: false` for agent files it never asked about — it\n // reads that as \"the file you named is clean\".\n if (params.specPath) {\n throw new Error(\n `No spec.config.yaml at or above this directory, so \"${params.specPath}\" was not linted as a spec. ` +\n `Call sdx_lint with no specPath to lint AGENTS.md and CLAUDE.md, or run \\`specdx init\\` to add a spec suite.`,\n );\n }\n const agentResults = await lintAgentFilesWithoutConfig(configDir);\n if (agentResults) {\n return JSON.stringify({\n diagnostics: agentResults.diagnostics,\n hasErrors: agentResults.diagnostics.some((d) => d.severity === \"error\"),\n hasWarnings: agentResults.diagnostics.some((d) => d.severity === \"warn\"),\n specsChecked: 0,\n assessed: false,\n specSuite: false,\n agentFilesChecked: agentResults.filesLinted,\n });\n }\n }\n\n // The path `findConfig` already resolved, so `loadConfig` does not walk the\n // tree again. Undefined only on the no-config-no-agent-file path, where\n // `loadConfig` throws the \"Run 'specdx init'\" error the CLI throws too.\n const config = await loadConfig(configPath, configDir);\n const preset = params.preset ?? config.lint?.extends ?? \"recommended\";\n const { rules, ignore } = await resolveLintConfig({\n config,\n preset: preset,\n 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, configDir);\n for (const file of files) {\n specs.push(await parseSpec(file));\n }\n }\n\n let graph;\n try {\n graph = buildGraph(config);\n } catch {\n // non-fatal\n }\n\n const engine = createLintEngine({ rules, config, graph, ignore });\n const results = engine.lint(specs);\n\n // One definition of \"does specPath select this file\", shared by the\n // diagnostic filter, the agent diagnostics below, and the assessed count, so\n // none of the three can disagree.\n const { specPath } = params;\n const selects = (filePath: string) => specPath === undefined || filePath.includes(specPath);\n\n let diagnostics: Diagnostic[] = results.diagnostics;\n let { hasErrors, hasWarnings } = results;\n if (specPath !== undefined) {\n diagnostics = diagnostics.filter((d) => selects(d.filePath));\n hasErrors = diagnostics.some((d) => d.severity === \"error\");\n hasWarnings = diagnostics.some((d) => d.severity === \"warn\");\n }\n\n // Agent instruction files, opt-in via the `agents` key. Kept in step with the\n // CLI deliberately: this tool duplicates `runLint` rather than calling it, and\n // that duplication has already shipped a divergence twice.\n //\n // Runs after the spec filter above, because it appends to the already-filtered\n // diagnostics — appending first and filtering after would drop agent findings\n // whenever `specPath` names a spec.\n let agentFiles = 0;\n if (config.agents) {\n const agentResults = await lintAgentFiles({ config, configDir });\n agentFiles = agentResults.filesLinted;\n diagnostics = [...diagnostics];\n\n if (!agentResults.assessed) {\n const patterns = config.agents.paths ?? [\"AGENTS.md\", \"CLAUDE.md\"];\n 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 hasErrors = true;\n }\n\n for (const diagnostic of agentResults.diagnostics) {\n if (!selects(diagnostic.filePath)) continue;\n diagnostics.push(diagnostic);\n if (diagnostic.severity === \"error\") hasErrors = true;\n if (diagnostic.severity === \"warn\") hasWarnings = true;\n }\n }\n\n const ignored = new Set(ignore);\n const linted = specs.filter((spec) => !ignored.has(spec.filePath) && selects(spec.filePath));\n\n return JSON.stringify({\n diagnostics,\n hasErrors,\n hasWarnings,\n specsChecked: linted.length,\n // False when nothing was selected — \"no diagnostics\" is then not a pass.\n assessed: linted.length > 0,\n specSuite: true,\n agentFilesChecked: agentFiles,\n });\n}\n","import { loadConfig, parseSpec, resolveGlob, buildGraph } from \"@specdx/core\";\nimport { pack } from \"@specdx/pack\";\nimport type { ParsedSpec } from \"@specdx/core\";\n\nexport async function handlePack(params: {\n task?: string;\n format?: string;\n budget?: number;\n}): Promise<string> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n\n const allSpecs: ParsedSpec[] = [];\n for (const [, entry] of Object.entries(config.specs)) {\n const files = await resolveGlob(entry.path, configDir);\n for (const file of files) {\n allSpecs.push(await parseSpec(file));\n }\n }\n\n let graph;\n try {\n graph = buildGraph(config);\n } catch {\n // non-fatal\n }\n\n const result = pack(\n allSpecs,\n {\n task: params.task,\n budget: params.budget,\n format: (params.format as \"xml\" | \"markdown\" | \"json\") ?? undefined,\n },\n config.pack,\n graph,\n );\n\n return result.output;\n}\n","import { loadConfig, parseSpec, resolveGlob, buildGraph } from \"@specdx/core\";\nimport { createLintEngine, resolveLintConfig } from \"@specdx/lint\";\nimport { DEFAULT_DIFF_CONFIG } from \"@specdx/diff\";\nimport type { ParsedSpec } from \"@specdx/core\";\n\nexport async function handleStatus(): Promise<string> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n\n const specs: { spec: ParsedSpec; entry: { path: string; owner?: string } }[] = [];\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 specs.push({ spec, entry: entry as { path: string; owner?: string } });\n }\n }\n\n const byStatus: Record<string, number> = {};\n for (const { spec } of specs) {\n const status = (spec.frontmatter.status as string) || \"unknown\";\n byStatus[status] = (byStatus[status] ?? 0) + 1;\n }\n\n const presetName = config.lint?.extends ?? \"recommended\";\n const { rules, ignore } = await resolveLintConfig({\n config,\n preset: presetName,\n configDir,\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 lintResults = engine.lint(specs.map((s) => s.spec));\n\n const errors = lintResults.diagnostics.filter((d) => d.severity === \"error\").length;\n const warnings = lintResults.diagnostics.filter((d) => d.severity === \"warn\").length;\n\n // Specs carrying no error-severity diagnostic.\n //\n // This was `specs.length - errors` here too, and the CLI-side fix did not\n // reach it: this handler is a near-copy of `runStatus`, so a repair to one\n // leaves the other reporting a negative number of passing specs. Kept in step\n // by the parity test in the CLI package (audit run 6, G2).\n const specsWithErrors = new Set(\n lintResults.diagnostics.filter((d) => d.severity === \"error\").map((d) => d.filePath),\n );\n const passing = specs.filter(({ spec }) => !specsWithErrors.has(spec.filePath)).length;\n\n const thresholdDays =\n config.diff?.staleness_threshold_days ?? DEFAULT_DIFF_CONFIG.staleness_threshold_days;\n const now = Date.now();\n const staleSpecs: { specId: string; daysSinceUpdate: number; owner?: string }[] = [];\n for (const { spec, entry } of specs) {\n const dateStr =\n (spec.frontmatter.updated as string | undefined) ||\n (spec.frontmatter.created as string | undefined);\n if (dateStr) {\n const days = Math.floor((now - new Date(dateStr).getTime()) / (1000 * 60 * 60 * 24));\n if (days > thresholdDays) {\n staleSpecs.push({\n specId: spec.frontmatter.id as string,\n daysSinceUpdate: days,\n owner: entry.owner,\n });\n }\n }\n }\n\n // An empty suite is unassessed, never a vacuous \"healthy\" (vacuous-pass audit)\n let verdict: \"healthy\" | \"warnings\" | \"errors\" | \"unassessed\" = \"healthy\";\n if (errors > 0 || graphError) verdict = \"errors\";\n else if (warnings > 0 || staleSpecs.length > 0) verdict = \"warnings\";\n else if (specs.length === 0) verdict = \"unassessed\";\n\n return JSON.stringify({\n project: config.project?.name ?? \"unknown\",\n // `specFiles` only. A second field named `specCount` gives a consumer no\n // way to know whether it counts config entries or resolved files -- the\n // ambiguity `sdx_validate` was already cleaned up to avoid.\n specFiles: specs.length,\n byStatus,\n lintHealth: { errors, warnings, passing },\n staleSpecs,\n integrityIssues: graphError ? [graphError] : [],\n verdict,\n });\n}\n","import { loadConfig, parseSpec, resolveGlob } from \"@specdx/core\";\nimport { runCheck } from \"@specdx/check\";\nimport type { ParsedSpec } from \"@specdx/core\";\n\nexport async function handleCheck(params: {\n framework?: string;\n specId?: string;\n}): Promise<string> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\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 (params.specId && spec.frontmatter.id !== params.specId) continue;\n specs.push(spec);\n }\n }\n\n const checkConfig = {\n ...config.check,\n ...(params.framework ? { framework: params.framework as \"express\" | \"hono\" | \"nextjs\" } : {}),\n };\n\n const result = await runCheck(specs, configDir, checkConfig);\n return JSON.stringify(result);\n}\n","import { join } from \"node:path\";\nimport { loadConfig } from \"@specdx/core\";\nimport { diffBetweenRefs, DEFAULT_DIFF_CONFIG, DiffError } from \"@specdx/diff\";\n\nexport async function handleDiff(params: {\n base?: string;\n head?: string;\n working?: boolean;\n}): Promise<string> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n const baseRef = params.base ?? config.diff?.baseline_ref ?? DEFAULT_DIFF_CONFIG.baseline_ref;\n const headRef = params.head ?? \"HEAD\";\n const configPath = join(configDir, \"spec.config.yaml\");\n\n try {\n const result = await diffBetweenRefs(configPath, baseRef, headRef, {\n working: params.working ?? false,\n });\n return JSON.stringify(result);\n } catch (err) {\n if (err instanceof DiffError) {\n return JSON.stringify({ error: err.message });\n }\n throw err;\n }\n}\n","import {\n loadConfig,\n buildGraph,\n GraphError,\n parseSpec,\n resolveGlob,\n collectReferenceEdges,\n findUnreflectedReferences,\n} from \"@specdx/core\";\nimport type { ParsedSpec } from \"@specdx/core\";\n\nexport async function handleGraph(params: { format?: string }): Promise<string> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n\n try {\n const graph = buildGraph(config);\n const sorted = graph.topologicalSort();\n\n const idToEntry = new Map<string, string>();\n const specs: ParsedSpec[] = [];\n for (const [key, entry] of Object.entries(config.specs)) {\n const paths = await resolveGlob(entry.path, configDir);\n for (const p of paths) {\n const spec = await parseSpec(p);\n specs.push(spec);\n if (typeof spec.frontmatter.id === \"string\") {\n idToEntry.set(spec.frontmatter.id, key);\n }\n }\n }\n const referenceEdges = collectReferenceEdges(specs);\n const unreflectedReferences = findUnreflectedReferences(referenceEdges, idToEntry, graph);\n\n if (params.format === \"dot\") {\n const lines = [\"digraph specs {\"];\n for (const edge of graph.edges) lines.push(` \"${edge.from}\" -> \"${edge.to}\";`);\n for (const ref of referenceEdges) {\n lines.push(\n ` \"${ref.fromId}\" -> \"${ref.toId}\" [style=dashed, label=\"${ref.relationship}\"];`,\n );\n }\n lines.push(\"}\");\n return lines.join(\"\\n\");\n }\n\n return JSON.stringify({\n nodes: sorted,\n edges: graph.edges,\n downstream: Object.fromEntries(sorted.map((n) => [n, graph.getDownstream(n)])),\n referenceEdges,\n unreflectedReferences,\n });\n } catch (err) {\n if (err instanceof GraphError) {\n return JSON.stringify({ error: err.message });\n }\n throw err;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,SAAS;;;ACClB,eAAsB,eAAe,QAA+B;AAClE,MAAI;AACF,UAAM,YAAY,OAAO,cAAc,QAAQ,IAAG;AAClD,UAAM,SAAS,MAAM,WAAW,QAAW,SAAS;AAEpD,eAAW,MAAM;AAIjB,QAAI,YAAY;AAChB,eAAW,SAAS,OAAO,OAAO,OAAO,KAAK,GAAG;AAC/C,oBAAc,MAAM,YAAY,MAAM,MAAM,SAAS,GAAG;IAC1D;AAEA,WAAO,KAAK,UAAU;MACpB,OAAO;MACP,aAAa,OAAO,KAAK,OAAO,KAAK,EAAE;MACvC;MACA,SAAS,OAAO,SAAS,QAAQ;KAClC;EACH,SAAS,KAAK;AACZ,QAAI,eAAe,aAAa;AAC9B,aAAO,KAAK,UAAU,EAAE,OAAO,OAAO,OAAO,IAAI,SAAS,SAAS,IAAI,OAAM,CAAE;IACjF;AACA,QAAI,eAAe,YAAY;AAC7B,aAAO,KAAK,UAAU,EAAE,OAAO,OAAO,OAAO,IAAI,QAAO,CAAE;IAC5D;AACA,UAAM;EACR;AACF;;;ACPA,eAAsB,WAAW,QAA8C;AAC7E,QAAM,YAAY,QAAQ,IAAG;AAK7B,QAAM,aAAa,MAAM,WAAW,SAAS;AAC7C,MAAI,CAAC,YAAY;AAIf,QAAI,OAAO,UAAU;AACnB,YAAM,IAAI,MACR,uDAAuD,OAAO,QAAQ,yIACyC;IAEnH;AACA,UAAM,eAAe,MAAM,4BAA4B,SAAS;AAChE,QAAI,cAAc;AAChB,aAAO,KAAK,UAAU;QACpB,aAAa,aAAa;QAC1B,WAAW,aAAa,YAAY,KAAK,CAAC,MAAM,EA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 @@ import { defineCommand } from "citty";
|
|
|
9
9
|
var generate_default = defineCommand({
|
|
10
10
|
meta: { name: "generate", description: "Generate spec stubs from existing specs" },
|
|
11
11
|
subCommands: {
|
|
12
|
-
story: () => import("./generate-story-
|
|
13
|
-
"test-plan": () => import("./generate-test-plan-
|
|
12
|
+
story: () => import("./generate-story-BXGNKWC6.js").then((m) => labelled("generate story", m.default)),
|
|
13
|
+
"test-plan": () => import("./generate-test-plan-PZUNCNN3.js").then(
|
|
14
14
|
(m) => labelled("generate test-plan", m.default)
|
|
15
15
|
)
|
|
16
16
|
}
|
|
@@ -18,4 +18,4 @@ var generate_default = defineCommand({
|
|
|
18
18
|
export {
|
|
19
19
|
generate_default as default
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=generate-
|
|
21
|
+
//# sourceMappingURL=generate-PTDHGDR2.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseFeatureEntries,
|
|
3
3
|
uncoveredFeatures
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VVZUJ6H4.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogger,
|
|
7
7
|
loadConfig,
|
|
8
8
|
parseSpec,
|
|
9
9
|
resolveGlob
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JGD3BOPH.js";
|
|
11
11
|
import {
|
|
12
12
|
REQUIRED_SECTIONS
|
|
13
13
|
} from "./chunk-XRWLPU24.js";
|
|
@@ -217,4 +217,4 @@ export {
|
|
|
217
217
|
defineCommandExport,
|
|
218
218
|
generateStories
|
|
219
219
|
};
|
|
220
|
-
//# sourceMappingURL=generate-story-
|
|
220
|
+
//# sourceMappingURL=generate-story-BXGNKWC6.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
loadConfig,
|
|
4
4
|
parseSpec,
|
|
5
5
|
resolveGlob
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JGD3BOPH.js";
|
|
7
7
|
import "./chunk-XRWLPU24.js";
|
|
8
8
|
import "./chunk-5WRI5ZAA.js";
|
|
9
9
|
|
|
@@ -206,4 +206,4 @@ export {
|
|
|
206
206
|
generateTestPlan,
|
|
207
207
|
registeredKeyFor
|
|
208
208
|
};
|
|
209
|
-
//# sourceMappingURL=generate-test-plan-
|
|
209
|
+
//# sourceMappingURL=generate-test-plan-PZUNCNN3.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
loadConfig,
|
|
14
14
|
parseSpec,
|
|
15
15
|
resolveGlob
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JGD3BOPH.js";
|
|
17
17
|
import "./chunk-XRWLPU24.js";
|
|
18
18
|
import "./chunk-5WRI5ZAA.js";
|
|
19
19
|
|
|
@@ -137,4 +137,4 @@ var graph_default = defineCommand({
|
|
|
137
137
|
export {
|
|
138
138
|
graph_default as default
|
|
139
139
|
};
|
|
140
|
-
//# sourceMappingURL=graph-
|
|
140
|
+
//# sourceMappingURL=graph-GKXD2IGW.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -113,6 +113,17 @@ interface RunLintResults extends LintResults {
|
|
|
113
113
|
* is a config promising a check that is not running.
|
|
114
114
|
*/
|
|
115
115
|
agentFiles: number;
|
|
116
|
+
/**
|
|
117
|
+
* False when there is no `spec.config.yaml` and only agent instruction files
|
|
118
|
+
* were linted. The zero-config on-ramp: a project with a CLAUDE.md and no
|
|
119
|
+
* spec suite gets a useful answer instead of "run specdx init".
|
|
120
|
+
*
|
|
121
|
+
* `assessed` keeps meaning "specs were assessed", so the vacuous-pass guard
|
|
122
|
+
* it exists for is unweakened; callers check this flag to know that a
|
|
123
|
+
* `specFiles: 0` is expected here rather than a suite that resolved to
|
|
124
|
+
* nothing.
|
|
125
|
+
*/
|
|
126
|
+
specSuite: boolean;
|
|
116
127
|
}
|
|
117
128
|
declare function runLint(options: RunLintOptions): Promise<RunLintResults>;
|
|
118
129
|
|
package/dist/index.js
CHANGED
|
@@ -2113,7 +2113,7 @@ var init_default = defineCommand({
|
|
|
2113
2113
|
import { defineCommand as defineCommand2 } from "citty";
|
|
2114
2114
|
|
|
2115
2115
|
// ../core/dist/config.js
|
|
2116
|
-
import { readFile } from "fs/promises";
|
|
2116
|
+
import { readFile, stat } from "fs/promises";
|
|
2117
2117
|
import { join as join2, dirname } from "path";
|
|
2118
2118
|
import { parse as parseYaml } from "yaml";
|
|
2119
2119
|
var ConfigError = class extends Error {
|
|
@@ -2152,15 +2152,24 @@ async function findConfig(from) {
|
|
|
2152
2152
|
let dir = from;
|
|
2153
2153
|
while (true) {
|
|
2154
2154
|
const candidate = join2(dir, CONFIG_FILENAME);
|
|
2155
|
+
let stats;
|
|
2155
2156
|
try {
|
|
2156
|
-
await
|
|
2157
|
-
|
|
2158
|
-
|
|
2157
|
+
stats = await stat(candidate);
|
|
2158
|
+
} catch (err) {
|
|
2159
|
+
const code = err.code;
|
|
2160
|
+
if (code !== "ENOENT" && code !== "ENOTDIR") {
|
|
2161
|
+
throw new ConfigError(`Cannot read config file: ${candidate} (${code}).`);
|
|
2162
|
+
}
|
|
2159
2163
|
const parent = dirname(dir);
|
|
2160
2164
|
if (parent === dir)
|
|
2161
2165
|
return void 0;
|
|
2162
2166
|
dir = parent;
|
|
2167
|
+
continue;
|
|
2168
|
+
}
|
|
2169
|
+
if (!stats.isFile()) {
|
|
2170
|
+
throw new ConfigError(`Cannot read config file: ${candidate} is not a regular file.`);
|
|
2163
2171
|
}
|
|
2172
|
+
return candidate;
|
|
2164
2173
|
}
|
|
2165
2174
|
}
|
|
2166
2175
|
|
|
@@ -3410,6 +3419,8 @@ function fencedLines(lines) {
|
|
|
3410
3419
|
});
|
|
3411
3420
|
return fenced;
|
|
3412
3421
|
}
|
|
3422
|
+
var REPORTS_ABSENCE = /\b(?:removed?|removal|deleted?|renamed?|moved|dropped|retired|replaced|no longer|does not exist)\b/i;
|
|
3423
|
+
var INTRODUCES_EXAMPLE = /\b(?:e\.g\.|for example|for instance|such as)/i;
|
|
3413
3424
|
function extractReferences(lines) {
|
|
3414
3425
|
const skip = fencedLines(lines);
|
|
3415
3426
|
const found = [];
|
|
@@ -3417,11 +3428,18 @@ function extractReferences(lines) {
|
|
|
3417
3428
|
lines.forEach((line, index) => {
|
|
3418
3429
|
if (skip.has(index))
|
|
3419
3430
|
return;
|
|
3431
|
+
if (REPORTS_ABSENCE.test(line.replace(/`[^`\n]*`|\]\([^)]*\)/g, "")))
|
|
3432
|
+
return;
|
|
3433
|
+
const exampleFrom = INTRODUCES_EXAMPLE.exec(line)?.index ?? Infinity;
|
|
3420
3434
|
const candidates = [];
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3435
|
+
const collect = (pattern) => {
|
|
3436
|
+
for (const match of line.matchAll(pattern)) {
|
|
3437
|
+
if (match.index < exampleFrom)
|
|
3438
|
+
candidates.push(match[1]);
|
|
3439
|
+
}
|
|
3440
|
+
};
|
|
3441
|
+
collect(/`([^`\n]+)`/g);
|
|
3442
|
+
collect(/\]\((?!https?:|#)([^)\s]+)\)/g);
|
|
3425
3443
|
for (const raw of candidates) {
|
|
3426
3444
|
const candidate = normalise(raw.trim());
|
|
3427
3445
|
if (!candidate || isNotAFileClaim(candidate))
|
|
@@ -3487,6 +3505,7 @@ var sizeBudgetRule = {
|
|
|
3487
3505
|
};
|
|
3488
3506
|
|
|
3489
3507
|
// ../lint/dist/agents/resolve-reference.js
|
|
3508
|
+
import { execFileSync } from "child_process";
|
|
3490
3509
|
import { readdirSync } from "fs";
|
|
3491
3510
|
import { join as join4, sep } from "path";
|
|
3492
3511
|
var SKIP_DIRECTORIES = /* @__PURE__ */ new Set([
|
|
@@ -3545,7 +3564,21 @@ function isPlaceholder(reference) {
|
|
|
3545
3564
|
const stem = base.split(".")[0] ?? base;
|
|
3546
3565
|
return PLACEHOLDER_STEMS.has(stem.toLowerCase());
|
|
3547
3566
|
}
|
|
3548
|
-
|
|
3567
|
+
var HAS_EXTENSION = /\.[A-Za-z][A-Za-z0-9]{0,9}$/;
|
|
3568
|
+
function createGitIgnoreCheck(configDir) {
|
|
3569
|
+
return (reference) => {
|
|
3570
|
+
try {
|
|
3571
|
+
execFileSync("git", ["check-ignore", "-q", "--", reference], {
|
|
3572
|
+
cwd: configDir,
|
|
3573
|
+
stdio: "ignore"
|
|
3574
|
+
});
|
|
3575
|
+
return true;
|
|
3576
|
+
} catch {
|
|
3577
|
+
return false;
|
|
3578
|
+
}
|
|
3579
|
+
};
|
|
3580
|
+
}
|
|
3581
|
+
function createReferenceResolver(files, options = {}) {
|
|
3549
3582
|
const exact = new Set(files);
|
|
3550
3583
|
const byLastSegment = /* @__PURE__ */ new Map();
|
|
3551
3584
|
for (const file of files) {
|
|
@@ -3562,13 +3595,19 @@ function createReferenceResolver(files) {
|
|
|
3562
3595
|
return true;
|
|
3563
3596
|
if (isPlaceholder(normalised))
|
|
3564
3597
|
return true;
|
|
3565
|
-
const
|
|
3598
|
+
const segments = normalised.split("/");
|
|
3599
|
+
const last = segments[segments.length - 1];
|
|
3566
3600
|
if (!last)
|
|
3567
3601
|
return false;
|
|
3568
|
-
const candidates = byLastSegment.get(last);
|
|
3569
|
-
if (
|
|
3570
|
-
return
|
|
3571
|
-
|
|
3602
|
+
const candidates = byLastSegment.get(last) ?? [];
|
|
3603
|
+
if (candidates.some((c) => c === normalised || c.endsWith(`/${normalised}`)))
|
|
3604
|
+
return true;
|
|
3605
|
+
if (segments.some((segment) => SKIP_DIRECTORIES.has(segment)))
|
|
3606
|
+
return true;
|
|
3607
|
+
if (segments.length > 1 && !HAS_EXTENSION.test(last) && segments[0] !== ".." && !byLastSegment.has(segments[0])) {
|
|
3608
|
+
return true;
|
|
3609
|
+
}
|
|
3610
|
+
return options.isIgnored?.(normalised) ?? false;
|
|
3572
3611
|
};
|
|
3573
3612
|
}
|
|
3574
3613
|
|
|
@@ -3608,7 +3647,9 @@ async function lintAgentFiles(options) {
|
|
|
3608
3647
|
const maxTokens = agents.max_tokens ?? DEFAULT_MAX_TOKENS;
|
|
3609
3648
|
const rules = resolveAgentRules(agents.rules);
|
|
3610
3649
|
const files = await discoverAgentFiles(patterns, configDir);
|
|
3611
|
-
const exists = options.exists ?? (files.length > 0 ? createReferenceResolver(indexProjectFiles(configDir)
|
|
3650
|
+
const exists = options.exists ?? (files.length > 0 ? createReferenceResolver(indexProjectFiles(configDir), {
|
|
3651
|
+
isIgnored: createGitIgnoreCheck(configDir)
|
|
3652
|
+
}) : () => true);
|
|
3612
3653
|
const diagnostics = [];
|
|
3613
3654
|
for (const file of files) {
|
|
3614
3655
|
for (const rule of rules) {
|
|
@@ -3628,6 +3669,11 @@ async function lintAgentFiles(options) {
|
|
|
3628
3669
|
}
|
|
3629
3670
|
return { diagnostics, filesLinted: files.length, assessed: files.length > 0 };
|
|
3630
3671
|
}
|
|
3672
|
+
var AGENT_ONLY_CONFIG = { version: "1.0", specs: {}, agents: {} };
|
|
3673
|
+
async function lintAgentFilesWithoutConfig(configDir) {
|
|
3674
|
+
const results = await lintAgentFiles({ config: AGENT_ONLY_CONFIG, configDir });
|
|
3675
|
+
return results.assessed ? results : null;
|
|
3676
|
+
}
|
|
3631
3677
|
|
|
3632
3678
|
// src/shared-args.ts
|
|
3633
3679
|
var quietArg = {
|
|
@@ -3709,7 +3755,28 @@ async function runLint(options) {
|
|
|
3709
3755
|
if (!options.configDir) {
|
|
3710
3756
|
throw new TypeError("runLint requires `configDir` \u2014 the directory holding spec.config.yaml.");
|
|
3711
3757
|
}
|
|
3712
|
-
const
|
|
3758
|
+
const configPath = await findConfig(options.configDir);
|
|
3759
|
+
if (!configPath) {
|
|
3760
|
+
if (options.specPath) {
|
|
3761
|
+
throw new ConfigError(
|
|
3762
|
+
`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.`
|
|
3763
|
+
);
|
|
3764
|
+
}
|
|
3765
|
+
const agentResults = await lintAgentFilesWithoutConfig(options.configDir);
|
|
3766
|
+
if (!agentResults) {
|
|
3767
|
+
throw new ConfigError("No spec.config.yaml found. Run 'specdx init' to create one.");
|
|
3768
|
+
}
|
|
3769
|
+
return {
|
|
3770
|
+
diagnostics: agentResults.diagnostics,
|
|
3771
|
+
hasErrors: agentResults.diagnostics.some((d) => d.severity === "error"),
|
|
3772
|
+
hasWarnings: agentResults.diagnostics.some((d) => d.severity === "warn"),
|
|
3773
|
+
specFiles: 0,
|
|
3774
|
+
assessed: false,
|
|
3775
|
+
agentFiles: agentResults.filesLinted,
|
|
3776
|
+
specSuite: false
|
|
3777
|
+
};
|
|
3778
|
+
}
|
|
3779
|
+
const config = await loadConfig(configPath, options.configDir);
|
|
3713
3780
|
const preset = options.preset ?? config.lint?.extends ?? "recommended";
|
|
3714
3781
|
const { rules, ignore } = await resolveLintConfig({
|
|
3715
3782
|
config,
|
|
@@ -3771,13 +3838,31 @@ async function runLint(options) {
|
|
|
3771
3838
|
}
|
|
3772
3839
|
const ignored = new Set(ignore);
|
|
3773
3840
|
const linted = specs.filter((spec) => !ignored.has(spec.filePath) && selects(spec.filePath));
|
|
3774
|
-
return {
|
|
3841
|
+
return {
|
|
3842
|
+
...results,
|
|
3843
|
+
specFiles: linted.length,
|
|
3844
|
+
assessed: linted.length > 0,
|
|
3845
|
+
agentFiles,
|
|
3846
|
+
specSuite: true
|
|
3847
|
+
};
|
|
3848
|
+
}
|
|
3849
|
+
function noSpecSuiteNotice(configDir) {
|
|
3850
|
+
return {
|
|
3851
|
+
ruleId: "agents/no-spec-suite",
|
|
3852
|
+
severity: "info",
|
|
3853
|
+
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.",
|
|
3854
|
+
filePath: configDir
|
|
3855
|
+
};
|
|
3775
3856
|
}
|
|
3776
3857
|
function cleanRunMessage(results) {
|
|
3777
|
-
const
|
|
3778
|
-
if (results.
|
|
3779
|
-
|
|
3858
|
+
const agentPart = `${results.agentFiles} agent ${results.agentFiles === 1 ? "file" : "files"}`;
|
|
3859
|
+
if (!results.specSuite) {
|
|
3860
|
+
return ` \u2713 ${agentPart} checked, no problems found.
|
|
3861
|
+
No spec.config.yaml here, so no specs were checked. Run \`specdx init\` to add a spec suite.
|
|
3862
|
+
`;
|
|
3780
3863
|
}
|
|
3864
|
+
const parts = [`${results.specFiles} ${results.specFiles === 1 ? "spec" : "specs"}`];
|
|
3865
|
+
if (results.agentFiles > 0) parts.push(agentPart);
|
|
3781
3866
|
return ` \u2713 ${parts.join(" and ")} checked, no problems found.
|
|
3782
3867
|
`;
|
|
3783
3868
|
}
|
|
@@ -3809,7 +3894,7 @@ var lint_default = defineCommand2({
|
|
|
3809
3894
|
preset: args.preset
|
|
3810
3895
|
});
|
|
3811
3896
|
const formatter = format.format === "json" ? formatJson : format.format === "github" ? formatGithub : formatPretty;
|
|
3812
|
-
if (!results.assessed) {
|
|
3897
|
+
if (!results.assessed && results.specSuite) {
|
|
3813
3898
|
console.error(
|
|
3814
3899
|
args.path ? `
|
|
3815
3900
|
\u26A0 No specs matched path "${args.path}", so nothing was linted. Check it against the specs declared in spec.config.yaml.
|
|
@@ -3817,7 +3902,9 @@ var lint_default = defineCommand2({
|
|
|
3817
3902
|
);
|
|
3818
3903
|
process.exit(3);
|
|
3819
3904
|
}
|
|
3820
|
-
const rendered = formatter(
|
|
3905
|
+
const rendered = formatter(
|
|
3906
|
+
results.specSuite ? results.diagnostics : [noSpecSuiteNotice(process.cwd()), ...results.diagnostics]
|
|
3907
|
+
);
|
|
3821
3908
|
if (format.format === "pretty" && results.diagnostics.length === 0) {
|
|
3822
3909
|
output.info(cleanRunMessage(results));
|
|
3823
3910
|
} else {
|