sdtk-code-kit 0.1.0

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 (55) hide show
  1. package/README.md +138 -0
  2. package/assets/manifest/toolkit-bundle.manifest.json +147 -0
  3. package/assets/manifest/toolkit-bundle.sha256.txt +28 -0
  4. package/assets/toolkit/toolkit/AGENTS.md +210 -0
  5. package/assets/toolkit/toolkit/install.ps1 +126 -0
  6. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +78 -0
  7. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +127 -0
  8. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +62 -0
  9. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +53 -0
  10. package/assets/toolkit/toolkit/sdtk-spec.config.json +6 -0
  11. package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +12 -0
  12. package/assets/toolkit/toolkit/skills/code-brainstorm/SKILL.md +56 -0
  13. package/assets/toolkit/toolkit/skills/code-debug/SKILL.md +297 -0
  14. package/assets/toolkit/toolkit/skills/code-debug/references/root-cause-tracing.md +69 -0
  15. package/assets/toolkit/toolkit/skills/code-discover/SKILL.md +54 -0
  16. package/assets/toolkit/toolkit/skills/code-execute/SKILL.md +75 -0
  17. package/assets/toolkit/toolkit/skills/code-finish/SKILL.md +206 -0
  18. package/assets/toolkit/toolkit/skills/code-parallel/SKILL.md +65 -0
  19. package/assets/toolkit/toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md +27 -0
  20. package/assets/toolkit/toolkit/skills/code-parallel/references/implementer-prompt.md +114 -0
  21. package/assets/toolkit/toolkit/skills/code-parallel/references/spec-reviewer-prompt.md +62 -0
  22. package/assets/toolkit/toolkit/skills/code-plan/SKILL.md +86 -0
  23. package/assets/toolkit/toolkit/skills/code-review/SKILL.md +80 -0
  24. package/assets/toolkit/toolkit/skills/code-review/references/checklist.md +126 -0
  25. package/assets/toolkit/toolkit/skills/code-review/references/code-reviewer.md +147 -0
  26. package/assets/toolkit/toolkit/skills/code-ship/SKILL.md +53 -0
  27. package/assets/toolkit/toolkit/skills/code-tdd/SKILL.md +379 -0
  28. package/assets/toolkit/toolkit/skills/code-tdd/references/testing-anti-patterns.md +300 -0
  29. package/assets/toolkit/toolkit/skills/code-verify/SKILL.md +145 -0
  30. package/assets/toolkit/toolkit/skills/code-worktree/SKILL.md +229 -0
  31. package/assets/toolkit/toolkit/templates/CODE_WORKFLOW_TEMPLATE.md +112 -0
  32. package/bin/sdtk-code.js +14 -0
  33. package/package.json +44 -0
  34. package/src/commands/build.js +53 -0
  35. package/src/commands/generate.js +11 -0
  36. package/src/commands/help.js +169 -0
  37. package/src/commands/init.js +86 -0
  38. package/src/commands/plan.js +52 -0
  39. package/src/commands/runtime.js +205 -0
  40. package/src/commands/ship.js +54 -0
  41. package/src/commands/start.js +89 -0
  42. package/src/commands/verify.js +57 -0
  43. package/src/index.js +70 -0
  44. package/src/lib/args.js +107 -0
  45. package/src/lib/errors.js +41 -0
  46. package/src/lib/powershell.js +65 -0
  47. package/src/lib/scope.js +55 -0
  48. package/src/lib/toolkit-payload.js +72 -0
  49. package/src/lib/workflow-artifact.js +453 -0
  50. package/src/lib/workflow-build.js +127 -0
  51. package/src/lib/workflow-handoff.js +427 -0
  52. package/src/lib/workflow-intake.js +100 -0
  53. package/src/lib/workflow-plan.js +96 -0
  54. package/src/lib/workflow-ship.js +163 -0
  55. package/src/lib/workflow-verify.js +212 -0
