sdtk-kit 0.3.9 → 1.0.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 (118) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +135 -177
  3. package/bin/sdtk-code.js +6 -0
  4. package/bin/sdtk-design.js +6 -0
  5. package/bin/sdtk-ops.js +6 -0
  6. package/bin/sdtk-spec.js +12 -0
  7. package/bin/sdtk-wiki.js +6 -0
  8. package/package.json +60 -46
  9. package/scripts/postinstall.js +40 -0
  10. package/assets/manifest/toolkit-bundle.manifest.json +0 -473
  11. package/assets/manifest/toolkit-bundle.sha256.txt +0 -93
  12. package/assets/toolkit/toolkit/AGENTS.md +0 -131
  13. package/assets/toolkit/toolkit/install.ps1 +0 -310
  14. package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +0 -54
  15. package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +0 -32
  16. package/assets/toolkit/toolkit/scripts/init-feature.ps1 +0 -261
  17. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +0 -169
  18. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +0 -189
  19. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +0 -139
  20. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +0 -116
  21. package/assets/toolkit/toolkit/sdtk.config.json +0 -28
  22. package/assets/toolkit/toolkit/sdtk.config.profiles.example.json +0 -50
  23. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +0 -84
  24. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +0 -22
  25. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  26. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/FLOWCHART_CREATION_RULES.md +0 -20
  27. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +0 -732
  28. package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +0 -43
  29. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  30. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/FLOWCHART_CREATION_RULES.md +0 -20
  31. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/YAML_CREATION_RULES.md +0 -128
  32. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +0 -83
  33. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +0 -22
  34. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  35. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOWCHART_CREATION_RULES.md +0 -20
  36. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
  37. package/assets/toolkit/toolkit/skills/sdtk-arch/references/YAML_CREATION_RULES.md +0 -128
  38. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +0 -29
  39. package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +0 -52
  40. package/assets/toolkit/toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py +0 -246
  41. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +0 -90
  42. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/code-quality-reviewer.md +0 -35
  43. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/implementer.md +0 -61
  44. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/spec-reviewer.md +0 -42
  45. package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +0 -21
  46. package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +0 -19
  47. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +0 -80
  48. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +0 -30
  49. package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +0 -53
  50. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +0 -86
  51. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
  52. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md +0 -51
  53. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md +0 -54
  54. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +0 -28
  55. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py +0 -136
  56. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +0 -414
  57. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +0 -74
  58. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md +0 -129
  59. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py +0 -97
  60. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +0 -302
  61. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +0 -90
  62. package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +0 -47
  63. package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +0 -59
  64. package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +0 -50
  65. package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +0 -57
  66. package/assets/toolkit/toolkit/skills-claude/dev/SKILL.md +0 -45
  67. package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +0 -20
  68. package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +0 -18
  69. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +0 -63
  70. package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +0 -52
  71. package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +0 -48
  72. package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +0 -90
  73. package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +0 -61
  74. package/assets/toolkit/toolkit/templates/QUALITY_CHECKLIST.md +0 -124
  75. package/assets/toolkit/toolkit/templates/README.md +0 -63
  76. package/assets/toolkit/toolkit/templates/SHARED_PLANNING.md +0 -80
  77. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +0 -22
  78. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +0 -67
  79. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  80. package/assets/toolkit/toolkit/templates/docs/api/API_ENDPOINTS_TEMPLATE.md +0 -229
  81. package/assets/toolkit/toolkit/templates/docs/api/FEATURE_API_TEMPLATE.yaml +0 -20
  82. package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +0 -20
  83. package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +0 -128
  84. package/assets/toolkit/toolkit/templates/docs/api/feature_api_flow_list_TEMPLATE.txt +0 -12
  85. package/assets/toolkit/toolkit/templates/docs/architecture/ARCH_DESIGN_TEMPLATE.md +0 -109
  86. package/assets/toolkit/toolkit/templates/docs/database/DATABASE_SPEC_TEMPLATE.md +0 -175
  87. package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +0 -60
  88. package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +0 -73
  89. package/assets/toolkit/toolkit/templates/docs/product/BACKLOG_TEMPLATE.md +0 -50
  90. package/assets/toolkit/toolkit/templates/docs/product/PRD_TEMPLATE.md +0 -66
  91. package/assets/toolkit/toolkit/templates/docs/product/PROJECT_INITIATION_TEMPLATE.md +0 -98
  92. package/assets/toolkit/toolkit/templates/docs/qa/QA_RELEASE_REPORT_TEMPLATE.md +0 -61
  93. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md +0 -129
  94. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_TEMPLATE.md +0 -104
  95. package/assets/toolkit/toolkit/templates/docs/specs/BA_SPEC_TEMPLATE.md +0 -139
  96. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
  97. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +0 -197
  98. package/assets/toolkit/toolkit/templates/handoffs/ARCH_TO_DEV.md +0 -31
  99. package/assets/toolkit/toolkit/templates/handoffs/BA_TO_ARCH.md +0 -28
  100. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE1_SPEC_REVIEW.md +0 -26
  101. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE2_CODE_QUALITY_REVIEW.md +0 -20
  102. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_QA.md +0 -23
  103. package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +0 -26
  104. package/assets/toolkit/toolkit/templates/handoffs/QA_RELEASE_DECISION.md +0 -21
  105. package/bin/sdtk.js +0 -15
  106. package/src/commands/auth.js +0 -85
  107. package/src/commands/generate.js +0 -177
  108. package/src/commands/help.js +0 -101
  109. package/src/commands/init.js +0 -97
  110. package/src/commands/runtime.js +0 -217
  111. package/src/index.js +0 -59
  112. package/src/lib/args.js +0 -116
  113. package/src/lib/errors.js +0 -41
  114. package/src/lib/github-access.js +0 -68
  115. package/src/lib/powershell.js +0 -85
  116. package/src/lib/scope.js +0 -68
  117. package/src/lib/state.js +0 -83
  118. package/src/lib/toolkit-payload.js +0 -99
