sdtk-code-kit 0.1.2 → 0.2.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 (69) hide show
  1. package/README.md +202 -185
  2. package/assets/manifest/toolkit-bundle.manifest.json +54 -54
  3. package/assets/manifest/toolkit-bundle.sha256.txt +26 -26
  4. package/assets/toolkit/toolkit/install.ps1 +156 -119
  5. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +78 -78
  6. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +150 -150
  7. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +62 -62
  8. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +82 -82
  9. package/assets/toolkit/toolkit/sdtk-spec.config.json +6 -6
  10. package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +12 -12
  11. package/assets/toolkit/toolkit/skills/code-brainstorm/SKILL.md +55 -55
  12. package/assets/toolkit/toolkit/skills/code-debug/SKILL.md +1 -1
  13. package/assets/toolkit/toolkit/skills/code-debug/references/root-cause-tracing.md +68 -68
  14. package/assets/toolkit/toolkit/skills/code-execute/SKILL.md +74 -74
  15. package/assets/toolkit/toolkit/skills/code-finish/SKILL.md +205 -205
  16. package/assets/toolkit/toolkit/skills/code-parallel/SKILL.md +64 -64
  17. package/assets/toolkit/toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md +26 -26
  18. package/assets/toolkit/toolkit/skills/code-parallel/references/implementer-prompt.md +113 -113
  19. package/assets/toolkit/toolkit/skills/code-parallel/references/spec-reviewer-prompt.md +61 -61
  20. package/assets/toolkit/toolkit/skills/code-plan/SKILL.md +85 -85
  21. package/assets/toolkit/toolkit/skills/code-review/SKILL.md +79 -79
  22. package/assets/toolkit/toolkit/skills/code-review/references/checklist.md +125 -125
  23. package/assets/toolkit/toolkit/skills/code-review/references/code-reviewer.md +146 -146
  24. package/assets/toolkit/toolkit/skills/code-ship/SKILL.md +52 -52
  25. package/assets/toolkit/toolkit/skills/code-tdd/SKILL.md +1 -1
  26. package/assets/toolkit/toolkit/skills/code-tdd/references/testing-anti-patterns.md +299 -299
  27. package/assets/toolkit/toolkit/skills/code-verify/SKILL.md +144 -144
  28. package/assets/toolkit/toolkit/skills/code-worktree/SKILL.md +13 -13
  29. package/assets/toolkit/toolkit/templates/CODE_WORKFLOW_TEMPLATE.md +140 -112
  30. package/bin/sdtk-code.js +14 -14
  31. package/package.json +4 -4
  32. package/src/commands/build.js +53 -53
  33. package/src/commands/doctor.js +52 -0
  34. package/src/commands/generate.js +11 -11
  35. package/src/commands/guardrails.js +123 -0
  36. package/src/commands/help.js +30 -4
  37. package/src/commands/init.js +98 -95
  38. package/src/commands/plan.js +53 -53
  39. package/src/commands/readiness.js +77 -0
  40. package/src/commands/resume.js +62 -0
  41. package/src/commands/runtime.js +224 -224
  42. package/src/commands/ship.js +59 -59
  43. package/src/commands/start.js +89 -89
  44. package/src/commands/status.js +78 -0
  45. package/src/commands/verify.js +71 -66
  46. package/src/index.js +32 -1
  47. package/src/lib/args.js +107 -107
  48. package/src/lib/errors.js +41 -41
  49. package/src/lib/powershell.js +65 -65
  50. package/src/lib/project-target-guard.js +53 -0
  51. package/src/lib/scope.js +72 -72
  52. package/src/lib/ship-readiness.js +281 -0
  53. package/src/lib/toolkit-payload.js +72 -72
  54. package/src/lib/trust-events.js +166 -0
  55. package/src/lib/trust-file-scope.js +154 -0
  56. package/src/lib/trust-policy.js +212 -0
  57. package/src/lib/trust-redact.js +35 -0
  58. package/src/lib/trust-trace.js +179 -0
  59. package/src/lib/update.js +8 -1
  60. package/src/lib/workflow-artifact.js +503 -496
  61. package/src/lib/workflow-build.js +127 -127
  62. package/src/lib/workflow-doctor.js +84 -0
  63. package/src/lib/workflow-handoff.js +1029 -937
  64. package/src/lib/workflow-intake.js +101 -101
  65. package/src/lib/workflow-plan.js +193 -193
  66. package/src/lib/workflow-review-packet.js +89 -0
  67. package/src/lib/workflow-ship.js +213 -213
  68. package/src/lib/workflow-state.js +439 -0
  69. package/src/lib/workflow-verify.js +43 -6