package/README.md ADDED
@@ -0,0 +1,138 @@
1
+ # sdtk-code-kit
2
+
3
+ `SDTK-CODE` is the coding-process toolkit in the `SDTK-SPEC -> SDTK-CODE -> SDTK-OPS` family.
4
+
5
+ Public package truth:
6
+ - install via `npm install -g sdtk-code-kit@0.1.0`
7
+ - use the `sdtk-code` command
8
+ - workflow-first commands are implemented:
9
+ - `start`
10
+ - `plan`
11
+ - `build`
12
+ - `verify`
13
+ - `ship`
14
+ - support commands are implemented:
15
+ - `init`
16
+ - `runtime install|uninstall|status`
17
+ - `help`
18
+ - `--version`
19
+ - package payload intentionally stays narrow:
20
+ - ships runtime assets needed by `init` and `runtime`
21
+ - ships `toolkit/templates/CODE_WORKFLOW_TEMPLATE.md` because `start` depends on it
22
+ - does not bulk-sync `toolkit/templates/**`
23
+ - the package is publicly installable, but real workflow execution still expects upstream `SDTK-SPEC` artifacts to already exist in the working project
24
+
25
+ ## Command surface
26
+
27
+ ```text
28
+ sdtk-code <command> [options]
29
+
30
+ Commands:
31
+ start
32
+ plan
33
+ build
34
+ verify
35
+ ship
36
+ init
37
+ runtime
38
+ help
39
+ --version
40
+ ```
41
+
42
+ `generate` is not part of the SDTK-CODE v1 public command surface.
43
+
44
+ ## Runtime behavior
45
+
46
+ | Runtime | Project scope | User scope | Notes |
47
+ |---|:---:|:---:|---|
48
+ | Claude | Yes | Yes | installs `code-*` skills |
49
+ | Codex | No | Yes | installs `sdtk-code-*` skills; Gate C0 blocks project scope |
50
+
51
+ Notes:
52
+ - `sdtk-code init` defaults to `codex`
53
+ - `sdtk-code runtime` requires `--runtime`
54
+ - init/runtime install shared files only: `AGENTS.md`, `sdtk-spec.config.json`, `sdtk-spec.config.profiles.example.json`
55
+ - SDTK-CODE does not install `CLAUDE.md` or `CODEX.md` in v1
56
+
57
+ ## Upstream boundary
58
+
59
+ Use this workflow surface only after upstream `SDTK-SPEC` handoff inputs already exist.
60
+
61
+ Preferred intake artifact:
62
+ - `docs/dev/CODE_HANDOFF_[FEATURE_KEY].json`
63
+
64
+ Compatibility fallback when the formal handoff file is missing:
65
+ - `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md`
66
+ - relevant API / DB / ARCH / FLOW_ACTION specs for the current slice
67
+ - `sdtk-spec.config.json`
68
+
69
+ This package does not replace `SDTK-SPEC` for upstream planning, architecture, or handoff generation.
70
+
71
+ ## Workflow-first package truth
72
+
73
+ Normal mode is workflow-first:
74
+ - feature lane: `start -> plan -> build -> verify -> ship`
75
+ - bugfix lane: `start -> build -> verify -> ship`
76
+
77
+ Canonical workflow artifact:
78
+ - `docs/dev/CODE_WORKFLOW_[FEATURE_KEY].md`
79
+
80
+ Canonical workflow template shipped with the package:
81
+ - `products/sdtk-code/toolkit/templates/CODE_WORKFLOW_TEMPLATE.md`
82
+
83
+ Expert mode remains direct raw `code-*` usage inside Claude or Codex.
84
+
85
+ ## Install and first smoke
86
+
87
+ ```powershell
88
+ npm install -g sdtk-code-kit@0.1.0
89
+ sdtk-code --help
90
+ sdtk-code init --runtime codex --project-path ./my-project
91
+ sdtk-code runtime status --runtime codex
92
+ ```
93
+
94
+ If you want Claude project-scope install behavior instead:
95
+
96
+ ```powershell
97
+ sdtk-code init --runtime claude --project-path ./my-project
98
+ sdtk-code runtime status --runtime claude --project-path ./my-project
99
+ ```
100
+
101
+ ## Maintainer packaging smoke
102
+
103
+ From this package directory:
104
+
105
+ ```powershell
106
+ npm run build:payload
107
+ npm run verify:payload
108
+ npm pack --dry-run
109
+ node bin/sdtk-code.js --help
110
+ node bin/sdtk-code.js init --runtime claude --project-path ..\..\..\..\tmp-sdtk-code
111
+ node bin/sdtk-code.js start --feature-key ORDER_MGMT --lane feature --project-path ..\..\..\..\tmp-sdtk-code
112
+ node bin/sdtk-code.js plan --feature-key ORDER_MGMT --project-path ..\..\..\..\tmp-sdtk-code --slice "API contract updates"
113
+ node bin/sdtk-code.js build --feature-key ORDER_MGMT --project-path ..\..\..\..\tmp-sdtk-code --active-slice "API contract updates" --complete
114
+ node bin/sdtk-code.js verify --feature-key ORDER_MGMT --project-path ..\..\..\..\tmp-sdtk-code --evidence "pytest -q|Regression suite passed|pass|docs/dev/evidence/ORDER_MGMT/pytest.txt" --spec-status pass --quality-status pass --complete
115
+ node bin/sdtk-code.js ship --feature-key ORDER_MGMT --project-path ..\..\..\..\tmp-sdtk-code --decision ship --preflight "npm pack --dry-run|Package smoke passed|pass|docs/dev/evidence/ORDER_MGMT/pack.txt"
116
+ ```
117
+
118
+ ## Release truth
119
+
120
+ First public release target:
121
+ - `sdtk-code-kit@0.1.0`
122
+
123
+ Release model:
124
+ - maintainer-driven local publish
125
+ - public npm metadata is part of the shipped package truth
126
+ - CI/tag-publish parity is follow-up hardening, not a blocker for the first public release
127
+
128
+ Historical note:
129
+ - older publishability planning assumed no workflow template belonged in the package payload
130
+ - that assumption is superseded by the implemented workflow-first rollout
131
+ - the package now intentionally ships only `CODE_WORKFLOW_TEMPLATE.md` from `toolkit/templates/`, not the full templates tree
132
+
133
+ ## References
134
+
135
+ - `products/sdtk-code/governance/usage-guide.md`
136
+ - `products/sdtk-code/governance/installation-runbook.md`
137
+ - `products/sdtk-code/governance/parity-matrix.md`
138
+ - `products/sdtk-code/governance/release-packaging.md`
@@ -0,0 +1,147 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "sourceCommit": "6bd50240df4da671347f44fbea93d34bfae5f258",
4
+ "fileCount": 28,
5
+ "files": [
6
+ {
7
+ "path": "toolkit/AGENTS.md",
8
+ "sha256": "04642d178219f03fb3922239df297ae91d81326046c153cf28f07f8a7db582ec",
9
+ "size": 8012
10
+ },
11
+ {
12
+ "path": "toolkit/install.ps1",
13
+ "sha256": "3fdb6c7f077004971a3f24ccdd2072ade36a3e9bc0f2a29309b2fa2a9fd585c7",
14
+ "size": 2950
15
+ },
16
+ {
17
+ "path": "toolkit/scripts/install-claude-skills.ps1",
18
+ "sha256": "720990cc979cdbca776bbe21eaeee0a73c5dd698ac6c8df430c7f22826ec9219",
19
+ "size": 2349
20
+ },
21
+ {
22
+ "path": "toolkit/scripts/install-codex-skills.ps1",
23
+ "sha256": "e47096d77f789fac6b9bc389b4f5fcb594db2f9530cde2c4f7708afd972d95ad",
24
+ "size": 3981
25
+ },
26
+ {
27
+ "path": "toolkit/scripts/uninstall-claude-skills.ps1",
28
+ "sha256": "148ddfc5a79a9dd6d7fa5b926c5511a5e4d458fa31003217cdc2eefcbe966cc2",
29
+ "size": 1776
30
+ },
31
+ {
32
+ "path": "toolkit/scripts/uninstall-codex-skills.ps1",
33
+ "sha256": "180125067b655790305a855c0f13a00abf94521a3c7d4cf47207c7d27776d5d5",
34
+ "size": 1518
35
+ },
36
+ {
37
+ "path": "toolkit/sdtk-spec.config.json",
38
+ "sha256": "dce4f2fd00ba5bd6b15ee09b83a17b878814fff9f63e12c01921820df93605e9",
39
+ "size": 113
40
+ },
41
+ {
42
+ "path": "toolkit/sdtk-spec.config.profiles.example.json",
43
+ "sha256": "e690255217a8b276c1d9bd3714e2cda9d92c0fac703bc955b9280e1b698e2d04",
44
+ "size": 288
45
+ },
46
+ {
47
+ "path": "toolkit/skills/code-brainstorm/SKILL.md",
48
+ "sha256": "8d6914cc4de12c5db57bd97f7b297db3fd0b35b1522f61eb936080221bd85759",
49
+ "size": 2352
50
+ },
51
+ {
52
+ "path": "toolkit/skills/code-debug/references/root-cause-tracing.md",
53
+ "sha256": "81bd8b131ec3d2740e9675e2fa4891584b448d52ef1e90a5484fabfa9b5f7a40",
54
+ "size": 2346
55
+ },
56
+ {
57
+ "path": "toolkit/skills/code-debug/SKILL.md",
58
+ "sha256": "a12da4370d3079055a4eb09fe4db7fe2fc611be440d3c7d89d527149a8888ae0",
59
+ "size": 10422
60
+ },
61
+ {
62
+ "path": "toolkit/skills/code-discover/SKILL.md",
63
+ "sha256": "de71c2ae31b28e6591e9045e940aa2c1e58b598145d2fb4fe77883ffafe56187",
64
+ "size": 3004
65
+ },
66
+ {
67
+ "path": "toolkit/skills/code-execute/SKILL.md",
68
+ "sha256": "44c017b15463b033c6b815a88c65b9d028b99334484929e2eb6dc709420a3a35",
69
+ "size": 2455
70
+ },
71
+ {
72
+ "path": "toolkit/skills/code-finish/SKILL.md",
73
+ "sha256": "f6cfc9c86e80afe0f83d7789f076f07e18aab1d3b650aad1da416eb4fcaf9929",
74
+ "size": 4397
75
+ },
76
+ {
77
+ "path": "toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md",
78
+ "sha256": "6e464c96353c8bc249f041b0b4d18afb115ac673b9665ab3bfc6948606a2abc3",
79
+ "size": 1241
80
+ },
81
+ {
82
+ "path": "toolkit/skills/code-parallel/references/implementer-prompt.md",
83
+ "sha256": "602d216ba4909b99f7b495e248dbf42944034e30087dad266035f3559446bbff",
84
+ "size": 4397
85
+ },
86
+ {
87
+ "path": "toolkit/skills/code-parallel/references/spec-reviewer-prompt.md",
88
+ "sha256": "8e9b6f346d230915c34cee24725b23a9744474d4e0ba63ce5328ced592cd584d",
89
+ "size": 2133
90
+ },
91
+ {
92
+ "path": "toolkit/skills/code-parallel/SKILL.md",
93
+ "sha256": "23220c3b14a9e7aade1e6fb7834bc2aa8baab3ae273c3d6504bc6cea7d2318dd",
94
+ "size": 2828
95
+ },
96
+ {
97
+ "path": "toolkit/skills/code-plan/SKILL.md",
98
+ "sha256": "0cb2e0f802fa4f356783d03cd6ef9b8067e7ef4ee034bca00e24d328c7b21b2c",
99
+ "size": 3634
100
+ },
101
+ {
102
+ "path": "toolkit/skills/code-review/references/checklist.md",
103
+ "sha256": "f6bf2391bf2b52952192ebaa3d9509137ea565fc584a620b2a1e055b8aef5a64",
104
+ "size": 6928
105
+ },
106
+ {
107
+ "path": "toolkit/skills/code-review/references/code-reviewer.md",
108
+ "sha256": "320cf457223033789edb7ed7f1ce39f44aa26def5036fb665bce2c94d0633961",
109
+ "size": 3525
110
+ },
111
+ {
112
+ "path": "toolkit/skills/code-review/SKILL.md",
113
+ "sha256": "59b75e3a8d90f0afc6759874dedefc4322905b38faf7b6dbccfceff88c178a02",
114
+ "size": 2904
115
+ },
116
+ {
117
+ "path": "toolkit/skills/code-ship/SKILL.md",
118
+ "sha256": "d511664ebc817d31f8c28b8e01053d807f3c83d293ff07a52e4ec274df0ce10f",
119
+ "size": 2251
120
+ },
121
+ {
122
+ "path": "toolkit/skills/code-tdd/references/testing-anti-patterns.md",
123
+ "sha256": "cff45b7dd0fc5b4c78086bc36532b73054333212881df5b56a8eef5b459991ef",
124
+ "size": 8334
125
+ },
126
+ {
127
+ "path": "toolkit/skills/code-tdd/SKILL.md",
128
+ "sha256": "2bdb79fe471aa76dc6939eb5bd90d1ae2739c68553cdb64b91f2cfafb083c1c3",
129
+ "size": 10842
130
+ },
131
+ {
132
+ "path": "toolkit/skills/code-verify/SKILL.md",
133
+ "sha256": "17a6b73ec64d96162cdee22ec58c53ece93ea0f6a60b2fc02fbe03e194346438",
134
+ "size": 4334
135
+ },
136
+ {
137
+ "path": "toolkit/skills/code-worktree/SKILL.md",
138
+ "sha256": "d6a1f2baf4540a504a5951f36f53dee64ba62a1dc38021c347576c1d230b29b2",
139
+ "size": 6357
140
+ },
141
+ {
142
+ "path": "toolkit/templates/CODE_WORKFLOW_TEMPLATE.md",
143
+ "sha256": "2e48444886c8a38ec0ec2cb0c73f7b8a7e5f273767d1fe3010dbff0f3ff8a60b",
144
+ "size": 2580
145
+ }
146
+ ]
147
+ }
@@ -0,0 +1,28 @@
1
+ 04642d178219f03fb3922239df297ae91d81326046c153cf28f07f8a7db582ec toolkit/AGENTS.md
2
+ 3fdb6c7f077004971a3f24ccdd2072ade36a3e9bc0f2a29309b2fa2a9fd585c7 toolkit/install.ps1
3
+ 720990cc979cdbca776bbe21eaeee0a73c5dd698ac6c8df430c7f22826ec9219 toolkit/scripts/install-claude-skills.ps1
4
+ e47096d77f789fac6b9bc389b4f5fcb594db2f9530cde2c4f7708afd972d95ad toolkit/scripts/install-codex-skills.ps1
5
+ 148ddfc5a79a9dd6d7fa5b926c5511a5e4d458fa31003217cdc2eefcbe966cc2 toolkit/scripts/uninstall-claude-skills.ps1
6
+ 180125067b655790305a855c0f13a00abf94521a3c7d4cf47207c7d27776d5d5 toolkit/scripts/uninstall-codex-skills.ps1
7
+ dce4f2fd00ba5bd6b15ee09b83a17b878814fff9f63e12c01921820df93605e9 toolkit/sdtk-spec.config.json
8
+ e690255217a8b276c1d9bd3714e2cda9d92c0fac703bc955b9280e1b698e2d04 toolkit/sdtk-spec.config.profiles.example.json
9
+ 8d6914cc4de12c5db57bd97f7b297db3fd0b35b1522f61eb936080221bd85759 toolkit/skills/code-brainstorm/SKILL.md
10
+ 81bd8b131ec3d2740e9675e2fa4891584b448d52ef1e90a5484fabfa9b5f7a40 toolkit/skills/code-debug/references/root-cause-tracing.md
11
+ a12da4370d3079055a4eb09fe4db7fe2fc611be440d3c7d89d527149a8888ae0 toolkit/skills/code-debug/SKILL.md
12
+ de71c2ae31b28e6591e9045e940aa2c1e58b598145d2fb4fe77883ffafe56187 toolkit/skills/code-discover/SKILL.md
13
+ 44c017b15463b033c6b815a88c65b9d028b99334484929e2eb6dc709420a3a35 toolkit/skills/code-execute/SKILL.md
14
+ f6cfc9c86e80afe0f83d7789f076f07e18aab1d3b650aad1da416eb4fcaf9929 toolkit/skills/code-finish/SKILL.md
15
+ 6e464c96353c8bc249f041b0b4d18afb115ac673b9665ab3bfc6948606a2abc3 toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md
16
+ 602d216ba4909b99f7b495e248dbf42944034e30087dad266035f3559446bbff toolkit/skills/code-parallel/references/implementer-prompt.md
17
+ 8e9b6f346d230915c34cee24725b23a9744474d4e0ba63ce5328ced592cd584d toolkit/skills/code-parallel/references/spec-reviewer-prompt.md
18
+ 23220c3b14a9e7aade1e6fb7834bc2aa8baab3ae273c3d6504bc6cea7d2318dd toolkit/skills/code-parallel/SKILL.md
19
+ 0cb2e0f802fa4f356783d03cd6ef9b8067e7ef4ee034bca00e24d328c7b21b2c toolkit/skills/code-plan/SKILL.md
20
+ f6bf2391bf2b52952192ebaa3d9509137ea565fc584a620b2a1e055b8aef5a64 toolkit/skills/code-review/references/checklist.md
21
+ 320cf457223033789edb7ed7f1ce39f44aa26def5036fb665bce2c94d0633961 toolkit/skills/code-review/references/code-reviewer.md
22
+ 59b75e3a8d90f0afc6759874dedefc4322905b38faf7b6dbccfceff88c178a02 toolkit/skills/code-review/SKILL.md
23
+ d511664ebc817d31f8c28b8e01053d807f3c83d293ff07a52e4ec274df0ce10f toolkit/skills/code-ship/SKILL.md
24
+ cff45b7dd0fc5b4c78086bc36532b73054333212881df5b56a8eef5b459991ef toolkit/skills/code-tdd/references/testing-anti-patterns.md
25
+ 2bdb79fe471aa76dc6939eb5bd90d1ae2739c68553cdb64b91f2cfafb083c1c3 toolkit/skills/code-tdd/SKILL.md
26
+ 17a6b73ec64d96162cdee22ec58c53ece93ea0f6a60b2fc02fbe03e194346438 toolkit/skills/code-verify/SKILL.md
27
+ d6a1f2baf4540a504a5951f36f53dee64ba62a1dc38021c347576c1d230b29b2 toolkit/skills/code-worktree/SKILL.md
28
+ 2e48444886c8a38ec0ec2cb0c73f7b8a7e5f273767d1fe3010dbff0f3ff8a60b toolkit/templates/CODE_WORKFLOW_TEMPLATE.md
@@ -0,0 +1,210 @@
1
+ # SDTK-CODE Workflow Routing Contract
2
+
3
+ ## 1. Product Identity
4
+ `SDTK-CODE` is the coding-only product in the `SDTK-SPEC -> SDTK-CODE -> SDTK-OPS` family.
5
+
6
+ It is a separate product from `SDTK-SPEC`, not a sub-phase inside `SDTK-SPEC`.
7
+
8
+ `SDTK-CODE` exists to enforce disciplined implementation work:
9
+ - implementation planning refinement
10
+ - TDD-first execution
11
+ - systematic debugging
12
+ - evidence-first verification
13
+ - spec-first and quality-second review
14
+ - ship and finish discipline
15
+
16
+ It does not own PM, BA, ARCH, or QA artifact generation.
17
+
18
+ ## 2. Upstream Boundary With SDTK-SPEC
19
+ `SDTK-SPEC` is the upstream docs-first system.
20
+
21
+ `SDTK-SPEC` produces the handoff artifacts.
22
+ `SDTK-CODE` starts after those handoff artifacts already exist.
23
+
24
+ Minimum expected inputs:
25
+ - `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md`
26
+ - `sdtk-spec.config.json`
27
+ - relevant architecture, API, DB, and flow/screen specs for the current slice when applicable
28
+
29
+ Preferred upstream intake artifact:
30
+ - `docs/dev/CODE_HANDOFF_[FEATURE_KEY].json`
31
+
32
+ Compatibility fallback when the formal handoff file is missing:
33
+ - `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md`
34
+ - `sdtk-spec.config.json`
35
+ - relevant architecture, API, DB, and flow/screen specs for the current slice when applicable
36
+
37
+ Expected outputs from `SDTK-CODE`:
38
+ - code changes
39
+ - test changes
40
+ - summarized verification evidence
41
+ - review findings
42
+ - ship or finish decisions
43
+
44
+ ## 3. Default Operating Model
45
+ The default product direction is workflow-first.
46
+
47
+ Normal mode is not "pick one of 12 skills and self-orchestrate from scratch."
48
+ Normal mode is:
49
+ - start from the workflow layer
50
+ - follow lane-aware routing
51
+ - keep execution traceable through `docs/dev/CODE_WORKFLOW_[FEATURE_KEY].md`
52
+
53
+ Important current truth:
54
+ - the workflow-first direction is locked
55
+ - the workflow routing contract now exists
56
+ - `start`, `plan`, `build`, `verify`, and `ship` now exist in the current package as control-plane workflow commands
57
+
58
+ That means this file is the routing contract for the workflow-first model. It describes the full intended workflow surface, which now exists in the CLI as control-plane workflow commands.
59
+
60
+ ## 4. Two-Layer Model
61
+ ### Workflow layer
62
+ This is the planned normal-mode surface.
63
+
64
+ Workflow phases:
65
+ - `start`
66
+ - `plan`
67
+ - `build`
68
+ - `verify`
69
+ - `ship`
70
+
71
+ The workflow layer is control-plane and routing-oriented.
72
+ It is intended to:
73
+ - validate state and inputs
74
+ - decide legal next steps
75
+ - update the workflow artifact
76
+ - route to the existing specialist engine
77
+
78
+ ### Specialist skill engine
79
+ The existing 12 `code-*` skills remain intact.
80
+
81
+ They are:
82
+ - the internal execution engine behind the workflow layer
83
+ - the expert-mode direct entrypoints
84
+ - not the default onboarding surface
85
+
86
+ ## 5. V1 Lane Model
87
+ V1 supports only two explicit lanes:
88
+ - `feature`
89
+ - `bugfix`
90
+
91
+ Deferred lanes remain out of scope for v1:
92
+ - `hardening`
93
+ - `review-only`
94
+ - `ship-only`
95
+
96
+ Lane intent:
97
+ - `feature` = full workflow: `start -> plan -> build -> verify -> ship`
98
+ - `bugfix` = lighter path: `start -> build -> verify -> ship`
99
+
100
+ Lane intake note:
101
+ - `feature` expects formal handoff by default and uses compatibility fallback only when the handoff file is missing
102
+ - `bugfix` also prefers formal handoff, but bounded compatibility fallback remains acceptable when the handoff file is missing
103
+
104
+ ## 6. Workflow Artifact
105
+ Canonical workflow artifact:
106
+ - `docs/dev/CODE_WORKFLOW_[FEATURE_KEY].md`
107
+
108
+ Canonical template path:
109
+ - `products/sdtk-code/toolkit/templates/CODE_WORKFLOW_TEMPLATE.md`
110
+
111
+ The workflow artifact is not a replacement for `FEATURE_IMPL_PLAN_[FEATURE_KEY].md`.
112
+ It is the coding execution memory that sits beside the upstream handoff artifact.
113
+
114
+ Evidence rule:
115
+ - summarized evidence belongs in `CODE_WORKFLOW_[FEATURE_KEY].md`
116
+ - raw command output should be stored separately and referenced from the workflow artifact
117
+
118
+ ## 7. Phase-To-Engine Mapping
119
+ | Workflow phase | Primary engine skills | Conditional engine skills | Notes |
120
+ |---|---|---|---|
121
+ | `start` | `code-discover` | `code-brainstorm` | Use `code-brainstorm` only when the slice is still ambiguous after intake grounding. |
122
+ | `plan` | `code-plan` | `code-brainstorm` | `code-brainstorm` remains optional when the implementation path is unclear. |
123
+ | `build` | `code-worktree`, `code-tdd`, `code-execute` | `code-parallel` | `code-parallel` should be used only for clearly independent tasks. |
124
+ | `verify` | `code-verify`, `code-review` | none | Review order stays evidence first, then spec/compliance, then quality. |
125
+ | `ship` | `code-ship`, `code-finish` | none | Ship stays coding-scope only and does not expand into full release governance. |
126
+
127
+ ### Cross-cutting reactive skill
128
+ `code-debug` is cross-cutting and reactive.
129
+
130
+ It is not a fixed top-level workflow phase.
131
+ Trigger it when failures occur during:
132
+ - `build`
133
+ - `verify`
134
+ - `ship` pre-flight or integration checks
135
+
136
+ ## 8. Normal Mode vs Expert Mode
137
+ ### Normal mode
138
+ Normal mode is workflow-first.
139
+
140
+ It should:
141
+ - begin from the workflow layer
142
+ - follow the lane model
143
+ - use the workflow artifact as the execution memory
144
+ - route to the engine skills intentionally rather than making the user choose blindly
145
+
146
+ ### Expert mode
147
+ Expert mode is direct raw `code-*` usage inside the runtime.
148
+
149
+ Examples:
150
+ - `/code-plan`
151
+ - `/code-tdd`
152
+ - `/code-debug`
153
+
154
+ Expert mode rules:
155
+ - raw skill usage remains available
156
+ - it is an advanced path, not the default onboarding path
157
+ - if a workflow artifact already exists, expert-mode deviations should be recorded against it
158
+ - v1 does not require a dedicated CLI expert-mode flag
159
+
160
+ ### Expert-mode deviation recording convention
161
+ Batch 7 keeps expert mode lightweight.
162
+
163
+ If a workflow artifact already exists and you bypass the normal workflow command path with raw `code-*` usage, record the deviation under `## 6. Evidence And Review Notes` using a lightweight note that captures:
164
+ - date/time
165
+ - current phase
166
+ - raw skill used
167
+ - reason for bypass
168
+ - evidence refs
169
+ - outcome or next action
170
+
171
+ This batch does not add runtime interception or a new artifact section for expert mode.
172
+ The rule is documentation plus lightweight recording inside the existing workflow artifact.
173
+
174
+ ## 9. Runtime Truth
175
+ | Runtime | Current truth | Workflow note |
176
+ |---|---|---|
177
+ | Claude | strongest intended runtime for v1 | full workflow direction is designed with Claude in mind |
178
+ | Codex | supported with user-scope only install | workflow routing must stay honest about degraded collaboration behavior |
179
+
180
+ Codex fallback note:
181
+ - `code-parallel` must degrade to sequential fallback when collaboration or subagent behavior is unavailable
182
+ - workflow routing must not assume runtime capabilities that Codex cannot reliably support
183
+
184
+ ## 10. Current Practical Reality
185
+ The current package can already handle:
186
+ - `sdtk-code init`
187
+ - `sdtk-code runtime install|uninstall|status`
188
+ - runtime skill installation for Claude and Codex
189
+
190
+ The workflow-first direction now defines the normal practical path:
191
+ - `sdtk-code start` for formal-handoff-first intake and artifact initialization
192
+ - `sdtk-code plan` for feature-lane refinement and optional lightweight bugfix planning
193
+ - `sdtk-code build` for build-progress tracking and next-step routing
194
+ - `sdtk-code verify` for summarized evidence capture and ordered review gating
195
+ - `sdtk-code ship` for final ship or finish decision capture
196
+ - direct raw `code-*` skills in Claude or Codex as the expert-mode escape hatch and specialist engine
197
+ - guided by this workflow routing contract
198
+
199
+ Current `start` intake truth:
200
+ - prefer `docs/dev/CODE_HANDOFF_[FEATURE_KEY].json`
201
+ - fall back to `FEATURE_IMPL_PLAN + sdtk-spec.config.json` only when the formal handoff file is missing
202
+ - block cleanly when the formal handoff file exists but is invalid or upstream-blocked
203
+
204
+ ## 11. What This Contract Prevents
205
+ This routing contract exists to prevent:
206
+ - treating `SDTK-CODE` as a loose 12-skill catalog
207
+ - creating a second competing wrapper-skill catalog
208
+ - drifting into PM/BA/ARCH/QA responsibilities
209
+ - modeling `code-debug` as a fixed linear phase
210
+ - overpromising workflow command behavior that is not implemented yet
@@ -0,0 +1,126 @@
1
+ param(
2
+ [Parameter(Mandatory = $true)]
3
+ [ValidateSet('codex', 'claude')]
4
+ [string]$Runtime,
5
+
6
+ [string]$ProjectPath,
7
+
8
+ [ValidateSet('project', 'user', '')]
9
+ [string]$Scope = '',
10
+
11
+ [switch]$Force,
12
+ [switch]$SkipRuntimeAssets,
13
+ [switch]$SkipSkills,
14
+ [switch]$Quiet
15
+ )
16
+
17
+ $ErrorActionPreference = 'Stop'
18
+ Set-StrictMode -Version Latest
19
+
20
+ function Copy-File {
21
+ param(
22
+ [Parameter(Mandatory = $true)][string]$SourcePath,
23
+ [Parameter(Mandatory = $true)][string]$DestinationPath,
24
+ [Parameter(Mandatory = $true)][bool]$Overwrite
25
+ )
26
+
27
+ if (-not (Test-Path -LiteralPath $SourcePath)) {
28
+ throw "Missing source file: $SourcePath"
29
+ }
30
+
31
+ if ((Test-Path -LiteralPath $DestinationPath) -and -not $Overwrite) {
32
+ if (-not $Quiet) {
33
+ Write-Warning "Already exists (skipping). Use -Force to overwrite: $DestinationPath"
34
+ }
35
+ return
36
+ }
37
+
38
+ $parent = Split-Path -Parent $DestinationPath
39
+ if ($parent -and -not (Test-Path -LiteralPath $parent)) {
40
+ New-Item -ItemType Directory -Force -Path $parent | Out-Null
41
+ }
42
+
43
+ Copy-Item -LiteralPath $SourcePath -Destination $DestinationPath -Force
44
+ }
45
+
46
+ $toolkitRoot = (Resolve-Path -LiteralPath $PSScriptRoot).Path
47
+ if (-not $ProjectPath) {
48
+ $ProjectPath = (Get-Location).Path
49
+ }
50
+ $projectRoot = (Resolve-Path -LiteralPath $ProjectPath).Path
51
+
52
+ if (-not $Scope) {
53
+ $Scope = if ($Runtime -eq 'claude') { 'project' } else { 'user' }
54
+ }
55
+
56
+ if ($Runtime -eq 'codex' -and $Scope -eq 'project') {
57
+ Write-Error "Codex does not support project-local skills. Use -Scope user instead."
58
+ exit 1
59
+ }
60
+
61
+ if ($SkipSkills) {
62
+ if (-not $Quiet) {
63
+ Write-Warning "-SkipSkills is deprecated. Use -SkipRuntimeAssets instead."
64
+ }
65
+ $SkipRuntimeAssets = $true
66
+ }
67
+
68
+ if (-not $Quiet) {
69
+ Write-Host "SDTK-CODE installer"
70
+ Write-Host " Runtime: $Runtime"
71
+ Write-Host " Scope: $Scope"
72
+ Write-Host " Project: $projectRoot"
73
+ Write-Host ""
74
+ }
75
+
76
+ $sharedFiles = @(
77
+ 'AGENTS.md',
78
+ 'sdtk-spec.config.json',
79
+ 'sdtk-spec.config.profiles.example.json'
80
+ )
81
+
82
+ foreach ($fileName in $sharedFiles) {
83
+ Copy-File `
84
+ -SourcePath (Join-Path $toolkitRoot $fileName) `
85
+ -DestinationPath (Join-Path $projectRoot $fileName) `
86
+ -Overwrite ([bool]$Force)
87
+
88
+ if (-not $Quiet) {
89
+ Write-Host " [OK] $fileName"
90
+ }
91
+ }
92
+
93
+ if (-not $SkipRuntimeAssets) {
94
+ $scriptPath = if ($Runtime -eq 'claude') {
95
+ Join-Path $toolkitRoot 'scripts/install-claude-skills.ps1'
96
+ } else {
97
+ Join-Path $toolkitRoot 'scripts/install-codex-skills.ps1'
98
+ }
99
+
100
+ if (-not (Test-Path -LiteralPath $scriptPath)) {
101
+ throw "Missing runtime installer: $scriptPath"
102
+ }
103
+
104
+ if (-not $Quiet) {
105
+ Write-Host ""
106
+ Write-Host "Installing $Runtime runtime assets..."
107
+ }
108
+
109
+ $params = @{
110
+ Scope = $Scope
111
+ Quiet = [bool]$Quiet
112
+ }
113
+ if ($Runtime -eq 'claude') {
114
+ $params.ProjectPath = $projectRoot
115
+ }
116
+ if ($Force) {
117
+ $params.Force = $true
118
+ }
119
+
120
+ & $scriptPath @params
121
+ }
122
+
123
+ if (-not $Quiet) {
124
+ Write-Host ""
125
+ Write-Host "SDTK-CODE installation complete."
126
+ }