sdtk-kit 0.3.2 → 0.3.4

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 (28) hide show
  1. package/README.md +40 -3
  2. package/assets/manifest/toolkit-bundle.manifest.json +87 -12
  3. package/assets/manifest/toolkit-bundle.sha256.txt +19 -4
  4. package/assets/toolkit/toolkit/AGENTS.md +20 -16
  5. package/assets/toolkit/toolkit/install.ps1 +122 -7
  6. package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +32 -10
  7. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +129 -0
  8. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +8 -0
  9. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +139 -0
  10. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +76 -0
  11. package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +46 -0
  12. package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +70 -0
  13. package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +49 -0
  14. package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +25 -0
  15. package/assets/toolkit/toolkit/skills-claude/dev/SKILL.md +45 -0
  16. package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +20 -0
  17. package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +18 -0
  18. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +63 -0
  19. package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +52 -0
  20. package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +47 -0
  21. package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +68 -0
  22. package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +63 -0
  23. package/package.json +2 -2
  24. package/src/commands/help.js +30 -4
  25. package/src/commands/init.js +25 -1
  26. package/src/commands/runtime.js +217 -0
  27. package/src/index.js +4 -1
  28. package/src/lib/scope.js +68 -0
@@ -1,7 +1,15 @@
1
1
  param(
2
+ [ValidateSet('project', 'user')]
3
+ [string]$Scope = 'user',
2
4
  [switch]$Force
3
5
  )
4
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
+
5
13
  $ErrorActionPreference = 'Stop'
6
14
  Set-StrictMode -Version Latest
7
15
 
