sdtk-code-kit 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +201 -201
  2. package/assets/manifest/toolkit-bundle.manifest.json +147 -147
  3. package/assets/manifest/toolkit-bundle.sha256.txt +28 -28
  4. package/assets/toolkit/toolkit/AGENTS.md +219 -219
  5. package/assets/toolkit/toolkit/install.ps1 +156 -156
  6. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +78 -78
  7. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +150 -150
  8. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +62 -62
  9. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +82 -82
  10. package/assets/toolkit/toolkit/sdtk-spec.config.json +6 -6
  11. package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +12 -12
  12. package/assets/toolkit/toolkit/skills/code-brainstorm/SKILL.md +55 -55
  13. package/assets/toolkit/toolkit/skills/code-debug/SKILL.md +296 -296
  14. package/assets/toolkit/toolkit/skills/code-debug/references/root-cause-tracing.md +68 -68
  15. package/assets/toolkit/toolkit/skills/code-discover/SKILL.md +54 -54
  16. package/assets/toolkit/toolkit/skills/code-execute/SKILL.md +74 -74
  17. package/assets/toolkit/toolkit/skills/code-finish/SKILL.md +205 -205
  18. package/assets/toolkit/toolkit/skills/code-parallel/SKILL.md +64 -64
  19. package/assets/toolkit/toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md +26 -26
  20. package/assets/toolkit/toolkit/skills/code-parallel/references/implementer-prompt.md +113 -113
  21. package/assets/toolkit/toolkit/skills/code-parallel/references/spec-reviewer-prompt.md +61 -61
  22. package/assets/toolkit/toolkit/skills/code-plan/SKILL.md +85 -85
  23. package/assets/toolkit/toolkit/skills/code-review/SKILL.md +79 -79
  24. package/assets/toolkit/toolkit/skills/code-review/references/checklist.md +125 -125
  25. package/assets/toolkit/toolkit/skills/code-review/references/code-reviewer.md +146 -146
  26. package/assets/toolkit/toolkit/skills/code-ship/SKILL.md +52 -52
  27. package/assets/toolkit/toolkit/skills/code-tdd/SKILL.md +378 -378
  28. package/assets/toolkit/toolkit/skills/code-tdd/references/testing-anti-patterns.md +299 -299
  29. package/assets/toolkit/toolkit/skills/code-verify/SKILL.md +144 -144
  30. package/assets/toolkit/toolkit/skills/code-worktree/SKILL.md +228 -228
  31. package/assets/toolkit/toolkit/templates/CODE_WORKFLOW_TEMPLATE.md +140 -140
  32. package/bin/sdtk-code.js +14 -14
  33. package/package.json +44 -44
  34. package/src/commands/build.js +53 -53
  35. package/src/commands/doctor.js +51 -51
  36. package/src/commands/generate.js +11 -11
  37. package/src/commands/guardrails.js +215 -123
  38. package/src/commands/help.js +244 -244
  39. package/src/commands/init.js +98 -98
  40. package/src/commands/plan.js +53 -53
  41. package/src/commands/readiness.js +77 -77
  42. package/src/commands/resume.js +61 -61
  43. package/src/commands/runtime.js +224 -224
  44. package/src/commands/ship.js +59 -59
  45. package/src/commands/sleep.js +132 -0
  46. package/src/commands/start.js +89 -89
  47. package/src/commands/status.js +77 -77
  48. package/src/commands/update.js +11 -11
  49. package/src/commands/verify.js +71 -71
  50. package/src/index.js +108 -104
  51. package/src/lib/args.js +107 -107
  52. package/src/lib/errors.js +41 -41
  53. package/src/lib/powershell.js +65 -65
  54. package/src/lib/project-target-guard.js +53 -53
  55. package/src/lib/scope.js +72 -72
  56. package/src/lib/ship-readiness.js +281 -281
  57. package/src/lib/sleep-plan.js +175 -0
  58. package/src/lib/sleep-report.js +229 -0
  59. package/src/lib/toolkit-payload.js +72 -72
  60. package/src/lib/trust-events.js +166 -166
  61. package/src/lib/trust-file-scope.js +154 -154
  62. package/src/lib/trust-policy.js +212 -212
  63. package/src/lib/trust-redact.js +35 -35
  64. package/src/lib/trust-trace.js +179 -179
  65. package/src/lib/update.js +344 -344
  66. package/src/lib/workflow-artifact.js +503 -503
  67. package/src/lib/workflow-build.js +127 -127
  68. package/src/lib/workflow-doctor.js +83 -83
  69. package/src/lib/workflow-handoff.js +1029 -1029
  70. package/src/lib/workflow-intake.js +101 -101
  71. package/src/lib/workflow-plan.js +193 -193
  72. package/src/lib/workflow-review-packet.js +650 -650
  73. package/src/lib/workflow-ship.js +213 -213
  74. package/src/lib/workflow-state.js +438 -438
  75. package/src/lib/workflow-verify.js +393 -393
