sdtk-spec-kit 0.3.14 → 0.3.16
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/assets/manifest/toolkit-bundle.manifest.json +69 -134
- package/assets/manifest/toolkit-bundle.sha256.txt +33 -46
- package/assets/toolkit/toolkit/AGENTS.md +17 -15
- package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +10 -6
- package/assets/toolkit/toolkit/install.ps1 +60 -50
- package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +2 -2
- package/assets/toolkit/toolkit/scripts/agents/run-claude-task.ps1 +332 -111
- package/assets/toolkit/toolkit/scripts/agents/run-codex-task.ps1 +618 -103
- package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +179 -169
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +111 -84
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +46 -10
- package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +85 -85
- package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +42 -3
- package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +61 -5
- package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +63 -5
- package/assets/toolkit/toolkit/skills/sdtk-mailbox-dispatch/SKILL.md +73 -71
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +53 -33
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +60 -24
- package/assets/toolkit/toolkit/skills/skills.catalog.yaml +9 -9
- package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +116 -90
- package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +49 -9
- package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +3 -3
- package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +36 -2
- package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +58 -5
- package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +60 -5
- package/assets/toolkit/toolkit/skills-claude/mailbox-dispatch/SKILL.md +73 -71
- package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +49 -27
- package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +74 -20
- package/assets/toolkit/toolkit/templates/README.md +5 -1
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +1 -2
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
- package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +3 -3
- package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +128 -128
- package/assets/toolkit/toolkit/templates/mailbox/AGENT_REPORT_TEMPLATE.md +62 -49
- package/assets/toolkit/toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md +23 -10
- package/package.json +48 -48
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +0 -22
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/FLOWCHART_CREATION_RULES.md +0 -20
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/FLOWCHART_CREATION_RULES.md +0 -20
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/YAML_CREATION_RULES.md +0 -128
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +0 -22
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOWCHART_CREATION_RULES.md +0 -20
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/YAML_CREATION_RULES.md +0 -128
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md +0 -129
|
@@ -1,169 +1,179 @@
|
|
|
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
|
|
38
|
-
param(
|
|
39
|
-
[Parameter(Mandatory = $true)][
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
$
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
$
|
|
114
|
-
$
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
$
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
$
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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 Get-ClaudeManagedReferenceSources {
|
|
38
|
+
param(
|
|
39
|
+
[Parameter(Mandatory = $true)][string]$SkillName
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
switch ($SkillName) {
|
|
43
|
+
'api-doc' { return @(
|
|
44
|
+
'templates/docs/api/YAML_CREATION_RULES.md',
|
|
45
|
+
'templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md'
|
|
46
|
+
) }
|
|
47
|
+
'api-design-spec' { return @(
|
|
48
|
+
'templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md'
|
|
49
|
+
) }
|
|
50
|
+
'arch' { return @(
|
|
51
|
+
'templates/docs/api/YAML_CREATION_RULES.md',
|
|
52
|
+
'templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md',
|
|
53
|
+
'templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md'
|
|
54
|
+
) }
|
|
55
|
+
'screen-design-spec' { return @(
|
|
56
|
+
'templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md',
|
|
57
|
+
'skills/sdtk-screen-design-spec/references/numbering-rules.md',
|
|
58
|
+
'skills/sdtk-screen-design-spec/references/figma-mcp.md',
|
|
59
|
+
'skills/sdtk-screen-design-spec/references/excel-image-export.md'
|
|
60
|
+
) }
|
|
61
|
+
'test-case-spec' { return @(
|
|
62
|
+
'templates/docs/qa/TEST_CASE_CREATION_RULES.md'
|
|
63
|
+
) }
|
|
64
|
+
default { return @() }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function Install-ClaudeSkillDirectory {
|
|
69
|
+
param(
|
|
70
|
+
[Parameter(Mandatory = $true)][System.IO.DirectoryInfo]$SkillDir,
|
|
71
|
+
[Parameter(Mandatory = $true)][string]$SkillsDest,
|
|
72
|
+
[Parameter(Mandatory = $true)][string]$ToolkitRoot,
|
|
73
|
+
[Parameter(Mandatory = $true)][bool]$Overwrite
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
$destDir = Join-Path $SkillsDest $SkillDir.Name
|
|
77
|
+
if (Test-Path -LiteralPath $destDir) {
|
|
78
|
+
if (-not $Overwrite) {
|
|
79
|
+
Write-Warning "Already exists (skipping). Use -Force to overwrite: $destDir"
|
|
80
|
+
return $true
|
|
81
|
+
}
|
|
82
|
+
Remove-Item -LiteralPath $destDir -Recurse -Force
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
$parent = Split-Path -Parent $destDir
|
|
86
|
+
if ($parent -and -not (Test-Path -LiteralPath $parent)) {
|
|
87
|
+
New-Item -ItemType Directory -Force -Path $parent | Out-Null
|
|
88
|
+
}
|
|
89
|
+
Copy-Item -LiteralPath $SkillDir.FullName -Destination $destDir -Recurse -Force
|
|
90
|
+
|
|
91
|
+
$canonicalSkillDir = Join-Path $ToolkitRoot "skills/sdtk-$($SkillDir.Name)"
|
|
92
|
+
foreach ($subDirName in @('scripts', 'prompts')) {
|
|
93
|
+
$srcSubDir = Join-Path $canonicalSkillDir $subDirName
|
|
94
|
+
$destSubDir = Join-Path $destDir $subDirName
|
|
95
|
+
if (-not (Test-Path -LiteralPath $srcSubDir)) {
|
|
96
|
+
continue
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (Test-Path -LiteralPath $destSubDir) {
|
|
100
|
+
Remove-Item -LiteralPath $destSubDir -Recurse -Force
|
|
101
|
+
}
|
|
102
|
+
Copy-Item -LiteralPath $srcSubDir -Destination $destSubDir -Recurse -Force
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
$referenceSources = @(Get-ClaudeManagedReferenceSources -SkillName $SkillDir.Name)
|
|
106
|
+
if ($referenceSources.Count -gt 0) {
|
|
107
|
+
$destRefDir = Join-Path $destDir 'references'
|
|
108
|
+
if (Test-Path -LiteralPath $destRefDir) {
|
|
109
|
+
Remove-Item -LiteralPath $destRefDir -Recurse -Force
|
|
110
|
+
}
|
|
111
|
+
New-Item -ItemType Directory -Force -Path $destRefDir | Out-Null
|
|
112
|
+
|
|
113
|
+
foreach ($relativeSource in $referenceSources) {
|
|
114
|
+
$srcRefPath = Join-Path $ToolkitRoot $relativeSource
|
|
115
|
+
$destRefPath = Join-Path $destRefDir ([System.IO.Path]::GetFileName($relativeSource))
|
|
116
|
+
Copy-File -SourcePath $srcRefPath -DestinationPath $destRefPath -Overwrite $true
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return $true
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
$toolkitRoot = Resolve-Path (Join-Path $PSScriptRoot '..')
|
|
124
|
+
|
|
125
|
+
# Resolve destination based on scope
|
|
126
|
+
if ($Scope -eq 'user') {
|
|
127
|
+
$skillsDest = Join-Path $HOME '.claude/skills'
|
|
128
|
+
Write-Host "Scope: user (installing to $skillsDest)"
|
|
129
|
+
} else {
|
|
130
|
+
if (-not $ProjectPath) {
|
|
131
|
+
$ProjectPath = (Resolve-Path (Join-Path $toolkitRoot '..')).Path
|
|
132
|
+
}
|
|
133
|
+
$projectRoot = Resolve-Path -LiteralPath $ProjectPath
|
|
134
|
+
$skillsDest = Join-Path $projectRoot '.claude/skills'
|
|
135
|
+
Write-Host "Scope: project (installing to $skillsDest)"
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
$skillsSource = Join-Path $toolkitRoot 'skills-claude'
|
|
139
|
+
if (-not (Test-Path -LiteralPath $skillsSource)) {
|
|
140
|
+
throw "Claude skills source not found: $skillsSource"
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
$skillCount = 0
|
|
144
|
+
foreach ($skillDir in (Get-ChildItem -Path $skillsSource -Directory)) {
|
|
145
|
+
$srcFile = Join-Path $skillDir.FullName 'SKILL.md'
|
|
146
|
+
if (-not (Test-Path -LiteralPath $srcFile)) { continue }
|
|
147
|
+
|
|
148
|
+
if (Install-ClaudeSkillDirectory -SkillDir $skillDir -SkillsDest $skillsDest -ToolkitRoot $toolkitRoot -Overwrite ([bool]$Force)) {
|
|
149
|
+
$skillCount++
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
# Remove obsolete shared Claude specialist reference catch-all if it exists
|
|
154
|
+
$legacyRefDest = Join-Path $skillsDest 'references'
|
|
155
|
+
if (Test-Path -LiteralPath $legacyRefDest) {
|
|
156
|
+
Remove-Item -LiteralPath $legacyRefDest -Recurse -Force
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
$managedRefCount = 0
|
|
160
|
+
foreach ($skillName in @('arch', 'api-doc', 'api-design-spec', 'screen-design-spec', 'test-case-spec')) {
|
|
161
|
+
$refDir = Join-Path $skillsDest "$skillName/references"
|
|
162
|
+
if (Test-Path -LiteralPath $refDir) {
|
|
163
|
+
$managedRefCount += @(Get-ChildItem -LiteralPath $refDir -File).Count
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
# Strict count assertions
|
|
168
|
+
$expectedSkills = 14
|
|
169
|
+
$expectedManagedRefs = 11
|
|
170
|
+
if ($skillCount -ne $expectedSkills) {
|
|
171
|
+
throw "Claude install failed. Expected $expectedSkills skills but installed $skillCount."
|
|
172
|
+
}
|
|
173
|
+
if ($managedRefCount -ne $expectedManagedRefs) {
|
|
174
|
+
throw "Claude install failed. Expected $expectedManagedRefs specialist reference files but installed $managedRefCount."
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
Write-Host " Skills installed: $skillCount"
|
|
178
|
+
Write-Host " Specialist refs : $managedRefCount"
|
|
179
|
+
Write-Host " Destination : $skillsDest"
|
|
@@ -1,84 +1,111 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sdtk-api-design-spec
|
|
3
|
-
description: Generate detailed API design markdown (`[FEATURE_KEY]_API_DESIGN_DETAIL.md`) from OpenAPI YAML and API flow list using Excel-style structure rules. Use when you need field-level request/response tables + per-endpoint process flow images for implementation/review handoff.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# SDTK-SPEC API Design Detail Spec
|
|
7
|
-
|
|
8
|
-
## Critical Constraints
|
|
9
|
-
- I do not drift from the source YAML or flow list.
|
|
10
|
-
- I do not leave broken flow image embeds or missing assumptions in the API design detail.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
- Flow summary / notes / login bullets from YAML `description`
|
|
42
|
-
- Process flow source block (`text` fenced block)
|
|
43
|
-
- Embedded flowchart image
|
|
44
|
-
- Path parameter table
|
|
45
|
-
- Request table (hierarchy levels + type + format + required)
|
|
46
|
-
- Success response table
|
|
47
|
-
- Error response table (explicit schema if defined, otherwise shared envelope + inferred business statuses from flow)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
- `
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
|
|
83
|
-
- `
|
|
84
|
-
|
|
1
|
+
---
|
|
2
|
+
name: sdtk-api-design-spec
|
|
3
|
+
description: Generate detailed API design markdown (`[FEATURE_KEY]_API_DESIGN_DETAIL.md`) from OpenAPI YAML and API flow list using Excel-style structure rules. Use when you need field-level request/response tables + per-endpoint process flow images for implementation/review handoff.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SDTK-SPEC API Design Detail Spec
|
|
7
|
+
|
|
8
|
+
## Critical Constraints
|
|
9
|
+
- I do not drift from the source YAML or flow list.
|
|
10
|
+
- I do not leave broken flow image embeds or missing assumptions in the API design detail.
|
|
11
|
+
- I do not generate API design detail without a valid YAML source and matching flow list.
|
|
12
|
+
- I do not skip the flowchart creation rules; freehand flow sections that bypass `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` are non-conformant.
|
|
13
|
+
|
|
14
|
+
## Outputs
|
|
15
|
+
- `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
|
|
16
|
+
- Supporting generated assets:
|
|
17
|
+
- `docs/api/flows/*.puml`
|
|
18
|
+
- `docs/api/images/*.svg`
|
|
19
|
+
|
|
20
|
+
## Required Inputs
|
|
21
|
+
- Feature key (`FEATURE_KEY`)
|
|
22
|
+
- API contract YAML:
|
|
23
|
+
- Preferred: `docs/api/[FeaturePascal]_API.yaml`
|
|
24
|
+
- Fallback: a specified YAML file path
|
|
25
|
+
- API flow list:
|
|
26
|
+
- Preferred: `docs/api/[feature_snake]_api_flow_list.txt`
|
|
27
|
+
- Fallback: a specified flow list path
|
|
28
|
+
|
|
29
|
+
## When To Stop Or Escalate
|
|
30
|
+
- Stop if the required YAML file does not exist or cannot be resolved; do not fabricate an endpoint table.
|
|
31
|
+
- Stop if the flow list is missing or contains no parseable `@startuml ... @enduml` blocks; record the gap and escalate to `sdtk-api-doc` for regeneration.
|
|
32
|
+
- Stop if YAML and flow list describe fundamentally different endpoint sets; surface the discrepancy as a blocker before generating any section.
|
|
33
|
+
- Escalate to `@arch` if a flow block is ambiguous about business logic that would change how a table row is authored.
|
|
34
|
+
|
|
35
|
+
## Core Process
|
|
36
|
+
1. Resolve input files (`yaml`, `flow_list`, `output`).
|
|
37
|
+
2. Load and apply `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` before generating any section.
|
|
38
|
+
3. Parse YAML endpoints (method, path, request schema, success/error schema).
|
|
39
|
+
4. Parse flow blocks from flow list (`@startuml ... @enduml`) and map by normalized `METHOD + path`.
|
|
40
|
+
5. Generate detailed markdown sections per API:
|
|
41
|
+
- Flow summary / notes / login bullets from YAML `description`
|
|
42
|
+
- Process flow source block (`text` fenced block)
|
|
43
|
+
- Embedded flowchart image
|
|
44
|
+
- Path parameter table
|
|
45
|
+
- Request table (hierarchy levels + type + format + required)
|
|
46
|
+
- Success response table
|
|
47
|
+
- Error response table (explicit schema if defined, otherwise shared envelope + inferred business statuses from flow)
|
|
48
|
+
6. Generate/update `.puml` per API under `docs/api/flows`.
|
|
49
|
+
7. Render `.svg` images under `docs/api/images`.
|
|
50
|
+
|
|
51
|
+
## Validation / Quality Gates
|
|
52
|
+
- Every API section has exactly one embedded image; no section is left without a flow visual.
|
|
53
|
+
- Every embed path exists on disk; broken image links are a hard failure.
|
|
54
|
+
- No render error image output is accepted.
|
|
55
|
+
- Markdown tables keep `No` sequential numbering.
|
|
56
|
+
- YAML-derived field tables match the YAML source exactly; no invented fields.
|
|
57
|
+
- Error response table aligns with actual flow exits, not placeholder `None` values.
|
|
58
|
+
- No mixed-language content in narrative text.
|
|
59
|
+
|
|
60
|
+
## Order-Critical Hard Gate
|
|
61
|
+
Do not generate any API section before reading and applying `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md`. Sections generated without that reference produce structurally incorrect output that will fail implementation review.
|
|
62
|
+
|
|
63
|
+
Do not emit `API_DESIGN_DETAIL.md` if the input YAML and flow list describe incompatible endpoint sets. Fix the upstream sources before proceeding.
|
|
64
|
+
|
|
65
|
+
## Common Mistakes
|
|
66
|
+
|
|
67
|
+
| Mistake | Why it is wrong | Do instead |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| Generate sections without reading flowchart rules | Produces non-conformant flow blocks | Always read `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` first |
|
|
70
|
+
| Leave error table as `None` or empty | Hides actual error paths from implementers | Derive error rows from the flow list and YAML error schemas |
|
|
71
|
+
| Embed image paths that do not exist on disk | Breaks document rendering for reviewers | Verify `.svg` exists before embedding; fail loudly if missing |
|
|
72
|
+
| Invent request fields not present in YAML | Introduces contract drift | Only table fields that exist in the parsed YAML schema |
|
|
73
|
+
| Run on an outdated YAML source | Generates stale API design detail | Always confirm the YAML was produced from the current BA/ARCH pass |
|
|
74
|
+
|
|
75
|
+
## Script
|
|
76
|
+
- `scripts/generate_api_design_detail.py`
|
|
77
|
+
|
|
78
|
+
### Typical command
|
|
79
|
+
```powershell
|
|
80
|
+
python "toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py" `
|
|
81
|
+
--feature-key WORK_PLANNING_BOARD `
|
|
82
|
+
--yaml "docs/api/WorkPlanningBoard_API.yaml" `
|
|
83
|
+
--flow-list "docs/api/work_planning_board_api_flow_list.txt" `
|
|
84
|
+
--output "docs/api/WORK_PLANNING_BOARD_API_DESIGN_DETAIL.md"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Optional subset generation
|
|
88
|
+
```powershell
|
|
89
|
+
python "toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py" `
|
|
90
|
+
--feature-key WORK_PLANNING_BOARD `
|
|
91
|
+
--yaml "docs/api/WorkPlanningBoard_API.yaml" `
|
|
92
|
+
--flow-list "docs/api/work_planning_board_api_flow_list.txt" `
|
|
93
|
+
--output "docs/api/WORK_PLANNING_BOARD_API_DESIGN_DETAIL.md" `
|
|
94
|
+
--include "POST /api/work-assignment/{organization_uuid}" `
|
|
95
|
+
--include "POST /api/work-assignment/edit/{organization_uuid}/{task_assignment_uuid}" `
|
|
96
|
+
--include "POST /api/work-assignment/delete/{organization_uuid}/{task_assignment_uuid}"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Orchestrator Integration (Hybrid)
|
|
100
|
+
- `apiDesignDetailMode` in `sdtk-spec.config.json` controls orchestration behavior:
|
|
101
|
+
- `auto` (default): generate API design detail when ARCH has API scope and YAML/flow sources are available.
|
|
102
|
+
- `on`: always generate API design detail for API scope (fail if required sources are missing).
|
|
103
|
+
- `off`: skip unless user explicitly requests.
|
|
104
|
+
|
|
105
|
+
## Reference Loading Guidance
|
|
106
|
+
Read at skill start:
|
|
107
|
+
- `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` (required before any section generation)
|
|
108
|
+
|
|
109
|
+
Read on demand:
|
|
110
|
+
- `docs/api/[FeaturePascal]_API.yaml` (required input)
|
|
111
|
+
- `docs/api/[feature_snake]_api_flow_list.txt` (required input)
|
|
@@ -8,6 +8,8 @@ description: Generate OpenAPI 3.x YAML and PlantUML flow diagrams for a feature
|
|
|
8
8
|
## Critical Constraints
|
|
9
9
|
- I do not invent API paths or payload contracts that contradict BA or ARCH artifacts.
|
|
10
10
|
- I do not leave YAML, endpoint markdown, and flow-list outputs out of sync.
|
|
11
|
+
- I do not emit a final API doc without applying canonical YAML and flowchart rules.
|
|
12
|
+
- I do not proceed if BA_SPEC or ARCH_DESIGN is absent or clearly incomplete for the current feature scope.
|
|
11
13
|
|
|
12
14
|
## Outputs
|
|
13
15
|
- `docs/api/[FeaturePascal]_API.yaml`
|
|
@@ -16,17 +18,24 @@ description: Generate OpenAPI 3.x YAML and PlantUML flow diagrams for a feature
|
|
|
16
18
|
- Optional downstream (via `sdtk-api-design-spec`):
|
|
17
19
|
- `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
|
|
18
20
|
|
|
19
|
-
## Inputs
|
|
20
|
-
- Feature name
|
|
21
|
-
- Entities
|
|
22
|
-
- Use cases (UC-xx)
|
|
21
|
+
## Required Inputs
|
|
22
|
+
- Feature name and key
|
|
23
|
+
- Entities and key fields
|
|
24
|
+
- Use cases (UC-xx) and business rules (BR-xx)
|
|
23
25
|
- Auth/permission model
|
|
26
|
+
- `docs/specs/BA_SPEC_[FEATURE_KEY].md` or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
|
|
24
27
|
|
|
25
|
-
##
|
|
28
|
+
## When To Stop Or Escalate
|
|
29
|
+
- Stop if no BA_SPEC or ARCH_DESIGN exists for the current feature; surface as a blocker before generating any artifact.
|
|
30
|
+
- Stop if path naming policy from `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` cannot be resolved without a product decision; record as OQ-xx and escalate to `@pm`.
|
|
31
|
+
- Stop if required UC/BR coverage cannot be confirmed from available sources; do not invent coverage.
|
|
32
|
+
- Escalate to `@arch` if the data model or endpoint scope is structurally ambiguous.
|
|
33
|
+
|
|
34
|
+
## Core Process
|
|
26
35
|
1. Read `docs/specs/BA_SPEC_[FEATURE_KEY].md` and/or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`.
|
|
27
|
-
2.
|
|
28
|
-
-
|
|
29
|
-
-
|
|
36
|
+
2. Load reference rules:
|
|
37
|
+
- `toolkit/templates/docs/api/YAML_CREATION_RULES.md` for YAML contract rules
|
|
38
|
+
- `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` for flow list / flowchart rules
|
|
30
39
|
3. Define endpoints mapped to UC-xx; keep path naming consistent across CRUD/search/list/mst patterns and apply `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` for canonical resource naming.
|
|
31
40
|
4. For each endpoint, document request/response schema and error cases.
|
|
32
41
|
5. Generate/update endpoint markdown (`[FEATURE_KEY]_ENDPOINTS.md`) with summary tables, API type grouping, and screen-logic mapping.
|
|
@@ -39,5 +48,32 @@ description: Generate OpenAPI 3.x YAML and PlantUML flow diagrams for a feature
|
|
|
39
48
|
- terminology consistency across endpoint detail, summary tables, and flow labels
|
|
40
49
|
10. If orchestrator mode requires API design detail generation (`apiDesignDetailMode=auto/on`), handoff to `sdtk-api-design-spec` after YAML + flow list are updated.
|
|
41
50
|
|
|
42
|
-
##
|
|
43
|
-
-
|
|
51
|
+
## Validation / Quality Gates
|
|
52
|
+
- YAML, ENDPOINTS.md, and flow list are consistent: the same resource uses the same path segment across all three.
|
|
53
|
+
- Every UC-xx in scope has at least one endpoint mapped.
|
|
54
|
+
- Every endpoint has a defined success response and at least one error case.
|
|
55
|
+
- All path segments match the canonical naming policy in `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md`.
|
|
56
|
+
- No OQ-xx is silently collapsed; unresolved items remain explicit.
|
|
57
|
+
- English artifact hygiene passes (no language leftovers, no mojibake).
|
|
58
|
+
|
|
59
|
+
## Order-Critical Hard Gate
|
|
60
|
+
Do not finalize YAML or ENDPOINTS.md before reading and applying both reference rule files. Generating endpoints without `toolkit/templates/docs/api/YAML_CREATION_RULES.md` and `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` produces non-conformant output that will fail downstream review.
|
|
61
|
+
|
|
62
|
+
## Common Mistakes
|
|
63
|
+
|
|
64
|
+
| Mistake | Why it is wrong | Do instead |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| Invent endpoint paths not in BA/ARCH | Creates untracked contract drift | Map every endpoint to an explicit UC-xx or BR-xx |
|
|
67
|
+
| Apply path naming from memory without reading policy | Policy details evolve; memory is stale | Always read `SDTK_API_PATH_STYLE_POLICY.md` first |
|
|
68
|
+
| Leave YAML and ENDPOINTS.md out of sync | Downstream tools depend on consistency | Cross-check path/method/schema for each endpoint across all three outputs |
|
|
69
|
+
| Silently collapse an OQ-xx marked as OPEN | Hides unresolved decisions | Keep OQ-xx explicit; escalate to `@pm` if resolution is needed |
|
|
70
|
+
| Skip flowchart rules and free-style PlantUML | Produces flows that deviate from SDTK conventions | Apply `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` before generating any flow |
|
|
71
|
+
|
|
72
|
+
## Reference Loading Guidance
|
|
73
|
+
Read these files at skill start, not on demand:
|
|
74
|
+
- `toolkit/templates/docs/api/YAML_CREATION_RULES.md`
|
|
75
|
+
- `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md`
|
|
76
|
+
|
|
77
|
+
Read on demand when needed:
|
|
78
|
+
- `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` (always required for path naming)
|
|
79
|
+
- `docs/specs/API_DOC_SKILL_ANALYSIS.md` (if present; deeper domain analysis only)
|