sdtk-spec-kit 0.3.11 → 0.3.13

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 (34) hide show
  1. package/assets/manifest/toolkit-bundle.manifest.json +79 -39
  2. package/assets/manifest/toolkit-bundle.sha256.txt +27 -19
  3. package/assets/toolkit/toolkit/AGENTS.md +1 -1
  4. package/assets/toolkit/toolkit/README.md +1 -1
  5. package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +1 -1
  6. package/assets/toolkit/toolkit/install.ps1 +347 -310
  7. package/assets/toolkit/toolkit/scripts/agents/run-claude-task.ps1 +52 -0
  8. package/assets/toolkit/toolkit/scripts/agents/run-codex-task.ps1 +44 -0
  9. package/assets/toolkit/toolkit/scripts/generate-code-handoff.ps1 +308 -246
  10. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +1 -1
  11. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +1 -1
  12. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +10 -0
  13. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +28 -4
  14. package/assets/toolkit/toolkit/skills/sdtk-mailbox-dispatch/SKILL.md +70 -0
  15. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +8 -0
  16. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +28 -0
  17. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +25 -0
  18. package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +9 -0
  19. package/assets/toolkit/toolkit/skills-claude/dev/SKILL.md +58 -57
  20. package/assets/toolkit/toolkit/skills-claude/mailbox-dispatch/SKILL.md +70 -0
  21. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +7 -0
  22. package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +29 -2
  23. package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +13 -2
  24. package/assets/toolkit/toolkit/templates/docs/dev/OPS_HANDOFF_CREATION_RULES.md +369 -0
  25. package/assets/toolkit/toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md +136 -0
  26. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_SDTK_CODE.md +34 -29
  27. package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +4 -0
  28. package/assets/toolkit/toolkit/templates/mailbox/AGENT_REPORT_TEMPLATE.md +46 -0
  29. package/assets/toolkit/toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md +59 -0
  30. package/package.json +48 -48
  31. package/src/commands/help.js +2 -0
  32. package/src/commands/init.js +108 -105
  33. package/src/lib/project-target-guard.js +53 -0
  34. package/src/lib/update.js +8 -1
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
- {
2
- "name": "sdtk-spec-kit",
3
- "version": "0.3.11",
4
- "description": "SDTK-SPEC CLI toolkit for deterministic software documentation workflows via the sdtk-spec command",
5
- "bin": {
6
- "sdtk-spec": "./bin/sdtk.js"
7
- },
8
- "main": "src/index.js",
9
- "type": "commonjs",
10
- "files": [
11
- "bin/",
12
- "src/",
13
- "assets/"
14
- ],
15
- "scripts": {
16
- "test": "npm run verify:payload && npm run pack:smoke",
17
- "build:payload": "powershell -ExecutionPolicy Bypass -File scripts/sync-toolkit-assets.ps1 && powershell -ExecutionPolicy Bypass -File scripts/build-toolkit-manifest.ps1",
18
- "verify:payload": "node -e \"require('./src/lib/toolkit-payload').verify()\"",
19
- "pack:smoke": "npm pack --dry-run",
20
- "pack:release": "npm pack",
21
- "prepublishOnly": "node -e \"require('./src/lib/toolkit-payload').verify()\""
22
- },
23
- "engines": {
24
- "node": ">=18.13.0"
25
- },
26
- "keywords": [
27
- "sdtk",
28
- "sdtk-spec",
29
- "sdtk-spec-kit",
30
- "cli",
31
- "documentation",
32
- "toolkit",
33
- "dockkit"
34
- ],
35
- "license": "MIT",
36
- "repository": {
37
- "type": "git",
38
- "url": "https://github.com/codexsdtk/sdtk-toolkit.git",
39
- "directory": "products/sdtk-spec/distribution/sdtk-spec-kit"
40
- },
41
- "homepage": "https://agenttoolkits.dev",
42
- "bugs": {
43
- "url": "https://github.com/codexsdtk/sdtk-toolkit/issues"
44
- },
45
- "publishConfig": {
46
- "access": "public"
47
- }
48
- }
1
+ {
2
+ "name": "sdtk-spec-kit",
3
+ "version": "0.3.13",
4
+ "description": "SDTK-SPEC CLI toolkit for deterministic software documentation workflows via the sdtk-spec command",
5
+ "bin": {
6
+ "sdtk-spec": "./bin/sdtk.js"
7
+ },
8
+ "main": "src/index.js",
9
+ "type": "commonjs",
10
+ "files": [
11
+ "bin/",
12
+ "src/",
13
+ "assets/"
14
+ ],
15
+ "scripts": {
16
+ "test": "npm run verify:payload && npm run pack:smoke",
17
+ "build:payload": "powershell -ExecutionPolicy Bypass -File scripts/sync-toolkit-assets.ps1 && powershell -ExecutionPolicy Bypass -File scripts/build-toolkit-manifest.ps1",
18
+ "verify:payload": "node -e \"require('./src/lib/toolkit-payload').verify()\"",
19
+ "pack:smoke": "npm pack --dry-run",
20
+ "pack:release": "npm pack",
21
+ "prepublishOnly": "node -e \"require('./src/lib/toolkit-payload').verify()\""
22
+ },
23
+ "engines": {
24
+ "node": ">=18.13.0"
25
+ },
26
+ "keywords": [
27
+ "sdtk",
28
+ "sdtk-spec",
29
+ "sdtk-spec-kit",
30
+ "cli",
31
+ "documentation",
32
+ "toolkit",
33
+ "dockkit"
34
+ ],
35
+ "license": "MIT",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/codexsdtk/sdtk-toolkit.git",
39
+ "directory": "products/sdtk-spec/distribution/sdtk-spec-kit"
40
+ },
41
+ "homepage": "https://agenttoolkits.dev",
42
+ "bugs": {
43
+ "url": "https://github.com/codexsdtk/sdtk-toolkit/issues"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ }
48
+ }
@@ -37,6 +37,8 @@ function cmdHelp() {
37
37
  " --skip-project-files Skip sdtk-spec init --force during update",
38
38
  " --skip-runtime-assets Skip runtime asset refresh during update",
39
39
  " --verbose Show detailed command output",
40
+ " Maintainer-root guard: init/update refuse the SDTK maintainer monorepo root as a managed project target.",
41
+ " Use a consumer project path, or use --skip-project-files when update should avoid project-file refresh.",
40
42
  "",
41
43
  "Runtime options:",
42
44
  " --runtime <codex|claude> Target runtime (required)",
@@ -1,105 +1,108 @@
1
- "use strict";
2
-
3
- const path = require("path");
4
- const { parseFlags, validateChoice } = require("../lib/args");
5
- const { verify, resolvePayloadFile } = require("../lib/toolkit-payload");
6
- const { runScript } = require("../lib/powershell");
7
- const { ValidationError } = require("../lib/errors");
8
- const { VALID_SCOPES, defaultScope, isProjectScopeSupported } = require("../lib/scope");
9
-
10
- const FLAG_DEFS = {
11
- runtime: { type: "string" },
12
- "project-path": { type: "string" },
13
- "runtime-scope": { type: "string" },
14
- force: { type: "boolean" },
15
- "skip-skills": { type: "boolean" },
16
- "skip-runtime-assets": { type: "boolean" },
17
- verbose: { type: "boolean" },
18
- };
19
-
20
- const VALID_RUNTIMES = ["codex", "claude"];
21
-
22
- async function cmdInit(args) {
23
- const { flags } = parseFlags(args, FLAG_DEFS);
24
-
25
- // Validate runtime
26
- const runtime = flags.runtime || "codex";
27
- validateChoice(runtime, VALID_RUNTIMES, "runtime");
28
-
29
- // Resolve scope
30
- const scope = flags["runtime-scope"] || defaultScope(runtime);
31
- validateChoice(scope, VALID_SCOPES, "runtime-scope");
32
-
33
- if (scope === "project" && !isProjectScopeSupported(runtime)) {
34
- throw new ValidationError(
35
- `${runtime} does not support project-local runtime assets. Use --runtime-scope user instead.`
36
- );
37
- }
38
-
39
- // Handle deprecated --skip-skills
40
- const skipAssets = flags["skip-runtime-assets"] || flags["skip-skills"];
41
- if (flags["skip-skills"] && !flags["skip-runtime-assets"]) {
42
- console.warn(
43
- "Warning: --skip-skills is deprecated. Use --skip-runtime-assets instead."
44
- );
45
- }
46
-
47
- // Resolve project path
48
- const projectPath = flags["project-path"]
49
- ? path.resolve(flags["project-path"])
50
- : process.cwd();
51
-
52
- // Verify payload integrity before proceeding
53
- verify();
54
-
55
- // Resolve bundled install.ps1
56
- const installScript = resolvePayloadFile("toolkit/install.ps1");
57
-
58
- // Build PowerShell parameters
59
- const params = {
60
- ProjectPath: projectPath,
61
- Runtime: runtime,
62
- Scope: scope,
63
- };
64
- if (flags.force) params.Force = true;
65
- if (skipAssets) params.SkipRuntimeAssets = true;
66
- if (!flags.verbose) params.Quiet = true;
67
-
68
- console.log(`Initializing SDTK-SPEC workspace...`);
69
- console.log(` Runtime: ${runtime}`);
70
- console.log(` Scope: ${scope}`);
71
- console.log(` Project: ${projectPath}`);
72
- if (runtime === "codex" && scope === "project") {
73
- console.log(` Codex home contract: ${path.join(projectPath, ".codex")}`);
74
- console.log(" Note: Launch Codex with CODEX_HOME=<project>/.codex to use project-local skills.");
75
- console.log(" Note: This CLI does not claim native .codex/skills auto-discovery.");
76
- }
77
- console.log("");
78
-
79
- const result = await runScript(installScript, params, { silent: !flags.verbose });
80
-
81
- if (result.exitCode !== 0) {
82
- if (result.stderr) {
83
- console.error(result.stderr);
84
- }
85
- throw new ValidationError(
86
- `Initialization failed (exit code ${result.exitCode}).`
87
- );
88
- }
89
-
90
- console.log("");
91
- console.log("SDTK-SPEC workspace initialized successfully.");
92
- if (runtime === "codex" && scope === "project") {
93
- console.log(`Project-local Codex skills were installed into ${path.join(projectPath, ".codex", "skills")}.`);
94
- console.log("Launch Codex with CODEX_HOME=<project>/.codex to activate that local runtime home.");
95
- }
96
- console.log("");
97
- console.log("Next steps:");
98
- console.log(" 1. Review and customize sdtk-spec.config.json for your project stack.");
99
- console.log(' 2. Run "sdtk-spec generate --feature-key <KEY> --feature-name <name>" to scaffold docs.');
100
- return 0;
101
- }
102
-
103
- module.exports = {
104
- cmdInit,
105
- };
1
+ "use strict";
2
+
3
+ const path = require("path");
4
+ const { parseFlags, validateChoice } = require("../lib/args");
5
+ const { verify, resolvePayloadFile } = require("../lib/toolkit-payload");
6
+ const { runScript } = require("../lib/powershell");
7
+ const { ValidationError } = require("../lib/errors");
8
+ const { VALID_SCOPES, defaultScope, isProjectScopeSupported } = require("../lib/scope");
9
+ const { assertProjectRefreshTargetAllowed } = require("../lib/project-target-guard");
10
+
11
+ const FLAG_DEFS = {
12
+ runtime: { type: "string" },
13
+ "project-path": { type: "string" },
14
+ "runtime-scope": { type: "string" },
15
+ force: { type: "boolean" },
16
+ "skip-skills": { type: "boolean" },
17
+ "skip-runtime-assets": { type: "boolean" },
18
+ verbose: { type: "boolean" },
19
+ };
20
+
21
+ const VALID_RUNTIMES = ["codex", "claude"];
22
+
23
+ async function cmdInit(args) {
24
+ const { flags } = parseFlags(args, FLAG_DEFS);
25
+
26
+ // Validate runtime
27
+ const runtime = flags.runtime || "codex";
28
+ validateChoice(runtime, VALID_RUNTIMES, "runtime");
29
+
30
+ // Resolve scope
31
+ const scope = flags["runtime-scope"] || defaultScope(runtime);
32
+ validateChoice(scope, VALID_SCOPES, "runtime-scope");
33
+
34
+ if (scope === "project" && !isProjectScopeSupported(runtime)) {
35
+ throw new ValidationError(
36
+ `${runtime} does not support project-local runtime assets. Use --runtime-scope user instead.`
37
+ );
38
+ }
39
+
40
+ // Handle deprecated --skip-skills
41
+ const skipAssets = flags["skip-runtime-assets"] || flags["skip-skills"];
42
+ if (flags["skip-skills"] && !flags["skip-runtime-assets"]) {
43
+ console.warn(
44
+ "Warning: --skip-skills is deprecated. Use --skip-runtime-assets instead."
45
+ );
46
+ }
47
+
48
+ // Resolve project path
49
+ const projectPath = flags["project-path"]
50
+ ? path.resolve(flags["project-path"])
51
+ : process.cwd();
52
+
53
+ assertProjectRefreshTargetAllowed("sdtk-spec", "init", projectPath);
54
+
55
+ // Verify payload integrity before proceeding
56
+ verify();
57
+
58
+ // Resolve bundled install.ps1
59
+ const installScript = resolvePayloadFile("toolkit/install.ps1");
60
+
61
+ // Build PowerShell parameters
62
+ const params = {
63
+ ProjectPath: projectPath,
64
+ Runtime: runtime,
65
+ Scope: scope,
66
+ };
67
+ if (flags.force) params.Force = true;
68
+ if (skipAssets) params.SkipRuntimeAssets = true;
69
+ if (!flags.verbose) params.Quiet = true;
70
+
71
+ console.log(`Initializing SDTK-SPEC workspace...`);
72
+ console.log(` Runtime: ${runtime}`);
73
+ console.log(` Scope: ${scope}`);
74
+ console.log(` Project: ${projectPath}`);
75
+ if (runtime === "codex" && scope === "project") {
76
+ console.log(` Codex home contract: ${path.join(projectPath, ".codex")}`);
77
+ console.log(" Note: Launch Codex with CODEX_HOME=<project>/.codex to use project-local skills.");
78
+ console.log(" Note: This CLI does not claim native .codex/skills auto-discovery.");
79
+ }
80
+ console.log("");
81
+
82
+ const result = await runScript(installScript, params, { silent: !flags.verbose });
83
+
84
+ if (result.exitCode !== 0) {
85
+ if (result.stderr) {
86
+ console.error(result.stderr);
87
+ }
88
+ throw new ValidationError(
89
+ `Initialization failed (exit code ${result.exitCode}).`
90
+ );
91
+ }
92
+
93
+ console.log("");
94
+ console.log("SDTK-SPEC workspace initialized successfully.");
95
+ if (runtime === "codex" && scope === "project") {
96
+ console.log(`Project-local Codex skills were installed into ${path.join(projectPath, ".codex", "skills")}.`);
97
+ console.log("Launch Codex with CODEX_HOME=<project>/.codex to activate that local runtime home.");
98
+ }
99
+ console.log("");
100
+ console.log("Next steps:");
101
+ console.log(" 1. Review and customize sdtk-spec.config.json for your project stack.");
102
+ console.log(' 2. Run "sdtk-spec generate --feature-key <KEY> --feature-name <name>" to scaffold docs.');
103
+ return 0;
104
+ }
105
+
106
+ module.exports = {
107
+ cmdInit,
108
+ };
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ const { ValidationError } = require("./errors");
6
+
7
+ const MAINTAINER_ROOT_MARKERS = [
8
+ "governance/ai/core/IMPROVEMENT_BACKLOG.md",
9
+ "products/sdtk-spec/toolkit/install.ps1",
10
+ ];
11
+ const PROTECTED_FILES = [
12
+ "AGENTS.md",
13
+ "CODEX.md",
14
+ "CLAUDE.md",
15
+ "sdtk-spec.config.json",
16
+ "sdtk-spec.config.profiles.example.json"
17
+ ];
18
+
19
+ function isMaintainerRoot(projectPath) {
20
+ const resolved = path.resolve(projectPath);
21
+ return MAINTAINER_ROOT_MARKERS.every((marker) => fs.existsSync(path.join(resolved, marker)));
22
+ }
23
+
24
+ function buildMaintainerRootMessage(cliName, action, projectPath) {
25
+ const lines = [
26
+ `Refusing to refresh managed project files into the SDTK maintainer repo root: ${projectPath}`,
27
+ `The ${action} flow would overwrite repo-owned files such as ${PROTECTED_FILES.join(", ")}.`,
28
+ "Target a consumer project path instead of the SDTK maintainer monorepo root.",
29
+ ];
30
+
31
+ if (action === "update") {
32
+ lines.push(`If you only need package/runtime refresh, rerun ${cliName} update with --skip-project-files.`);
33
+ } else {
34
+ lines.push(`If you only need runtime assets, use ${cliName} runtime install against the desired consumer project path instead of ${cliName} init.`);
35
+ }
36
+
37
+ return lines.join("\n");
38
+ }
39
+
40
+ function assertProjectRefreshTargetAllowed(cliName, action, projectPath) {
41
+ if (!isMaintainerRoot(projectPath)) {
42
+ return;
43
+ }
44
+
45
+ throw new ValidationError(buildMaintainerRootMessage(cliName, action, projectPath));
46
+ }
47
+
48
+ module.exports = {
49
+ assertProjectRefreshTargetAllowed,
50
+ buildMaintainerRootMessage,
51
+ isMaintainerRoot,
52
+ };
53
+
package/src/lib/update.js CHANGED
@@ -5,6 +5,7 @@ const { spawn } = require("child_process");
5
5
  const { parseFlags, validateChoice } = require("./args");
6
6
  const { CliError, DependencyError, ValidationError } = require("./errors");
7
7
  const { VALID_SCOPES, defaultScope, isProjectScopeSupported } = require("./scope");
8
+ const { assertProjectRefreshTargetAllowed } = require("./project-target-guard");
8
9
 
9
10
  const PACKAGE_NAME = "sdtk-spec-kit";
10
11
  const CLI_NAME = "sdtk-spec";
@@ -231,11 +232,17 @@ function parseUpdateOptions(args) {
231
232
  }
232
233
  }
233
234
 
235
+ const projectPath = path.resolve(flags["project-path"] || process.cwd());
236
+
237
+ if (runtime && !flags["skip-project-files"]) {
238
+ assertProjectRefreshTargetAllowed("sdtk-spec", "update", projectPath);
239
+ }
240
+
234
241
  return {
235
242
  requestedVersion,
236
243
  runtime,
237
244
  scope,
238
- projectPath: path.resolve(flags["project-path"] || process.cwd()),
245
+ projectPath,
239
246
  checkOnly: flags["check-only"],
240
247
  skipProjectFiles: flags["skip-project-files"],
241
248
  skipRuntimeAssets: flags["skip-runtime-assets"],