@@ -0,0 +1,139 @@
1
+ param(
2
+ [string]$ProjectPath,
3
+ [ValidateSet('project', 'user')]
4
+ [string]$Scope = 'project',
5
+ [string]$SkillName,
6
+ [switch]$All,
7
+ [switch]$BackupExisting,
8
+ [string]$BackupPath
9
+ )
10
+
11
+ $ErrorActionPreference = 'Stop'
12
+ Set-StrictMode -Version Latest
13
+
14
+ function Backup-Directory {
15
+ param(
16
+ [Parameter(Mandatory = $true)][string]$SourcePath,
17
+ [Parameter(Mandatory = $true)][string]$BackupRoot,
18
+ [Parameter(Mandatory = $true)][string]$Name
19
+ )
20
+
21
+ if (-not (Test-Path -LiteralPath $SourcePath)) {
22
+ return $null
23
+ }
24
+
25
+ New-Item -ItemType Directory -Force -Path $BackupRoot | Out-Null
26
+ $dest = Join-Path $BackupRoot $Name
27
+ if (Test-Path -LiteralPath $dest) {
28
+ Remove-Item -LiteralPath $dest -Recurse -Force
29
+ }
30
+ Copy-Item -LiteralPath $SourcePath -Destination $dest -Recurse -Force
31
+ return $dest
32
+ }
33
+
34
+ if ($All -and $SkillName) {
35
+ throw "Use either -All or -SkillName, not both."
36
+ }
37
+
38
+ $toolkitRoot = Resolve-Path (Join-Path $PSScriptRoot '..')
39
+ $skillsSrc = Join-Path $toolkitRoot 'skills-claude'
40
+ if (-not (Test-Path -LiteralPath $skillsSrc)) {
41
+ throw "Missing toolkit Claude skills source directory: $skillsSrc"
42
+ }
43
+
44
+ $managedSkillNames = Get-ChildItem -LiteralPath $skillsSrc -Directory | Select-Object -ExpandProperty Name
45
+ if (-not $managedSkillNames -or $managedSkillNames.Count -eq 0) {
46
+ throw "No managed Claude skills found in: $skillsSrc"
47
+ }
48
+
49
+ $targetNames = @()
50
+ if ($SkillName) {
51
+ if ($managedSkillNames -notcontains $SkillName) {
52
+ throw "Skill '$SkillName' is not in managed Claude skills list. Known skills: $($managedSkillNames -join ', ')"
53
+ }
54
+ $targetNames = @($SkillName)
55
+ } elseif ($All) {
56
+ $targetNames = @($managedSkillNames)
57
+ } else {
58
+ $targetNames = @($managedSkillNames)
59
+ }
60
+
61
+ # Resolve destination based on scope
62
+ if ($Scope -eq 'user') {
63
+ $skillsDest = Join-Path $HOME '.claude/skills'
64
+ } else {
65
+ if (-not $ProjectPath) {
66
+ $ProjectPath = (Resolve-Path (Join-Path $toolkitRoot '..')).Path
67
+ }
68
+ $projectRoot = Resolve-Path -LiteralPath $ProjectPath
69
+ $skillsDest = Join-Path $projectRoot '.claude/skills'
70
+ }
71
+
72
+ if (-not (Test-Path -LiteralPath $skillsDest)) {
73
+ Write-Host "Claude skills directory not found: $skillsDest"
74
+ exit 0
75
+ }
76
+
77
+ $backupRootResolved = $null
78
+ if ($BackupExisting) {
79
+ if (-not $BackupPath -or $BackupPath.Trim().Length -eq 0) {
80
+ $timestamp = Get-Date -Format 'yyyyMMdd-HHmmss'
81
+ $parentDir = if ($Scope -eq 'user') { Join-Path $HOME '.claude' } else { $projectRoot }
82
+ $BackupPath = Join-Path $parentDir (Join-Path 'skills-backups' ("uninstall-" + $timestamp))
83
+ }
84
+ New-Item -ItemType Directory -Force -Path $BackupPath | Out-Null
85
+ $backupRootResolved = (Resolve-Path -LiteralPath $BackupPath).Path
86
+ Write-Host "Backup mode enabled: $backupRootResolved"
87
+ }
88
+
89
+ $removed = New-Object System.Collections.Generic.List[string]
90
+ $missing = New-Object System.Collections.Generic.List[string]
91
+
92
+ foreach ($name in $targetNames) {
93
+ $dest = Join-Path $skillsDest $name
94
+ if (-not (Test-Path -LiteralPath $dest)) {
95
+ $missing.Add($name) | Out-Null
96
+ Write-Warning "Skill not installed, skipping: $name"
97
+ continue
98
+ }
99
+
100
+ if ($BackupExisting) {
101
+ $backupDest = Backup-Directory -SourcePath $dest -BackupRoot $backupRootResolved -Name $name
102
+ if ($backupDest) {
103
+ Write-Host "Backed up: $name -> $backupDest"
104
+ }
105
+ }
106
+
107
+ Remove-Item -LiteralPath $dest -Recurse -Force
108
+ $removed.Add($name) | Out-Null
109
+ Write-Host "Uninstalled: $name"
110
+ }
111
+
112
+ # Also remove references directory if uninstalling all
113
+ if ($All -or (-not $SkillName)) {
114
+ $refDir = Join-Path $skillsDest 'references'
115
+ if (Test-Path -LiteralPath $refDir) {
116
+ if ($BackupExisting) {
117
+ Backup-Directory -SourcePath $refDir -BackupRoot $backupRootResolved -Name 'references' | Out-Null
118
+ Write-Host "Backed up: references -> $backupRootResolved/references"
119
+ }
120
+ Remove-Item -LiteralPath $refDir -Recurse -Force
121
+ Write-Host "Removed references directory."
122
+ }
123
+ }
124
+
125
+ Write-Host ""
126
+ Write-Host "Uninstall summary:"
127
+ Write-Host "- Scope: $Scope"
128
+ Write-Host "- Destination: $skillsDest"
129
+ Write-Host "- Removed: $($removed.Count)"
130
+ if ($removed.Count -gt 0) {
131
+ $removed | ForEach-Object { Write-Host " - $_" }
132
+ }
133
+ Write-Host "- Missing/Skipped: $($missing.Count)"
134
+ if ($missing.Count -gt 0) {
135
+ $missing | ForEach-Object { Write-Host " - $_" }
136
+ }
137
+ if ($backupRootResolved) {
138
+ Write-Host "- Backup directory: $backupRootResolved"
139
+ }
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: api-design-spec
3
+ description: Generate detailed API design markdown 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
+ ## Required Inputs (read before proceeding)
7
+ Read the following artifacts for the current feature:
8
+ 1. `docs/api/[FeaturePascal]_API.yaml` — API contract
9
+ 2. `docs/api/[feature_snake]_api_flow_list.txt` — flow list
10
+
11
+ ## Input
12
+ $ARGUMENTS
13
+
14
+ # SDTK API Design Detail Spec
15
+
16
+ ## Outputs
17
+ - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
18
+ - Supporting generated assets:
19
+ - `docs/api/flows/*.puml`
20
+ - `docs/api/images/*.svg`
21
+
22
+ ## Required Inputs
23
+ - Feature key (`FEATURE_KEY`)
24
+ - API contract YAML:
25
+ - Preferred: `docs/api/[FeaturePascal]_API.yaml`
26
+ - Fallback: a specified YAML file path
27
+ - API flow list:
28
+ - Preferred: `docs/api/[feature_snake]_api_flow_list.txt`
29
+ - Fallback: a specified flow list path
30
+
31
+ ## Core Rules
32
+ - Apply `.claude/skills/references/API_DESIGN_FLOWCHART_CREATION_RULES.md` first.
33
+ - Keep endpoint contracts consistent with source YAML.
34
+ - Keep process flow source synchronized with flow list (`*_api_flow_list.txt`).
35
+ - Keep one visible flowchart per API section (embed image), avoid duplicate preview rendering.
36
+ - Keep `Process Flow` sections implementation-readable:
37
+ - include YAML-derived flow summary / notes / login bullets
38
+ - keep error sections aligned with actual flow exits, not `None`
39
+
40
+ ## Generation Procedure
41
+ 1. Resolve input files (`yaml`, `flow_list`, `output`).
42
+ 2. Parse YAML endpoints (method, path, request schema, success/error schema).
43
+ 3. Parse flow blocks from flow list (`@startuml ... @enduml`) and map by `METHOD + path`.
44
+ 4. Generate detailed markdown sections per API:
45
+ - Flow summary / notes / login bullets from YAML `description`
46
+ - Process flow source block (`text` fenced block)
47
+ - Embedded flowchart image
48
+ - Path parameter table
49
+ - Request table (hierarchy levels + type + format + required)
50
+ - Success response table
51
+ - Error response table (explicit schema if defined, otherwise shared envelope + inferred business statuses from flow)
52
+ 5. Generate/update `.puml` per API under `docs/api/flows`.
53
+ 6. Render `.svg` images under `docs/api/images`.
54
+ 7. Validate:
55
+ - every API section has one embedded image
56
+ - every embed path exists
57
+ - no render error image output
58
+ - markdown tables keep `No` sequential numbering
59
+
60
+ ## Script
61
+ - `scripts/generate_api_design_detail.py`
62
+
63
+ ### Typical command
64
+ ```bash
65
+ python scripts/generate_api_design_detail.py \
66
+ --feature-key SCHEDULE_WHITEBOARD \
67
+ --yaml "docs/api/ScheduleWhiteboard_API.yaml" \
68
+ --flow-list "docs/api/schedule_whiteboard_api_flow_list.txt" \
69
+ --output "docs/api/SCHEDULE_WHITEBOARD_API_DESIGN_DETAIL.md"
70
+ ```
71
+
72
+ ## Orchestrator Integration (Hybrid)
73
+ - `apiDesignDetailMode` in `sdtk.config.json` controls orchestration behavior:
74
+ - `auto` (default): generate API design detail when ARCH has API scope and YAML/flow sources are available.
75
+ - `on`: always generate API design detail for API scope (fail if required sources are missing).
76
+ - `off`: skip unless user explicitly requests.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: api-doc
3
+ description: Generate OpenAPI 3.x YAML and PlantUML flow diagrams for a feature following this toolkit's API conventions. Use when you need to create/update docs/api/* (API spec + flow list) from BA_SPEC/ARCH_DESIGN.
4
+ ---
5
+
6
+ ## Required Inputs (read before proceeding)
7
+ Read the following artifacts for the current feature:
8
+ 1. `docs/specs/BA_SPEC_*.md` — business rules, use cases
9
+ 2. `docs/architecture/ARCH_DESIGN_*.md` — system components, data model
10
+
11
+ ## Input
12
+ $ARGUMENTS
13
+
14
+ # SDTK API Documentation
15
+
16
+ ## Outputs
17
+ - `docs/api/[FeaturePascal]_API.yaml`
18
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
19
+ - `docs/api/[feature_snake]_api_flow_list.txt`
20
+ - Optional downstream (via `/api-design-spec`):
21
+ - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
22
+
23
+ ## Inputs (minimum)
24
+ - Feature name/key
25
+ - Entities + key fields
26
+ - Use cases (UC-xx) + business rules (BR-xx)
27
+ - Auth/permission model
28
+
29
+ ## Process
30
+ 1. Read `docs/specs/BA_SPEC_[FEATURE_KEY].md` and/or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`.
31
+ 2. Read and apply split API rule sources:
32
+ - `.claude/skills/references/YAML_CREATION_RULES.md` for YAML contract rules
33
+ - `.claude/skills/references/API_DESIGN_FLOWCHART_CREATION_RULES.md` for flow list / flowchart rules
34
+ 3. Define endpoints mapped to UC-xx; keep path naming consistent across CRUD/search/list/mst patterns.
35
+ 4. For each endpoint, document request/response schema and error cases.
36
+ 5. Generate/update endpoint markdown (`[FEATURE_KEY]_ENDPOINTS.md`) with summary tables, API type grouping, and screen-logic mapping.
37
+ 6. Generate PlantUML flows including: auth, permission check, validation, main logic, error exits.
38
+ 7. Ensure traceability notes reference UC/BR where relevant.
39
+ 8. Validate English output hygiene when generating English artifacts:
40
+ - no mixed-language leftovers in narrative text
41
+ - no mojibake/encoding corruption markers
42
+ - terminology consistency across endpoint detail, summary tables, and flow labels
43
+ 9. If orchestrator mode requires API design detail generation (`apiDesignDetailMode=auto/on`), handoff to `/api-design-spec` after YAML + flow list are updated.
44
+
45
+ ## Reference
46
+ - Deeper analysis: `docs/specs/API_DOC_SKILL_ANALYSIS.md` (if present).
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: arch
3
+ description: Solution Architect workflow for SDTK. Use when you need to convert BA_SPEC + PM backlog into technical architecture, API contracts (OpenAPI), and UI layout docs; update SHARED_PLANNING.md / QUALITY_CHECKLIST.md and handoff to DEV.
4
+ ---
5
+
6
+ ## SDTK Pipeline Rules (always apply)
7
+ 1. Pipeline: PM Initiation → BA Analysis → PM Planning → Architecture Design → Development + Review → QA Validation
8
+ 2. After completing phase work: update SHARED_PLANNING.md + QUALITY_CHECKLIST.md
9
+ 3. If unclear: log OQ-xx in artifact, escalate to PM (PM asks user if needed)
10
+ 4. Traceability: REQ → BR/UC/AC → design → backlog → code/tests → QA
11
+ 5. Code review must be COMPLETE before QA phase can start
12
+ 6. Do not skip phases. If inputs missing, ask focused questions.
13
+
14
+ ## Prerequisites (verify before proceeding)
15
+ Read QUALITY_CHECKLIST.md and verify:
16
+ - Phase 2 BA Analysis gate must show all items [x] Done.
17
+ - Phase 2+ PM Planning gate must show all items [x] Done.
18
+
19
+ If prerequisites NOT met: report which gate is missing, suggest user run the prerequisite phase first.
20
+
21
+ ## Current Context
22
+ - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk.config.json','utf8'))}catch{process.stdout.write('{}')}"`
23
+ - Pipeline: !`node -e "try{process.stdout.write(require('fs').readFileSync('SHARED_PLANNING.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
24
+ - Gates: !`node -e "try{process.stdout.write(require('fs').readFileSync('QUALITY_CHECKLIST.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
25
+ - State: !`node -e "try{process.stdout.write(require('fs').readFileSync('.sdtk/orchestration-state.json','utf8'))}catch{process.stdout.write('{}')}"`
26
+
27
+ ## Input
28
+ $ARGUMENTS
29
+
30
+ If no arguments provided, read current feature context from SHARED_PLANNING.md.
31
+
32
+ # SDTK ARCH (Solution Architecture)
33
+
34
+ ## Outputs
35
+ - `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
36
+ - If applicable:
37
+ - `docs/api/[FeaturePascal]_API.yaml`
38
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
39
+ - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
40
+ - `docs/api/[feature_snake]_api_flow_list.txt`
41
+ - `docs/database/DATABASE_SPEC_[FEATURE_KEY].md`
42
+ - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
43
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
44
+
45
+ ## Process
46
+ 1. Read BA spec + PRD/backlog.
47
+ 2. Read `sdtk.config.json` for project stack assumptions (backend/frontend/db/auth).
48
+ 3. If architecture output includes API contracts/flows, read and apply the split API rule sources before defining endpoints/flows:
49
+ - `.claude/skills/references/YAML_CREATION_RULES.md`
50
+ - `.claude/skills/references/API_DESIGN_FLOWCHART_CREATION_RULES.md`
51
+ 4. If architecture output includes screen flow-action specs, read and apply rules from `.claude/skills/references/FLOW_ACTION_SPEC_CREATION_RULES.md` (global numbering policy).
52
+ 5. If API detail spec is required, use skill `/api-design-spec` to build/update `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md` using YAML + flow list.
53
+ 6. For complex UI flow-action specs, use skill `/screen-design-spec` to build/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`.
54
+ 7. Define:
55
+ - System components + data model
56
+ - API endpoints and flows (if backend changes)
57
+ - Screen layouts (if UI changes)
58
+ - Security/authz decisions
59
+ 8. Create/update:
60
+ - OpenAPI YAML + API endpoint markdown
61
+ - API flow list
62
+ - API design detail spec (when `orchestration.apiDesignDetailMode` is `auto/on`)
63
+ - Database spec (if DB impact exists)
64
+ - Flow-action spec and design layout (if UI impact exists)
65
+ 9. Ensure mapping UC/BR -> DB/API/screens and run output hygiene checks:
66
+ - EN artifacts use English narrative text (except clearly marked original-language appendix blocks).
67
+ - No mojibake/encoding corruption in markdown/yaml/txt outputs.
68
+ 10. If anything is unclear: record OQ-xx in ARCH_DESIGN "Open Questions" and escalate to PM (suggest user run `/pm` for a decision if still missing info).
69
+ 11. Update shared state + Phase 3 checklist.
70
+ 12. Handoff: suggest user run `/dev` to implement the design.
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: ba
3
+ description: Business Analyst workflow for SDTK. Use when you need to turn PM initiation into BA_SPEC with glossary, business rules (BR-xx), use cases (UC-xx), acceptance criteria (AC-xx), NFRs, risks, open questions, and a traceability matrix.
4
+ ---
5
+
6
+ ## SDTK Pipeline Rules (always apply)
7
+ 1. Pipeline: PM Initiation → BA Analysis → PM Planning → Architecture Design → Development + Review → QA Validation
8
+ 2. After completing phase work: update SHARED_PLANNING.md + QUALITY_CHECKLIST.md
9
+ 3. If unclear: log OQ-xx in artifact, escalate to PM (PM asks user if needed)
10
+ 4. Traceability: REQ → BR/UC/AC → design → backlog → code/tests → QA
11
+ 5. Code review must be COMPLETE before QA phase can start
12
+ 6. Do not skip phases. If inputs missing, ask focused questions.
13
+
14
+ ## Prerequisites (verify before proceeding)
15
+ Read QUALITY_CHECKLIST.md and verify:
16
+ - Phase 1 PM Init gate must show all items [x] Done.
17
+
18
+ If prerequisites NOT met: report which gate is missing, suggest user run `/pm` first.
19
+
20
+ ## Current Context
21
+ - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk.config.json','utf8'))}catch{process.stdout.write('{}')}"`
22
+ - Pipeline: !`node -e "try{process.stdout.write(require('fs').readFileSync('SHARED_PLANNING.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
23
+ - Gates: !`node -e "try{process.stdout.write(require('fs').readFileSync('QUALITY_CHECKLIST.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
24
+ - State: !`node -e "try{process.stdout.write(require('fs').readFileSync('.sdtk/orchestration-state.json','utf8'))}catch{process.stdout.write('{}')}"`
25
+
26
+ ## Input
27
+ $ARGUMENTS
28
+
29
+ If no arguments provided, read current feature context from SHARED_PLANNING.md.
30
+
31
+ # SDTK BA (Business Analysis)
32
+
33
+ ## Output
34
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md`
35
+
36
+ ## Process
37
+ 1. Read `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md` (and any source requirements).
38
+ 2. Produce:
39
+ - Glossary
40
+ - BR-xx (numbered)
41
+ - UC-xx (cover 100% REQ-xx)
42
+ - AC-xx (mapped to UC/BR)
43
+ - NFR-xx
44
+ - Risks + Open Questions
45
+ - Traceability summary table (REQ → UC/BR/AC)
46
+ 3. If source requirements are VI/JP: preserve the original text and add a literal EN translation in appendices.
47
+ 4. If anything is unclear: record OQ-xx in BA_SPEC "Open Questions" and escalate to PM (suggest user run `/pm` for a decision if still missing info).
48
+ 5. Update `SHARED_PLANNING.md` + `QUALITY_CHECKLIST.md` Phase 2.
49
+ 6. Handoff: suggest user run `/pm` to proceed with PRD planning.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: design-layout
3
+ description: Generate UI screen layout documentation for a feature, including PlantUML @startsalt wireframes and item tables. Use when a feature includes frontend/admin screens and you need docs/design/* deliverables.
4
+ ---
5
+
6
+ ## Required Inputs (read before proceeding)
7
+ Read the following artifacts for the current feature:
8
+ 1. `docs/specs/BA_SPEC_*.md` — screens + fields
9
+ 2. `docs/api/[FEATURE_KEY]_ENDPOINTS.md` — API list
10
+
11
+ ## Input
12
+ $ARGUMENTS
13
+
14
+ # SDTK Screen Layout Design
15
+
16
+ ## Output
17
+ - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
18
+
19
+ ## Process
20
+ 1. Read BA spec (screens + fields) and API list.
21
+ 2. For each screen, include:
22
+ - PlantUML `@startsalt` wireframe first
23
+ - API list table
24
+ - Item table with numbering that matches the wireframe
25
+ 3. Keep screen IDs consistent (A-*, B-*, C-*).
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: dev
3
+ description: Developer workflow for SDTK. Use when you need to implement a feature from ARCH_DESIGN + BACKLOG: create an implementation plan, write code + tests, complete mandatory code review gate, and prepare a QA handoff.
4
+ ---
5
+
6
+ ## SDTK Pipeline Rules (always apply)
7
+ 1. Pipeline: PM Initiation → BA Analysis → PM Planning → Architecture Design → Development + Review → QA Validation
8
+ 2. After completing phase work: update SHARED_PLANNING.md + QUALITY_CHECKLIST.md
9
+ 3. If unclear: log OQ-xx in artifact, escalate to PM (PM asks user if needed)
10
+ 4. Traceability: REQ → BR/UC/AC → design → backlog → code/tests → QA
11
+ 5. Code review must be COMPLETE before QA phase can start
12
+ 6. Do not skip phases. If inputs missing, ask focused questions.
13
+
14
+ ## Prerequisites (verify before proceeding)
15
+ Read QUALITY_CHECKLIST.md and verify:
16
+ - Phase 3 ARCH Design gate must show all items [x] Done.
17
+
18
+ If prerequisites NOT met: report which gate is missing, suggest user run `/arch` first.
19
+
20
+ ## Current Context
21
+ - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk.config.json','utf8'))}catch{process.stdout.write('{}')}"`
22
+ - Pipeline: !`node -e "try{process.stdout.write(require('fs').readFileSync('SHARED_PLANNING.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
23
+ - Gates: !`node -e "try{process.stdout.write(require('fs').readFileSync('QUALITY_CHECKLIST.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
24
+ - State: !`node -e "try{process.stdout.write(require('fs').readFileSync('.sdtk/orchestration-state.json','utf8'))}catch{process.stdout.write('{}')}"`
25
+
26
+ ## Input
27
+ $ARGUMENTS
28
+
29
+ If no arguments provided, read current feature context from SHARED_PLANNING.md.
30
+
31
+ # SDTK DEV (Implementation + Code Review)
32
+
33
+ ## Outputs
34
+ - `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md`
35
+ - Code + tests (follow repo conventions)
36
+
37
+ ## Process
38
+ 1. Read `ARCH_DESIGN_*` + backlog.
39
+ 2. Read `sdtk.config.json` for project stack + test/lint commands.
40
+ 3. Write `FEATURE_IMPL_PLAN_*` (scope, file list, test plan).
41
+ 4. If anything is unclear: record OQ-xx in FEATURE_IMPL_PLAN "Open Questions" and escalate to PM (suggest user run `/pm` for a decision if still missing info).
42
+ 5. Implement incrementally with tests.
43
+ 6. Complete mandatory code review gate (self + peer checklist; AI peer review allowed).
44
+ 7. Update `SHARED_PLANNING.md` + `QUALITY_CHECKLIST.md` Phase 4.
45
+ 8. Handoff: suggest user run `/qa` to test (only after code review PASS).
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: dev-backend
3
+ description: Generate/modify Python Django REST Framework backend code following the toolkit conventions (models/views/services/serializers/validation/urls/enums). Use when implementing backend features in that project style.
4
+ ---
5
+
6
+ ## Input
7
+ $ARGUMENTS
8
+
9
+ # SDTK Backend (Toolkit conventions)
10
+
11
+ ## Process
12
+ 1. Check whether this repository already has a backend reference module and follow its patterns.
13
+ 2. Follow module structure: `src/backend/<module>/{models,view,service,serializers,validation,enum,urls.py}`.
14
+ 3. Apply conventions:
15
+ - Soft delete via `del_flg`
16
+ - Audit fields (creator/updater/del timestamps)
17
+ - Permission checks before operations
18
+ - `transaction.atomic()` for writes
19
+ - Logging decorator on public endpoints
20
+ 4. Add tests for critical business rules and state transitions.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: dev-frontend
3
+ description: Generate/modify React frontend code following the toolkit conventions (list/register/edit/detail pages, components, services, React Query hooks, permission checks). Use when implementing frontend features in that project style.
4
+ ---
5
+
6
+ ## Input
7
+ $ARGUMENTS
8
+
9
+ # SDTK Frontend (Toolkit conventions)
10
+
11
+ ## Process
12
+ 1. Check whether this repository already has a frontend reference module and follow its patterns.
13
+ 2. Follow structure:
14
+ - `src/frontend/features/{feature}/...`
15
+ - `src/frontend/services/{feature}/{feature}Service.js`
16
+ - `src/frontend/services/apiHook/{feature}.js`
17
+ 3. Implement screens based on `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`.
18
+ 4. Preserve patterns: React Query hooks, loading states, permission checks, consistent labels.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: orchestrator
3
+ description: Orchestrate a full 6-phase SDLC multi-agent workflow (PM/BA/ARCH/DEV/QA) using this repo's conventions: SHARED_PLANNING.md + QUALITY_CHECKLIST.md + docs/* artifacts + phase handoffs.
4
+ ---
5
+
6
+ ## SDTK Pipeline Rules (always apply)
7
+ 1. Pipeline: PM Initiation → BA Analysis → PM Planning → Architecture Design → Development + Review → QA Validation
8
+ 2. After completing phase work: update SHARED_PLANNING.md + QUALITY_CHECKLIST.md
9
+ 3. If unclear: log OQ-xx in artifact, escalate to PM (PM asks user if needed)
10
+ 4. Traceability: REQ → BR/UC/AC → design → backlog → code/tests → QA
11
+ 5. Code review must be COMPLETE before QA phase can start
12
+ 6. Do not skip phases. If inputs missing, ask focused questions.
13
+
14
+ ## Current Context
15
+ - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk.config.json','utf8'))}catch{process.stdout.write('{}')}"`
16
+ - Pipeline: !`node -e "try{process.stdout.write(require('fs').readFileSync('SHARED_PLANNING.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
17
+ - Gates: !`node -e "try{process.stdout.write(require('fs').readFileSync('QUALITY_CHECKLIST.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
18
+ - State: !`node -e "try{process.stdout.write(require('fs').readFileSync('.sdtk/orchestration-state.json','utf8'))}catch{process.stdout.write('{}')}"`
19
+
20
+ ## Input
21
+ $ARGUMENTS
22
+
23
+ If no arguments provided, read current feature context from SHARED_PLANNING.md.
24
+
25
+ # SDTK Orchestrator (multi-agent workflow)
26
+
27
+ ## Initialize
28
+ - Ensure feature key + feature name exist (ask if missing).
29
+ - Read `sdtk.config.json` (project stack + commands) if present.
30
+ - Run `sdtk generate --feature-key <KEY> --feature-name "<NAME>"` to create skeleton artifacts.
31
+
32
+ ## Execute pipeline (one phase per turn)
33
+ - Default role: PM (entry point) if user did not specify.
34
+ - Respect role tags: `/pm`, `/ba`, `/arch`, `/dev`, `/qa`.
35
+ - For each phase:
36
+ - Create/update the phase artifact(s) in `docs/`.
37
+ - If phase is ARCH and API contract/flow is in scope, invoke `/api-doc` to produce/update `docs/api/[FeaturePascal]_API.yaml`, `docs/api/[FEATURE_KEY]_ENDPOINTS.md`, and `docs/api/[feature_snake]_api_flow_list.txt`.
38
+ - If phase is ARCH and API detail spec is in scope, invoke `/api-design-spec` to produce/update `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`.
39
+ - If phase is ARCH and UI flow behavior is in scope, invoke `/screen-design-spec` to produce/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`.
40
+ - If phase is QA and test-case specification is in scope, invoke `/test-case-spec` to produce/update `docs/qa/[FEATURE_KEY]_TEST_CASE.md`.
41
+ - Update `SHARED_PLANNING.md` (phase row + activity log).
42
+ - Update `QUALITY_CHECKLIST.md` (mark items PASS/Pending).
43
+ - Produce one clear handoff message to the next role.
44
+
45
+ ## API design detail mode (Hybrid)
46
+ - Read `sdtk.config.json` key: `orchestration.apiDesignDetailMode`.
47
+ - Supported values:
48
+ - `auto` (default): run `/api-design-spec` when ARCH has API scope and YAML + flow list are available.
49
+ - `on`: always run `/api-design-spec` for API scope (fail fast if required inputs are missing).
50
+ - `off`: skip API design detail generation unless user explicitly requests it.
51
+
52
+ ## Test-case spec mode (Hybrid)
53
+ - Read `sdtk.config.json` key: `orchestration.testCaseSpecMode`.
54
+ - Supported values:
55
+ - `auto` (default): run `/test-case-spec` when QA phase requires reusable test-case artifact.
56
+ - `on`: always run `/test-case-spec` for QA phase (fail fast if required inputs are missing).
57
+ - `off`: skip test-case spec generation unless user explicitly requests it.
58
+
59
+ ## Guardrails
60
+ - Do not skip phases; if prerequisites are missing, ask focused questions.
61
+ - Keep traceability: REQ -> BR/UC/AC -> design -> backlog -> code/tests -> QA report.
62
+ - Require code review completion before QA handoff.
63
+ - If input requirements are VI/JP: preserve original text + add EN translation in appendix for traceability (at least in Project Initiation and BA spec).
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: pm
3
+ description: Product Manager + meta-orchestrator workflow for SDTK. Use when you need to start a new feature (Phase 1) or produce PM planning artifacts (PRD + BACKLOG) and update SHARED_PLANNING.md / QUALITY_CHECKLIST.md with correct phase handoffs.
4
+ ---
5
+
6
+ ## SDTK Pipeline Rules (always apply)
7
+ 1. Pipeline: PM Initiation → BA Analysis → PM Planning → Architecture Design → Development + Review → QA Validation
8
+ 2. After completing phase work: update SHARED_PLANNING.md + QUALITY_CHECKLIST.md
9
+ 3. If unclear: log OQ-xx in artifact, escalate to PM (PM asks user if needed)
10
+ 4. Traceability: REQ → BR/UC/AC → design → backlog → code/tests → QA
11
+ 5. Code review must be COMPLETE before QA phase can start
12
+ 6. Do not skip phases. If inputs missing, ask focused questions.
13
+
14
+ ## Prerequisites (verify before proceeding)
15
+ Read QUALITY_CHECKLIST.md and verify:
16
+ - Phase 1 (PM Init): No prerequisites required.
17
+ - Phase 2+ (PM Planning): BA Analysis gate must show all items [x] Done.
18
+
19
+ If prerequisites NOT met: report which gate is missing, suggest user run the prerequisite phase first.
20
+
21
+ ## Current Context
22
+ - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk.config.json','utf8'))}catch{process.stdout.write('{}')}"`
23
+ - Pipeline: !`node -e "try{process.stdout.write(require('fs').readFileSync('SHARED_PLANNING.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
24
+ - Gates: !`node -e "try{process.stdout.write(require('fs').readFileSync('QUALITY_CHECKLIST.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
25
+ - State: !`node -e "try{process.stdout.write(require('fs').readFileSync('.sdtk/orchestration-state.json','utf8'))}catch{process.stdout.write('{}')}"`
26
+
27
+ ## Input
28
+ $ARGUMENTS
29
+
30
+ If no arguments provided, read current feature context from SHARED_PLANNING.md.
31
+
32
+ # SDTK PM (Entry Point + Planning)
33
+
34
+ ## Outputs
35
+ - Phase 1: `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md`
36
+ - Phase 2+ (after BA spec): `docs/product/PRD_[FEATURE_KEY].md` + `docs/product/BACKLOG_[FEATURE_KEY].md`
37
+
38
+ ## Process
39
+ 1. Confirm `FEATURE_KEY` + `FEATURE_NAME` + Phase-1 scope in/out.
40
+ 2. Create/update PM artifact(s).
41
+ 3. Ensure REQ-xx list is clear and testable.
42
+ 4. If requirements are provided in VI/JP: keep the original text in an appendix and add an EN translation (literal) for traceability.
43
+ 5. Update `SHARED_PLANNING.md` + `QUALITY_CHECKLIST.md`.
44
+ 6. Handoff:
45
+ - After Project Initiation -> suggest user run `/ba` to analyze requirements
46
+ - After PRD/Backlog -> suggest user run `/arch` to design architecture
47
+
48
+ ## Clarification And Decisions (PM responsibility)
49
+ - Collect OQ-xx items raised by BA/ARCH/DEV/QA in their respective artifacts.
50
+ - Try to resolve OQ-xx using existing docs and reasonable product/tech decisions.
51
+ - If still missing information from the original input: ask the user (final stakeholder) and record the answer as the resolution.
52
+ - Record decisions in PRD `Decision Log` and update OQ-xx `Resolution` fields in the originating docs.