@@ -1,28 +1,28 @@
1
1
  6bd495507c8b5e7a8f6a4f04623e7eccc69ee9a6f907c48e3d5a6c4cdc76bfc8 toolkit/AGENTS.md
2
- 4500fee93ba7f50f66d599f9b1ca63066698d129ea3639f699e9ea3b4255e15d toolkit/install.ps1
3
- 720990cc979cdbca776bbe21eaeee0a73c5dd698ac6c8df430c7f22826ec9219 toolkit/scripts/install-claude-skills.ps1
4
- 7d61249db7eee6185e5454f7427b808c79d5e564e0d2214ee5f92fa105effb04 toolkit/scripts/install-codex-skills.ps1
5
- 148ddfc5a79a9dd6d7fa5b926c5511a5e4d458fa31003217cdc2eefcbe966cc2 toolkit/scripts/uninstall-claude-skills.ps1
6
- 0fd11650bd445fad37c728471872b99bfb8bd17dfb95e62431ceccfad7f0852f toolkit/scripts/uninstall-codex-skills.ps1
7
- 04122c6d6c4de38d3b8dae890b95523aef6646a46b95c9b979852f2e123e753c toolkit/sdtk-spec.config.json
8
- e690255217a8b276c1d9bd3714e2cda9d92c0fac703bc955b9280e1b698e2d04 toolkit/sdtk-spec.config.profiles.example.json
9
- d797d707dc34d299dbac13f09f3bc8cc42759cb69a9fa5b2cb2269e4c246061e toolkit/skills/code-brainstorm/SKILL.md
10
- 698c89de9a0586e83ee52147adf345fa2ab813a06b454ca50e9c69e423f0a910 toolkit/skills/code-debug/references/root-cause-tracing.md
11
- 0eaffea2cb755c6f2598c46bd937dcec82f2727160fac9a4beb36ff79560418e toolkit/skills/code-debug/SKILL.md
2
+ edfb6675837922681acba3a28cf15526acb1f56992f13c0d61856aff23156687 toolkit/install.ps1
3
+ af74bc2a412a085d5244859f1005528807562d2eb8d79930843ec41ea9d80c71 toolkit/scripts/install-claude-skills.ps1
4
+ 8b90ce795fc05a5d241942cee576c6c8517893a7a28e80118dce2b158c3719e8 toolkit/scripts/install-codex-skills.ps1
5
+ 4ef5f672c08c69f25ccd42025af33e9e49e34edee8a74752bf0cb011724cd513 toolkit/scripts/uninstall-claude-skills.ps1
6
+ 8801e7ed3b0a9c3e9075fe1f05edab65ac9ce1d56669c88a56e56916b8ca3ff6 toolkit/scripts/uninstall-codex-skills.ps1
7
+ 2952fcbb9e75a2406cf9edb0de0582a79757e87ce5d9004e9b132ab65583bb26 toolkit/sdtk-spec.config.json
8
+ 538f2f57ee02b81577fad16fb6683c05534b4b14ea53a711c86c8a3e9cb04ccc toolkit/sdtk-spec.config.profiles.example.json
9
+ 2ba66bf89044689734c62e49b736820e646b63029d0a4a3fee02714e075bb54a toolkit/skills/code-brainstorm/SKILL.md
10
+ c5010c4d0d35eaf6da66ff9d73c3c3e58ca2c8aaa38218ba3e80ced08bde09ff toolkit/skills/code-debug/references/root-cause-tracing.md
11
+ 8d0889d7ffcca9957be6decd4c62b9a67da9e10a0717a50dfa6ec5ef2e3be69f toolkit/skills/code-debug/SKILL.md
12
12
  de71c2ae31b28e6591e9045e940aa2c1e58b598145d2fb4fe77883ffafe56187 toolkit/skills/code-discover/SKILL.md