@@ -1,261 +0,0 @@
1
- param(
2
- [Parameter(Mandatory = $true)]
3
- [string]$FeatureKey,
4
-
5
- [Parameter(Mandatory = $true)]
6
- [string]$FeatureName,
7
-
8
- [string]$ProjectPath,
9
-
10
- [switch]$Force,
11
-
12
- [switch]$ValidateOnly
13
- )
14
-
15
- $ErrorActionPreference = 'Stop'
16
- Set-StrictMode -Version Latest
17
-
18
- function ConvertTo-PascalCase {
19
- param([Parameter(Mandatory = $true)][string]$Text)
20
-
21
- $parts = $Text -split '[^A-Za-z0-9]+' | Where-Object { $_ -and $_.Trim().Length -gt 0 }
22
- if (-not $parts -or $parts.Count -eq 0) {
23
- return ''
24
- }
25
-
26
- return ($parts | ForEach-Object {
27
- if ($_.Length -eq 1) { $_.Substring(0, 1).ToUpper() }
28
- else { $_.Substring(0, 1).ToUpper() + $_.Substring(1) }
29
- }) -join ''
30
- }
31
-
32
- function Render-Template {
33
- param(
34
- [Parameter(Mandatory = $true)][string]$TemplatePath,
35
- [Parameter(Mandatory = $true)][hashtable]$Tokens
36
- )
37
-
38
- $content = Get-Content -Raw -Path $TemplatePath -Encoding UTF8
39
- # Strip BOM if present (Windows PowerShell 5.1 may read BOM into string)
40
- if ($content.Length -gt 0 -and $content[0] -eq [char]0xFEFF) {
41
- $content = $content.Substring(1)
42
- }
43
- foreach ($key in $Tokens.Keys) {
44
- $content = $content.Replace("{{${key}}}", [string]$Tokens[$key])
45
- }
46
- return $content
47
- }
48
-
49
- function Write-RenderedFile {
50
- param(
51
- [Parameter(Mandatory = $true)][string]$DestinationPath,
52
- [Parameter(Mandatory = $true)][string]$TemplatePath,
53
- [Parameter(Mandatory = $true)][hashtable]$Tokens,
54
- [Parameter(Mandatory = $true)][bool]$Overwrite
55
- )
56
-
57
- if ((Test-Path -LiteralPath $DestinationPath) -and -not $Overwrite) {
58
- throw "Refusing to overwrite existing file (use -Force): $DestinationPath"
59
- }
60
-
61
- $parent = Split-Path -Parent $DestinationPath
62
- if ($parent -and -not (Test-Path -LiteralPath $parent)) {
63
- New-Item -ItemType Directory -Force -Path $parent | Out-Null
64
- }
65
-
66
- $rendered = Render-Template -TemplatePath $TemplatePath -Tokens $Tokens
67
- $utf8NoBom = New-Object System.Text.UTF8Encoding($false)
68
- [System.IO.File]::WriteAllText($DestinationPath, $rendered, $utf8NoBom)
69
- }
70
-
71
- $config = $null
72
- function Get-StringOrDefault {
73
- param(
74
- [AllowNull()][object]$Value,
75
- [Parameter(Mandatory = $true)][string]$Default
76
- )
77
-
78
- if ($null -eq $Value) {
79
- return $Default
80
- }
81
- $text = ([string]$Value).Trim()
82
- if ($text.Length -eq 0) {
83
- return $Default
84
- }
85
- return $text
86
- }
87
-
88
- function Get-PropValue {
89
- param(
90
- [AllowNull()][object]$Object,
91
- [Parameter(Mandatory = $true)][string]$Name
92
- )
93
-
94
- if ($null -eq $Object) {
95
- return $null
96
- }
97
- $prop = $Object.PSObject.Properties[$Name]
98
- if ($null -eq $prop) {
99
- return $null
100
- }
101
- return $prop.Value
102
- }
103
-
104
- $toolkitRoot = Resolve-Path (Join-Path $PSScriptRoot '..')
105
-
106
- if ($ProjectPath) {
107
- if (-not (Test-Path -LiteralPath $ProjectPath)) {
108
- New-Item -ItemType Directory -Force -Path $ProjectPath | Out-Null
109
- }
110
- $projectRoot = Resolve-Path -LiteralPath $ProjectPath
111
- } else {
112
- $projectRoot = Resolve-Path (Join-Path $toolkitRoot '..')
113
- }
114
-
115
- # Warn if legacy Docs/ compatibility folder exists at project root
116
- $legacyDocs = Join-Path $projectRoot 'Docs'
117
- if ((Test-Path -LiteralPath $legacyDocs) -and ($env:OS -eq 'Windows_NT')) {
118
- Write-Host "[WARN] Legacy 'Docs/' folder detected at project root." -ForegroundColor Yellow
119
- Write-Host " On Windows, 'docs/' and 'Docs/' resolve to same folder." -ForegroundColor Yellow
120
- Write-Host " Consider: git mv Docs tmp-docs && git mv tmp-docs docs" -ForegroundColor Yellow
121
- }
122
-
123
- $templateRoot = Join-Path $toolkitRoot 'templates'
124
-
125
- if (-not (Test-Path -LiteralPath $templateRoot)) {
126
- throw "Missing templates directory: $templateRoot"
127
- }
128
-
129
- $configPath = Join-Path $projectRoot 'sdtk.config.json'
130
- if (-not (Test-Path -LiteralPath $configPath)) {
131
- $configPath = Join-Path $toolkitRoot 'sdtk.config.json'
132
- }
133
-
134
- if (Test-Path -LiteralPath $configPath) {
135
- try {
136
- $config = Get-Content -Raw -LiteralPath $configPath | ConvertFrom-Json
137
- } catch {
138
- throw "Failed to parse config file: $configPath`n$($_.Exception.Message)"
139
- }
140
- }
141
-
142
- $FeatureKey = $FeatureKey.Trim()
143
- $FeatureName = $FeatureName.Trim()
144
-
145
- if (-not $FeatureKey) { throw "FeatureKey is empty." }
146
- if ($FeatureKey -notmatch '^[A-Z][A-Z0-9_]*$') {
147
- throw "Invalid FeatureKey. Use UPPER_SNAKE_CASE (A-Z, 0-9, _)."
148
- }
149
- if (-not $FeatureName) { throw "FeatureName is empty." }
150
-
151
- $now = Get-Date
152
- $date = $now.ToString('yyyy-MM-dd')
153
- $dateTime = $now.ToString('yyyy-MM-dd HH:mm')
154
-
155
- $featureSnake = $FeatureKey.ToLower()
156
- $featurePascal = ConvertTo-PascalCase -Text $FeatureName
157
- if (-not $featurePascal) {
158
- $featurePascal = ConvertTo-PascalCase -Text $FeatureKey
159
- }
160
-
161
- $stack = Get-PropValue -Object $config -Name 'stack'
162
- $commands = Get-PropValue -Object $config -Name 'commands'
163
-
164
- $stackBackend = Get-StringOrDefault -Value (Get-PropValue -Object $stack -Name 'backend') -Default 'TBD'
165
- $stackFrontend = Get-StringOrDefault -Value (Get-PropValue -Object $stack -Name 'frontend') -Default 'TBD'
166
- $stackMobile = Get-StringOrDefault -Value (Get-PropValue -Object $stack -Name 'mobile') -Default 'TBD'
167
- $stackDatabase = Get-StringOrDefault -Value (Get-PropValue -Object $stack -Name 'database') -Default 'TBD'
168
- $stackAuth = Get-StringOrDefault -Value (Get-PropValue -Object $stack -Name 'auth') -Default 'TBD'
169
-
170
- $cmdBackendTests = Get-StringOrDefault -Value (Get-PropValue -Object $commands -Name 'backendTests') -Default 'TBD'
171
- $cmdBackendTypecheck = Get-StringOrDefault -Value (Get-PropValue -Object $commands -Name 'backendTypecheck') -Default 'TBD'
172
- $cmdBackendLint = Get-StringOrDefault -Value (Get-PropValue -Object $commands -Name 'backendLint') -Default 'TBD'
173
- $cmdFrontendTests = Get-StringOrDefault -Value (Get-PropValue -Object $commands -Name 'frontendTests') -Default 'TBD'
174
- $cmdFrontendLint = Get-StringOrDefault -Value (Get-PropValue -Object $commands -Name 'frontendLint') -Default 'TBD'
175
- $cmdE2eTests = Get-StringOrDefault -Value (Get-PropValue -Object $commands -Name 'e2eTests') -Default 'TBD'
176
-
177
- $tokens = @{
178
- FEATURE_KEY = $FeatureKey
179
- FEATURE_NAME = $FeatureName
180
- FEATURE_PASCAL = $featurePascal
181
- FEATURE_SNAKE = $featureSnake
182
- DATE = $date
183
- DATETIME = $dateTime
184
-
185
- STACK_BACKEND = $stackBackend
186
- STACK_FRONTEND = $stackFrontend
187
- STACK_MOBILE = $stackMobile
188
- STACK_DATABASE = $stackDatabase
189
- STACK_AUTH = $stackAuth
190
-
191
- CMD_BACKEND_TESTS = $cmdBackendTests
192
- CMD_BACKEND_TYPECHECK = $cmdBackendTypecheck
193
- CMD_BACKEND_LINT = $cmdBackendLint
194
- CMD_FRONTEND_TESTS = $cmdFrontendTests
195
- CMD_FRONTEND_LINT = $cmdFrontendLint
196
- CMD_E2E_TESTS = $cmdE2eTests
197
- }
198
-
199
- $outputs = @(
200
- @{ Dest = (Join-Path $projectRoot 'SHARED_PLANNING.md'); Template = (Join-Path $templateRoot 'SHARED_PLANNING.md') },
201
- @{ Dest = (Join-Path $projectRoot 'QUALITY_CHECKLIST.md'); Template = (Join-Path $templateRoot 'QUALITY_CHECKLIST.md') },
202
-
203
- @{ Dest = (Join-Path $projectRoot "docs/product/PROJECT_INITIATION_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/product/PROJECT_INITIATION_TEMPLATE.md') },
204
- @{ Dest = (Join-Path $projectRoot "docs/specs/BA_SPEC_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/specs/BA_SPEC_TEMPLATE.md') },
205
- @{ Dest = (Join-Path $projectRoot "docs/specs/${FeatureKey}_FLOW_ACTION_SPEC.md"); Template = (Join-Path $templateRoot 'docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md') },
206
- @{ Dest = (Join-Path $projectRoot "docs/product/PRD_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/product/PRD_TEMPLATE.md') },
207
- @{ Dest = (Join-Path $projectRoot "docs/product/BACKLOG_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/product/BACKLOG_TEMPLATE.md') },
208
- @{ Dest = (Join-Path $projectRoot "docs/architecture/ARCH_DESIGN_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/architecture/ARCH_DESIGN_TEMPLATE.md') },
209
- @{ Dest = (Join-Path $projectRoot "docs/database/DATABASE_SPEC_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/database/DATABASE_SPEC_TEMPLATE.md') },
210
-
211
- @{ Dest = (Join-Path $projectRoot "docs/api/${featurePascal}_API.yaml"); Template = (Join-Path $templateRoot 'docs/api/FEATURE_API_TEMPLATE.yaml') },
212
- @{ Dest = (Join-Path $projectRoot "docs/api/${FeatureKey}_ENDPOINTS.md"); Template = (Join-Path $templateRoot 'docs/api/API_ENDPOINTS_TEMPLATE.md') },
213
- @{ Dest = (Join-Path $projectRoot "docs/api/${FeatureKey}_API_DESIGN_DETAIL.md"); Template = (Join-Path $templateRoot 'docs/api/API_DESIGN_DETAIL_TEMPLATE.md') },
214
- @{ Dest = (Join-Path $projectRoot "docs/api/${featureSnake}_api_flow_list.txt"); Template = (Join-Path $templateRoot 'docs/api/feature_api_flow_list_TEMPLATE.txt') },
215
- @{ Dest = (Join-Path $projectRoot "docs/design/DESIGN_LAYOUT_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/design/DESIGN_LAYOUT_TEMPLATE.md') },
216
-
217
- @{ Dest = (Join-Path $projectRoot "docs/dev/FEATURE_IMPL_PLAN_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md') },
218
- @{ Dest = (Join-Path $projectRoot "docs/qa/${FeatureKey}_TEST_CASE.md"); Template = (Join-Path $templateRoot 'docs/qa/TEST_CASE_TEMPLATE.md') },
219
- @{ Dest = (Join-Path $projectRoot "docs/qa/QA_RELEASE_REPORT_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/qa/QA_RELEASE_REPORT_TEMPLATE.md') }
220
- )
221
-
222
- if ($ValidateOnly) {
223
- foreach ($item in $outputs) {
224
- $tmpl = [string]$item.Template
225
- if (-not (Test-Path -LiteralPath $tmpl)) {
226
- throw "Missing template file: $tmpl"
227
- }
228
- }
229
-
230
- Write-Host "Validation only: inputs and templates are valid."
231
- Write-Host "No files were written because -ValidateOnly was specified."
232
- return
233
- }
234
-
235
- $created = New-Object System.Collections.Generic.List[string]
236
- foreach ($item in $outputs) {
237
- $dest = [string]$item.Dest
238
- $tmpl = [string]$item.Template
239
- if (-not (Test-Path -LiteralPath $tmpl)) {
240
- throw "Missing template file: $tmpl"
241
- }
242
-
243
- $willOverwrite = (Test-Path -LiteralPath $dest)
244
- Write-RenderedFile -DestinationPath $dest -TemplatePath $tmpl -Tokens $tokens -Overwrite ([bool]$Force)
245
- if (-not $willOverwrite) {
246
- $created.Add($dest) | Out-Null
247
- }
248
- }
249
-
250
- Write-Host "Initialized feature: $FeatureKey ($FeatureName)"
251
- Write-Host "FeaturePascal: $featurePascal"
252
- Write-Host "FeatureSnake: $featureSnake"
253
-
254
- if ($created.Count -gt 0) {
255
- Write-Host ""
256
- Write-Host "Created files:"
257
- $created | ForEach-Object { Write-Host " - $_" }
258
- } else {
259
- Write-Host ""
260
- Write-Host "No new files created (all existed); use -Force to overwrite if needed."
261
- }
@@ -1,169 +0,0 @@
1
- param(
2
- [string]$ProjectPath,
3
- [ValidateSet('project', 'user')]
4
- [string]$Scope = 'project',
5
- [switch]$Force
6
- )
7
-
8
- $ErrorActionPreference = 'Stop'
9
- Set-StrictMode -Version Latest
10
-
11
- function Copy-File {
12
- param(
13
- [Parameter(Mandatory = $true)][string]$SourcePath,
14
- [Parameter(Mandatory = $true)][string]$DestinationPath,
15
- [Parameter(Mandatory = $true)][bool]$Overwrite
16
- )
17
-
18
- if (-not (Test-Path -LiteralPath $SourcePath)) {
19
- throw "Missing source: $SourcePath"
20
- }
21
-
22
- if (Test-Path -LiteralPath $DestinationPath) {
23
- if (-not $Overwrite) {
24
- Write-Warning "Already exists (skipping). Use -Force to overwrite: $DestinationPath"
25
- return
26
- }
27
- }
28
-
29
- $parent = Split-Path -Parent $DestinationPath
30
- if ($parent -and -not (Test-Path -LiteralPath $parent)) {
31
- New-Item -ItemType Directory -Force -Path $parent | Out-Null
32
- }
33
-
34
- Copy-Item -LiteralPath $SourcePath -Destination $DestinationPath -Force
35
- }
36
-
37
- function Install-ClaudeSkillDirectory {
38
- param(
39
- [Parameter(Mandatory = $true)][System.IO.DirectoryInfo]$SkillDir,
40
- [Parameter(Mandatory = $true)][string]$SkillsDest,
41
- [Parameter(Mandatory = $true)][string]$ToolkitRoot,
42
- [Parameter(Mandatory = $true)][bool]$Overwrite
43
- )
44
-
45
- $destDir = Join-Path $SkillsDest $SkillDir.Name
46
- if (Test-Path -LiteralPath $destDir) {
47
- if (-not $Overwrite) {
48
- Write-Warning "Already exists (skipping). Use -Force to overwrite: $destDir"
49
- return $true
50
- }
51
- Remove-Item -LiteralPath $destDir -Recurse -Force
52
- }
53
-
54
- $parent = Split-Path -Parent $destDir
55
- if ($parent -and -not (Test-Path -LiteralPath $parent)) {
56
- New-Item -ItemType Directory -Force -Path $parent | Out-Null
57
- }
58
- Copy-Item -LiteralPath $SkillDir.FullName -Destination $destDir -Recurse -Force
59
-
60
- $canonicalSkillDir = Join-Path $ToolkitRoot "skills/sdtk-$($SkillDir.Name)"
61
- foreach ($subDirName in @('scripts', 'prompts')) {
62
- $srcSubDir = Join-Path $canonicalSkillDir $subDirName
63
- $destSubDir = Join-Path $destDir $subDirName
64
- if (-not (Test-Path -LiteralPath $srcSubDir)) {
65
- continue
66
- }
67
-
68
- if (Test-Path -LiteralPath $destSubDir) {
69
- Remove-Item -LiteralPath $destSubDir -Recurse -Force
70
- }
71
- Copy-Item -LiteralPath $srcSubDir -Destination $destSubDir -Recurse -Force
72
- }
73
-
74
- return $true
75
- }
76
-
77
- $toolkitRoot = Resolve-Path (Join-Path $PSScriptRoot '..')
78
-
79
- # Resolve destination based on scope
80
- if ($Scope -eq 'user') {
81
- $skillsDest = Join-Path $HOME '.claude/skills'
82
- Write-Host "Scope: user (installing to $skillsDest)"
83
- } else {
84
- if (-not $ProjectPath) {
85
- $ProjectPath = (Resolve-Path (Join-Path $toolkitRoot '..')).Path
86
- }
87
- $projectRoot = Resolve-Path -LiteralPath $ProjectPath
88
- $skillsDest = Join-Path $projectRoot '.claude/skills'
89
- Write-Host "Scope: project (installing to $skillsDest)"
90
- }
91
-
92
- $skillsSource = Join-Path $toolkitRoot 'skills-claude'
93
- if (-not (Test-Path -LiteralPath $skillsSource)) {
94
- throw "Claude skills source not found: $skillsSource"
95
- }
96
-
97
- $skillCount = 0
98
- foreach ($skillDir in (Get-ChildItem -Path $skillsSource -Directory)) {
99
- $srcFile = Join-Path $skillDir.FullName 'SKILL.md'
100
- if (-not (Test-Path -LiteralPath $srcFile)) { continue }
101
-
102
- if (Install-ClaudeSkillDirectory -SkillDir $skillDir -SkillsDest $skillsDest -ToolkitRoot $toolkitRoot -Overwrite ([bool]$Force)) {
103
- $skillCount++
104
- }
105
- }
106
-
107
- # Install reference files
108
- $refDest = Join-Path $skillsDest 'references'
109
- if (-not (Test-Path -LiteralPath $refDest)) {
110
- New-Item -ItemType Directory -Force -Path $refDest | Out-Null
111
- }
112
-
113
- $refCount = 0
114
- $missingRefs = @()
115
-
116
- # 6 files from toolkit/templates/docs/
117
- $templateRefs = @(
118
- @{ Src = 'templates/docs/api/YAML_CREATION_RULES.md' },
119
- @{ Src = 'templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md' },
120
- @{ Src = 'templates/docs/api/FLOWCHART_CREATION_RULES.md' },
121
- @{ Src = 'templates/docs/api/API_DESIGN_CREATION_RULES.md' },
122
- @{ Src = 'templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md' },
123
- @{ Src = 'templates/docs/qa/TEST_CASE_CREATION_RULES.md' }
124
- )
125
-
126
- foreach ($ref in $templateRefs) {
127
- $srcPath = Join-Path $toolkitRoot $ref.Src
128
- $fileName = Split-Path -Leaf $srcPath
129
- $destPath = Join-Path $refDest $fileName
130
- if (Test-Path -LiteralPath $srcPath) {
131
- Copy-File -SourcePath $srcPath -DestinationPath $destPath -Overwrite ([bool]$Force)
132
- $refCount++
133
- } else {
134
- $missingRefs += $srcPath
135
- }
136
- }
137
-
138
- # 3 files from toolkit/skills/sdtk-screen-design-spec/references/
139
- $screenRefs = @('numbering-rules.md', 'figma-mcp.md', 'excel-image-export.md')
140
- foreach ($fileName in $screenRefs) {
141
- $srcPath = Join-Path $toolkitRoot "skills/sdtk-screen-design-spec/references/$fileName"
142
- $destPath = Join-Path $refDest $fileName
143
- if (Test-Path -LiteralPath $srcPath) {
144
- Copy-File -SourcePath $srcPath -DestinationPath $destPath -Overwrite ([bool]$Force)
145
- $refCount++
146
- } else {
147
- $missingRefs += $srcPath
148
- }
149
- }
150
-
151
- # Fail-fast: abort if any reference files are missing
152
- if ($missingRefs.Count -gt 0) {
153
- $list = ($missingRefs | ForEach-Object { " - $_" }) -join "`n"
154
- throw "Claude install failed. Missing reference files:`n$list"
155
- }
156
-
157
- # Strict count assertions
158
- $expectedSkills = 13
159
- $expectedRefs = 9
160
- if ($skillCount -ne $expectedSkills) {
161
- throw "Claude install failed. Expected $expectedSkills skills but installed $skillCount."
162
- }
163
- if ($refCount -ne $expectedRefs) {
164
- throw "Claude install failed. Expected $expectedRefs reference files but installed $refCount."
165
- }
166
-
167
- Write-Host " Skills installed: $skillCount"
168
- Write-Host " Reference files : $refCount"
169
- Write-Host " Destination : $skillsDest"
@@ -1,189 +0,0 @@
1
- param(
2
- [ValidateSet('project', 'user')]
3
- [string]$Scope = 'user',
4
- [switch]$Force
5
- )
6
-
7
- # Gate C0: Codex does not support project-local skills
8
- if ($Scope -eq 'project') {
9
- Write-Error "Codex does not support project-local skills. Use --scope user instead."
10
- exit 1
11
- }
12
-
13
- $ErrorActionPreference = 'Stop'
14
- Set-StrictMode -Version Latest
15
-
16
- function Get-FileSha256 {
17
- param(
18
- [Parameter(Mandatory = $true)][string]$Path
19
- )
20
-
21
- if (-not (Test-Path -LiteralPath $Path)) {
22
- return $null
23
- }
24
-
25
- $stream = [System.IO.File]::OpenRead($Path)
26
- try {
27
- $sha = [System.Security.Cryptography.SHA256]::Create()
28
- $hashBytes = $sha.ComputeHash($stream)
29
- return [BitConverter]::ToString($hashBytes).Replace('-', '')
30
- } finally {
31
- $stream.Close()
32
- }
33
- }
34
-
35
- $repoRoot = Resolve-Path (Join-Path $PSScriptRoot '..')
36
- $skillsSrc = Join-Path $repoRoot 'skills'
37
- $canonicalRulesPath = Join-Path $repoRoot 'templates/docs/api/FLOWCHART_CREATION_RULES.md'
38
- $canonicalRulesHash = Get-FileSha256 -Path $canonicalRulesPath
39
- $canonicalApiDesignRulesPath = Join-Path $repoRoot 'templates/docs/api/API_DESIGN_CREATION_RULES.md'
40
- $canonicalApiDesignRulesHash = Get-FileSha256 -Path $canonicalApiDesignRulesPath
41
- $canonicalFlowRulesPath = Join-Path $repoRoot 'templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md'
42
- $canonicalFlowRulesHash = Get-FileSha256 -Path $canonicalFlowRulesPath
43
- $canonicalTestCaseRulesPath = Join-Path $repoRoot 'templates/docs/qa/TEST_CASE_CREATION_RULES.md'
44
- $canonicalTestCaseRulesHash = Get-FileSha256 -Path $canonicalTestCaseRulesPath
45
-
46
- if (-not (Test-Path -LiteralPath $skillsSrc)) {
47
- throw "Missing skills directory: $skillsSrc"
48
- }
49
-
50
- $codexHome = $env:CODEX_HOME
51
- if (-not $codexHome) {
52
- $codexHome = Join-Path $HOME '.codex'
53
- }
54
-
55
- $skillsDest = Join-Path $codexHome 'skills'
56
- New-Item -ItemType Directory -Force -Path $skillsDest | Out-Null
57
-
58
- Get-ChildItem -LiteralPath $skillsSrc -Directory | ForEach-Object {
59
- $dest = Join-Path $skillsDest $_.Name
60
- if (Test-Path -LiteralPath $dest) {
61
- if (-not $Force) {
62
- Write-Warning "Skill already installed (skipping). Use -Force to overwrite: $($_.Name)"
63
- $existingSkillRulesPath = Join-Path $dest 'references/FLOWCHART_CREATION_RULES.md'
64
- $existingSkillRulesHash = Get-FileSha256 -Path $existingSkillRulesPath
65
- if ($existingSkillRulesHash) {
66
- if ($canonicalRulesHash -and ($existingSkillRulesHash -eq $canonicalRulesHash)) {
67
- Write-Host " - Existing ruleset: FLOWCHART_CREATION_RULES.md (SHA256=$existingSkillRulesHash, source-sync=OK)"
68
- } elseif ($canonicalRulesHash) {
69
- Write-Warning " - Existing ruleset hash mismatch for $($_.Name): skill=$existingSkillRulesHash template=$canonicalRulesHash"
70
- } else {
71
- Write-Host " - Existing ruleset: FLOWCHART_CREATION_RULES.md (SHA256=$existingSkillRulesHash)"
72
- }
73
- }
74
- $existingFlowRulesPath = Join-Path $dest 'references/FLOW_ACTION_SPEC_CREATION_RULES.md'
75
- $existingFlowRulesHash = Get-FileSha256 -Path $existingFlowRulesPath
76
- if ($existingFlowRulesHash) {
77
- if ($canonicalFlowRulesHash -and ($existingFlowRulesHash -eq $canonicalFlowRulesHash)) {
78
- Write-Host " - Existing ruleset: FLOW_ACTION_SPEC_CREATION_RULES.md (SHA256=$existingFlowRulesHash, source-sync=OK)"
79
- } elseif ($canonicalFlowRulesHash) {
80
- Write-Warning " - Existing ruleset hash mismatch for $($_.Name): skill=$existingFlowRulesHash template=$canonicalFlowRulesHash"
81
- } else {
82
- Write-Host " - Existing ruleset: FLOW_ACTION_SPEC_CREATION_RULES.md (SHA256=$existingFlowRulesHash)"
83
- }
84
- }
85
- $existingApiDesignRulesPath = Join-Path $dest 'references/API_DESIGN_CREATION_RULES.md'
86
- $existingApiDesignRulesHash = Get-FileSha256 -Path $existingApiDesignRulesPath
87
- if ($existingApiDesignRulesHash) {
88
- if ($canonicalApiDesignRulesHash -and ($existingApiDesignRulesHash -eq $canonicalApiDesignRulesHash)) {
89
- Write-Host " - Existing ruleset: API_DESIGN_CREATION_RULES.md (SHA256=$existingApiDesignRulesHash, source-sync=OK)"
90
- } elseif ($canonicalApiDesignRulesHash) {
91
- Write-Warning " - Existing ruleset hash mismatch for $($_.Name): skill=$existingApiDesignRulesHash template=$canonicalApiDesignRulesHash"
92
- } else {
93
- Write-Host " - Existing ruleset: API_DESIGN_CREATION_RULES.md (SHA256=$existingApiDesignRulesHash)"
94
- }
95
- }
96
- $existingTestCaseRulesPath = Join-Path $dest 'references/TEST_CASE_CREATION_RULES.md'
97
- $existingTestCaseRulesHash = Get-FileSha256 -Path $existingTestCaseRulesPath
98
- if ($existingTestCaseRulesHash) {
99
- if ($canonicalTestCaseRulesHash -and ($existingTestCaseRulesHash -eq $canonicalTestCaseRulesHash)) {
100
- Write-Host " - Existing ruleset: TEST_CASE_CREATION_RULES.md (SHA256=$existingTestCaseRulesHash, source-sync=OK)"
101
- } elseif ($canonicalTestCaseRulesHash) {
102
- Write-Warning " - Existing ruleset hash mismatch for $($_.Name): skill=$existingTestCaseRulesHash template=$canonicalTestCaseRulesHash"
103
- } else {
104
- Write-Host " - Existing ruleset: TEST_CASE_CREATION_RULES.md (SHA256=$existingTestCaseRulesHash)"
105
- }
106
- }
107
- return
108
- }
109
- Remove-Item -LiteralPath $dest -Recurse -Force
110
- }
111
- Copy-Item -LiteralPath $_.FullName -Destination $dest -Recurse -Force
112
- Write-Host "Installed: $($_.Name)"
113
-
114
- $skillRulesPath = Join-Path $dest 'references/FLOWCHART_CREATION_RULES.md'
115
- $skillRulesHash = Get-FileSha256 -Path $skillRulesPath
116
- if ($skillRulesHash) {
117
- if ($canonicalRulesHash -and ($skillRulesHash -eq $canonicalRulesHash)) {
118
- Write-Host " - Ruleset: FLOWCHART_CREATION_RULES.md (SHA256=$skillRulesHash, source-sync=OK)"
119
- } elseif ($canonicalRulesHash) {
120
- Write-Warning " - Ruleset hash mismatch for $($_.Name): skill=$skillRulesHash template=$canonicalRulesHash"
121
- } else {
122
- Write-Host " - Ruleset: FLOWCHART_CREATION_RULES.md (SHA256=$skillRulesHash)"
123
- }
124
- }
125
-
126
- $skillFlowRulesPath = Join-Path $dest 'references/FLOW_ACTION_SPEC_CREATION_RULES.md'
127
- $skillFlowRulesHash = Get-FileSha256 -Path $skillFlowRulesPath
128
- if ($skillFlowRulesHash) {
129
- if ($canonicalFlowRulesHash -and ($skillFlowRulesHash -eq $canonicalFlowRulesHash)) {
130
- Write-Host " - Ruleset: FLOW_ACTION_SPEC_CREATION_RULES.md (SHA256=$skillFlowRulesHash, source-sync=OK)"
131
- } elseif ($canonicalFlowRulesHash) {
132
- Write-Warning " - Ruleset hash mismatch for $($_.Name): skill=$skillFlowRulesHash template=$canonicalFlowRulesHash"
133
- } else {
134
- Write-Host " - Ruleset: FLOW_ACTION_SPEC_CREATION_RULES.md (SHA256=$skillFlowRulesHash)"
135
- }
136
- }
137
-
138
- $skillApiDesignRulesPath = Join-Path $dest 'references/API_DESIGN_CREATION_RULES.md'
139
- $skillApiDesignRulesHash = Get-FileSha256 -Path $skillApiDesignRulesPath
140
- if ($skillApiDesignRulesHash) {
141
- if ($canonicalApiDesignRulesHash -and ($skillApiDesignRulesHash -eq $canonicalApiDesignRulesHash)) {
142
- Write-Host " - Ruleset: API_DESIGN_CREATION_RULES.md (SHA256=$skillApiDesignRulesHash, source-sync=OK)"
143
- } elseif ($canonicalApiDesignRulesHash) {
144
- Write-Warning " - Ruleset hash mismatch for $($_.Name): skill=$skillApiDesignRulesHash template=$canonicalApiDesignRulesHash"
145
- } else {
146
- Write-Host " - Ruleset: API_DESIGN_CREATION_RULES.md (SHA256=$skillApiDesignRulesHash)"
147
- }
148
- }
149
-
150
- $skillTestCaseRulesPath = Join-Path $dest 'references/TEST_CASE_CREATION_RULES.md'
151
- $skillTestCaseRulesHash = Get-FileSha256 -Path $skillTestCaseRulesPath
152
- if ($skillTestCaseRulesHash) {
153
- if ($canonicalTestCaseRulesHash -and ($skillTestCaseRulesHash -eq $canonicalTestCaseRulesHash)) {
154
- Write-Host " - Ruleset: TEST_CASE_CREATION_RULES.md (SHA256=$skillTestCaseRulesHash, source-sync=OK)"
155
- } elseif ($canonicalTestCaseRulesHash) {
156
- Write-Warning " - Ruleset hash mismatch for $($_.Name): skill=$skillTestCaseRulesHash template=$canonicalTestCaseRulesHash"
157
- } else {
158
- Write-Host " - Ruleset: TEST_CASE_CREATION_RULES.md (SHA256=$skillTestCaseRulesHash)"
159
- }
160
- }
161
- }
162
-
163
- Write-Host ""
164
- Write-Host "Skills installed into: $skillsDest"
165
- if ($canonicalRulesHash) {
166
- Write-Host "Canonical API ruleset: $canonicalRulesPath"
167
- Write-Host "Canonical API ruleset SHA256: $canonicalRulesHash"
168
- } else {
169
- Write-Warning "Canonical API ruleset not found: $canonicalRulesPath"
170
- }
171
- if ($canonicalApiDesignRulesHash) {
172
- Write-Host "Canonical API design ruleset: $canonicalApiDesignRulesPath"
173
- Write-Host "Canonical API design ruleset SHA256: $canonicalApiDesignRulesHash"
174
- } else {
175
- Write-Warning "Canonical API design ruleset not found: $canonicalApiDesignRulesPath"
176
- }
177
- if ($canonicalFlowRulesHash) {
178
- Write-Host "Canonical Flow Action ruleset: $canonicalFlowRulesPath"
179
- Write-Host "Canonical Flow Action ruleset SHA256: $canonicalFlowRulesHash"
180
- } else {
181
- Write-Warning "Canonical Flow Action ruleset not found: $canonicalFlowRulesPath"
182
- }
183
- if ($canonicalTestCaseRulesHash) {
184
- Write-Host "Canonical Test Case ruleset: $canonicalTestCaseRulesPath"
185
- Write-Host "Canonical Test Case ruleset SHA256: $canonicalTestCaseRulesHash"
186
- } else {
187
- Write-Warning "Canonical Test Case ruleset not found: $canonicalTestCaseRulesPath"
188
- }
189
- Write-Host "Restart Codex to pick up new skills."