sdtk-code-kit 0.2.0 → 0.3.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.
- package/README.md +3 -3
- package/assets/manifest/toolkit-bundle.manifest.json +57 -57
- package/assets/manifest/toolkit-bundle.sha256.txt +28 -28
- package/assets/toolkit/toolkit/AGENTS.md +219 -219
- package/assets/toolkit/toolkit/install.ps1 +156 -156
- package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +78 -78
- package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +150 -150
- package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +62 -62
- package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +82 -82
- package/assets/toolkit/toolkit/sdtk-spec.config.json +6 -6
- package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +12 -12
- package/assets/toolkit/toolkit/skills/code-brainstorm/SKILL.md +55 -55
- package/assets/toolkit/toolkit/skills/code-debug/SKILL.md +296 -296
- package/assets/toolkit/toolkit/skills/code-debug/references/root-cause-tracing.md +68 -68
- package/assets/toolkit/toolkit/skills/code-discover/SKILL.md +54 -54
- package/assets/toolkit/toolkit/skills/code-execute/SKILL.md +74 -74
- package/assets/toolkit/toolkit/skills/code-finish/SKILL.md +205 -205
- package/assets/toolkit/toolkit/skills/code-parallel/SKILL.md +64 -64
- package/assets/toolkit/toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md +26 -26
- package/assets/toolkit/toolkit/skills/code-parallel/references/implementer-prompt.md +113 -113
- package/assets/toolkit/toolkit/skills/code-parallel/references/spec-reviewer-prompt.md +61 -61
- package/assets/toolkit/toolkit/skills/code-plan/SKILL.md +85 -85
- package/assets/toolkit/toolkit/skills/code-review/SKILL.md +79 -79
- package/assets/toolkit/toolkit/skills/code-review/references/checklist.md +125 -125
- package/assets/toolkit/toolkit/skills/code-review/references/code-reviewer.md +146 -146
- package/assets/toolkit/toolkit/skills/code-ship/SKILL.md +52 -52
- package/assets/toolkit/toolkit/skills/code-tdd/SKILL.md +378 -378
- package/assets/toolkit/toolkit/skills/code-tdd/references/testing-anti-patterns.md +299 -299
- package/assets/toolkit/toolkit/skills/code-verify/SKILL.md +144 -144
- package/assets/toolkit/toolkit/skills/code-worktree/SKILL.md +228 -228
- package/assets/toolkit/toolkit/templates/CODE_WORKFLOW_TEMPLATE.md +140 -140
- package/package.json +2 -2
- package/src/commands/agent-team.js +174 -0
- package/src/commands/guardrails.js +94 -2
- package/src/commands/help.js +13 -0
- package/src/commands/sleep.js +132 -0
- package/src/index.js +8 -0
- package/src/lib/agent-team-export.js +409 -0
- package/src/lib/agent-team-plan.js +514 -0
- package/src/lib/sleep-plan.js +175 -0
- package/src/lib/sleep-report.js +229 -0
- package/src/lib/trust-events.js +20 -1
|
@@ -1,156 +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
|
-
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
|
+
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
|
+
}
|