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
@@ -1,53 +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-code/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
-
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-code/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/scope.js CHANGED
@@ -1,72 +1,72 @@
1
- "use strict";
2
-
3
- const os = require("os");
4
- const path = require("path");
5
-
6
- const VALID_SCOPES = ["project", "user"];
7
-
8
- function defaultScope(runtime) {
9
- return runtime === "claude" ? "project" : "user";
10
- }
11
-
12
- function isProjectScopeSupported(runtime) {
13
- return runtime === "claude" || runtime === "codex";
14
- }
15
-
16
- function resolveCodexProjectHome(projectPath) {
17
- return path.join(projectPath || process.cwd(), ".codex");
18
- }
19
-
20
- function resolveCodexUserHome() {
21
- return process.env.CODEX_HOME || path.join(os.homedir(), ".codex");
22
- }
23
-
24
- function resolveCodexHome(scope, projectPath) {
25
- return scope === "project"
26
- ? resolveCodexProjectHome(projectPath)
27
- : resolveCodexUserHome();
28
- }
29
-
30
- function resolveSkillsDir(runtime, scope, projectPath) {
31
- if (runtime === "claude") {
32
- if (scope === "user") {
33
- return path.join(os.homedir(), ".claude", "skills");
34
- }
35
- return path.join(projectPath || process.cwd(), ".claude", "skills");
36
- }
37
-
38
- const codexHome = resolveCodexHome(scope, projectPath);
39
- return path.join(codexHome, "skills");
40
- }
41
-
42
- const MANAGED_CLAUDE_SKILLS = [
43
- "code-brainstorm",
44
- "code-debug",
45
- "code-discover",
46
- "code-execute",
47
- "code-finish",
48
- "code-parallel",
49
- "code-plan",
50
- "code-review",
51
- "code-ship",
52
- "code-tdd",
53
- "code-verify",
54
- "code-worktree",
55
- ];
56
-
57
- const MANAGED_CODEX_SKILLS = MANAGED_CLAUDE_SKILLS.map((name) => `sdtk-${name}`);
58
-
59
- function managedSkillNames(runtime) {
60
- return runtime === "claude" ? MANAGED_CLAUDE_SKILLS : MANAGED_CODEX_SKILLS;
61
- }
62
-
63
- module.exports = {
64
- VALID_SCOPES,
65
- defaultScope,
66
- isProjectScopeSupported,
67
- resolveCodexHome,
68
- resolveCodexProjectHome,
69
- resolveCodexUserHome,
70
- resolveSkillsDir,
71
- managedSkillNames,
72
- };
1
+ "use strict";
2
+
3
+ const os = require("os");
4
+ const path = require("path");
5
+
6
+ const VALID_SCOPES = ["project", "user"];
7
+
8
+ function defaultScope(runtime) {
9
+ return runtime === "claude" ? "project" : "user";
10
+ }
11
+
12
+ function isProjectScopeSupported(runtime) {
13
+ return runtime === "claude" || runtime === "codex";
14
+ }
15
+
16
+ function resolveCodexProjectHome(projectPath) {
17
+ return path.join(projectPath || process.cwd(), ".codex");
18
+ }
19
+
20
+ function resolveCodexUserHome() {
21
+ return process.env.CODEX_HOME || path.join(os.homedir(), ".codex");
22
+ }
23
+
24
+ function resolveCodexHome(scope, projectPath) {
25
+ return scope === "project"
26
+ ? resolveCodexProjectHome(projectPath)
27
+ : resolveCodexUserHome();
28
+ }
29
+
30
+ function resolveSkillsDir(runtime, scope, projectPath) {
31
+ if (runtime === "claude") {
32
+ if (scope === "user") {
33
+ return path.join(os.homedir(), ".claude", "skills");
34
+ }
35
+ return path.join(projectPath || process.cwd(), ".claude", "skills");
36
+ }
37
+
38
+ const codexHome = resolveCodexHome(scope, projectPath);
39
+ return path.join(codexHome, "skills");
40
+ }
41
+
42
+ const MANAGED_CLAUDE_SKILLS = [
43
+ "code-brainstorm",
44
+ "code-debug",
45
+ "code-discover",
46
+ "code-execute",
47
+ "code-finish",
48
+ "code-parallel",
49
+ "code-plan",
50
+ "code-review",
51
+ "code-ship",
52
+ "code-tdd",
53
+ "code-verify",
54
+ "code-worktree",
55
+ ];
56
+
57
+ const MANAGED_CODEX_SKILLS = MANAGED_CLAUDE_SKILLS.map((name) => `sdtk-${name}`);
58
+
59
+ function managedSkillNames(runtime) {
60
+ return runtime === "claude" ? MANAGED_CLAUDE_SKILLS : MANAGED_CODEX_SKILLS;
61
+ }
62
+
63
+ module.exports = {
64
+ VALID_SCOPES,
65
+ defaultScope,
66
+ isProjectScopeSupported,
67
+ resolveCodexHome,
68
+ resolveCodexProjectHome,
69
+ resolveCodexUserHome,
70
+ resolveSkillsDir,
71
+ managedSkillNames,
72
+ };