specdx 0.4.0-alpha.14 → 0.4.0-alpha.16

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 (22) hide show
  1. package/.claude-plugin/plugin.json +7 -2
  2. package/dist/main.js +2 -2
  3. package/dist/main.js.map +1 -1
  4. package/dist/skills/{specdx-author-spec.md → core/specdx-author-spec/SKILL.md} +10 -6
  5. package/dist/skills/{specdx-author-spec → core/specdx-author-spec/references}/step-01-frontmatter.md +1 -1
  6. package/dist/skills/{specdx-onboard.md → core/specdx-onboard/SKILL.md} +5 -1
  7. package/dist/skills/{specdx-plan-from-spec.md → core/specdx-plan-from-spec/SKILL.md} +5 -1
  8. package/dist/skills/{specdx-pre-commit.md → core/specdx-pre-commit/SKILL.md} +5 -1
  9. package/dist/skills/{specdx-review-spec.md → core/specdx-review-spec/SKILL.md} +5 -1
  10. package/dist/skills/core/specdx-router/SKILL.md +67 -0
  11. package/dist/skills/{specdx-sprint-review.md → core/specdx-sprint-review/SKILL.md} +5 -1
  12. package/dist/skills/{specdx-start-task.md → core/specdx-start-task/SKILL.md} +5 -1
  13. package/dist/skills/{specdx-check-drift.md → experimental/specdx-check-drift/SKILL.md} +5 -1
  14. package/dist/skills/{specdx-verify.md → experimental/specdx-verify/SKILL.md} +5 -1
  15. package/dist/{skills-EQTVRLER.js → skills-IKRQ3IZP.js} +44 -18
  16. package/dist/skills-IKRQ3IZP.js.map +1 -0
  17. package/hooks/hooks.json +12 -6
  18. package/package.json +5 -5
  19. package/dist/skills-EQTVRLER.js.map +0 -1
  20. /package/dist/skills/{spec-type-reference.md → core/specdx-author-spec/references/spec-type-reference.md} +0 -0
  21. /package/dist/skills/{specdx-author-spec → core/specdx-author-spec/references}/step-02-sections.md +0 -0
  22. /package/dist/skills/{specdx-author-spec → core/specdx-author-spec/references}/step-03-finalize.md +0 -0
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "specdx",
3
- "version": "0.4.0-alpha.1",
3
+ "version": "0.4.0-alpha.16",
4
4
  "description": "Spec-driven development skills for Claude Code",
5
- "commands": "./dist/skills"
5
+ "author": {
6
+ "name": "umxr",
7
+ "url": "https://github.com/umxr"
8
+ },
9
+ "skills": "./dist/skills/core",
10
+ "hooks": "./hooks/hooks.json"
6
11
  }
package/dist/main.js CHANGED
@@ -10,7 +10,7 @@ import { defineCommand as defineCommand2, runMain } from "citty";
10
10
  // package.json