13
- 8627a8c33cd170cc8009feb2b6ab7bf2bc4be91daa3609dc331a554ba41b1b3d toolkit/skills/code-execute/SKILL.md
14
- 5e352fb1739cf0b9297f34e49ae01d8b0c0ed57448c3c8f3b286d12e1177a130 toolkit/skills/code-finish/SKILL.md
15
- 5fec663aa52b7fd2b942f71a0755f0cd109d2273a5cd21c7c24eeed7684a4cc9 toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md
16
- 10bc07e6498e6a1e54805cce4d964545f2c1614e6679b0c1c4eb7d17b894e3a6 toolkit/skills/code-parallel/references/implementer-prompt.md
17
- b22d3262f252f7cc994d13bfe16c7103f3afe1e66c255090d88e53fbd68a0f82 toolkit/skills/code-parallel/references/spec-reviewer-prompt.md
18
- 393edd1c3ef6ff936c5ec6e2e739d3c02f1e6370e5a72872f186b5d2971d37b7 toolkit/skills/code-parallel/SKILL.md
19
- 7fe115e27a83d04243401bb628ae4246a323246c972fd54890fe4a7e97926bbf toolkit/skills/code-plan/SKILL.md
20
- 4612b4e40992f594b577146ac14f1ff13c1812e8e9da64b07eb1e2de5363af5d toolkit/skills/code-review/references/checklist.md
21
- 7f5328dca12cb200005ae9d4386f63a9b0acb735ece57f82db206b4a3189ccae toolkit/skills/code-review/references/code-reviewer.md
22
- 4d10ec40ae8ca87de03b2724b90c91053bf756c880a67d8f9a79aabd948f49b5 toolkit/skills/code-review/SKILL.md
23
- c8dbbae4f8ed65b00e38a386cb9adba340c90dc7fd0dd8257f3c1fea37322558 toolkit/skills/code-ship/SKILL.md
24
- a85c93883197eef41f5392875b41a19b8cdeb3b14b3c6fb5a6dbfb6f21a1b825 toolkit/skills/code-tdd/references/testing-anti-patterns.md
25
- adc09aae75a67705cfa69122b1496e0f8f64a56f5ed8e31c3f18bbed9c8238ed toolkit/skills/code-tdd/SKILL.md
26
- 6df69cf2db69d13672b3e73a2c25aca48791e9ea912c1e1fbc3ce7734399c346 toolkit/skills/code-verify/SKILL.md
27
- c715716c3e2599fa2e5376c68c0496d5b631085ecdb31709df91f0e69aafe74b toolkit/skills/code-worktree/SKILL.md
28
- 2e48444886c8a38ec0ec2cb0c73f7b8a7e5f273767d1fe3010dbff0f3ff8a60b toolkit/templates/CODE_WORKFLOW_TEMPLATE.md
13
+ c8a2ab27a755a6ef3aafb216ae41bad4ad3e2fbdd3b5bb4831d18811134a0c04 toolkit/skills/code-execute/SKILL.md
14
+ 9624a06d6670004569c51dd80d640328c4759e30c1a20cb4739703ada77cbb47 toolkit/skills/code-finish/SKILL.md
15
+ dfb116c7e7e38ad41178a8d389eb21207b037cc385658f4fda021e8ab41fc9bf toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md
16
+ b593b76fb9c3e75827ef6eb1f4a4d1672cc0182b63edb70098943c45cedd9675 toolkit/skills/code-parallel/references/implementer-prompt.md
17
+ 79a960f7a3b03f3fcc57fb2e3e84d4f14b3896e94718db7702ad7fc9987b9fd4 toolkit/skills/code-parallel/references/spec-reviewer-prompt.md
18
+ 1cd49f827d618baf6e407538d6c726ef57889f3414d5df9947ac9aa9c579e586 toolkit/skills/code-parallel/SKILL.md
19
+ e3678a9ed56a5acac5476ed267128f1a3012230d251c970692f3c83b026b0d6c toolkit/skills/code-plan/SKILL.md
20
+ f8dca772cb9709e771e1fb794f4511ba399be12be81c84e6b3d2ab1c5fb6da02 toolkit/skills/code-review/references/checklist.md
21
+ 7736646295a45cb0ea1b607842c1ebebf28ee36ae6facc5e1c373adf745e40af toolkit/skills/code-review/references/code-reviewer.md
22
+ 5653bd2b2369feb4b4b6a32e7095eadf67e85e1620f7db66fa1ac8eca4af7f5b toolkit/skills/code-review/SKILL.md
23
+ f9bc4ca51046d56ec9b363bc76b3355c14aede2597811115bc3602a695525568 toolkit/skills/code-ship/SKILL.md
24
+ 590cbc45f0ff56ccb027910cd955f792a729550eda87c0ca48361aa3ea31a34e toolkit/skills/code-tdd/references/testing-anti-patterns.md
25
+ 75a4f319c7ab1c0e42eabe385fdc41b990aca156dd123a2c89cd7815a8d4b379 toolkit/skills/code-tdd/SKILL.md
26
+ 52ba508927b05eec72b53b4516c4242aab13b8d2571b23989e53b86fd0a7859f toolkit/skills/code-verify/SKILL.md
27
+ a9e5e735e738917006add76f96b05eaceae4bab2ba260ac1c7e61b40ebd66206 toolkit/skills/code-worktree/SKILL.md
28
+ 7662da58140c5a44c4e64fa1ebf33df5fe29f2505e367c5428f8447f1de5d041 toolkit/templates/CODE_WORKFLOW_TEMPLATE.md
@@ -1,119 +1,156 @@
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 ($SkipSkills) {
57
- if (-not $Quiet) {
58
- Write-Warning "-SkipSkills is deprecated. Use -SkipRuntimeAssets instead."
59
- }
60
- $SkipRuntimeAssets = $true
61
- }
62
-
63
- if (-not $Quiet) {
64
- Write-Host "SDTK-CODE installer"
65
- Write-Host " Runtime: $Runtime"
66
- Write-Host " Scope: $Scope"
67
- Write-Host " Project: $projectRoot"
68
- Write-Host ""
69
- }
70
-
71
- $sharedFiles = @(
72
- 'AGENTS.md',
73
- 'sdtk-spec.config.json',
74
- 'sdtk-spec.config.profiles.example.json'
75
- )
76
-
77
- foreach ($fileName in $sharedFiles) {
78
- Copy-File `
79
- -SourcePath (Join-Path $toolkitRoot $fileName) `
80
- -DestinationPath (Join-Path $projectRoot $fileName) `
81
- -Overwrite ([bool]$Force)
82
-
83
- if (-not $Quiet) {
84
- Write-Host " [OK] $fileName"
85
- }
86
- }
87
-
88
- if (-not $SkipRuntimeAssets) {
89
- $scriptPath = if ($Runtime -eq 'claude') {
90
- Join-Path $toolkitRoot 'scripts/install-claude-skills.ps1'
91
- } else {
92
- Join-Path $toolkitRoot 'scripts/install-codex-skills.ps1'
93
- }
94
-
95
- if (-not (Test-Path -LiteralPath $scriptPath)) {
96
- throw "Missing runtime installer: $scriptPath"
97
- }
98
-
99
- if (-not $Quiet) {
100
- Write-Host ""
101
- Write-Host "Installing $Runtime runtime assets..."
102
- }
103
-
104
- $params = @{
105
- Scope = $Scope
106
- ProjectPath = $projectRoot
107
- Quiet = [bool]$Quiet
108
- }
109
- if ($Force) {
110
- $params.Force = $true
111
- }
112
-
113
- & $scriptPath @params
114
- }
115
-
116
- if (-not $Quiet) {
117
- Write-Host ""
118
- Write-Host "SDTK-CODE installation complete."
119
- }
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
+ function Test-IsMaintainerRoot {
47
+ param(
48
+ [Parameter(Mandatory = $true)][string]$ProjectRoot,
49
+ [Parameter(Mandatory = $true)][string[]]$Markers
50
+ )
51
+
52
+ foreach ($marker in $Markers) {
53
+ if (-not (Test-Path -LiteralPath (Join-Path $ProjectRoot $marker))) {
54
+ return $false
55
+ }
56
+ }
57
+
58
+ return $true
59
+ }
60
+
61
+ function Get-MaintainerRootInstallMessage {
62
+ param(
63
+ [Parameter(Mandatory = $true)][string]$ProjectRoot
64
+ )
65
+
66
+ return @(
67
+ "Refusing to install managed project files into the SDTK maintainer repo root: $ProjectRoot"
68
+ "This install flow would overwrite repo-owned files such as AGENTS.md, CODEX.md, CLAUDE.md, sdtk-spec.config.json, sdtk-spec.config.profiles.example.json."
69
+ "Target a consumer project path instead of the SDTK maintainer monorepo root."
70
+ "If you only need runtime assets, install them into a separate consumer project path rather than the maintainer repo root."
71
+ ) -join "`n"
72
+ }
73
+
74
+ $toolkitRoot = (Resolve-Path -LiteralPath $PSScriptRoot).Path
75
+ if (-not $ProjectPath) {
76
+ $ProjectPath = (Get-Location).Path
77
+ }
78
+ $projectRoot = (Resolve-Path -LiteralPath $ProjectPath).Path
79
+
80
+ $maintainerRootMarkers = @(
81
+ 'governance/ai/core/IMPROVEMENT_BACKLOG.md',
82
+ 'products/sdtk-code/toolkit/install.ps1'
83
+ )
84
+
85
+ if (Test-IsMaintainerRoot -ProjectRoot $projectRoot -Markers $maintainerRootMarkers) {
86
+ throw (Get-MaintainerRootInstallMessage -ProjectRoot $projectRoot)
87
+ }
88
+
89
+ if (-not $Scope) {
90
+ $Scope = if ($Runtime -eq 'claude') { 'project' } else { 'user' }
91
+ }
92
+
93
+ if ($SkipSkills) {
94
+ if (-not $Quiet) {
95
+ Write-Warning "-SkipSkills is deprecated. Use -SkipRuntimeAssets instead."
96
+ }
97
+ $SkipRuntimeAssets = $true
98
+ }
99
+
100
+ if (-not $Quiet) {
101
+ Write-Host "SDTK-CODE installer"
102
+ Write-Host " Runtime: $Runtime"
103
+ Write-Host " Scope: $Scope"
104
+ Write-Host " Project: $projectRoot"
105
+ Write-Host ""
106
+ }
107
+
108
+ $sharedFiles = @(
109
+ 'AGENTS.md',
110
+ 'sdtk-spec.config.json',
111
+ 'sdtk-spec.config.profiles.example.json'
112
+ )
113
+
114
+ foreach ($fileName in $sharedFiles) {
115
+ Copy-File `
116
+ -SourcePath (Join-Path $toolkitRoot $fileName) `
117
+ -DestinationPath (Join-Path $projectRoot $fileName) `
118
+ -Overwrite ([bool]$Force)
119
+
120
+ if (-not $Quiet) {
121
+ Write-Host " [OK] $fileName"
122
+ }
123
+ }
124
+
125
+ if (-not $SkipRuntimeAssets) {
126
+ $scriptPath = if ($Runtime -eq 'claude') {
127
+ Join-Path $toolkitRoot 'scripts/install-claude-skills.ps1'
128
+ } else {
129
+ Join-Path $toolkitRoot 'scripts/install-codex-skills.ps1'
130
+ }
131
+
132
+ if (-not (Test-Path -LiteralPath $scriptPath)) {
133
+ throw "Missing runtime installer: $scriptPath"
134
+ }
135
+
136
+ if (-not $Quiet) {
137
+ Write-Host ""
138
+ Write-Host "Installing $Runtime runtime assets..."
139
+ }
140
+
141
+ $params = @{
142
+ Scope = $Scope
143
+ ProjectPath = $projectRoot
144
+ Quiet = [bool]$Quiet
145
+ }
146
+ if ($Force) {
147
+ $params.Force = $true
148
+ }
149
+
150
+ & $scriptPath @params
151
+ }
152
+
153
+ if (-not $Quiet) {
154
+ Write-Host ""
155
+ Write-Host "SDTK-CODE installation complete."
156
+ }
@@ -1,78 +1,78 @@
1
- param(
2
- [string]$ProjectPath,
3
- [ValidateSet('project', 'user')]
4
- [string]$Scope = 'project',
5
- [switch]$Force,
6
- [switch]$Quiet
7
- )
8
-
9
- $ErrorActionPreference = 'Stop'
10
- Set-StrictMode -Version Latest
11
-
12
- $toolkitRoot = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
13
- $skillsSource = Join-Path $toolkitRoot 'skills'
14
- if (-not (Test-Path -LiteralPath $skillsSource)) {
15
- throw "Missing toolkit skills source directory: $skillsSource"
16
- }
17
-
18
- $managedSkills = @(Get-ChildItem -LiteralPath $skillsSource -Directory | Sort-Object Name)
19
- if ($managedSkills.Count -ne 12) {
20
- throw "Expected 12 managed SDTK-CODE skills but found $($managedSkills.Count)."
21
- }
22
-
23
- if ($Scope -eq 'user') {
24
- $skillsDest = Join-Path $HOME '.claude/skills'
25
- } else {
26
- if (-not $ProjectPath) {
27
- throw "ProjectPath is required for Claude project scope installation."
28
- }
29
- $projectRoot = (Resolve-Path -LiteralPath $ProjectPath).Path
30
- $skillsDest = Join-Path $projectRoot '.claude/skills'
31
- }
32
-
33
- New-Item -ItemType Directory -Force -Path $skillsDest | Out-Null
34
-
35
- $copied = 0
36
- $skipped = 0
37
- foreach ($skillDir in $managedSkills) {
38
- $skillFile = Join-Path $skillDir.FullName 'SKILL.md'
39
- if (-not (Test-Path -LiteralPath $skillFile)) {
40
- throw "Managed skill is missing SKILL.md: $($skillDir.FullName)"
41
- }
42
-
43
- $destDir = Join-Path $skillsDest $skillDir.Name
44
- if (Test-Path -LiteralPath $destDir) {
45
- if (-not $Force) {
46
- $skipped++
47
- if (-not $Quiet) {
48
- Write-Warning "Skill already installed (skipping). Use -Force to overwrite: $($skillDir.Name)"
49
- }
50
- continue
51
- }
52
- Remove-Item -LiteralPath $destDir -Recurse -Force
53
- }
54
-
55
- Copy-Item -LiteralPath $skillDir.FullName -Destination $destDir -Recurse -Force
56
- $copied++
57
- if (-not $Quiet) {
58
- Write-Host "Installed: $($skillDir.Name)"
59
- }
60
- }
61
-
62
- $installedNow = @(
63
- Get-ChildItem -LiteralPath $skillsDest -Directory -ErrorAction SilentlyContinue |
64
- Where-Object { $managedSkills.Name -contains $_.Name } |
65
- Select-Object -ExpandProperty Name
66
- )
67
- if ($installedNow.Count -ne 12) {
68
- throw "Claude skill install incomplete. Expected 12 managed skills at $skillsDest but found $($installedNow.Count)."
69
- }
70
-
71
- if (-not $Quiet) {
72
- Write-Host ""
73
- Write-Host "Install summary:"
74
- Write-Host "- Scope: $Scope"
75
- Write-Host "- Destination: $skillsDest"
76
- Write-Host "- Copied: $copied"
77
- Write-Host "- Skipped: $skipped"
78
- }
1
+ param(
2
+ [string]$ProjectPath,
3
+ [ValidateSet('project', 'user')]
4
+ [string]$Scope = 'project',
5
+ [switch]$Force,
6
+ [switch]$Quiet
7
+ )
8
+
9
+ $ErrorActionPreference = 'Stop'
10
+ Set-StrictMode -Version Latest
11
+
12
+ $toolkitRoot = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
13
+ $skillsSource = Join-Path $toolkitRoot 'skills'
14
+ if (-not (Test-Path -LiteralPath $skillsSource)) {
15
+ throw "Missing toolkit skills source directory: $skillsSource"
16
+ }
17
+
18
+ $managedSkills = @(Get-ChildItem -LiteralPath $skillsSource -Directory | Sort-Object Name)
19
+ if ($managedSkills.Count -ne 12) {
20
+ throw "Expected 12 managed SDTK-CODE skills but found $($managedSkills.Count)."
21
+ }
22
+
23
+ if ($Scope -eq 'user') {
24
+ $skillsDest = Join-Path $HOME '.claude/skills'
25
+ } else {
26
+ if (-not $ProjectPath) {
27
+ throw "ProjectPath is required for Claude project scope installation."
28
+ }
29
+ $projectRoot = (Resolve-Path -LiteralPath $ProjectPath).Path
30
+ $skillsDest = Join-Path $projectRoot '.claude/skills'
31
+ }
32
+
33
+ New-Item -ItemType Directory -Force -Path $skillsDest | Out-Null
34
+
35
+ $copied = 0
36
+ $skipped = 0
37
+ foreach ($skillDir in $managedSkills) {
38
+ $skillFile = Join-Path $skillDir.FullName 'SKILL.md'
39
+ if (-not (Test-Path -LiteralPath $skillFile)) {
40
+ throw "Managed skill is missing SKILL.md: $($skillDir.FullName)"
41
+ }
42
+
43
+ $destDir = Join-Path $skillsDest $skillDir.Name
44
+ if (Test-Path -LiteralPath $destDir) {
45
+ if (-not $Force) {
46
+ $skipped++
47
+ if (-not $Quiet) {
48
+ Write-Warning "Skill already installed (skipping). Use -Force to overwrite: $($skillDir.Name)"
49
+ }
50
+ continue
51
+ }
52
+ Remove-Item -LiteralPath $destDir -Recurse -Force
53
+ }
54
+
55
+ Copy-Item -LiteralPath $skillDir.FullName -Destination $destDir -Recurse -Force
56
+ $copied++
57
+ if (-not $Quiet) {
58
+ Write-Host "Installed: $($skillDir.Name)"
59
+ }
60
+ }
61
+
62
+ $installedNow = @(
63
+ Get-ChildItem -LiteralPath $skillsDest -Directory -ErrorAction SilentlyContinue |
64
+ Where-Object { $managedSkills.Name -contains $_.Name } |
65
+ Select-Object -ExpandProperty Name
66
+ )
67
+ if ($installedNow.Count -ne 12) {
68
+ throw "Claude skill install incomplete. Expected 12 managed skills at $skillsDest but found $($installedNow.Count)."
69
+ }
70
+
71
+ if (-not $Quiet) {
72
+ Write-Host ""
73
+ Write-Host "Install summary:"
74
+ Write-Host "- Scope: $Scope"
75
+ Write-Host "- Destination: $skillsDest"
76
+ Write-Host "- Copied: $copied"
77
+ Write-Host "- Skipped: $skipped"
78
+ }