package/src/index.js CHANGED
@@ -1,104 +1,108 @@
1
- "use strict";
2
-
3
- const { cmdBuild } = require("./commands/build");
4
- const { cmdDoctor } = require("./commands/doctor");
5
- const { cmdGuardrails } = require("./commands/guardrails");
6
- const { cmdHelp } = require("./commands/help");
7
- const { cmdReadiness } = require("./commands/readiness");
8
- const { cmdInit } = require("./commands/init");
9
- const { cmdPlan } = require("./commands/plan");
10
- const { cmdResume } = require("./commands/resume");
11
- const { cmdRuntime } = require("./commands/runtime");
12
- const { cmdShip } = require("./commands/ship");
13
- const { cmdStart } = require("./commands/start");
14
- const { cmdStatus } = require("./commands/status");
15
- const { cmdUpdate } = require("./commands/update");
16
- const { cmdVerify } = require("./commands/verify");
17
- const { ValidationError } = require("./lib/errors");
18
-
19
- function getVersion() {
20
- const pkg = require("../package.json");
21
- return pkg.version;
22
- }
23
-
24
- function parseCommand(argv) {
25
- if (!argv || argv.length === 0) {
26
- return { command: "help", args: [] };
27
- }
28
-
29
- const [first, ...rest] = argv;
30
- if (first === "-h" || first === "--help") {
31
- return { command: "help", args: [] };
32
- }
33
- if (first === "-v" || first === "--version") {
34
- return { command: "version", args: [] };
35
- }
36
-
37
- return { command: first, args: rest };
38
- }
39
-
40
- const COMMANDS = new Set([
41
- "help",
42
- "version",
43
- "init",
44
- "runtime",
45
- "start",
46
- "plan",
47
- "build",
48
- "verify",
49
- "ship",
50
- "status",
51
- "doctor",
52
- "guardrails",
53
- "readiness",
54
- "resume",
55
- "update",
56
- ]);
57
-
58
- async function run(argv) {
59
- const { command, args } = parseCommand(argv);
60
-
61
- if (!COMMANDS.has(command)) {
62
- throw new ValidationError(
63
- `Unknown command: "${command}". Run "sdtk-code --help" for available commands.`
64
- );
65
- }
66
-
67
- switch (command) {
68
- case "help":
69
- return cmdHelp();
70
- case "version":
71
- console.log(`sdtk-code-kit ${getVersion()}`);
72
- return 0;
73
- case "init":
74
- return cmdInit(args);
75
- case "runtime":
76
- return cmdRuntime(args);
77
- case "start":
78
- return cmdStart(args);
79
- case "plan":
80
- return cmdPlan(args);
81
- case "build":
82
- return cmdBuild(args);
83
- case "verify":
84
- return cmdVerify(args);
85
- case "ship":
86
- return cmdShip(args);
87
- case "status":
88
- return cmdStatus(args);
89
- case "doctor":
90
- return cmdDoctor(args);
91
- case "guardrails":
92
- return cmdGuardrails(args);
93
- case "readiness":
94
- return cmdReadiness(args);
95
- case "resume":
96
- return cmdResume(args);
97
- case "update":
98
- return cmdUpdate(args);
99
- }
100
- }
101
-
102
- module.exports = {
103
- run,
104
- };
1
+ "use strict";
2
+
3
+ const { cmdBuild } = require("./commands/build");
4
+ const { cmdDoctor } = require("./commands/doctor");
5
+ const { cmdGuardrails } = require("./commands/guardrails");
6
+ const { cmdHelp } = require("./commands/help");
7
+ const { cmdReadiness } = require("./commands/readiness");
8
+ const { cmdInit } = require("./commands/init");
9
+ const { cmdPlan } = require("./commands/plan");
10
+ const { cmdResume } = require("./commands/resume");
11
+ const { cmdRuntime } = require("./commands/runtime");
12
+ const { cmdShip } = require("./commands/ship");
13
+ const { cmdStart } = require("./commands/start");
14
+ const { cmdStatus } = require("./commands/status");
15
+ const { cmdSleep } = require("./commands/sleep");
16
+ const { cmdUpdate } = require("./commands/update");
17
+ const { cmdVerify } = require("./commands/verify");
18
+ const { ValidationError } = require("./lib/errors");
19
+
20
+ function getVersion() {
21
+ const pkg = require("../package.json");
22
+ return pkg.version;
23
+ }
24
+
25
+ function parseCommand(argv) {
26
+ if (!argv || argv.length === 0) {
27
+ return { command: "help", args: [] };
28
+ }
29
+
30
+ const [first, ...rest] = argv;
31
+ if (first === "-h" || first === "--help") {
32
+ return { command: "help", args: [] };
33
+ }
34
+ if (first === "-v" || first === "--version") {
35
+ return { command: "version", args: [] };
36
+ }
37
+
38
+ return { command: first, args: rest };
39
+ }
40
+
41
+ const COMMANDS = new Set([
42
+ "help",
43
+ "version",
44
+ "init",
45
+ "runtime",
46
+ "start",
47
+ "plan",
48
+ "build",
49
+ "verify",
50
+ "ship",
51
+ "status",
52
+ "doctor",
53
+ "guardrails",
54
+ "readiness",
55
+ "resume",
56
+ "sleep",
57
+ "update",
58
+ ]);
59
+
60
+ async function run(argv) {
61
+ const { command, args } = parseCommand(argv);
62
+
63
+ if (!COMMANDS.has(command)) {
64
+ throw new ValidationError(
65
+ `Unknown command: "${command}". Run "sdtk-code --help" for available commands.`
66
+ );
67
+ }
68
+
69
+ switch (command) {
70
+ case "help":
71
+ return cmdHelp();
72
+ case "version":
73
+ console.log(`sdtk-code-kit ${getVersion()}`);
74
+ return 0;
75
+ case "init":
76
+ return cmdInit(args);
77
+ case "runtime":
78
+ return cmdRuntime(args);
79
+ case "start":
80
+ return cmdStart(args);
81
+ case "plan":
82
+ return cmdPlan(args);
83
+ case "build":
84
+ return cmdBuild(args);
85
+ case "verify":
86
+ return cmdVerify(args);
87
+ case "ship":
88
+ return cmdShip(args);
89
+ case "status":
90
+ return cmdStatus(args);
91
+ case "doctor":
92
+ return cmdDoctor(args);
93
+ case "guardrails":
94
+ return cmdGuardrails(args);
95
+ case "readiness":
96
+ return cmdReadiness(args);
97
+ case "resume":
98
+ return cmdResume(args);
99
+ case "sleep":
100
+ return cmdSleep(args);
101
+ case "update":
102
+ return cmdUpdate(args);
103
+ }
104
+ }
105
+
106
+ module.exports = {
107
+ run,
108
+ };
package/src/lib/args.js CHANGED
@@ -1,107 +1,107 @@
1
- "use strict";
2
-
3
- const { ValidationError } = require("./errors");
4
-
5
- function parseFlags(argv, defs) {
6
- const flags = {};
7
- const positional = [];
8
- const aliasMap = {};
9
-
10
- for (const [name, def] of Object.entries(defs)) {
11
- if (def.alias) {
12
- aliasMap[def.alias] = name;
13
- }
14
- if (def.type === "boolean") {
15
- flags[name] = false;
16
- } else if (def.multiple) {
17
- flags[name] = [];
18
- } else {
19
- flags[name] = undefined;
20
- }
21
- }
22
-
23
- let i = 0;
24
- while (i < argv.length) {
25
- const arg = argv[i];
26
-
27
- if (!arg.startsWith("-")) {
28
- positional.push(arg);
29
- i++;
30
- continue;
31
- }
32
-
33
- let key;
34
- let inlineValue;
35
- if (arg.includes("=")) {
36
- const eqIdx = arg.indexOf("=");
37
- key = arg.slice(0, eqIdx);
38
- inlineValue = arg.slice(eqIdx + 1);
39
- } else {
40
- key = arg;
41
- }
42
-
43
- const stripped = key.replace(/^-{1,2}/, "");
44
- const resolved = aliasMap[stripped] || stripped;
45
- if (!(resolved in defs)) {
46
- throw new ValidationError(`Unknown flag: ${key}`);
47
- }
48
-
49
- const def = defs[resolved];
50
- if (def.type === "boolean") {
51
- flags[resolved] = true;
52
- i++;
53
- continue;
54
- }
55
-
56
- let value = inlineValue;
57
- if (value === undefined) {
58
- i++;
59
- if (i >= argv.length) {
60
- throw new ValidationError(`Flag ${key} requires a value.`);
61
- }
62
- value = argv[i];
63
- }
64
-
65
- if (def.multiple) {
66
- flags[resolved].push(value);
67
- } else {
68
- flags[resolved] = value;
69
- }
70
- i++;
71
- }
72
-
73
- return { flags, positional };
74
- }
75
-
76
- function requireFlag(flags, name, label) {
77
- const value = flags[name];
78
- if (value === undefined || value === null || value === "") {
79
- throw new ValidationError(`Missing required flag: --${label || name}`);
80
- }
81
- return value;
82
- }
83
-
84
- function validateChoice(value, choices, label) {
85
- if (!choices.includes(value)) {
86
- throw new ValidationError(
87
- `Invalid value for --${label}: "${value}". Must be one of: ${choices.join(", ")}`
88
- );
89
- }
90
- return value;
91
- }
92
-
93
- function validatePattern(value, regex, label, hint) {
94
- if (!regex.test(value)) {
95
- throw new ValidationError(
96
- `Invalid value for --${label}: "${value}". ${hint || `Must match ${regex}`}`
97
- );
98
- }
99
- return value;
100
- }
101
-
102
- module.exports = {
103
- parseFlags,
104
- requireFlag,
105
- validateChoice,
106
- validatePattern,
107
- };
1
+ "use strict";
2
+
3
+ const { ValidationError } = require("./errors");
4
+
5
+ function parseFlags(argv, defs) {
6
+ const flags = {};
7
+ const positional = [];
8
+ const aliasMap = {};
9
+
10
+ for (const [name, def] of Object.entries(defs)) {
11
+ if (def.alias) {
12
+ aliasMap[def.alias] = name;
13
+ }
14
+ if (def.type === "boolean") {
15
+ flags[name] = false;
16
+ } else if (def.multiple) {
17
+ flags[name] = [];
18
+ } else {
19
+ flags[name] = undefined;
20
+ }
21
+ }
22
+
23
+ let i = 0;
24
+ while (i < argv.length) {
25
+ const arg = argv[i];
26
+
27
+ if (!arg.startsWith("-")) {
28
+ positional.push(arg);
29
+ i++;
30
+ continue;
31
+ }
32
+
33
+ let key;
34
+ let inlineValue;
35
+ if (arg.includes("=")) {
36
+ const eqIdx = arg.indexOf("=");
37
+ key = arg.slice(0, eqIdx);
38
+ inlineValue = arg.slice(eqIdx + 1);
39
+ } else {
40
+ key = arg;
41
+ }
42
+
43
+ const stripped = key.replace(/^-{1,2}/, "");
44
+ const resolved = aliasMap[stripped] || stripped;
45
+ if (!(resolved in defs)) {
46
+ throw new ValidationError(`Unknown flag: ${key}`);
47
+ }
48
+
49
+ const def = defs[resolved];
50
+ if (def.type === "boolean") {
51
+ flags[resolved] = true;
52
+ i++;
53
+ continue;
54
+ }
55
+
56
+ let value = inlineValue;
57
+ if (value === undefined) {
58
+ i++;
59
+ if (i >= argv.length) {
60
+ throw new ValidationError(`Flag ${key} requires a value.`);
61
+ }
62
+ value = argv[i];
63
+ }
64
+
65
+ if (def.multiple) {
66
+ flags[resolved].push(value);
67
+ } else {
68
+ flags[resolved] = value;
69
+ }
70
+ i++;
71
+ }
72
+
73
+ return { flags, positional };
74
+ }
75
+
76
+ function requireFlag(flags, name, label) {
77
+ const value = flags[name];
78
+ if (value === undefined || value === null || value === "") {
79
+ throw new ValidationError(`Missing required flag: --${label || name}`);
80
+ }
81
+ return value;
82
+ }
83
+
84
+ function validateChoice(value, choices, label) {
85
+ if (!choices.includes(value)) {
86
+ throw new ValidationError(
87
+ `Invalid value for --${label}: "${value}". Must be one of: ${choices.join(", ")}`
88
+ );
89
+ }
90
+ return value;
91
+ }
92
+
93
+ function validatePattern(value, regex, label, hint) {
94
+ if (!regex.test(value)) {
95
+ throw new ValidationError(
96
+ `Invalid value for --${label}: "${value}". ${hint || `Must match ${regex}`}`
97
+ );
98
+ }
99
+ return value;
100
+ }
101
+
102
+ module.exports = {
103
+ parseFlags,
104
+ requireFlag,
105
+ validateChoice,
106
+ validatePattern,
107
+ };
package/src/lib/errors.js CHANGED
@@ -1,41 +1,41 @@
1
- "use strict";
2
-
3
- class CliError extends Error {
4
- constructor(message, exitCode = 4) {
5
- super(message);
6
- this.name = this.constructor.name;
7
- this.exitCode = exitCode;
8
- }
9
- }
10
-
11
- class ValidationError extends CliError {
12
- constructor(message) {
13
- super(message, 1);
14
- }
15
- }
16
-
17
- class DependencyError extends CliError {
18
- constructor(message) {
19
- super(message, 2);
20
- }
21
- }
22
-
23
- class IntegrityError extends CliError {
24
- constructor(message) {
25
- super(message, 3);
26
- }
27
- }
28
-
29
- class InternalError extends CliError {
30
- constructor(message) {
31
- super(message, 4);
32
- }
33
- }
34
-
35
- module.exports = {
36
- CliError,
37
- ValidationError,
38
- DependencyError,
39
- IntegrityError,
40
- InternalError,
41
- };
1
+ "use strict";
2
+
3
+ class CliError extends Error {
4
+ constructor(message, exitCode = 4) {
5
+ super(message);
6
+ this.name = this.constructor.name;
7
+ this.exitCode = exitCode;
8
+ }
9
+ }
10
+
11
+ class ValidationError extends CliError {
12
+ constructor(message) {
13
+ super(message, 1);
14
+ }
15
+ }
16
+
17
+ class DependencyError extends CliError {
18
+ constructor(message) {
19
+ super(message, 2);
20
+ }
21
+ }
22
+
23
+ class IntegrityError extends CliError {
24
+ constructor(message) {
25
+ super(message, 3);
26
+ }
27
+ }
28
+
29
+ class InternalError extends CliError {
30
+ constructor(message) {
31
+ super(message, 4);
32
+ }
33
+ }
34
+
35
+ module.exports = {
36
+ CliError,
37
+ ValidationError,
38
+ DependencyError,
39
+ IntegrityError,
40
+ InternalError,
41
+ };
@@ -1,65 +1,65 @@
1
- "use strict";
2
-
3
- const { execFile } = require("child_process");
4
- const { DependencyError } = require("./errors");
5
-
6
- function findPowerShell() {
7
- if (process.platform === "win32") {
8
- return "powershell.exe";
9
- }
10
- return "pwsh";
11
- }
12
-
13
- function runScript(scriptPath, params = {}, options = {}) {
14
- return new Promise((resolve, reject) => {
15
- const psExe = findPowerShell();
16
- const args = [
17
- "-ExecutionPolicy",
18
- "Bypass",
19
- "-NoProfile",
20
- "-NonInteractive",
21
- "-File",
22
- scriptPath,
23
- ];
24
-
25
- for (const [key, value] of Object.entries(params)) {
26
- if (value === true) {
27
- args.push(`-${key}`);
28
- } else if (value === false || value === undefined || value === null) {
29
- continue;
30
- } else {
31
- args.push(`-${key}`);
32
- args.push(String(value));
33
- }
34
- }
35
-
36
- execFile(psExe, args, { maxBuffer: 10 * 1024 * 1024 }, (error, stdout, stderr) => {
37
- if (error && error.code === "ENOENT") {
38
- reject(
39
- new DependencyError(
40
- `PowerShell not found. Ensure PowerShell is installed and available in PATH.\nTried: ${psExe}`
41
- )
42
- );
43
- return;
44
- }
45
-
46
- const exitCode = error ? error.code || 1 : 0;
47
- const result = {
48
- exitCode: typeof exitCode === "number" ? exitCode : 1,
49
- stdout: stdout || "",
50
- stderr: stderr || "",
51
- };
52
-
53
- if (!options.silent && result.stdout) {
54
- process.stdout.write(result.stdout);
55
- }
56
-
57
- resolve(result);
58
- });
59
- });
60
- }
61
-
62
- module.exports = {
63
- findPowerShell,
64
- runScript,
65
- };
1
+ "use strict";
2
+
3
+ const { execFile } = require("child_process");
4
+ const { DependencyError } = require("./errors");
5
+
6
+ function findPowerShell() {
7
+ if (process.platform === "win32") {
8
+ return "powershell.exe";
9
+ }
10
+ return "pwsh";
11
+ }
12
+
13
+ function runScript(scriptPath, params = {}, options = {}) {
14
+ return new Promise((resolve, reject) => {
15
+ const psExe = findPowerShell();
16
+ const args = [
17
+ "-ExecutionPolicy",
18
+ "Bypass",
19
+ "-NoProfile",
20
+ "-NonInteractive",
21
+ "-File",
22
+ scriptPath,
23
+ ];
24
+
25
+ for (const [key, value] of Object.entries(params)) {
26
+ if (value === true) {
27
+ args.push(`-${key}`);
28
+ } else if (value === false || value === undefined || value === null) {
29
+ continue;
30
+ } else {
31
+ args.push(`-${key}`);
32
+ args.push(String(value));
33
+ }
34
+ }
35
+
36
+ execFile(psExe, args, { maxBuffer: 10 * 1024 * 1024 }, (error, stdout, stderr) => {
37
+ if (error && error.code === "ENOENT") {
38
+ reject(
39
+ new DependencyError(
40
+ `PowerShell not found. Ensure PowerShell is installed and available in PATH.\nTried: ${psExe}`
41
+ )
42
+ );
43
+ return;
44
+ }
45
+
46
+ const exitCode = error ? error.code || 1 : 0;
47
+ const result = {
48
+ exitCode: typeof exitCode === "number" ? exitCode : 1,
49
+ stdout: stdout || "",
50
+ stderr: stderr || "",
51
+ };
52
+
53
+ if (!options.silent && result.stdout) {
54
+ process.stdout.write(result.stdout);
55
+ }
56
+
57
+ resolve(result);
58
+ });
59
+ });
60
+ }
61
+
62
+ module.exports = {
63
+ findPowerShell,
64
+ runScript,
65
+ };