11
11
  var package_default = {
12
12
  name: "specdx",
13
- version: "0.4.0-alpha.14",
13
+ version: "0.4.0-alpha.16",
14
14
  description: "Spec-driven development toolchain. Validate, lint, pack, and ship specs for LLM-assisted workflows.",
15
15
  type: "module",
16
16
  license: "MIT",
@@ -222,7 +222,7 @@ var main = defineCommand2({
222
222
  lint: () => import("./lint-A5AXYDSO.js").then((m) => m.default),
223
223
  validate: () => import("./validate-HMOCZJ2M.js").then((m) => m.default),
224
224
  graph: () => import("./graph-KZDCVMLT.js").then((m) => m.default),
225
- skills: () => import("./skills-EQTVRLER.js").then((m) => m.default),
225
+ skills: () => import("./skills-IKRQ3IZP.js").then((m) => m.default),
226
226
  pack: () => import("./pack-I5WFM6B6.js").then((m) => m.default),
227
227
  diff: () => import("./diff-AWFDXYX4.js").then((m) => m.default),
228
228
  status: () => import("./status-QLG3ZKS7.js").then((m) => m.default),
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main.ts","../package.json","../src/commands/init.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { defineCommand, runMain } from \"citty\";\nimport pkg from \"../package.json\" with { type: \"json\" };\nimport initCommand from \"./commands/init.js\";\n\nconst main = defineCommand({\n meta: { name: \"specdx\", version: pkg.version, description: \"specdx — Spec Developer Experience\" },\n subCommands: {\n init: initCommand,\n lint: () => import(\"./commands/lint.js\").then((m) => m.default),\n validate: () => import(\"./commands/validate.js\").then((m) => m.default),\n graph: () => import(\"./commands/graph.js\").then((m) => m.default),\n skills: () => import(\"./commands/skills.js\").then((m) => m.default),\n pack: () => import(\"./commands/pack.js\").then((m) => m.default),\n diff: () => import(\"./commands/diff.js\").then((m) => m.default),\n status: () => import(\"./commands/status.js\").then((m) => m.default),\n explain: () => import(\"./commands/explain.js\").then((m) => m.default),\n check: () => import(\"./commands/check.js\").then((m) => m.default),\n ready: () => import(\"./commands/ready.js\").then((m) => m.default),\n update: () => import(\"./commands/update.js\").then((m) => m.default),\n generate: () => import(\"./commands/generate.js\").then((m) => m.default),\n migrate: () => import(\"./commands/migrate.js\").then((m) => m.default),\n mcp: () => import(\"./commands/mcp.js\").then((m) => m.default),\n },\n});\n\nrunMain(main).catch((err: Error) => {\n console.error(`\\n ✗ ${err.message}\\n`);\n process.exit(1);\n});\n","{\n \"name\": \"specdx\",\n \"version\": \"0.4.0-alpha.14\",\n \"description\": \"Spec-driven development toolchain. Validate, lint, pack, and ship specs for LLM-assisted workflows.\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"author\": \"Umar Gora (https://github.com/umxr)\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/umxr/specdx.git\",\n \"directory\": \"packages/cli\"\n },\n \"homepage\": \"https://github.com/umxr/specdx#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/umxr/specdx/issues\"\n },\n \"keywords\": [\n \"spec\",\n \"specification\",\n \"prd\",\n \"technical-design\",\n \"api-contract\",\n \"lint\",\n \"validation\",\n \"llm\",\n \"ai\",\n \"context-packing\",\n \"spec-driven-development\",\n \"claude-code\"\n ],\n \"engines\": {\n \"node\": \">=18.0.0\"\n },\n \"bin\": {\n \"specdx\": \"./dist/main.js\"\n },\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\"\n }\n },\n \"files\": [\n \"dist\",\n \".claude-plugin\",\n \"hooks\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run\",\n \"clean\": \"rm -rf dist *.tsbuildinfo\"\n },\n \"dependencies\": {\n \"@modelcontextprotocol/sdk\": \"^1.27.0\",\n \"ajv\": \"^8.18.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"citty\": \"^0.2.1\",\n \"consola\": \"^3.4.0\",\n \"gray-matter\": \"^4.0.3\",\n \"js-tiktoken\": \"^1.0.18\",\n \"remark-parse\": \"^11.0.0\",\n \"tinyglobby\": \"^0.2.12\",\n \"unified\": \"^11.0.0\",\n \"unist-util-visit\": \"^5.0.0\",\n \"yaml\": \"^2.7.0\",\n \"zod\": \"^3.23.0\"\n },\n \"devDependencies\": {\n \"@specdx/check\": \"workspace:*\",\n \"@specdx/core\": \"workspace:*\",\n \"@specdx/diff\": \"workspace:*\",\n \"@specdx/lint\": \"workspace:*\",\n \"@specdx/mcp\": \"workspace:*\",\n \"@specdx/pack\": \"workspace:*\",\n \"@specdx/schema\": \"workspace:*\",\n \"@specdx/skills\": \"workspace:*\",\n \"tsup\": \"^8.5.1\",\n \"typescript\": \"^5.7.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","import { defineCommand } from \"citty\";\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { REQUIRED_SECTIONS } from \"@specdx/schema\";\n\nexport type Template = \"lightweight\" | \"bmad\" | \"api-first\" | \"quick\" | \"context\";\n\ninterface ScaffoldOptions {\n projectName: string;\n template: Template;\n targetDir: string;\n}\n\nconst TEMPLATE_SPECS: Record<\n Template,\n Array<{ filename: string; type: keyof typeof REQUIRED_SECTIONS }>\n> = {\n lightweight: [\n { filename: \"prd.md\", type: \"prd\" },\n { filename: \"technical-design.md\", type: \"technical-design\" },\n ],\n bmad: [\n { filename: \"prd.md\", type: \"prd\" },\n { filename: \"technical-design.md\", type: \"technical-design\" },\n { filename: \"test-plan.md\", type: \"test-plan\" },\n ],\n \"api-first\": [\n { filename: \"technical-design.md\", type: \"technical-design\" },\n { filename: \"api-contract.md\", type: \"api-contract\" },\n { filename: \"test-plan.md\", type: \"test-plan\" },\n ],\n quick: [{ filename: \"quick-spec.md\", type: \"quick-spec\" }],\n context: [{ filename: \"project-context.md\", type: \"project-context\" }],\n};\n\nconst TEMPLATE_EXTRA_DIRS: Record<Template, string[]> = {\n lightweight: [],\n bmad: [\"specs/stories\", \"specs/adr\"],\n \"api-first\": [],\n quick: [],\n context: [],\n};\n\nfunction specIdFromFilename(filename: string): string {\n return filename.replace(/\\.md$/, \"\");\n}\n\nfunction specTitleFromType(type: string): string {\n return type\n .split(\"-\")\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \");\n}\n\nfunction buildSpecFile(\n filename: string,\n type: keyof typeof REQUIRED_SECTIONS,\n projectName: string,\n today: string,\n): string {\n const id = specIdFromFilename(filename);\n const title = `${specTitleFromType(type)} — ${projectName}`;\n const sections = REQUIRED_SECTIONS[type];\n\n const frontmatter = [\n \"---\",\n `id: ${id}`,\n `type: ${type}`,\n `title: \"${title}\"`,\n `status: draft`,\n `version: \"0.1\"`,\n `created: \"${today}\"`,\n `authors: [\"author\"]`,\n \"---\",\n ].join(\"\\n\");\n\n const body = sections.map((section) => `\\n## ${section}\\n\\n<!-- placeholder -->`).join(\"\\n\");\n\n return `${frontmatter}\\n${body}\\n`;\n}\n\nfunction buildConfigYaml(\n projectName: string,\n specs: Array<{ filename: string; type: string }>,\n): string {\n const specEntries = specs\n .map(({ filename, type }) => {\n const key = specIdFromFilename(filename);\n return ` ${key}:\\n path: specs/${filename}\\n type: ${type}`;\n })\n .join(\"\\n\");\n\n return (\n [`version: \"1.0\"`, `project:`, ` name: \"${projectName}\"`, `specs:`, specEntries].join(\"\\n\") +\n \"\\n\"\n );\n}\n\nexport async function scaffoldProject({\n projectName,\n template,\n targetDir,\n}: ScaffoldOptions): Promise<void> {\n const today = new Date().toISOString().slice(0, 10);\n const specsDir = join(targetDir, \"specs\");\n\n // Create specs/ directory\n await mkdir(specsDir, { recursive: true });\n\n // Create extra template dirs (e.g., bmad needs stories/ and adr/)\n for (const extraDir of TEMPLATE_EXTRA_DIRS[template]) {\n await mkdir(join(targetDir, extraDir), { recursive: true });\n }\n\n const specs = TEMPLATE_SPECS[template];\n\n // Write spec files\n for (const { filename, type } of specs) {\n const content = buildSpecFile(filename, type, projectName, today);\n await writeFile(join(specsDir, filename), content, \"utf-8\");\n }\n\n // Write spec.config.yaml\n const configContent = buildConfigYaml(projectName, specs);\n await writeFile(join(targetDir, \"spec.config.yaml\"), configContent, \"utf-8\");\n}\n\nexport default defineCommand({\n meta: {\n name: \"init\",\n description: \"Initialize a new specdx project with spec scaffolding\",\n },\n args: {\n name: {\n type: \"string\",\n description: \"Project name\",\n required: true,\n },\n template: {\n type: \"string\",\n description: \"Template to use (lightweight, bmad, api-first)\",\n default: \"lightweight\",\n },\n dir: {\n type: \"string\",\n description: \"Target directory\",\n default: \".\",\n },\n },\n async run({ args }) {\n const { name, template, dir } = args;\n const validTemplates: Template[] = [\"lightweight\", \"bmad\", \"api-first\", \"quick\", \"context\"];\n if (!validTemplates.includes(template as Template)) {\n console.error(`Unknown template: ${template}. Choose from: ${validTemplates.join(\", \")}`);\n process.exit(1);\n }\n console.log(`Scaffolding \"${name}\" with template \"${template}\" in ${dir}...`);\n await scaffoldProject({ projectName: name, template: template as Template, targetDir: dir });\n console.log(`Done! Project \"${name}\" scaffolded successfully.`);\n },\n});\n"],"mappings":";;;;;;;AACA,SAAS,iBAAAA,gBAAe,eAAe;;;ACDvC;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,QAAU;AAAA,EACV,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,IACP,WAAa;AAAA,EACf;AAAA,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA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AAQ,MAAM,OAAO,sBAAsB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAClE,SAAS,MAAM,OAAO,uBAAuB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IACpE,OAAO,MAAM,OAAO,qBAAqB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAChE,OAAO,MAAM,OAAO,qBAAqB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAChE,QAAQ,MAAM,OAAO,sBAAsB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAClE,UAAU,MAAM,OAAO,wBAAwB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IACtE,SAAS,MAAM,OAAO,uBAAuB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IACpE,KAAK,MAAM,OAAO,mBAAmB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EAC9D;AACF,CAAC;AAED,QAAQ,IAAI,EAAE,MAAM,CAAC,QAAe;AAClC,UAAQ,MAAM;AAAA,WAAS,IAAI,OAAO;AAAA,CAAI;AACtC,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["defineCommand","defineCommand"]}
1
+ {"version":3,"sources":["../src/main.ts","../package.json","../src/commands/init.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { defineCommand, runMain } from \"citty\";\nimport pkg from \"../package.json\" with { type: \"json\" };\nimport initCommand from \"./commands/init.js\";\n\nconst main = defineCommand({\n meta: { name: \"specdx\", version: pkg.version, description: \"specdx — Spec Developer Experience\" },\n subCommands: {\n init: initCommand,\n lint: () => import(\"./commands/lint.js\").then((m) => m.default),\n validate: () => import(\"./commands/validate.js\").then((m) => m.default),\n graph: () => import(\"./commands/graph.js\").then((m) => m.default),\n skills: () => import(\"./commands/skills.js\").then((m) => m.default),\n pack: () => import(\"./commands/pack.js\").then((m) => m.default),\n diff: () => import(\"./commands/diff.js\").then((m) => m.default),\n status: () => import(\"./commands/status.js\").then((m) => m.default),\n explain: () => import(\"./commands/explain.js\").then((m) => m.default),\n check: () => import(\"./commands/check.js\").then((m) => m.default),\n ready: () => import(\"./commands/ready.js\").then((m) => m.default),\n update: () => import(\"./commands/update.js\").then((m) => m.default),\n generate: () => import(\"./commands/generate.js\").then((m) => m.default),\n migrate: () => import(\"./commands/migrate.js\").then((m) => m.default),\n mcp: () => import(\"./commands/mcp.js\").then((m) => m.default),\n },\n});\n\nrunMain(main).catch((err: Error) => {\n console.error(`\\n ✗ ${err.message}\\n`);\n process.exit(1);\n});\n","{\n \"name\": \"specdx\",\n \"version\": \"0.4.0-alpha.16\",\n \"description\": \"Spec-driven development toolchain. Validate, lint, pack, and ship specs for LLM-assisted workflows.\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"author\": \"Umar Gora (https://github.com/umxr)\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/umxr/specdx.git\",\n \"directory\": \"packages/cli\"\n },\n \"homepage\": \"https://github.com/umxr/specdx#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/umxr/specdx/issues\"\n },\n \"keywords\": [\n \"spec\",\n \"specification\",\n \"prd\",\n \"technical-design\",\n \"api-contract\",\n \"lint\",\n \"validation\",\n \"llm\",\n \"ai\",\n \"context-packing\",\n \"spec-driven-development\",\n \"claude-code\"\n ],\n \"engines\": {\n \"node\": \">=18.0.0\"\n },\n \"bin\": {\n \"specdx\": \"./dist/main.js\"\n },\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\"\n }\n },\n \"files\": [\n \"dist\",\n \".claude-plugin\",\n \"hooks\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run\",\n \"clean\": \"rm -rf dist *.tsbuildinfo\"\n },\n \"dependencies\": {\n \"@modelcontextprotocol/sdk\": \"^1.27.0\",\n \"ajv\": \"^8.18.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"citty\": \"^0.2.1\",\n \"consola\": \"^3.4.0\",\n \"gray-matter\": \"^4.0.3\",\n \"js-tiktoken\": \"^1.0.18\",\n \"remark-parse\": \"^11.0.0\",\n \"tinyglobby\": \"^0.2.12\",\n \"unified\": \"^11.0.0\",\n \"unist-util-visit\": \"^5.0.0\",\n \"yaml\": \"^2.7.0\",\n \"zod\": \"^3.23.0\"\n },\n \"devDependencies\": {\n \"@specdx/check\": \"workspace:*\",\n \"@specdx/core\": \"workspace:*\",\n \"@specdx/diff\": \"workspace:*\",\n \"@specdx/lint\": \"workspace:*\",\n \"@specdx/mcp\": \"workspace:*\",\n \"@specdx/pack\": \"workspace:*\",\n \"@specdx/schema\": \"workspace:*\",\n \"@specdx/skills\": \"workspace:*\",\n \"tsup\": \"^8.5.1\",\n \"typescript\": \"^5.7.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","import { defineCommand } from \"citty\";\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { REQUIRED_SECTIONS } from \"@specdx/schema\";\n\nexport type Template = \"lightweight\" | \"bmad\" | \"api-first\" | \"quick\" | \"context\";\n\ninterface ScaffoldOptions {\n projectName: string;\n template: Template;\n targetDir: string;\n}\n\nconst TEMPLATE_SPECS: Record<\n Template,\n Array<{ filename: string; type: keyof typeof REQUIRED_SECTIONS }>\n> = {\n lightweight: [\n { filename: \"prd.md\", type: \"prd\" },\n { filename: \"technical-design.md\", type: \"technical-design\" },\n ],\n bmad: [\n { filename: \"prd.md\", type: \"prd\" },\n { filename: \"technical-design.md\", type: \"technical-design\" },\n { filename: \"test-plan.md\", type: \"test-plan\" },\n ],\n \"api-first\": [\n { filename: \"technical-design.md\", type: \"technical-design\" },\n { filename: \"api-contract.md\", type: \"api-contract\" },\n { filename: \"test-plan.md\", type: \"test-plan\" },\n ],\n quick: [{ filename: \"quick-spec.md\", type: \"quick-spec\" }],\n context: [{ filename: \"project-context.md\", type: \"project-context\" }],\n};\n\nconst TEMPLATE_EXTRA_DIRS: Record<Template, string[]> = {\n lightweight: [],\n bmad: [\"specs/stories\", \"specs/adr\"],\n \"api-first\": [],\n quick: [],\n context: [],\n};\n\nfunction specIdFromFilename(filename: string): string {\n return filename.replace(/\\.md$/, \"\");\n}\n\nfunction specTitleFromType(type: string): string {\n return type\n .split(\"-\")\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \");\n}\n\nfunction buildSpecFile(\n filename: string,\n type: keyof typeof REQUIRED_SECTIONS,\n projectName: string,\n today: string,\n): string {\n const id = specIdFromFilename(filename);\n const title = `${specTitleFromType(type)} — ${projectName}`;\n const sections = REQUIRED_SECTIONS[type];\n\n const frontmatter = [\n \"---\",\n `id: ${id}`,\n `type: ${type}`,\n `title: \"${title}\"`,\n `status: draft`,\n `version: \"0.1\"`,\n `created: \"${today}\"`,\n `authors: [\"author\"]`,\n \"---\",\n ].join(\"\\n\");\n\n const body = sections.map((section) => `\\n## ${section}\\n\\n<!-- placeholder -->`).join(\"\\n\");\n\n return `${frontmatter}\\n${body}\\n`;\n}\n\nfunction buildConfigYaml(\n projectName: string,\n specs: Array<{ filename: string; type: string }>,\n): string {\n const specEntries = specs\n .map(({ filename, type }) => {\n const key = specIdFromFilename(filename);\n return ` ${key}:\\n path: specs/${filename}\\n type: ${type}`;\n })\n .join(\"\\n\");\n\n return (\n [`version: \"1.0\"`, `project:`, ` name: \"${projectName}\"`, `specs:`, specEntries].join(\"\\n\") +\n \"\\n\"\n );\n}\n\nexport async function scaffoldProject({\n projectName,\n template,\n targetDir,\n}: ScaffoldOptions): Promise<void> {\n const today = new Date().toISOString().slice(0, 10);\n const specsDir = join(targetDir, \"specs\");\n\n // Create specs/ directory\n await mkdir(specsDir, { recursive: true });\n\n // Create extra template dirs (e.g., bmad needs stories/ and adr/)\n for (const extraDir of TEMPLATE_EXTRA_DIRS[template]) {\n await mkdir(join(targetDir, extraDir), { recursive: true });\n }\n\n const specs = TEMPLATE_SPECS[template];\n\n // Write spec files\n for (const { filename, type } of specs) {\n const content = buildSpecFile(filename, type, projectName, today);\n await writeFile(join(specsDir, filename), content, \"utf-8\");\n }\n\n // Write spec.config.yaml\n const configContent = buildConfigYaml(projectName, specs);\n await writeFile(join(targetDir, \"spec.config.yaml\"), configContent, \"utf-8\");\n}\n\nexport default defineCommand({\n meta: {\n name: \"init\",\n description: \"Initialize a new specdx project with spec scaffolding\",\n },\n args: {\n name: {\n type: \"string\",\n description: \"Project name\",\n required: true,\n },\n template: {\n type: \"string\",\n description: \"Template to use (lightweight, bmad, api-first)\",\n default: \"lightweight\",\n },\n dir: {\n type: \"string\",\n description: \"Target directory\",\n default: \".\",\n },\n },\n async run({ args }) {\n const { name, template, dir } = args;\n const validTemplates: Template[] = [\"lightweight\", \"bmad\", \"api-first\", \"quick\", \"context\"];\n if (!validTemplates.includes(template as Template)) {\n console.error(`Unknown template: ${template}. Choose from: ${validTemplates.join(\", \")}`);\n process.exit(1);\n }\n console.log(`Scaffolding \"${name}\" with template \"${template}\" in ${dir}...`);\n await scaffoldProject({ projectName: name, template: template as Template, targetDir: dir });\n console.log(`Done! Project \"${name}\" scaffolded successfully.`);\n },\n});\n"],"mappings":";;;;;;;AACA,SAAS,iBAAAA,gBAAe,eAAe;;;ACDvC;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,QAAU;AAAA,EACV,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,IACP,WAAa;AAAA,EACf;AAAA,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,SAAW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OAAO,uBAAuB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IACpE,OAAO,MAAM,OAAO,qBAAqB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAChE,OAAO,MAAM,OAAO,qBAAqB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAChE,QAAQ,MAAM,OAAO,sBAAsB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAClE,UAAU,MAAM,OAAO,wBAAwB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IACtE,SAAS,MAAM,OAAO,uBAAuB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IACpE,KAAK,MAAM,OAAO,mBAAmB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EAC9D;AACF,CAAC;AAED,QAAQ,IAAI,EAAE,MAAM,CAAC,QAAe;AAClC,UAAQ,MAAM;AAAA,WAAS,IAAI,OAAO;AAAA,CAAI;AACtC,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["defineCommand","defineCommand"]}
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: specdx-author-spec
3
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
4
+ allowed-tools: Bash(npx specdx:*) Read Write Edit
5
5
  ---
6
6
 
7
7
  # Author a Spec
@@ -10,20 +10,24 @@ This skill follows a 3-step workflow. Load each step file as you reach it — th
10
10
 
11
11
  ## Steps
12
12
 
13
- 1. **Frontmatter** — Read `specdx-author-spec/step-01-frontmatter.md` next to this file
13
+ 1. **Frontmatter** — Read `references/step-01-frontmatter.md`
14
14
  - Determine spec type, check existing specs, create file with frontmatter
15
15
 
16
- 2. **Sections** — Read `specdx-author-spec/step-02-sections.md`
16
+ 2. **Sections** — Read `references/step-02-sections.md`
17
17
  - Write sections one at a time, lint after every 2-3 sections
18
18
  - HARD GATE: Do NOT skip lint between sections
19
19
 
20
- 3. **Finalize** — Read `specdx-author-spec/step-03-finalize.md`
20
+ 3. **Finalize** — Read `references/step-03-finalize.md`
21
21
  - Register in spec.config.yaml, run final validation
22
22
 
23
23
  ## How to use
24
24
 
25
- Start by reading `specdx-author-spec/step-01-frontmatter.md` (relative to this file's directory). Complete that step fully before moving to step 2.
25
+ Start by reading `references/step-01-frontmatter.md` (relative to this file). Complete that step fully before moving to step 2.
26
26
 
27
27
  Each step file is self-contained with its own instructions. Do NOT read ahead — load one step at a time.
28
28
 
29
- For detailed reference on spec types and their fields, see `spec-type-reference.md` in this directory.
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 — `sdx lint` will now flag placeholder sections, so an empty pass means real content.
@@ -19,7 +19,7 @@ Ask what kind of spec they need:
19
19
  | `adr` | Recording a decision | Context, Decision, Status, Consequences |
20
20
  | `api-contract` | Defining an API | Endpoints, Request/Response Schemas, Auth, Error Codes |
21
21
 
22
- For detailed guidance on each type, read `spec-type-reference.md` in the parent directory.
22
+ For detailed guidance on each type, read `spec-type-reference.md` in this directory.
23
23
 
24
24
  ## Check existing specs
25
25
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: specdx-onboard
3
3
  description: "Use when a new developer joins the project, asks 'what is this project', 'explain the specs', 'how does this codebase work', 'what specs exist', or wants an overview of the spec suite. Provides a guided tour of the project's specs."
4
- allowed-tools: Bash(npx specdx *)
4
+ allowed-tools: Bash(npx specdx:*)
5
5
  ---
6
6
 
7
7
  # Onboard — Spec Suite Overview
@@ -47,3 +47,7 @@ Guide the developer through:
47
47
  - If a spec is marked `draft`, note that it's tentative and may change
48
48
  - If a spec is marked `superseded`, briefly mention what replaced it
49
49
  - Use the dependency graph to explain why specs exist (e.g. "The test plan depends on the technical design because test cases reference the API endpoints defined there")
50
+
51
+ ## It's working if
52
+
53
+ The reader can name what the project is for, which specs are authoritative, and where to look next — without opening a spec file. If your summary is a restatement of the spec list, it has not oriented anyone.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: specdx-plan-from-spec
3
3
  description: "Use when the user asks to plan implementation, create a plan from specs, or says 'how should I build this', 'plan this', 'create an implementation plan', or 'what's the approach'. Generates a step-by-step plan grounded in project specs."
4
- allowed-tools: Bash(npx specdx *)
4
+ allowed-tools: Bash(npx specdx:*)
5
5
  ---
6
6
 
7
7
  # Plan From Spec
@@ -70,3 +70,7 @@ If the user doesn't have superpowers, use a simpler numbered list format.
70
70
  2. **Flag gaps** — if the task needs decisions not covered by any spec, say so
71
71
  3. **Respect non-goals** — if the PRD says "not X", don't plan for X
72
72
  4. **Note risks** — if the technical design lists risks relevant to the task, address them in the plan
73
+
74
+ ## It's working if
75
+
76
+ Every step traces to a spec section or is explicitly flagged as a gap the specs do not cover. A plan with steps that trace to neither is invention, not planning.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: specdx-pre-commit
3
3
  description: "Use when the user is about to commit, mentions committing, or says 'let's commit', 'ready to commit', 'wrap up', or 'commit this'. Checks spec health and flags drift before committing."
4
- allowed-tools: Bash(npx specdx *)
4
+ allowed-tools: Bash(npx specdx:*)
5
5
  ---
6
6
 
7
7
  # Pre-Commit Spec Check
@@ -64,3 +64,7 @@ Respect the user's decision either way.
64
64
  | "I already ran lint earlier" | Specs may have changed since. Run it again. |
65
65
  | "The diff command failed, so skip everything" | Report the lint results at minimum. |
66
66
  | "`specdx diff` said no changes, so we're clear" | Without `--working` it never looked at the working tree. Re-run with the flag. |
67
+
68
+ ## It's working if
69
+
70
+ You ran `specdx diff --working` and can state which specs changed, or that none did. If you said "safe to commit" from a run that never looked at the working tree, the check reported on the wrong thing.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: specdx-review-spec
3
3
  description: "Use when the user asks to review a spec, says 'is this spec good enough', 'review my spec', 'check spec quality', or 'audit this spec'. Runs multi-layer spec quality review."
4
- allowed-tools: Bash(npx specdx *), Read, Agent
4
+ allowed-tools: Bash(npx specdx:*) Read Agent
5
5
  ---
6
6
 
7
7
  # Review Spec Quality
@@ -75,3 +75,7 @@ Do NOT skip any of the three review passes. Each catches different classes of pr
75
75
  | "Three passes is overkill for a small spec" | Small specs have the most gaps. Run all three. |
76
76
  | "The completeness pass already found issues, so skip the rest" | Consistency and adversarial reviews find different issues. |
77
77
  | "I can combine the passes into one review" | Separate passes with different prompts catch more. |
78
+
79
+ ## It's working if
80
+
81
+ Each of the three passes produced at least one finding, or you can say precisely why it found nothing. Three clean passes on a first-draft spec usually means the passes were not adversarial.
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: specdx-router
3
+ description: Ask which specdx workflow fits your situation. A map over the spec-driven flow — authoring, planning, implementing, verifying, shipping — and where the human decisions sit.
4
+ disable-model-invocation: true
5
+ allowed-tools: Bash(npx specdx:*)
6
+ ---
7
+
8
+ # Which specdx workflow fits?
9
+
10
+ You describe where you are. This names the workflow and the next thing to run.
11
+
12
+ It recommends and stops. It does not author a spec, build a plan, or fire the
13
+ skill it names — what you get back is the next thing to type.
14
+
15
+ ## The main flow
16
+
17
+ Idea → spec → plan → implement → verify → commit. Most work enters at step 1
18
+ or step 3.
19
+
20
+ | Step | Skill | The decision it leaves you |
21
+ |---|---|---|
22
+ | 1. Capture intent | `specdx-author-spec` | Which spec type, and whether this needs a spec at all |
23
+ | 2. Quality-gate the spec | `specdx-review-spec` | Whether the spec is concrete enough to build from |
24
+ | 3. Load context | `specdx-start-task` | Nothing — run it before every coding session |
25
+ | 4. Plan the build | `specdx-plan-from-spec` | Slice order, and what to defer |
26
+ | 5. Ship it | `specdx-pre-commit` | Whether downstream specs get updated now or later |
27
+
28
+ ## Route by situation
29
+
30
+ | Where you are | What to reach for |
31
+ |---|---|
32
+ | New to this repo, don't know what the specs say | `specdx-onboard` |
33
+ | About to write code | `specdx-start-task` — always, before the first edit |
34
+ | An idea that isn't written down yet | `specdx-author-spec` |
35
+ | A spec exists but feels vague | `specdx-review-spec` |
36
+ | A spec is solid, need an approach | `specdx-plan-from-spec` |
37
+ | About to commit | `specdx-pre-commit` |
38
+ | Reporting progress to other people | `specdx-sprint-review` |
39
+ | Wondering if the code still matches the specs | `specdx-verify` (experimental) |
40
+ | Wondering if the specs still match the code | `specdx-check-drift` (experimental) |
41
+
42
+ The last two are experimental: they are built on `sdx check`, whose static
43
+ analysis is noisy on prose-heavy specs. Treat their findings as prompts to look,
44
+ not as failures.
45
+
46
+ ## Distinctions that are easy to get wrong
47
+
48
+ - **`specdx-start-task` vs `specdx-plan-from-spec`** — turns on whether you know
49
+ the approach. `start-task` loads context so you can begin. `plan-from-spec`
50
+ decides the order of work first. A one-file change needs the former only.
51
+ - **`specdx-verify` vs `specdx-check-drift`** — turns on which side you suspect.
52
+ `verify` asks "did I build what the spec said". `check-drift` asks "have the
53
+ specs fallen behind the code".
54
+ - **`specdx-review-spec` vs `sdx lint`** — turns on what kind of problem.
55
+ `lint` catches structural and mechanical faults. `review-spec` judges whether
56
+ the content is decision-ready.
57
+
58
+ ## When you don't need any of this
59
+
60
+ A typo fix, a dependency bump, a rename with no behaviour change. Spec context
61
+ costs tokens and attention; spend it where intent is genuinely at stake.
62
+
63
+ ## It's working if
64
+
65
+ You leave knowing the single next command to type, and why the neighbouring
66
+ skill was not it. If two skills still look interchangeable after reading this,
67
+ the router has failed — say so, because that is a bug in this file.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: specdx-sprint-review
3
3
  description: "Use when the user asks for a summary, sprint review, spec health report, progress update, or says 'how are specs looking', 'spec health', or 'what changed'. Generates a shareable spec health report."
4
- allowed-tools: Bash(npx specdx *)
4
+ allowed-tools: Bash(npx specdx:*)
5
5
  ---
6
6
 
7
7
  # Sprint Review — Spec Health Report
@@ -67,3 +67,7 @@ The `diff --format json` output looks like:
67
67
  "summary": "1 spec changed, 1 downstream affected"
68
68
  }
69
69
  ```
70
+
71
+ ## It's working if
72
+
73
+ Someone who did not attend the work can read the report and know the suite's health and what changed. If `diff` was unavailable, the report says so rather than implying nothing changed.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: specdx-start-task
3
3
  description: Use when the user describes work they're about to do, mentions implementing a feature, asks to start a task, or says 'implement', 'build', 'add', 'fix', or 'refactor'. Loads relevant spec context before coding.
4
- allowed-tools: Bash(npx specdx *)
4
+ allowed-tools: Bash(npx specdx:*)
5
5
  ---
6
6
 
7
7
  # Load Spec Context
@@ -56,3 +56,7 @@ For the rest of the session:
56
56
  2. **Flag drift** — if the code or the user's request contradicts a spec, surface it clearly. Do NOT silently ignore contradictions.
57
57
  3. **Note gaps** — if the task needs decisions not covered by any spec, say so
58
58
  4. **Respect status** — `approved` specs are current truth; `draft` specs are tentative; `superseded` specs show as collapsed one-liners
59
+
60
+ ## It's working if
61
+
62
+ You can name the specs governing the task and any constraint they impose, before the first edit. If `pack` returned no specs, that is a signal to check the task wording — not a licence to code without context.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: specdx-check-drift
3
3
  description: "[experimental — built on sdx check, whose static analysis can be noisy] Use when the user says 'check drift', 'did I drift from spec', 'am I still aligned', or as part of a pre-commit check. Compares recent code changes against spec definitions."
4
- allowed-tools: Bash(npx specdx *), Read
4
+ allowed-tools: Bash(npx specdx:*) Read
5
5
  ---
6
6
 
7
7
  # Check Spec Drift
@@ -71,3 +71,7 @@ For each drift:
71
71
  | "No specs changed, so no drift" | Code can drift even when specs don't change. Run the check. |
72
72
  | "The check score is high enough" | Even 95% means 5% drift. Review the findings. |
73
73
  | "I'll check drift later" | Drift compounds. Check now. |
74
+
75
+ ## It's working if
76
+
77
+ You can say, for each finding, whether the code or the spec should change. A list of findings with no direction is a report, not a drift check.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: specdx-verify
3
3
  description: "[experimental — built on sdx check, whose static analysis can be noisy] Use when the user says 'verify', 'check against spec', 'does this match the spec', 'review implementation', or after completing a feature. Runs spec-to-implementation analysis and reviews findings."
4
- allowed-tools: Bash(npx specdx *), Read
4
+ allowed-tools: Bash(npx specdx:*) Read
5
5
  ---
6
6
 
7
7
  # Verify Implementation Against Specs
@@ -79,3 +79,7 @@ Do NOT skip Step 1. Always run `npx specdx check` before reviewing. Do not rely
79
79
  | "There are too many findings to review" | Group by category, prioritize errors over warnings. Review all errors. |
80
80
  | "The check failed, so skip it" | Report the failure. Partial results are still valuable. |
81
81
  | "The user didn't ask for verification" | If you just finished implementing, verify. It's part of the job. |
82
+
83
+ ## It's working if
84
+
85
+ Every error-level finding is either resolved or consciously accepted with a reason. Warnings from prose-heavy test plans are expected noise — say so rather than treating the score as a grade.
@@ -4,22 +4,26 @@ import "./chunk-5WRI5ZAA.js";
4
4
  import { defineCommand } from "citty";
5
5
 
6
6
  // ../skills/dist/install.js
7
- import { mkdir, writeFile, readFile, stat } from "fs/promises";
7
+ import { mkdir, writeFile, readFile, stat, readdir } from "fs/promises";
8
8
  import { statSync } from "fs";
9
- import { join, dirname } from "path";
9
+ import { join, dirname, relative } from "path";
10
10
  import { fileURLToPath } from "url";
11
11
  var __dirname = dirname(fileURLToPath(import.meta.url));
12
- var SKILL_NAMES = [
12
+ var CORE_SKILL_NAMES = [
13
+ "specdx-router",
13
14
  "specdx-start-task",
14
15
  "specdx-author-spec",
15
16
  "specdx-pre-commit",
16
17
  "specdx-sprint-review",
17
18
  "specdx-plan-from-spec",
18
19
  "specdx-onboard",
19
- "specdx-verify",
20
- "specdx-review-spec",
21
- "specdx-check-drift"
20
+ "specdx-review-spec"
22
21
  ];
22
+ var EXPERIMENTAL_SKILL_NAMES = ["specdx-verify", "specdx-check-drift"];
23
+ var SKILL_NAMES = [...CORE_SKILL_NAMES, ...EXPERIMENTAL_SKILL_NAMES];
24
+ function bucketOf(skillName) {
25
+ return EXPERIMENTAL_SKILL_NAMES.includes(skillName) ? "experimental" : "core";
26
+ }
23
27
  function getSkillSourceDir() {
24
28
  const bundledPath = join(__dirname, "skills");
25
29
  try {
@@ -29,23 +33,40 @@ function getSkillSourceDir() {
29
33
  return join(__dirname, "..", "skills");
30
34
  }
31
35
  }
32
- async function installSkills(projectDir) {
36
+ async function filesUnder(dir, base = dir) {
37
+ const entries = await readdir(dir, { withFileTypes: true });
38
+ const files = [];
39
+ for (const entry of entries) {
40
+ const full = join(dir, entry.name);
41
+ if (entry.isDirectory()) {
42
+ files.push(...await filesUnder(full, base));
43
+ } else {
44
+ files.push(relative(base, full));
45
+ }
46
+ }
47
+ return files;
48
+ }
49
+ async function installSkills(projectDir, options = {}) {
33
50
  const sourceDir = getSkillSourceDir();
34
- const commandsDir = join(projectDir, ".claude", "commands");
51
+ const skillsDir = join(projectDir, ".claude", "skills");
35
52
  const installed = [];
36
53
  const updated = [];
37
- await mkdir(commandsDir, { recursive: true });
38
- for (const skillName of SKILL_NAMES) {
39
- const sourcePath = join(sourceDir, `${skillName}.md`);
40
- const targetPath = join(commandsDir, `${skillName}.md`);
41
- const content = await readFile(sourcePath, "utf-8");
54
+ await mkdir(skillsDir, { recursive: true });
55
+ const names = options.experimental ? SKILL_NAMES : CORE_SKILL_NAMES;
56
+ for (const skillName of names) {
57
+ const sourcePath = join(sourceDir, bucketOf(skillName), skillName);
58
+ const targetPath = join(skillsDir, skillName);
42
59
  let exists = false;
43
60
  try {
44
- await stat(targetPath);
61
+ await stat(join(targetPath, "SKILL.md"));
45
62
  exists = true;
46
63
  } catch {
47
64
  }
48
- await writeFile(targetPath, content, "utf-8");
65
+ for (const file of await filesUnder(sourcePath)) {
66
+ const target = join(targetPath, file);
67
+ await mkdir(dirname(target), { recursive: true });
68
+ await writeFile(target, await readFile(join(sourcePath, file), "utf-8"), "utf-8");
69
+ }
49
70
  if (exists) {
50
71
  updated.push(skillName);
51
72
  } else {
@@ -66,11 +87,16 @@ var skills_default = defineCommand({
66
87
  type: "string",
67
88
  description: "Target directory (default: current directory)",
68
89
  default: "."
90
+ },
91
+ experimental: {
92
+ type: "boolean",
93
+ description: "Also install experimental skills (built on the experimental check command)",
94
+ default: false
69
95
  }
70
96
  },
71
97
  async run({ args }) {
72
98
  try {
73
- const result = await installSkills(args.dir);
99
+ const result = await installSkills(args.dir, { experimental: args.experimental });
74
100
  if (result.installed.length === 0 && result.updated.length === 0) {
75
101
  console.log(" No skill files to install.");
76
102
  return;
@@ -78,7 +104,7 @@ var skills_default = defineCommand({
78
104
  for (const file of result.installed) console.log(` \u2713 Installed ${file}`);
79
105
  for (const file of result.updated) console.log(` \u2713 Updated ${file}`);
80
106
  console.log(`
81
- Skills installed to .claude/commands/`);
107
+ Skills installed to .claude/skills/`);
82
108
  } catch (err) {
83
109
  console.error(`
84
110
  \u2717 ${err.message}
@@ -92,4 +118,4 @@ var skills_default = defineCommand({
92
118
  export {
93
119
  skills_default as default
94
120
  };
95
- //# sourceMappingURL=skills-EQTVRLER.js.map
121
+ //# sourceMappingURL=skills-IKRQ3IZP.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 experimental: {\n type: \"boolean\",\n description: \"Also install experimental skills (built on the experimental check command)\",\n default: false,\n },\n },\n async run({ args }) {\n try {\n const result = await installSkills(args.dir, { experimental: args.experimental });\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/skills/`);\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, readdir } from \"node:fs/promises\";\nimport { statSync } from \"node:fs\";\nimport { join, dirname, relative } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n/**\n * Promoted skills — the set the Claude Code plugin ships and `skills install`\n * writes by default.\n *\n * Promotion is the directory a skill lives in, not an adjective in its\n * description. A string is easy to drift past; a folder is not.\n */\nexport const CORE_SKILL_NAMES = [\n \"specdx-router\",\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-review-spec\",\n];\n\n/** Skills built on `sdx check`, whose static analysis is noisy on prose specs. */\nexport const EXPERIMENTAL_SKILL_NAMES = [\"specdx-verify\", \"specdx-check-drift\"];\n\n/** Every skill that ships, promoted or not. */\nexport const SKILL_NAMES = [...CORE_SKILL_NAMES, ...EXPERIMENTAL_SKILL_NAMES];\n\n/** Bucket directory a skill lives in, under the skills root. */\nexport function bucketOf(skillName: string): \"core\" | \"experimental\" {\n return EXPERIMENTAL_SKILL_NAMES.includes(skillName) ? \"experimental\" : \"core\";\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\n/** Every file under a directory, as paths relative to it. */\nasync function filesUnder(dir: string, base = dir): Promise<string[]> {\n const entries = await readdir(dir, { withFileTypes: true });\n const files: string[] = [];\n for (const entry of entries) {\n const full = join(dir, entry.name);\n if (entry.isDirectory()) {\n files.push(...(await filesUnder(full, base)));\n } else {\n files.push(relative(base, full));\n }\n }\n return files;\n}\n\n/**\n * Install skills into a project's `.claude/skills/`.\n *\n * The Agent Skills specification defines a skill as a *directory* containing a\n * `SKILL.md`, so the whole directory is copied -- `references/` and any other\n * bundled resources included. Skills previously shipped as flat files under\n * `.claude/commands/`, which made them slash commands rather than skills.\n */\nexport interface InstallOptions {\n /** Include experimental skills. Off by default: only promoted skills ship. */\n experimental?: boolean;\n}\n\nexport async function installSkills(\n projectDir: string,\n options: InstallOptions = {},\n): Promise<InstallResult> {\n const sourceDir = getSkillSourceDir();\n const skillsDir = join(projectDir, \".claude\", \"skills\");\n const installed: string[] = [];\n const updated: string[] = [];\n\n await mkdir(skillsDir, { recursive: true });\n\n const names = options.experimental ? SKILL_NAMES : CORE_SKILL_NAMES;\n\n for (const skillName of names) {\n const sourcePath = join(sourceDir, bucketOf(skillName), skillName);\n const targetPath = join(skillsDir, skillName);\n\n let exists = false;\n try {\n await stat(join(targetPath, \"SKILL.md\"));\n exists = true;\n } catch {\n // Not installed yet\n }\n\n for (const file of await filesUnder(sourcePath)) {\n const target = join(targetPath, file);\n await mkdir(dirname(target), { recursive: true });\n await writeFile(target, await readFile(join(sourcePath, file), \"utf-8\"), \"utf-8\");\n }\n\n if (exists) {\n updated.push(skillName);\n } else {\n installed.push(skillName);\n }\n }\n\n return { installed, updated };\n}\n"],"mappings":";;;AAAA,SAAS,qBAAqB;;;ACA9B,SAAS,OAAO,WAAW,UAAU,MAAM,eAAe;AAC1D,SAAS,gBAAgB;AACzB,SAAS,MAAM,SAAS,gBAAgB;AACxC,SAAS,qBAAqB;AAE9B,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AASjD,IAAM,mBAAmB;EAC9B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAIK,IAAM,2BAA2B,CAAC,iBAAiB,oBAAoB;AAGvE,IAAM,cAAc,CAAC,GAAG,kBAAkB,GAAG,wBAAwB;AAGtE,SAAU,SAAS,WAAiB;AACxC,SAAO,yBAAyB,SAAS,SAAS,IAAI,iBAAiB;AACzE;AAOA,SAAS,oBAAiB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K,SAAS;IACxB,OAAO;AACL,gBAAU,KAAK,SAAS;IAC1B;EACF;AAEA,SAAO,EAAE,WAAW,QAAO;AAC7B;;;ADrHA,IAAO,iBAAQ,cAAc;AAAA,EAC3B,MAAM,EAAE,MAAM,UAAU,aAAa,2CAA2C;AAAA,EAChF,aAAa;AAAA,IACX,SAAS,cAAc;AAAA,MACrB,MAAM,EAAE,MAAM,WAAW,aAAa,kCAAkC;AAAA,MACxE,MAAM;AAAA,QACJ,KAAK;AAAA,UACH,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS;AAAA,QACX;AAAA,QACA,cAAc;AAAA,UACZ,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,KAAK,EAAE,cAAc,KAAK,aAAa,CAAC;AAChF,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,sCAAyC;AAAA,QACvD,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":[]}
package/hooks/hooks.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
- "hooks": [
3
- {
4
- "event": "SessionStart",
5
- "command": "./hooks/session-start"
6
- }
7
- ]
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "hooks": [
6
+ {
7
+ "type": "command",
8
+ "command": "\"${CLAUDE_PLUGIN_ROOT}\"/hooks/session-start"
9
+ }
10
+ ]
11
+ }
12
+ ]
13
+ }
8
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specdx",
3
- "version": "0.4.0-alpha.14",
3
+ "version": "0.4.0-alpha.16",
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",
@@ -64,13 +64,13 @@
64
64
  "tsup": "^8.5.1",
65
65
  "typescript": "^5.7.0",
66
66
  "@specdx/check": "0.0.0",
67
- "@specdx/core": "0.0.0",
68
67
  "@specdx/diff": "0.0.0",
69
- "@specdx/lint": "0.0.0",
68
+ "@specdx/core": "0.0.0",
70
69
  "@specdx/mcp": "0.0.0",
70
+ "@specdx/lint": "0.0.0",
71
71
  "@specdx/pack": "0.0.0",
72
- "@specdx/schema": "0.0.0",
73
- "@specdx/skills": "0.0.0"
72
+ "@specdx/skills": "0.0.0",
73
+ "@specdx/schema": "0.0.0"
74
74
  },
75
75
  "publishConfig": {
76
76
  "access": "public"
@@ -1 +0,0 @@
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"],"mappings":";;;AAAA,SAAS,qBAAqB;;;ACA9B,SAAS,OAAO,WAAW,UAAU,YAAY;AACjD,SAAS,gBAAgB;AACzB,SAAS,MAAM,eAAe;AAC9B,SAAS,qBAAqB;AAE9B,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC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