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
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
# YAML CREATION RULES FINAL
|
|
2
|
-
|
|
3
|
-
This file is the canonical rule set for designing and maintaining feature-level OpenAPI YAML.
|
|
4
|
-
|
|
5
|
-
Use this file for:
|
|
6
|
-
- OpenAPI YAML contract design
|
|
7
|
-
- endpoint path/method decisions
|
|
8
|
-
- request/response schema design
|
|
9
|
-
- endpoint summary and contract consistency checks
|
|
10
|
-
|
|
11
|
-
Do not use this file as the primary rule source for:
|
|
12
|
-
- flowchart writing details
|
|
13
|
-
- API design detail markdown layout
|
|
14
|
-
|
|
15
|
-
Use `API_DESIGN_FLOWCHART_CREATION_RULES_FINAL.md` for those.
|
|
16
|
-
|
|
17
|
-
## 1. Rule Precedence
|
|
18
|
-
- Priority 1: follow the existing system's real route, method, payload, and response conventions.
|
|
19
|
-
- Priority 2: match the current source code and runtime behavior.
|
|
20
|
-
- Priority 3: apply the reusable standards in this document.
|
|
21
|
-
- If a reusable rule conflicts with the target system, keep the system rule and document the exception explicitly.
|
|
22
|
-
|
|
23
|
-
## 2. API Scope Classification
|
|
24
|
-
- Every endpoint must be classified as one of:
|
|
25
|
-
- `New`
|
|
26
|
-
- `Deferred`
|
|
27
|
-
- `Existing (reuse)`
|
|
28
|
-
- Do not silently create a new feature-local API if an existing system API already provides the same behavior with a compatible contract.
|
|
29
|
-
- If the existing API is close in purpose but payload or response is incompatible with the feature need, create a bounded new API.
|
|
30
|
-
|
|
31
|
-
## 3. Endpoint Path Design
|
|
32
|
-
- Use singular resource names in endpoint paths.
|
|
33
|
-
- Use explicit action segments only when needed by system convention:
|
|
34
|
-
- `list`
|
|
35
|
-
- `search`
|
|
36
|
-
- `edit`
|
|
37
|
-
- `delete`
|
|
38
|
-
- `multi-create`
|
|
39
|
-
- Prefer stable system-style patterns such as:
|
|
40
|
-
- list: `GET /{resource}/list/{
|
|
41
|
-
- search: `POST /{resource}/search/{
|
|
42
|
-
- view-specific search: `POST /{resource}/
|
|
43
|
-
- create: `POST /{resource}/{
|
|
44
|
-
- detail: `GET /{resource}/{
|
|
45
|
-
- edit: `POST /{resource}/edit/{
|
|
46
|
-
- delete: `POST /{resource}/delete/{
|
|
47
|
-
- Separate namespaces by bounded context.
|
|
48
|
-
- Do not repeat namespace meaning in child path segments.
|
|
49
|
-
|
|
50
|
-
## 4. Request Contract Rules
|
|
51
|
-
- For feature-owned POST search and write APIs, prefer a stable wrapper:
|
|
52
|
-
- `data: { ... }`
|
|
53
|
-
- For complex filters, place fields under:
|
|
54
|
-
- `data.info`
|
|
55
|
-
- If reusing an existing system API, keep the owning module's contract shape exactly as-is.
|
|
56
|
-
- Do not force reused APIs into the feature wrapper pattern.
|
|
57
|
-
- If a payload field changes behavior, the field must be explicit in the schema and must not remain only in examples.
|
|
58
|
-
|
|
59
|
-
## 5. Response Contract Rules
|
|
60
|
-
- Success responses must include `status` at minimum.
|
|
61
|
-
- Create APIs should return the minimum new identifier required by the caller.
|
|
62
|
-
- Example: `status +
|
|
63
|
-
- Edit and delete APIs should return status-only unless the target system has a stronger standard.
|
|
64
|
-
- Pre-check or validation helper APIs should return only the minimum boolean or status needed by the UI.
|
|
65
|
-
- Do not return detail payloads the UI does not consume.
|
|
66
|
-
- Do not add FE-only visual helper payloads when the client can derive them safely.
|
|
67
|
-
- Example: remove `timeline_backgrounds` if the frontend renders timeline lines from existing data.
|
|
68
|
-
|
|
69
|
-
## 6. Naming and Field Mapping Rules
|
|
70
|
-
- Use canonical business-domain terminology from the system glossary and database.
|
|
71
|
-
- Prefer actual system terms such as:
|
|
72
|
-
- `
|
|
73
|
-
- `
|
|
74
|
-
- `
|
|
75
|
-
- `certification`
|
|
76
|
-
- Avoid legacy aliases when an official term already exists.
|
|
77
|
-
- Field names should align with database semantics when they represent the same concept.
|
|
78
|
-
- If the DB uses a string state code, the API field must not be modeled as an integer.
|
|
79
|
-
- If a field is date-only (`format: date`), include the display format in the description.
|
|
80
|
-
- Example: `Start date (YYYYMMDD)`
|
|
81
|
-
|
|
82
|
-
## 7. Search and List API Rules
|
|
83
|
-
- One search API may serve multiple UI actions when the logic is the same:
|
|
84
|
-
- initial load
|
|
85
|
-
- search button
|
|
86
|
-
- refresh after mode/date change
|
|
87
|
-
- If one endpoint serves multiple UI actions, document that explicitly in YAML description and endpoint docs.
|
|
88
|
-
- Search APIs must define filter combination semantics clearly:
|
|
89
|
-
- AND across different fields
|
|
90
|
-
- OR within each `*_uuids` array
|
|
91
|
-
- If UI rendering depends on stable order, the YAML description must state the confirmed ORDER BY logic.
|
|
92
|
-
|
|
93
|
-
## 8. Split vs Reuse Rules
|
|
94
|
-
- Split read/search endpoints when the FE needs materially different grouped or view-shaped datasets.
|
|
95
|
-
- Merge or remove helper payloads when they add maintenance cost without business value.
|
|
96
|
-
- Reuse existing platform APIs when behavior already exists and only a feature-level mapping layer is needed.
|
|
97
|
-
- Example: reuse shared environment setting APIs instead of creating feature-local setting APIs.
|
|
98
|
-
|
|
99
|
-
## 9. Sample Data Rules
|
|
100
|
-
- For fields declared as `format: uuid`, use canonical UUID samples.
|
|
101
|
-
- Example: `123e4567-e89b-12d3-a456-426614174000`
|
|
102
|
-
- Do not use placeholder UUID-like labels such as:
|
|
103
|
-
- `customer-uuid-001`
|
|
104
|
-
- `assign-uuid-001`
|
|
105
|
-
- Keep sample data deterministic and internally consistent across request and response examples.
|
|
106
|
-
|
|
107
|
-
## 10. Cross-Artifact Consistency Rules
|
|
108
|
-
- The YAML contract is the source of truth for:
|
|
109
|
-
- endpoint path
|
|
110
|
-
- method
|
|
111
|
-
- request wrapper
|
|
112
|
-
- response shape
|
|
113
|
-
- After any YAML contract change, sync these artifacts:
|
|
114
|
-
- endpoint markdown
|
|
115
|
-
- flow list
|
|
116
|
-
- PlantUML flow assets
|
|
117
|
-
- API design detail markdown
|
|
118
|
-
- If any artifact cannot yet be synced, note the mismatch explicitly rather than leaving stale content.
|
|
119
|
-
|
|
120
|
-
## 11. Minimum YAML Quality Gate
|
|
121
|
-
- Path/method follow the target system convention.
|
|
122
|
-
- API type is classified (`New`, `Deferred`, `Existing (reuse)`).
|
|
123
|
-
- Request/response wrappers are stable and explicit.
|
|
124
|
-
- FE-only helper payloads are removed.
|
|
125
|
-
- Field names and types match DB semantics.
|
|
126
|
-
- UUID examples are valid UUIDs.
|
|
127
|
-
- Date descriptions include display format where needed.
|
|
1
|
+
# YAML CREATION RULES FINAL
|
|
2
|
+
|
|
3
|
+
This file is the canonical rule set for designing and maintaining feature-level OpenAPI YAML.
|
|
4
|
+
|
|
5
|
+
Use this file for:
|
|
6
|
+
- OpenAPI YAML contract design
|
|
7
|
+
- endpoint path/method decisions
|
|
8
|
+
- request/response schema design
|
|
9
|
+
- endpoint summary and contract consistency checks
|
|
10
|
+
|
|
11
|
+
Do not use this file as the primary rule source for:
|
|
12
|
+
- flowchart writing details
|
|
13
|
+
- API design detail markdown layout
|
|
14
|
+
|
|
15
|
+
Use `API_DESIGN_FLOWCHART_CREATION_RULES_FINAL.md` for those.
|
|
16
|
+
|
|
17
|
+
## 1. Rule Precedence
|
|
18
|
+
- Priority 1: follow the existing system's real route, method, payload, and response conventions.
|
|
19
|
+
- Priority 2: match the current source code and runtime behavior.
|
|
20
|
+
- Priority 3: apply the reusable standards in this document.
|
|
21
|
+
- If a reusable rule conflicts with the target system, keep the system rule and document the exception explicitly.
|
|
22
|
+
|
|
23
|
+
## 2. API Scope Classification
|
|
24
|
+
- Every endpoint must be classified as one of:
|
|
25
|
+
- `New`
|
|
26
|
+
- `Deferred`
|
|
27
|
+
- `Existing (reuse)`
|
|
28
|
+
- Do not silently create a new feature-local API if an existing system API already provides the same behavior with a compatible contract.
|
|
29
|
+
- If the existing API is close in purpose but payload or response is incompatible with the feature need, create a bounded new API.
|
|
30
|
+
|
|
31
|
+
## 3. Endpoint Path Design
|
|
32
|
+
- Use singular resource names in endpoint paths.
|
|
33
|
+
- Use explicit action segments only when needed by system convention:
|
|
34
|
+
- `list`
|
|
35
|
+
- `search`
|
|
36
|
+
- `edit`
|
|
37
|
+
- `delete`
|
|
38
|
+
- `multi-create`
|
|
39
|
+
- Prefer stable system-style patterns such as:
|
|
40
|
+
- list: `GET /{resource}/list/{organization_uuid}/{parent_uuid}`
|
|
41
|
+
- search: `POST /{resource}/search/{organization_uuid}`
|
|
42
|
+
- view-specific search: `POST /{resource}/resource-view/search/{organization_uuid}`
|
|
43
|
+
- create: `POST /{resource}/{organization_uuid}`
|
|
44
|
+
- detail: `GET /{resource}/{organization_uuid}/{resource_uuid}`
|
|
45
|
+
- edit: `POST /{resource}/edit/{organization_uuid}/{resource_uuid}`
|
|
46
|
+
- delete: `POST /{resource}/delete/{organization_uuid}/{resource_uuid}`
|
|
47
|
+
- Separate namespaces by bounded context.
|
|
48
|
+
- Do not repeat namespace meaning in child path segments.
|
|
49
|
+
|
|
50
|
+
## 4. Request Contract Rules
|
|
51
|
+
- For feature-owned POST search and write APIs, prefer a stable wrapper:
|
|
52
|
+
- `data: { ... }`
|
|
53
|
+
- For complex filters, place fields under:
|
|
54
|
+
- `data.info`
|
|
55
|
+
- If reusing an existing system API, keep the owning module's contract shape exactly as-is.
|
|
56
|
+
- Do not force reused APIs into the feature wrapper pattern.
|
|
57
|
+
- If a payload field changes behavior, the field must be explicit in the schema and must not remain only in examples.
|
|
58
|
+
|
|
59
|
+
## 5. Response Contract Rules
|
|
60
|
+
- Success responses must include `status` at minimum.
|
|
61
|
+
- Create APIs should return the minimum new identifier required by the caller.
|
|
62
|
+
- Example: `status + task_assignment_uuid`
|
|
63
|
+
- Edit and delete APIs should return status-only unless the target system has a stronger standard.
|
|
64
|
+
- Pre-check or validation helper APIs should return only the minimum boolean or status needed by the UI.
|
|
65
|
+
- Do not return detail payloads the UI does not consume.
|
|
66
|
+
- Do not add FE-only visual helper payloads when the client can derive them safely.
|
|
67
|
+
- Example: remove `timeline_backgrounds` if the frontend renders timeline lines from existing data.
|
|
68
|
+
|
|
69
|
+
## 6. Naming and Field Mapping Rules
|
|
70
|
+
- Use canonical business-domain terminology from the system glossary and database.
|
|
71
|
+
- Prefer actual system terms such as:
|
|
72
|
+
- `resource`
|
|
73
|
+
- `task`
|
|
74
|
+
- `assignee`
|
|
75
|
+
- `certification`
|
|
76
|
+
- Avoid legacy aliases when an official term already exists.
|
|
77
|
+
- Field names should align with database semantics when they represent the same concept.
|
|
78
|
+
- If the DB uses a string state code, the API field must not be modeled as an integer.
|
|
79
|
+
- If a field is date-only (`format: date`), include the display format in the description.
|
|
80
|
+
- Example: `Start date (YYYYMMDD)`
|
|
81
|
+
|
|
82
|
+
## 7. Search and List API Rules
|
|
83
|
+
- One search API may serve multiple UI actions when the logic is the same:
|
|
84
|
+
- initial load
|
|
85
|
+
- search button
|
|
86
|
+
- refresh after mode/date change
|
|
87
|
+
- If one endpoint serves multiple UI actions, document that explicitly in YAML description and endpoint docs.
|
|
88
|
+
- Search APIs must define filter combination semantics clearly:
|
|
89
|
+
- AND across different fields
|
|
90
|
+
- OR within each `*_uuids` array
|
|
91
|
+
- If UI rendering depends on stable order, the YAML description must state the confirmed ORDER BY logic.
|
|
92
|
+
|
|
93
|
+
## 8. Split vs Reuse Rules
|
|
94
|
+
- Split read/search endpoints when the FE needs materially different grouped or view-shaped datasets.
|
|
95
|
+
- Merge or remove helper payloads when they add maintenance cost without business value.
|
|
96
|
+
- Reuse existing platform APIs when behavior already exists and only a feature-level mapping layer is needed.
|
|
97
|
+
- Example: reuse shared environment setting APIs instead of creating feature-local setting APIs.
|
|
98
|
+
|
|
99
|
+
## 9. Sample Data Rules
|
|
100
|
+
- For fields declared as `format: uuid`, use canonical UUID samples.
|
|
101
|
+
- Example: `123e4567-e89b-12d3-a456-426614174000`
|
|
102
|
+
- Do not use placeholder UUID-like labels such as:
|
|
103
|
+
- `customer-uuid-001`
|
|
104
|
+
- `assign-uuid-001`
|
|
105
|
+
- Keep sample data deterministic and internally consistent across request and response examples.
|
|
106
|
+
|
|
107
|
+
## 10. Cross-Artifact Consistency Rules
|
|
108
|
+
- The YAML contract is the source of truth for:
|
|
109
|
+
- endpoint path
|
|
110
|
+
- method
|
|
111
|
+
- request wrapper
|
|
112
|
+
- response shape
|
|
113
|
+
- After any YAML contract change, sync these artifacts:
|
|
114
|
+
- endpoint markdown
|
|
115
|
+
- flow list
|
|
116
|
+
- PlantUML flow assets
|
|
117
|
+
- API design detail markdown
|
|
118
|
+
- If any artifact cannot yet be synced, note the mismatch explicitly rather than leaving stale content.
|
|
119
|
+
|
|
120
|
+
## 11. Minimum YAML Quality Gate
|
|
121
|
+
- Path/method follow the target system convention.
|
|
122
|
+
- API type is classified (`New`, `Deferred`, `Existing (reuse)`).
|
|
123
|
+
- Request/response wrappers are stable and explicit.
|
|
124
|
+
- FE-only helper payloads are removed.
|
|
125
|
+
- Field names and types match DB semantics.
|
|
126
|
+
- UUID examples are valid UUIDs.
|
|
127
|
+
- Date descriptions include display format where needed.
|
|
128
128
|
- Search/list APIs document filter semantics and ordering when relevant.
|
|
@@ -1,83 +1,85 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sdtk-arch
|
|
3
|
-
description: Solution Architect workflow for SDTK-SPEC. 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-SPEC ARCH (Solution Architecture)
|
|
7
|
-
|
|
8
|
-
## Critical Constraints
|
|
9
|
-
- I do not generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI-scope features.
|
|
10
|
-
- I do not let API, DB, and UI artifacts drift from the same BA and PM source of truth.
|
|
11
|
-
|
|
12
|
-
## Outputs
|
|
13
|
-
- `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
|
|
14
|
-
- If applicable:
|
|
15
|
-
- `docs/api/[FeaturePascal]_API.yaml`
|
|
16
|
-
- `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
|
|
17
|
-
- `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
|
|
18
|
-
- `docs/api/[feature_snake]_api_flow_list.txt`
|
|
19
|
-
- `docs/database/DATABASE_SPEC_[FEATURE_KEY].md`
|
|
20
|
-
- `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
|
|
21
|
-
- `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
|
|
22
|
-
|
|
23
|
-
## Flow Overview
|
|
24
|
-
|
|
25
|
-
```dot
|
|
26
|
-
digraph sdtk_arch_flow {
|
|
27
|
-
rankdir=TB;
|
|
28
|
-
BA_SPEC -> ARCH_DESIGN;
|
|
29
|
-
ARCH_DESIGN -> DESIGN_LAYOUT;
|
|
30
|
-
DESIGN_LAYOUT -> FLOW_ACTION_SPEC;
|
|
31
|
-
ARCH_DESIGN -> API_YAML;
|
|
32
|
-
API_YAML -> API_DETAIL;
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Process
|
|
37
|
-
1. Read BA spec and PRD/backlog.
|
|
38
|
-
2. Read `sdtk-spec.config.json` for project stack assumptions (backend/frontend/db/auth).
|
|
39
|
-
3. If architecture output includes API contracts/flows, read and apply:
|
|
40
|
-
- `./references/YAML_CREATION_RULES.md`
|
|
41
|
-
- `./references/API_DESIGN_FLOWCHART_CREATION_RULES.md`
|
|
42
|
-
- `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` for canonical resource naming and multi-word path style
|
|
43
|
-
4. If architecture output includes screen flow-action specs, read and apply `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
|
|
44
|
-
5. If API detail spec is required, use `sdtk-api-design-spec` to build/update `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md` using YAML + flow list.
|
|
45
|
-
6. For UI-scope features, enforce this generation sequence:
|
|
46
|
-
a. Generate/update `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` first (using `sdtk-design-layout`).
|
|
47
|
-
b. Attempt to render screen preview images from the layout using `render_design_layout_images.py`. Output: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`. If rendering fails (no Java/plantuml.jar), fall back to the render-skipped note -- do not silently skip.
|
|
48
|
-
c. Then generate/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` (using `sdtk-screen-design-spec`).
|
|
49
|
-
d. The flow-action spec must reference the design-layout doc as its design source when no Figma/screenshot is available (Design Source Type: `generated-draft`). Use rendered `.svg` files as the screen image. If render failed, use the render-skipped note instead of a broken image reference.
|
|
50
|
-
7. For complex UI flow-action specs, use `sdtk-screen-design-spec` to build/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`.
|
|
51
|
-
8. Define:
|
|
52
|
-
- System components + data model
|
|
53
|
-
- API endpoints and flows
|
|
54
|
-
- Screen layouts
|
|
55
|
-
- Security/authz decisions
|
|
56
|
-
9. Create/update:
|
|
57
|
-
- OpenAPI YAML + API endpoint markdown
|
|
58
|
-
- API flow list
|
|
59
|
-
- API design detail spec (when `orchestration.apiDesignDetailMode` is `auto/on`)
|
|
60
|
-
- Database spec (if DB impact exists)
|
|
61
|
-
- Design layout (if UI impact exists) - must be created before flow-action spec
|
|
62
|
-
- Flow-action spec (if UI impact exists) - must reference design layout as fallback source
|
|
63
|
-
10. Ensure mapping UC/BR -> DB/API/screens and run output hygiene checks:
|
|
64
|
-
- EN artifacts use English narrative text (except clearly marked original-language appendix blocks)
|
|
65
|
-
- No mojibake/encoding corruption in markdown/yaml/txt outputs
|
|
66
|
-
11. For
|
|
67
|
-
12.
|
|
68
|
-
13.
|
|
69
|
-
14.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
|
83
|
-
|
|
|
1
|
+
---
|
|
2
|
+
name: sdtk-arch
|
|
3
|
+
description: Solution Architect workflow for SDTK-SPEC. 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-SPEC ARCH (Solution Architecture)
|
|
7
|
+
|
|
8
|
+
## Critical Constraints
|
|
9
|
+
- I do not generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI-scope features.
|
|
10
|
+
- I do not let API, DB, and UI artifacts drift from the same BA and PM source of truth.
|
|
11
|
+
|
|
12
|
+
## Outputs
|
|
13
|
+
- `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
|
|
14
|
+
- If applicable:
|
|
15
|
+
- `docs/api/[FeaturePascal]_API.yaml`
|
|
16
|
+
- `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
|
|
17
|
+
- `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
|
|
18
|
+
- `docs/api/[feature_snake]_api_flow_list.txt`
|
|
19
|
+
- `docs/database/DATABASE_SPEC_[FEATURE_KEY].md`
|
|
20
|
+
- `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
|
|
21
|
+
- `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
|
|
22
|
+
|
|
23
|
+
## Flow Overview
|
|
24
|
+
|
|
25
|
+
```dot
|
|
26
|
+
digraph sdtk_arch_flow {
|
|
27
|
+
rankdir=TB;
|
|
28
|
+
BA_SPEC -> ARCH_DESIGN;
|
|
29
|
+
ARCH_DESIGN -> DESIGN_LAYOUT;
|
|
30
|
+
DESIGN_LAYOUT -> FLOW_ACTION_SPEC;
|
|
31
|
+
ARCH_DESIGN -> API_YAML;
|
|
32
|
+
API_YAML -> API_DETAIL;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Process
|
|
37
|
+
1. Read BA spec and PRD/backlog.
|
|
38
|
+
2. Read `sdtk-spec.config.json` for project stack assumptions (backend/frontend/db/auth).
|
|
39
|
+
3. If architecture output includes API contracts/flows, read and apply:
|
|
40
|
+
- `./references/YAML_CREATION_RULES.md`
|
|
41
|
+
- `./references/API_DESIGN_FLOWCHART_CREATION_RULES.md`
|
|
42
|
+
- `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` for canonical resource naming and multi-word path style
|
|
43
|
+
4. If architecture output includes screen flow-action specs, read and apply `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
|
|
44
|
+
5. If API detail spec is required, use `sdtk-api-design-spec` to build/update `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md` using YAML + flow list.
|
|
45
|
+
6. For UI-scope features, enforce this generation sequence:
|
|
46
|
+
a. Generate/update `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` first (using `sdtk-design-layout`).
|
|
47
|
+
b. Attempt to render screen preview images from the layout using `render_design_layout_images.py`. Output: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`. If rendering fails (no Java/plantuml.jar), fall back to the render-skipped note -- do not silently skip.
|
|
48
|
+
c. Then generate/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` (using `sdtk-screen-design-spec`).
|
|
49
|
+
d. The flow-action spec must reference the design-layout doc as its design source when no Figma/screenshot is available (Design Source Type: `generated-draft`). Use rendered `.svg` files as the screen image. If render failed, use the render-skipped note instead of a broken image reference.
|
|
50
|
+
7. For complex UI flow-action specs, use `sdtk-screen-design-spec` to build/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`.
|
|
51
|
+
8. Define:
|
|
52
|
+
- System components + data model
|
|
53
|
+
- API endpoints and flows
|
|
54
|
+
- Screen layouts
|
|
55
|
+
- Security/authz decisions
|
|
56
|
+
9. Create/update:
|
|
57
|
+
- OpenAPI YAML + API endpoint markdown
|
|
58
|
+
- API flow list
|
|
59
|
+
- API design detail spec (when `orchestration.apiDesignDetailMode` is `auto/on`)
|
|
60
|
+
- Database spec (if DB impact exists)
|
|
61
|
+
- Design layout (if UI impact exists) - must be created before flow-action spec
|
|
62
|
+
- Flow-action spec (if UI impact exists) - must reference design layout as fallback source
|
|
63
|
+
10. Ensure mapping UC/BR -> DB/API/screens and run output hygiene checks:
|
|
64
|
+
- EN artifacts use English narrative text (except clearly marked original-language appendix blocks)
|
|
65
|
+
- No mojibake/encoding corruption in markdown/yaml/txt outputs
|
|
66
|
+
11. For workflow/tooling hardening batches that stop before `/dev`, lock the validator matrix, exact approved DEV surfaces, exact out-of-scope list, and explicit stop-before-`/dev` wording inside `ARCH_DESIGN_[FEATURE_KEY].md` before handoff.
|
|
67
|
+
12. For benchmark runs, apply `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`: keep benchmark-expected open questions explicitly OPEN unless the requirement source resolves them.
|
|
68
|
+
13. If anything is unclear, record OQ-xx in ARCH_DESIGN "Open Questions" and escalate to `@pm` for a decision.
|
|
69
|
+
14. Update shared state + Phase 3 checklist.
|
|
70
|
+
15. Handoff: `@dev please prepare FEATURE_IMPL_PLAN + CODE_HANDOFF for SDTK-CODE ...`.
|
|
71
|
+
|
|
72
|
+
## Order-Critical Hard Gate
|
|
73
|
+
For UI-scope features, do not generate or update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` until `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` already exists and is current enough to serve as the design source for the same scope.
|
|
74
|
+
|
|
75
|
+
If the layout is missing, stale, or cannot support the flow-action spec, stop and fix the layout first. Do not reverse the order and repair it later.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## Common Mistakes
|
|
79
|
+
|
|
80
|
+
| Mistake | Why it is wrong | Do instead |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| Generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI scope | Forces the spec to invent screen behavior without a design source | Create or refresh the layout first, then derive the flow-action spec |
|
|
83
|
+
| Treat API YAML, API detail, and flow-action outputs as independent documents | Causes naming and traceability drift across artifacts | Keep ARCH outputs linked through shared requirements and path policy |
|
|
84
|
+
| Close open questions silently during ARCH | Hides unresolved design decisions from downstream roles | Record `OQ-xx` explicitly and escalate through `@pm` |
|
|
85
|
+
| Hand off a workflow/tooling hardening batch without a validator matrix or exact DEV surface list | Leaves `/dev` and SDTK-CODE with an under-specified contract boundary | Lock the validator matrix, exact DEV surfaces, exact out-of-scope list, and stop-before-`/dev` wording before handoff |
|