sdtk-code-kit 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -130
- package/assets/manifest/toolkit-bundle.manifest.json +47 -47
- package/assets/manifest/toolkit-bundle.sha256.txt +23 -23
- package/assets/toolkit/toolkit/AGENTS.md +8 -1
- package/assets/toolkit/toolkit/install.ps1 +1 -8
- package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +30 -7
- package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +31 -2
- package/assets/toolkit/toolkit/sdtk-spec.config.json +1 -1
- package/assets/toolkit/toolkit/skills/code-brainstorm/SKILL.md +0 -1
- package/assets/toolkit/toolkit/skills/code-debug/SKILL.md +1 -2
- package/assets/toolkit/toolkit/skills/code-debug/references/root-cause-tracing.md +0 -1
- package/assets/toolkit/toolkit/skills/code-execute/SKILL.md +0 -1
- package/assets/toolkit/toolkit/skills/code-finish/SKILL.md +0 -1
- package/assets/toolkit/toolkit/skills/code-parallel/SKILL.md +0 -1
- package/assets/toolkit/toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md +0 -1
- package/assets/toolkit/toolkit/skills/code-parallel/references/implementer-prompt.md +0 -1
- package/assets/toolkit/toolkit/skills/code-parallel/references/spec-reviewer-prompt.md +0 -1
- package/assets/toolkit/toolkit/skills/code-plan/SKILL.md +0 -1
- package/assets/toolkit/toolkit/skills/code-review/SKILL.md +0 -1
- package/assets/toolkit/toolkit/skills/code-review/references/checklist.md +0 -1
- package/assets/toolkit/toolkit/skills/code-review/references/code-reviewer.md +0 -1
- package/assets/toolkit/toolkit/skills/code-ship/SKILL.md +0 -1
- package/assets/toolkit/toolkit/skills/code-tdd/SKILL.md +1 -2
- package/assets/toolkit/toolkit/skills/code-tdd/references/testing-anti-patterns.md +0 -1
- package/assets/toolkit/toolkit/skills/code-verify/SKILL.md +0 -1
- package/assets/toolkit/toolkit/skills/code-worktree/SKILL.md +13 -14
- package/package.json +1 -1
- package/src/commands/help.js +163 -145
- package/src/commands/init.js +10 -1
- package/src/commands/plan.js +1 -0
- package/src/commands/runtime.js +27 -8
- package/src/commands/ship.js +5 -0
- package/src/lib/scope.js +19 -2
- package/src/lib/workflow-artifact.js +51 -14
- package/src/lib/workflow-handoff.js +510 -0
- package/src/lib/workflow-intake.js +2 -1
- package/src/lib/workflow-plan.js +102 -5
- package/src/lib/workflow-ship.js +53 -3
package/src/commands/init.js
CHANGED
|
@@ -29,7 +29,7 @@ async function cmdInit(args) {
|
|
|
29
29
|
validateChoice(scope, VALID_SCOPES, "runtime-scope");
|
|
30
30
|
if (scope === "project" && !isProjectScopeSupported(runtime)) {
|
|
31
31
|
throw new ValidationError(
|
|
32
|
-
|
|
32
|
+
`${runtime} does not support project-local runtime assets. Use --runtime-scope user instead.`
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -62,6 +62,11 @@ async function cmdInit(args) {
|
|
|
62
62
|
console.log(` Runtime: ${runtime}`);
|
|
63
63
|
console.log(` Scope: ${scope}`);
|
|
64
64
|
console.log(` Project: ${projectPath}`);
|
|
65
|
+
if (runtime === "codex" && scope === "project") {
|
|
66
|
+
console.log(` Codex home contract: ${path.join(projectPath, ".codex")}`);
|
|
67
|
+
console.log(" Note: Launch Codex with CODEX_HOME=<project>/.codex to use project-local skills.");
|
|
68
|
+
console.log(" Note: This CLI does not claim native .codex/skills auto-discovery.");
|
|
69
|
+
}
|
|
65
70
|
console.log("");
|
|
66
71
|
|
|
67
72
|
const result = await runScript(installScript, params, { silent: !flags.verbose });
|
|
@@ -74,6 +79,10 @@ async function cmdInit(args) {
|
|
|
74
79
|
|
|
75
80
|
console.log("");
|
|
76
81
|
console.log("SDTK-CODE workspace initialized successfully.");
|
|
82
|
+
if (runtime === "codex" && scope === "project") {
|
|
83
|
+
console.log(`Project-local Codex skills were installed into ${path.join(projectPath, ".codex", "skills")}.`);
|
|
84
|
+
console.log("Launch Codex with CODEX_HOME=<project>/.codex to activate that local runtime home.");
|
|
85
|
+
}
|
|
77
86
|
console.log("");
|
|
78
87
|
console.log("Next steps:");
|
|
79
88
|
console.log(" 1. Review and customize sdtk-spec.config.json for your project stack.");
|
package/src/commands/plan.js
CHANGED
|
@@ -11,6 +11,7 @@ const FLAG_DEFS = {
|
|
|
11
11
|
"in-scope": { type: "string", multiple: true },
|
|
12
12
|
"out-scope": { type: "string", multiple: true },
|
|
13
13
|
slice: { type: "string", multiple: true },
|
|
14
|
+
"use-seeded-candidates": { type: "boolean" },
|
|
14
15
|
assumption: { type: "string", multiple: true },
|
|
15
16
|
risk: { type: "string", multiple: true },
|
|
16
17
|
note: { type: "string", multiple: true },
|
package/src/commands/runtime.js
CHANGED
|
@@ -11,6 +11,8 @@ const {
|
|
|
11
11
|
defaultScope,
|
|
12
12
|
isProjectScopeSupported,
|
|
13
13
|
managedSkillNames,
|
|
14
|
+
resolveCodexProjectHome,
|
|
15
|
+
resolveCodexUserHome,
|
|
14
16
|
resolveSkillsDir,
|
|
15
17
|
} = require("../lib/scope");
|
|
16
18
|
|
|
@@ -29,7 +31,7 @@ const SUBCOMMANDS = ["install", "uninstall", "status"];
|
|
|
29
31
|
function validateScopeForRuntime(runtime, scope, label) {
|
|
30
32
|
if (scope === "project" && !isProjectScopeSupported(runtime)) {
|
|
31
33
|
throw new ValidationError(
|
|
32
|
-
|
|
34
|
+
`${runtime} does not support project-local runtime assets. Use --${label} user instead.`
|
|
33
35
|
);
|
|
34
36
|
}
|
|
35
37
|
}
|
|
@@ -51,7 +53,7 @@ async function cmdRuntimeInstall(flags) {
|
|
|
51
53
|
: "toolkit/scripts/install-codex-skills.ps1";
|
|
52
54
|
const script = resolvePayloadFile(scriptName);
|
|
53
55
|
const params = { Scope: scope };
|
|
54
|
-
if (
|
|
56
|
+
if (scope === "project") {
|
|
55
57
|
params.ProjectPath = projectPath;
|
|
56
58
|
}
|
|
57
59
|
if (flags.force) {
|
|
@@ -61,9 +63,14 @@ async function cmdRuntimeInstall(flags) {
|
|
|
61
63
|
console.log(`Installing ${runtime} runtime assets...`);
|
|
62
64
|
console.log(` Runtime: ${runtime}`);
|
|
63
65
|
console.log(` Scope: ${scope}`);
|
|
64
|
-
if (
|
|
66
|
+
if (scope === "project") {
|
|
65
67
|
console.log(` Project: ${projectPath}`);
|
|
66
68
|
}
|
|
69
|
+
if (runtime === "codex" && scope === "project") {
|
|
70
|
+
console.log(` Codex home contract: ${resolveCodexProjectHome(projectPath)}`);
|
|
71
|
+
console.log(" Note: Launch Codex with CODEX_HOME=<project>/.codex to activate this project-local install.");
|
|
72
|
+
console.log(" Note: Native .codex/skills auto-discovery is not claimed.");
|
|
73
|
+
}
|
|
67
74
|
console.log("");
|
|
68
75
|
|
|
69
76
|
const result = await runScript(script, params, { silent: !flags.verbose });
|
|
@@ -95,9 +102,9 @@ async function cmdRuntimeUninstall(flags) {
|
|
|
95
102
|
? "toolkit/scripts/uninstall-claude-skills.ps1"
|
|
96
103
|
: "toolkit/scripts/uninstall-codex-skills.ps1";
|
|
97
104
|
const script = resolvePayloadFile(scriptName);
|
|
98
|
-
const params = {
|
|
99
|
-
|
|
100
|
-
|
|
105
|
+
const params = {};
|
|
106
|
+
params.Scope = scope;
|
|
107
|
+
if (scope === "project") {
|
|
101
108
|
params.ProjectPath = projectPath;
|
|
102
109
|
}
|
|
103
110
|
if (flags.all) {
|
|
@@ -107,7 +114,7 @@ async function cmdRuntimeUninstall(flags) {
|
|
|
107
114
|
console.log(`Uninstalling ${runtime} runtime assets...`);
|
|
108
115
|
console.log(` Runtime: ${runtime}`);
|
|
109
116
|
console.log(` Scope: ${scope}`);
|
|
110
|
-
if (
|
|
117
|
+
if (scope === "project") {
|
|
111
118
|
console.log(` Project: ${projectPath}`);
|
|
112
119
|
}
|
|
113
120
|
console.log("");
|
|
@@ -130,11 +137,20 @@ function cmdRuntimeStatus(flags) {
|
|
|
130
137
|
validateChoice(runtime, VALID_RUNTIMES, "runtime");
|
|
131
138
|
|
|
132
139
|
const projectPath = flags["project-path"] ? path.resolve(flags["project-path"]) : process.cwd();
|
|
133
|
-
const scopes =
|
|
140
|
+
const scopes = ["project", "user"];
|
|
134
141
|
|
|
135
142
|
console.log(`Runtime: ${runtime}`);
|
|
136
143
|
console.log("");
|
|
137
144
|
|
|
145
|
+
if (runtime === "codex") {
|
|
146
|
+
console.log("Codex scope truth:");
|
|
147
|
+
console.log(` Project-local root: ${resolveCodexProjectHome(projectPath)}`);
|
|
148
|
+
console.log(` User/global root: ${resolveCodexUserHome()}`);
|
|
149
|
+
console.log(" Project-local Codex support requires launching Codex with CODEX_HOME=<project>/.codex.");
|
|
150
|
+
console.log(" Native .codex/skills auto-discovery is not claimed.");
|
|
151
|
+
console.log("");
|
|
152
|
+
}
|
|
153
|
+
|
|
138
154
|
for (const scope of scopes) {
|
|
139
155
|
const skillsDir = resolveSkillsDir(runtime, scope, projectPath);
|
|
140
156
|
const managed = managedSkillNames(runtime);
|
|
@@ -164,6 +180,9 @@ function cmdRuntimeStatus(flags) {
|
|
|
164
180
|
|
|
165
181
|
console.log(` Scope: ${scope}`);
|
|
166
182
|
console.log(` Path: ${skillsDir}`);
|
|
183
|
+
if (runtime === "codex" && scope === "project") {
|
|
184
|
+
console.log(" Activation: explicit CODEX_HOME=<project>/.codex contract required");
|
|
185
|
+
}
|
|
167
186
|
console.log(` Status: ${status}`);
|
|
168
187
|
if (exists && hasManagedSkills && skillCount < managed.length) {
|
|
169
188
|
const missing = managed.filter((name) => !installedNames.includes(name));
|
package/src/commands/ship.js
CHANGED
|
@@ -45,6 +45,11 @@ function cmdShip(args) {
|
|
|
45
45
|
console.log(` Preflight: ${result.preflightCount}`);
|
|
46
46
|
console.log(` Next phase: ${result.nextPhase}`);
|
|
47
47
|
console.log(` Engine: ${result.suggestedEngineSkills.join(", ")}`);
|
|
48
|
+
if (result.opsHandoff && result.opsHandoff.emitted) {
|
|
49
|
+
console.log(` OPS handoff: ${result.opsHandoff.opsHandoffPath}`);
|
|
50
|
+
} else if (result.opsHandoff && result.opsHandoff.reason) {
|
|
51
|
+
console.log(` OPS handoff: ${result.opsHandoff.reason}`);
|
|
52
|
+
}
|
|
48
53
|
|
|
49
54
|
return 0;
|
|
50
55
|
}
|
package/src/lib/scope.js
CHANGED
|
@@ -10,7 +10,21 @@ function defaultScope(runtime) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
function isProjectScopeSupported(runtime) {
|
|
13
|
-
return runtime === "claude";
|
|
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();
|
|
14
28
|
}
|
|
15
29
|
|
|
16
30
|
function resolveSkillsDir(runtime, scope, projectPath) {
|
|
@@ -21,7 +35,7 @@ function resolveSkillsDir(runtime, scope, projectPath) {
|
|
|
21
35
|
return path.join(projectPath || process.cwd(), ".claude", "skills");
|
|
22
36
|
}
|
|
23
37
|
|
|
24
|
-
const codexHome =
|
|
38
|
+
const codexHome = resolveCodexHome(scope, projectPath);
|
|
25
39
|
return path.join(codexHome, "skills");
|
|
26
40
|
}
|
|
27
41
|
|
|
@@ -50,6 +64,9 @@ module.exports = {
|
|
|
50
64
|
VALID_SCOPES,
|
|
51
65
|
defaultScope,
|
|
52
66
|
isProjectScopeSupported,
|
|
67
|
+
resolveCodexHome,
|
|
68
|
+
resolveCodexProjectHome,
|
|
69
|
+
resolveCodexUserHome,
|
|
53
70
|
resolveSkillsDir,
|
|
54
71
|
managedSkillNames,
|
|
55
72
|
};
|
|
@@ -97,8 +97,21 @@ function renderPlanBlock(data) {
|
|
|
97
97
|
if (Array.isArray(data.planNotes) && data.planNotes.length > 0) {
|
|
98
98
|
planningNotes.push(...data.planNotes);
|
|
99
99
|
}
|
|
100
|
+
const candidateSlices = Array.isArray(data.candidateSlices) ? data.candidateSlices : [];
|
|
101
|
+
const candidatePlanningNotes = Array.isArray(data.candidatePlanningNotes)
|
|
102
|
+
? data.candidatePlanningNotes
|
|
103
|
+
: [];
|
|
104
|
+
const shouldRenderSeededCandidates =
|
|
105
|
+
data.currentPhase === "start" &&
|
|
106
|
+
data.lane === "feature" &&
|
|
107
|
+
data.slices.length === 0 &&
|
|
108
|
+
candidateSlices.length > 0;
|
|
109
|
+
|
|
110
|
+
if (shouldRenderSeededCandidates) {
|
|
111
|
+
planningNotes.unshift(...candidatePlanningNotes);
|
|
112
|
+
}
|
|
100
113
|
|
|
101
|
-
|
|
114
|
+
const lines = [
|
|
102
115
|
"<!-- SDTK-CODE:PLAN:START -->",
|
|
103
116
|
"## 3. Scope Lock",
|
|
104
117
|
"### In Scope",
|
|
@@ -114,17 +127,36 @@ function renderPlanBlock(data) {
|
|
|
114
127
|
renderBulletList(data.risks, "No explicit planning risks recorded."),
|
|
115
128
|
"",
|
|
116
129
|
"## 4. Plan / Slices",
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
if (shouldRenderSeededCandidates) {
|
|
133
|
+
lines.push(
|
|
134
|
+
"### Seeded Candidate Slices From Formal Handoff",
|
|
135
|
+
renderBulletList(candidateSlices, "No candidate slices seeded from the formal handoff."),
|
|
136
|
+
"",
|
|
137
|
+
"### Finalized Slices After `plan`",
|
|
138
|
+
renderBulletList(data.slices, "Pending confirmation during workflow planning."),
|
|
139
|
+
""
|
|
140
|
+
);
|
|
141
|
+
} else {
|
|
142
|
+
lines.push(
|
|
143
|
+
renderBulletList(
|
|
144
|
+
data.slices,
|
|
145
|
+
data.lane === "bugfix"
|
|
146
|
+
? "Lightweight bugfix planning not recorded yet."
|
|
147
|
+
: "Pending lane-specific planning or build guidance."
|
|
148
|
+
),
|
|
149
|
+
""
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
lines.push(
|
|
124
154
|
"### Planning Notes",
|
|
125
155
|
renderBulletList(planningNotes, "No additional planning notes recorded."),
|
|
126
|
-
"<!-- SDTK-CODE:PLAN:END -->"
|
|
127
|
-
|
|
156
|
+
"<!-- SDTK-CODE:PLAN:END -->"
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
return lines.join("\n");
|
|
128
160
|
}
|
|
129
161
|
|
|
130
162
|
function renderBuildBlock(data) {
|
|
@@ -225,10 +257,13 @@ function renderShipBlock(data) {
|
|
|
225
257
|
}
|
|
226
258
|
|
|
227
259
|
function renderManagedBlocks(data) {
|
|
228
|
-
const suggestedEngine = data.suggestedEngineSkills
|
|
229
|
-
.map((value) => `\`${value}\``)
|
|
230
|
-
.join(", ");
|
|
231
260
|
const currentPhase = data.currentPhase || "start";
|
|
261
|
+
const isClosedWorkflow = data.nextPhase === "none";
|
|
262
|
+
const nextPhaseLabel = isClosedWorkflow ? "none (workflow closed)" : data.nextPhase;
|
|
263
|
+
const suggestedEngine =
|
|
264
|
+
isClosedWorkflow || !Array.isArray(data.suggestedEngineSkills) || data.suggestedEngineSkills.length === 0
|
|
265
|
+
? "none (workflow closed)"
|
|
266
|
+
: data.suggestedEngineSkills.map((value) => `\`${value}\``).join(", ");
|
|
232
267
|
|
|
233
268
|
return {
|
|
234
269
|
METADATA: [
|
|
@@ -270,7 +305,7 @@ function renderManagedBlocks(data) {
|
|
|
270
305
|
"<!-- SDTK-CODE:STATUS:START -->",
|
|
271
306
|
"## 5. Status Checklist",
|
|
272
307
|
`- Current phase: \`${currentPhase}\``,
|
|
273
|
-
`- Next recommended phase: \`${
|
|
308
|
+
`- Next recommended phase: \`${nextPhaseLabel}\``,
|
|
274
309
|
`- Suggested engine entrypoints: ${suggestedEngine}`,
|
|
275
310
|
`- Blocking state: \`${data.blockingState}\``,
|
|
276
311
|
"<!-- SDTK-CODE:STATUS:END -->",
|
|
@@ -405,6 +440,8 @@ function createOrUpdateWorkflowArtifact(options) {
|
|
|
405
440
|
risks: options.risks || [],
|
|
406
441
|
slices: options.slices || [],
|
|
407
442
|
planNotes: options.planNotes || [],
|
|
443
|
+
candidateSlices: options.candidateSlices || [],
|
|
444
|
+
candidatePlanningNotes: options.candidatePlanningNotes || [],
|
|
408
445
|
activeSlices: options.activeSlices || [],
|
|
409
446
|
buildNotes: options.buildNotes || [],
|
|
410
447
|
debugNotes: options.debugNotes || [],
|