sdtk-spec-kit 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +219 -197
- package/assets/manifest/toolkit-bundle.manifest.json +70 -55
- package/assets/manifest/toolkit-bundle.sha256.txt +29 -26
- package/assets/toolkit/toolkit/README.md +50 -0
- package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +185 -0
- package/assets/toolkit/toolkit/scripts/init-feature.ps1 +2 -1
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +84 -84
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/YAML_CREATION_RULES.md +127 -127
- package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +85 -83
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +220 -220
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/YAML_CREATION_RULES.md +127 -127
- package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +108 -102
- package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +97 -81
- package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +37 -30
- package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +75 -61
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +220 -220
- package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +90 -90
- package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +25 -53
- package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +12 -6
- package/assets/toolkit/toolkit/templates/QUALITY_CHECKLIST.md +124 -124
- package/assets/toolkit/toolkit/templates/README.md +1 -0
- package/assets/toolkit/toolkit/templates/SHARED_PLANNING.md +81 -81
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
- package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +127 -127
- package/assets/toolkit/toolkit/templates/docs/database/DATABASE_SPEC_TEMPLATE.md +174 -174
- package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +106 -96
- package/assets/toolkit/toolkit/templates/docs/qa/CONTROLLER_ACCEPTANCE_TEMPLATE.md +90 -0
- package/assets/toolkit/toolkit/templates/docs/qa/QA_RELEASE_REPORT_TEMPLATE.md +162 -95
- package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +220 -220
- package/package.json +20 -20
- package/src/commands/help.js +24 -10
- package/src/commands/update.js +11 -0
- package/src/index.js +62 -59
- package/src/lib/update.js +326 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# SDTK-SPEC Multi-Agent Software Development Toolkit
|
|
2
|
+
|
|
3
|
+
This guide explains how to run SDTK-SPEC as a runtime-agnostic toolkit with adapters for Codex and Claude Code.
|
|
4
|
+
It is product-specific to `SDTK-SPEC` within the broader `SDTK Suite` family (`SDTK-SPEC`, `SDTK-CODE`, `SDTK-OPS`).
|
|
5
|
+
Use the root `README.md` for suite-level framing and `products/sdtk-code/toolkit/SDTKCODE_TOOLKIT.md` for the downstream coding product.
|
|
6
|
+
|
|
7
|
+
Canonical install/runtime source of truth:
|
|
8
|
+
- `governance/ai/cli/SDTK_RUNTIME_AND_FEATURE_STATUS.md`
|
|
9
|
+
|
|
10
|
+
## 1. What SDTK-SPEC Is
|
|
11
|
+
SDTK-SPEC is a practical delivery framework for software teams.
|
|
12
|
+
It provides:
|
|
13
|
+
- a fixed SDLC workflow,
|
|
14
|
+
- reusable documentation templates,
|
|
15
|
+
- specialized skills for each phase,
|
|
16
|
+
- and explicit quality gates.
|
|
17
|
+
|
|
18
|
+
This guide does not document `SDTK-OPS` as a runnable product because that surface is still planned/partial only.
|
|
19
|
+
|
|
20
|
+
## 2. SDLC Model
|
|
21
|
+
Default flow:
|
|
22
|
+
1. PM initiation
|
|
23
|
+
2. BA analysis
|
|
24
|
+
3. PM planning
|
|
25
|
+
4. Architecture design
|
|
26
|
+
5. Development planning + SDTK-CODE handoff
|
|
27
|
+
6. QA validation and release decision
|
|
28
|
+
|
|
29
|
+
SDTK-SPEC and SDTK-CODE stay separate:
|
|
30
|
+
- SDTK-SPEC owns upstream docs, planning, and handoff generation
|
|
31
|
+
- SDTK-CODE owns downstream coding workflow (`start -> plan -> build -> verify -> ship`)
|
|
32
|
+
- QA remains in SDTK-SPEC and normally consumes downstream evidence from SDTK-CODE
|
|
33
|
+
|
|
34
|
+
## 3. Runtime-Adaptive Installation
|
|
35
|
+
From project root:
|
|
36
|
+
|
|
37
|
+
### 3.1 Codex runtime
|
|
38
|
+
`powershell -ExecutionPolicy Bypass -File ".\toolkit\install.ps1" -Runtime codex`
|
|
39
|
+
|
|
40
|
+
### 3.2 Claude Code runtime
|
|
41
|
+
`powershell -ExecutionPolicy Bypass -File ".\toolkit\install.ps1" -Runtime claude`
|
|
42
|
+
|
|
43
|
+
### 3.3 Common installer options
|
|
44
|
+
- `-Force`: overwrite existing adapter/config files in project root.
|
|
45
|
+
- `-RuntimeScope`: `project` or `user` -- controls where skill files are installed (default: `project` for Claude, `user` for Codex).
|
|
46
|
+
- `-SkipRuntimeAssets`: skip skill file installation for the selected runtime.
|
|
47
|
+
- `-SkipSkills`: **(deprecated)** use `-SkipRuntimeAssets` instead.
|
|
48
|
+
|
|
49
|
+
## 4. What Installer Copies
|
|
50
|
+
Always:
|
|
51
|
+
- `toolkit/AGENTS.md` -> `AGENTS.md`
|
|
52
|
+
- `toolkit/sdtk-spec.config.json` -> `sdtk-spec.config.json`
|
|
53
|
+
- `toolkit/sdtk-spec.config.profiles.example.json` -> `sdtk-spec.config.profiles.example.json`
|
|
54
|
+
|
|
55
|
+
By runtime:
|
|
56
|
+
- `codex` -> `toolkit/runtimes/codex/CODEX_TEMPLATE.md` -> `CODEX.md`
|
|
57
|
+
- `claude` -> `toolkit/runtimes/claude/CLAUDE_TEMPLATE.md` -> `CLAUDE.md`
|
|
58
|
+
|
|
59
|
+
Runtime behavior (scope-aware installation):
|
|
60
|
+
- `codex`: installs skills into `$CODEX_HOME/skills/` or `~/.codex/skills/` by default, and into `<project>/.codex/skills/` only through the explicit local `CODEX_HOME=<project>/.codex` contract. Native `.codex/skills` auto-discovery is not claimed.
|
|
61
|
+
- `claude`: installs skills into `.claude/skills/` in the project root (project scope, default) or `~/.claude/skills/` (user scope).
|
|
62
|
+
|
|
63
|
+
## 5. Feature Bootstrap
|
|
64
|
+
After install:
|
|
65
|
+
|
|
66
|
+
`powershell -ExecutionPolicy Bypass -File ".\toolkit\scripts\init-feature.ps1" -FeatureKey WORKFLOW_ENGINE -FeatureName "Workflow Engine"`
|
|
67
|
+
|
|
68
|
+
Use `-ProjectPath` when toolkit is not directly under project root.
|
|
69
|
+
Use `-ValidateOnly` to verify inputs/templates without writing files.
|
|
70
|
+
|
|
71
|
+
## 6. Role Tags
|
|
72
|
+
Use the same role tags across runtimes:
|
|
73
|
+
- `/pm`
|
|
74
|
+
- `/ba`
|
|
75
|
+
- `/arch`
|
|
76
|
+
- `/dev`
|
|
77
|
+
- `/qa`
|
|
78
|
+
- `/engineer` (technical escalation)
|
|
79
|
+
|
|
80
|
+
Default role is `/pm` when role is not specified.
|
|
81
|
+
|
|
82
|
+
## 7. Orchestration Mapping
|
|
83
|
+
Architecture phase:
|
|
84
|
+
- API contract/flow scope -> `sdtk-api-doc`
|
|
85
|
+
- API design detail from YAML + flow list -> `sdtk-api-design-spec`
|
|
86
|
+
- UI flow-action scope -> `sdtk-screen-design-spec`
|
|
87
|
+
|
|
88
|
+
DEV phase:
|
|
89
|
+
- `/dev` creates `FEATURE_IMPL_PLAN` + `CODE_HANDOFF`
|
|
90
|
+
- `toolkit/scripts/generate-code-handoff.ps1` generates the canonical machine-readable handoff JSON
|
|
91
|
+
- legacy prompt templates under `toolkit/skills/sdtk-dev/prompts/` remain available as manual helper assets only
|
|
92
|
+
|
|
93
|
+
QA phase:
|
|
94
|
+
- detailed reusable test-case artifact -> `sdtk-test-case-spec`
|
|
95
|
+
- execution report and release decision -> `sdtk-qa`
|
|
96
|
+
- normal prerequisite is downstream implementation evidence, normally from SDTK-CODE
|
|
97
|
+
|
|
98
|
+
## 8. Hybrid Controls (`sdtk-spec.config.json`)
|
|
99
|
+
- `orchestration.apiDesignDetailMode = auto|on|off`
|
|
100
|
+
- `orchestration.testCaseSpecMode = auto|on|off`
|
|
101
|
+
|
|
102
|
+
## 8.1 Skill Catalog and Handoff Assets
|
|
103
|
+
- `toolkit/skills/skills.catalog.yaml` is the canonical inventory for the 13 core SDTK-SPEC skills.
|
|
104
|
+
- `toolkit/templates/handoffs/` provides the standard PM/BA/ARCH/DEV/QA handoff prompts and review gates.
|
|
105
|
+
- Every core `SKILL.md` includes `## Critical Constraints` derived from the active hard gates and verification policy.
|
|
106
|
+
- Use `governance/ai/core/SDTK_SKILL_AUTHORING_AND_TESTING.md` when creating or updating skills.
|
|
107
|
+
|
|
108
|
+
## 9. Workflow Quality Contracts
|
|
109
|
+
|
|
110
|
+
### Verification Before Completion
|
|
111
|
+
All phases apply `governance/ai/core/SDTK_VERIFICATION_BEFORE_COMPLETION_POLICY.md`. No workflow step may report done, pass, or release-ready without fresh command evidence. Red flags include `should pass`, `probably works`, and trusting agent reports without verification.
|
|
112
|
+
|
|
113
|
+
### Order-Critical Hard Gates
|
|
114
|
+
Three hard gates enforce mandatory sequencing:
|
|
115
|
+
- ARCH: `DESIGN_LAYOUT` must be generated before `FLOW_ACTION_SPEC` for UI-scope features
|
|
116
|
+
- DEV: `FEATURE_IMPL_PLAN` must be approved before `READY_FOR_SDTK_CODE` can be emitted
|
|
117
|
+
- QA: downstream implementation evidence must exist before QA handoff starts
|
|
118
|
+
|
|
119
|
+
### `/dev` Ownership
|
|
120
|
+
The default `/dev` role does not implement code in this wave.
|
|
121
|
+
It:
|
|
122
|
+
1. refines `FEATURE_IMPL_PLAN`
|
|
123
|
+
2. determines readiness
|
|
124
|
+
3. emits `CODE_HANDOFF`
|
|
125
|
+
4. suggests the exact `sdtk-code start ...` command when ready
|
|
126
|
+
|
|
127
|
+
### Specification Quoting
|
|
128
|
+
QA validation and reusable test-case design must quote exact requirement text when judging a match or mismatch.
|
|
129
|
+
Use:
|
|
130
|
+
- `Spec says: "[exact quote]" -> Evidence: [match/mismatch + file reference]`
|
|
131
|
+
|
|
132
|
+
### Assumptions Discipline
|
|
133
|
+
`FLOW_ACTION_SPEC_TEMPLATE.md` and `API_DESIGN_DETAIL_TEMPLATE.md` require a top-level `## Assumptions` section so inferred or deferred decisions stay explicit during ARCH output review.
|
|
134
|
+
|
|
135
|
+
### Subagent Model Selection
|
|
136
|
+
When dispatching manual helper tasks via `sdtk-dev`, use:
|
|
137
|
+
- Fast or cheap model for mechanical single-file changes
|
|
138
|
+
- Standard model for multi-file integration tasks
|
|
139
|
+
- Most capable model for architecture and design decisions
|
|
140
|
+
|
|
141
|
+
## 10. Artifact Structure
|
|
142
|
+
Shared state:
|
|
143
|
+
- `SHARED_PLANNING.md`
|
|
144
|
+
- `QUALITY_CHECKLIST.md`
|
|
145
|
+
|
|
146
|
+
Phase outputs:
|
|
147
|
+
- `docs/product/`
|
|
148
|
+
- `docs/specs/`
|
|
149
|
+
- `docs/architecture/`
|
|
150
|
+
- `docs/api/`
|
|
151
|
+
- `docs/design/`
|
|
152
|
+
- `docs/dev/`
|
|
153
|
+
- `docs/qa/`
|
|
154
|
+
- `docs/database/`
|
|
155
|
+
|
|
156
|
+
## 11. Rule Sources
|
|
157
|
+
- API YAML rules:
|
|
158
|
+
- `toolkit/templates/docs/api/YAML_CREATION_RULES.md`
|
|
159
|
+
- API design detail + flowchart rules:
|
|
160
|
+
- `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md`
|
|
161
|
+
- Compatibility notes kept for legacy references:
|
|
162
|
+
- `toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md`
|
|
163
|
+
- `toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md`
|
|
164
|
+
- Screen flow-action rules:
|
|
165
|
+
- `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md`
|
|
166
|
+
- QA test-case rules:
|
|
167
|
+
- `toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md`
|
|
168
|
+
|
|
169
|
+
## 12. Examples
|
|
170
|
+
Use `examples/` for onboarding-ready scenario packs:
|
|
171
|
+
- `enterprise-crud-ui-api-db`
|
|
172
|
+
- `api-only-service`
|
|
173
|
+
- `admin-console-flow-action`
|
|
174
|
+
- `bugfix-hotfix-flow`
|
|
175
|
+
|
|
176
|
+
## 13. Runtime Readiness Audit
|
|
177
|
+
Run the audit script before maintainer testing or runtime troubleshooting:
|
|
178
|
+
|
|
179
|
+
`powershell -ExecutionPolicy Bypass -File ".\toolkit\scripts\check-runtime-readiness.ps1" -Runtime <claude|codex>`
|
|
180
|
+
|
|
181
|
+
Use `-Json` for machine-readable output.
|
|
182
|
+
|
|
183
|
+
## 14. Output Language
|
|
184
|
+
- Feature artifacts under `docs/**`: default English.
|
|
185
|
+
- Toolkit guidance docs: English or Vietnamese.
|
|
@@ -216,7 +216,8 @@ $outputs = @(
|
|
|
216
216
|
|
|
217
217
|
@{ Dest = (Join-Path $projectRoot "docs/dev/FEATURE_IMPL_PLAN_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md') },
|
|
218
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') }
|
|
219
|
+
@{ Dest = (Join-Path $projectRoot "docs/qa/QA_RELEASE_REPORT_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/qa/QA_RELEASE_REPORT_TEMPLATE.md') },
|
|
220
|
+
@{ Dest = (Join-Path $projectRoot "docs/qa/CONTROLLER_ACCEPTANCE_$FeatureKey.md"); Template = (Join-Path $templateRoot 'docs/qa/CONTROLLER_ACCEPTANCE_TEMPLATE.md') }
|
|
220
221
|
)
|
|
221
222
|
|
|
222
223
|
if ($ValidateOnly) {
|
|
@@ -1,84 +1,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
|
-
|
|
12
|
-
## Outputs
|
|
13
|
-
- `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
|
|
14
|
-
- Supporting generated assets:
|
|
15
|
-
- `docs/api/flows/*.puml`
|
|
16
|
-
- `docs/api/images/*.svg`
|
|
17
|
-
|
|
18
|
-
## Required Inputs
|
|
19
|
-
- Feature key (`FEATURE_KEY`)
|
|
20
|
-
- API contract YAML:
|
|
21
|
-
- Preferred: `docs/api/[FeaturePascal]_API.yaml`
|
|
22
|
-
- Fallback: a specified YAML file path
|
|
23
|
-
- API flow list:
|
|
24
|
-
- Preferred: `docs/api/[feature_snake]_api_flow_list.txt`
|
|
25
|
-
- Fallback: a specified flow list path
|
|
26
|
-
|
|
27
|
-
## Core Rules
|
|
28
|
-
- Apply `./references/API_DESIGN_FLOWCHART_CREATION_RULES.md` first.
|
|
29
|
-
- Keep endpoint contracts consistent with source YAML.
|
|
30
|
-
- Keep process flow source synchronized with flow list (`*_api_flow_list.txt`).
|
|
31
|
-
- Keep one visible flowchart per API section (embed image), avoid duplicate preview rendering.
|
|
32
|
-
- Keep `Process Flow` sections implementation-readable:
|
|
33
|
-
- include YAML-derived flow summary / notes / login bullets
|
|
34
|
-
- keep error sections aligned with actual flow exits, not `None`
|
|
35
|
-
|
|
36
|
-
## Generation Procedure
|
|
37
|
-
1. Resolve input files (`yaml`, `flow_list`, `output`).
|
|
38
|
-
2. Parse YAML endpoints (method, path, request schema, success/error schema).
|
|
39
|
-
3. Parse flow blocks from flow list (`@startuml ... @enduml`) and map by normalized `METHOD + path`.
|
|
40
|
-
4. 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
|
-
5. Generate/update `.puml` per API under `docs/api/flows`.
|
|
49
|
-
6. Render `.svg` images under `docs/api/images`.
|
|
50
|
-
7. Validate:
|
|
51
|
-
- every API section has one embedded image
|
|
52
|
-
- every embed path exists
|
|
53
|
-
- no render error image output
|
|
54
|
-
- markdown tables keep `No` sequential numbering
|
|
55
|
-
|
|
56
|
-
## Script
|
|
57
|
-
- `scripts/generate_api_design_detail.py`
|
|
58
|
-
|
|
59
|
-
### Typical command
|
|
60
|
-
```powershell
|
|
61
|
-
python "toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py" `
|
|
62
|
-
--feature-key
|
|
63
|
-
--yaml "docs/api/
|
|
64
|
-
--flow-list "docs/api/
|
|
65
|
-
--output "docs/api/
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Optional subset generation
|
|
69
|
-
```powershell
|
|
70
|
-
python "toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py" `
|
|
71
|
-
--feature-key
|
|
72
|
-
--yaml "docs/api/
|
|
73
|
-
--flow-list "docs/api/
|
|
74
|
-
--output "docs/api/
|
|
75
|
-
--include "POST /api/
|
|
76
|
-
--include "POST /api/
|
|
77
|
-
--include "POST /api/
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Orchestrator Integration (Hybrid)
|
|
81
|
-
- `apiDesignDetailMode` in `sdtk-spec.config.json` controls orchestration behavior:
|
|
82
|
-
- `auto` (default): generate API design detail when ARCH has API scope and YAML/flow sources are available.
|
|
83
|
-
- `on`: always generate API design detail for API scope (fail if required sources are missing).
|
|
84
|
-
- `off`: skip unless user explicitly requests.
|
|
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
|
+
## Outputs
|
|
13
|
+
- `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
|
|
14
|
+
- Supporting generated assets:
|
|
15
|
+
- `docs/api/flows/*.puml`
|
|
16
|
+
- `docs/api/images/*.svg`
|
|
17
|
+
|
|
18
|
+
## Required Inputs
|
|
19
|
+
- Feature key (`FEATURE_KEY`)
|
|
20
|
+
- API contract YAML:
|
|
21
|
+
- Preferred: `docs/api/[FeaturePascal]_API.yaml`
|
|
22
|
+
- Fallback: a specified YAML file path
|
|
23
|
+
- API flow list:
|
|
24
|
+
- Preferred: `docs/api/[feature_snake]_api_flow_list.txt`
|
|
25
|
+
- Fallback: a specified flow list path
|
|
26
|
+
|
|
27
|
+
## Core Rules
|
|
28
|
+
- Apply `./references/API_DESIGN_FLOWCHART_CREATION_RULES.md` first.
|
|
29
|
+
- Keep endpoint contracts consistent with source YAML.
|
|
30
|
+
- Keep process flow source synchronized with flow list (`*_api_flow_list.txt`).
|
|
31
|
+
- Keep one visible flowchart per API section (embed image), avoid duplicate preview rendering.
|
|
32
|
+
- Keep `Process Flow` sections implementation-readable:
|
|
33
|
+
- include YAML-derived flow summary / notes / login bullets
|
|
34
|
+
- keep error sections aligned with actual flow exits, not `None`
|
|
35
|
+
|
|
36
|
+
## Generation Procedure
|
|
37
|
+
1. Resolve input files (`yaml`, `flow_list`, `output`).
|
|
38
|
+
2. Parse YAML endpoints (method, path, request schema, success/error schema).
|
|
39
|
+
3. Parse flow blocks from flow list (`@startuml ... @enduml`) and map by normalized `METHOD + path`.
|
|
40
|
+
4. 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
|
+
5. Generate/update `.puml` per API under `docs/api/flows`.
|
|
49
|
+
6. Render `.svg` images under `docs/api/images`.
|
|
50
|
+
7. Validate:
|
|
51
|
+
- every API section has one embedded image
|
|
52
|
+
- every embed path exists
|
|
53
|
+
- no render error image output
|
|
54
|
+
- markdown tables keep `No` sequential numbering
|
|
55
|
+
|
|
56
|
+
## Script
|
|
57
|
+
- `scripts/generate_api_design_detail.py`
|
|
58
|
+
|
|
59
|
+
### Typical command
|
|
60
|
+
```powershell
|
|
61
|
+
python "toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py" `
|
|
62
|
+
--feature-key WORK_PLANNING_BOARD `
|
|
63
|
+
--yaml "docs/api/WorkPlanningBoard_API.yaml" `
|
|
64
|
+
--flow-list "docs/api/work_planning_board_api_flow_list.txt" `
|
|
65
|
+
--output "docs/api/WORK_PLANNING_BOARD_API_DESIGN_DETAIL.md"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Optional subset generation
|
|
69
|
+
```powershell
|
|
70
|
+
python "toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py" `
|
|
71
|
+
--feature-key WORK_PLANNING_BOARD `
|
|
72
|
+
--yaml "docs/api/WorkPlanningBoard_API.yaml" `
|
|
73
|
+
--flow-list "docs/api/work_planning_board_api_flow_list.txt" `
|
|
74
|
+
--output "docs/api/WORK_PLANNING_BOARD_API_DESIGN_DETAIL.md" `
|
|
75
|
+
--include "POST /api/work-assignment/{organization_uuid}" `
|
|
76
|
+
--include "POST /api/work-assignment/edit/{organization_uuid}/{task_assignment_uuid}" `
|
|
77
|
+
--include "POST /api/work-assignment/delete/{organization_uuid}/{task_assignment_uuid}"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Orchestrator Integration (Hybrid)
|
|
81
|
+
- `apiDesignDetailMode` in `sdtk-spec.config.json` controls orchestration behavior:
|
|
82
|
+
- `auto` (default): generate API design detail when ARCH has API scope and YAML/flow sources are available.
|
|
83
|
+
- `on`: always generate API design detail for API scope (fail if required sources are missing).
|
|
84
|
+
- `off`: skip unless user explicitly requests.
|