sdtk-kit 0.3.0
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 +131 -0
- package/assets/manifest/toolkit-bundle.manifest.json +303 -0
- package/assets/manifest/toolkit-bundle.sha256.txt +59 -0
- package/assets/toolkit/toolkit/AGENTS.md +103 -0
- package/assets/toolkit/toolkit/install.ps1 +155 -0
- package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +32 -0
- package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +32 -0
- package/assets/toolkit/toolkit/scripts/init-feature.ps1 +253 -0
- package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +181 -0
- package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +116 -0
- package/assets/toolkit/toolkit/sdtk.config.json +28 -0
- package/assets/toolkit/toolkit/sdtk.config.profiles.example.json +50 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +78 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +212 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/FLOWCHART_CREATION_RULES.md +397 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +565 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +36 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/FLOWCHART_CREATION_RULES.md +397 -0
- package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +43 -0
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +212 -0
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOWCHART_CREATION_RULES.md +397 -0
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +136 -0
- package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +24 -0
- package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +21 -0
- package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +20 -0
- package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +17 -0
- package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +15 -0
- package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +44 -0
- package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +26 -0
- package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +22 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +59 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +136 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md +51 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md +54 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +76 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py +136 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +249 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +65 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md +129 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py +97 -0
- package/assets/toolkit/toolkit/templates/QUALITY_CHECKLIST.md +124 -0
- package/assets/toolkit/toolkit/templates/README.md +56 -0
- package/assets/toolkit/toolkit/templates/SHARED_PLANNING.md +80 -0
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +212 -0
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +62 -0
- package/assets/toolkit/toolkit/templates/docs/api/API_ENDPOINTS_TEMPLATE.md +229 -0
- package/assets/toolkit/toolkit/templates/docs/api/FEATURE_API_TEMPLATE.yaml +20 -0
- package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +397 -0
- package/assets/toolkit/toolkit/templates/docs/api/feature_api_flow_list_TEMPLATE.txt +12 -0
- package/assets/toolkit/toolkit/templates/docs/architecture/ARCH_DESIGN_TEMPLATE.md +109 -0
- package/assets/toolkit/toolkit/templates/docs/database/DATABASE_SPEC_TEMPLATE.md +175 -0
- package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +49 -0
- package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +73 -0
- package/assets/toolkit/toolkit/templates/docs/product/BACKLOG_TEMPLATE.md +50 -0
- package/assets/toolkit/toolkit/templates/docs/product/PRD_TEMPLATE.md +66 -0
- package/assets/toolkit/toolkit/templates/docs/product/PROJECT_INITIATION_TEMPLATE.md +98 -0
- package/assets/toolkit/toolkit/templates/docs/qa/QA_RELEASE_REPORT_TEMPLATE.md +61 -0
- package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md +129 -0
- package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_TEMPLATE.md +104 -0
- package/assets/toolkit/toolkit/templates/docs/specs/BA_SPEC_TEMPLATE.md +139 -0
- package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +136 -0
- package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +160 -0
- package/bin/sdtk.js +15 -0
- package/package.json +47 -0
- package/src/commands/auth.js +85 -0
- package/src/commands/generate.js +177 -0
- package/src/commands/help.js +69 -0
- package/src/commands/init.js +73 -0
- package/src/index.js +56 -0
- package/src/lib/args.js +116 -0
- package/src/lib/errors.js +41 -0
- package/src/lib/github-access.js +68 -0
- package/src/lib/powershell.js +85 -0
- package/src/lib/state.js +83 -0
- package/src/lib/toolkit-payload.js +99 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
# Flowchart Creation Rules for AI Agents (PlantUML)
|
|
2
|
+
|
|
3
|
+
This document defines reusable rules for creating and updating API flowcharts in this project.
|
|
4
|
+
Target files are usually API flow list documents (for example `*_api.txt`) and API YAML files (for example `docs/api/*.yaml`).
|
|
5
|
+
|
|
6
|
+
## 1. Scope and Goal
|
|
7
|
+
|
|
8
|
+
- Use PlantUML activity diagrams for API process flows.
|
|
9
|
+
- Keep diagrams readable, implementation-aware, and consistent with current backend logic.
|
|
10
|
+
- Prefer minimal-impact documentation changes when existing customer logic is already running.
|
|
11
|
+
|
|
12
|
+
## 2. File and Diagram Structure
|
|
13
|
+
|
|
14
|
+
- One API flow = one `@startuml ... @enduml` block.
|
|
15
|
+
- If helper logic is extracted, add a separate `@startuml ... @enduml` block for that helper.
|
|
16
|
+
- Keep API title in `partition`:
|
|
17
|
+
- `partition "POST **/api/path/{company_uuid}** Japanese summary" { ... }`
|
|
18
|
+
- Optional helper flow style:
|
|
19
|
+
- `rectangle "Logic function name" { ... }`
|
|
20
|
+
|
|
21
|
+
## 3. Mandatory Activity Syntax Rules
|
|
22
|
+
|
|
23
|
+
- Every action line must end with `;`
|
|
24
|
+
- Every `if (...) then (...)` must be closed by `endif`
|
|
25
|
+
- Use `else (no)` and `then (yes)` labels explicitly for branch readability.
|
|
26
|
+
- Use `repeat ... repeat while ...` only when loop behavior is required.
|
|
27
|
+
|
|
28
|
+
## 4. Color/Highlight Rules (Non-deprecated)
|
|
29
|
+
|
|
30
|
+
Use stereotype-based color syntax (new style), not old prefix style.
|
|
31
|
+
|
|
32
|
+
- Correct:
|
|
33
|
+
- `:Return Error status = 100: Parameter invalid;<<#pink>>`
|
|
34
|
+
- `:Call query_search_by_keyword() function;<<#lightGreen>>`
|
|
35
|
+
- Avoid deprecated old style:
|
|
36
|
+
- `#pink:...`
|
|
37
|
+
- `#lightGreen:...`
|
|
38
|
+
|
|
39
|
+
## 5. Standard API Flow Skeleton
|
|
40
|
+
|
|
41
|
+
```plantuml
|
|
42
|
+
@startuml
|
|
43
|
+
partition "POST **/sample/path/{company_uuid}** API summary" {
|
|
44
|
+
start
|
|
45
|
+
:Process authentication\\nCommon auth process;
|
|
46
|
+
:Validate parameter;
|
|
47
|
+
if (is valid) then (no)
|
|
48
|
+
:Return Error status = 100: Parameter invalid;<<#pink>>
|
|
49
|
+
stop
|
|
50
|
+
else (yes)
|
|
51
|
+
endif
|
|
52
|
+
:Main process;
|
|
53
|
+
:Close DB connection;
|
|
54
|
+
:Create api response;
|
|
55
|
+
stop
|
|
56
|
+
}
|
|
57
|
+
@enduml
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## 6. Query-Building Style Rules
|
|
61
|
+
|
|
62
|
+
When describing SQL-like logic in flowchart:
|
|
63
|
+
|
|
64
|
+
- Build query in steps:
|
|
65
|
+
1. `Create search query and condition statement from request.data;`
|
|
66
|
+
2. `query = "...";`
|
|
67
|
+
3. `condition = "...";`
|
|
68
|
+
4. optional condition append blocks
|
|
69
|
+
5. `Compose full query: fullQuery = query + condition;`
|
|
70
|
+
6. apply order/paging
|
|
71
|
+
7. execute query
|
|
72
|
+
|
|
73
|
+
- Keyword pattern:
|
|
74
|
+
- `LIKE '%data.info.keyword%'`
|
|
75
|
+
- Order pattern:
|
|
76
|
+
- `Add order by data.info.order_flg data.info.order_type into fullQuery;`
|
|
77
|
+
- Paging pattern:
|
|
78
|
+
- `Add "LIMIT = data.info.limit OFFSET = data.info.offset" into fullQuery;`
|
|
79
|
+
|
|
80
|
+
### 6.1 Endpoint-level Mapping Must Be Explicit
|
|
81
|
+
|
|
82
|
+
For keyword/order enhancements, always document mapping between request params and DB columns per endpoint.
|
|
83
|
+
|
|
84
|
+
- `keyword` must list all searchable columns/tables.
|
|
85
|
+
- `order_flg` must list allowed sort targets and mapped columns.
|
|
86
|
+
- `order_type` must be documented as `asc/desc`.
|
|
87
|
+
- If payload includes new fields that are not handled by current legacy code,
|
|
88
|
+
add explicit processing logic for those new fields in the helper flow.
|
|
89
|
+
Do not silently ignore newly introduced request fields.
|
|
90
|
+
|
|
91
|
+
Example (`/bukken-manager/regno/customer/search/{company_uuid}`):
|
|
92
|
+
- `keyword`:
|
|
93
|
+
- `CLD_DAT_CUSTOMER_REG_NO_INFO.customer_reg_no`
|
|
94
|
+
- `CLD_MST_LOCATION_INFO.location_name`
|
|
95
|
+
- `CLD_MST_REG_NO_TYPE_INFO.name`
|
|
96
|
+
- `order_flg`:
|
|
97
|
+
- `customer_reg_no` / `location_name` / `name`
|
|
98
|
+
- `order_type`:
|
|
99
|
+
- `asc` / `desc`
|
|
100
|
+
|
|
101
|
+
## 7. Backward-Compatible Merge Pattern
|
|
102
|
+
|
|
103
|
+
When new requirements are added to an existing API:
|
|
104
|
+
|
|
105
|
+
- Keep current handler path for old request behavior.
|
|
106
|
+
- Add conditional branch for new logic only when required params exist.
|
|
107
|
+
- Recommended branch style:
|
|
108
|
+
- If all new params are null -> keep old logic
|
|
109
|
+
- Else -> call extracted helper function
|
|
110
|
+
- Use this exact "no-impact first" branch when preserving customer legacy handlers:
|
|
111
|
+
- `if (data.info.keyword null and data.info.order_flg null and data.info.order_type null) then (yes)`
|
|
112
|
+
- `:Keep the current search logic handler: <existing_handler>();`
|
|
113
|
+
- `else (no)` -> call helper for new query logic
|
|
114
|
+
- In the legacy branch, do not duplicate old internal sub-steps unless explicitly requested.
|
|
115
|
+
- Avoid extra lines like mapping/query detail when they are already part of existing handler behavior.
|
|
116
|
+
- Prefer one concise line:
|
|
117
|
+
- `:Keep the current search logic handler: <existing_handler>();`
|
|
118
|
+
|
|
119
|
+
Example:
|
|
120
|
+
|
|
121
|
+
```plantuml
|
|
122
|
+
if (data.info.keyword null and data.info.order_flg null and data.info.order_type null) then (yes)
|
|
123
|
+
:Keep the current search logic handler: regno_search();
|
|
124
|
+
else (no)
|
|
125
|
+
:Call query_search_by_keyword() function;<<#lightGreen>>
|
|
126
|
+
endif
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## 8. Helper Function Diagram Pattern
|
|
130
|
+
|
|
131
|
+
```plantuml
|
|
132
|
+
@startuml
|
|
133
|
+
rectangle "Logic query search by keyword" {
|
|
134
|
+
:query_search_by_keyword();<<#lightGreen>>
|
|
135
|
+
:Create search query and condition statement from request.data;
|
|
136
|
+
:query = "...";
|
|
137
|
+
:condition = "...";
|
|
138
|
+
if (data.info.keyword not null) then (yes)
|
|
139
|
+
:condition += "...";
|
|
140
|
+
else (no)
|
|
141
|
+
endif
|
|
142
|
+
:Compose full query:\\nfullQuery = query + condition;
|
|
143
|
+
:Add order by data.info.order_flg data.info.order_type into fullQuery;
|
|
144
|
+
:Add "LIMIT = data.info.limit OFFSET = data.info.offset" into fullQuery;
|
|
145
|
+
:Execute fullQuery and get data;
|
|
146
|
+
:return return_datas;
|
|
147
|
+
}
|
|
148
|
+
@enduml
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 8.1 Helper Naming Rule
|
|
152
|
+
|
|
153
|
+
- Use helper names that include endpoint domain to avoid collisions across many APIs.
|
|
154
|
+
- Recommended:
|
|
155
|
+
- `query_search_by_keyword()` for generic case
|
|
156
|
+
- `query_search_by_keyword_customer_regno()` for customer-regno endpoint
|
|
157
|
+
|
|
158
|
+
### 8.2 Legacy Fallback Rule (Search APIs)
|
|
159
|
+
|
|
160
|
+
- When modernizing an existing search endpoint, explicitly describe legacy fallback behavior:
|
|
161
|
+
- soft-delete flag fallback from existing code path (if any)
|
|
162
|
+
- default order fallback when `order_flg/order_type` is absent
|
|
163
|
+
- default filters applied when optional inputs are null
|
|
164
|
+
- Keep these fallback notes visible in flowchart text to avoid behavior drift.
|
|
165
|
+
|
|
166
|
+
### 8.3 Extended Filter Branch/Response Rule
|
|
167
|
+
|
|
168
|
+
- If new optional filter fields are added, include all of them in the no-impact branch check.
|
|
169
|
+
- When relation-based filters are used, explicitly show join/filter logic in helper flow.
|
|
170
|
+
- If response contains multiple typed lists, keep each list explicit in flowchart/YAML (for example `data.<entity>_info[]`) and include summary metadata such as `count` when applicable.
|
|
171
|
+
|
|
172
|
+
## 9. Path Canonicalization Rule
|
|
173
|
+
|
|
174
|
+
- If YAML path and actual route path are different, use the confirmed actual route path in flowchart.
|
|
175
|
+
- Always prioritize route path defined in backend code (`urls.py`) over YAML documentation.
|
|
176
|
+
- If route path cannot be found in code, fallback to YAML path and mark it as assumed/temporary.
|
|
177
|
+
- Always confirm this with user before finalizing.
|
|
178
|
+
|
|
179
|
+
## 9A. API Endpoint Design Rules (Project Standard)
|
|
180
|
+
|
|
181
|
+
These rules must be applied when creating/updating API flowcharts and YAML in this project.
|
|
182
|
+
|
|
183
|
+
- Use singular object keyword in endpoint path:
|
|
184
|
+
- Correct: `/invoice`, `/assignment`, `/personal-schedule`
|
|
185
|
+
- Avoid: `/invoices`, `/assignments`
|
|
186
|
+
- Use canonical business-domain keywords from glossary/spec terminology.
|
|
187
|
+
- Avoid ambiguous aliases when official domain terms exist.
|
|
188
|
+
- Use action keywords that describe behavior clearly:
|
|
189
|
+
- List: `.../list/...`
|
|
190
|
+
- Update: `.../edit/...`
|
|
191
|
+
- Delete: `.../delete/...`
|
|
192
|
+
- Multi-create: `.../multi-create`
|
|
193
|
+
- Avoid vague action keyword `bulk` when behavior is multi-create.
|
|
194
|
+
|
|
195
|
+
### 9A.1 Endpoint Pattern
|
|
196
|
+
|
|
197
|
+
- List API:
|
|
198
|
+
- `GET /{object}/list/{company_uuid}/{bukken_uuid}`
|
|
199
|
+
- Create API:
|
|
200
|
+
- `POST /{object}/{company_uuid}/{bukken_uuid}`
|
|
201
|
+
- Edit API:
|
|
202
|
+
- `POST /{object}/edit/{company_uuid}/{object_uuid}`
|
|
203
|
+
- Detail API:
|
|
204
|
+
- `GET /{object}/edit/{company_uuid}/{object_uuid}`
|
|
205
|
+
- Delete API:
|
|
206
|
+
- `POST /{object}/delete/{company_uuid}/{object_uuid}`
|
|
207
|
+
|
|
208
|
+
### 9A.2 HTTP Method Policy
|
|
209
|
+
|
|
210
|
+
- Do not use `PUT` for update APIs. Use `POST .../edit/{uuid}`.
|
|
211
|
+
- Do not use `DELETE` method for delete APIs. Use `POST .../delete/{uuid}`.
|
|
212
|
+
|
|
213
|
+
### 9A.3 Canonical Examples
|
|
214
|
+
|
|
215
|
+
- Invoice sample:
|
|
216
|
+
- `GET /invoice/list/{company_uuid}/{bukken_uuid}`
|
|
217
|
+
- `POST /invoice/{company_uuid}/{bukken_uuid}`
|
|
218
|
+
- `POST /invoice/edit/{company_uuid}/{invoice_uuid}`
|
|
219
|
+
- `GET /invoice/edit/{company_uuid}/{invoice_uuid}`
|
|
220
|
+
- `POST /invoice/delete/{company_uuid}/{bukken_uuid}`
|
|
221
|
+
|
|
222
|
+
## 9B. General Design and Documentation Governance Rules
|
|
223
|
+
|
|
224
|
+
Apply the rules below as cross-project standards for API YAML and flowchart generation.
|
|
225
|
+
These rules complement section `9A` (path syntax + method policy) and avoid redefining it.
|
|
226
|
+
|
|
227
|
+
### 9B.1 Rule Precedence and Consistency
|
|
228
|
+
|
|
229
|
+
- Endpoint naming/method conventions must follow section `9A`.
|
|
230
|
+
- If a feature needs an exception from `9A`, document the reason and get explicit confirmation before finalizing.
|
|
231
|
+
- Keep terminology consistent across path, request/response schema, flowchart labels, and API summary tables.
|
|
232
|
+
|
|
233
|
+
### 9B.2 Parameter Placement Rule
|
|
234
|
+
|
|
235
|
+
- Path parameters: identity and routing keys (`{company_uuid}`, `{resource_uuid}`).
|
|
236
|
+
- Query parameters: lightweight filtering/sorting/paging.
|
|
237
|
+
- Request body: complex/multi-field search criteria.
|
|
238
|
+
- If retrieval requires many filter fields, prefer dedicated `POST .../search` over overloaded query strings.
|
|
239
|
+
|
|
240
|
+
### 9B.3 Read Contract Shape Rule (List vs Search)
|
|
241
|
+
|
|
242
|
+
- Use list-style read API for simple retrieval contracts.
|
|
243
|
+
- Use search-style read API when filter logic is complex or payload-based.
|
|
244
|
+
- If one endpoint forces heavy client-side matching/filtering for different screen modes, split read endpoints by view purpose.
|
|
245
|
+
|
|
246
|
+
### 9B.4 Endpoint Split vs Merge Decision Rule
|
|
247
|
+
|
|
248
|
+
- Split endpoints when:
|
|
249
|
+
- view/use-case shaping is materially different
|
|
250
|
+
- one endpoint causes excessive client orchestration
|
|
251
|
+
- Merge endpoints/datasets when:
|
|
252
|
+
- data is always consumed together under the same filter context
|
|
253
|
+
- separate endpoints only add latency and maintenance cost
|
|
254
|
+
- Record split/merge rationale in API description and flowchart notes.
|
|
255
|
+
|
|
256
|
+
### 9B.5 Reuse vs New Endpoint Rule
|
|
257
|
+
|
|
258
|
+
- Reuse existing endpoints only when request/response contract is truly compatible with target screen logic.
|
|
259
|
+
- If existing API is semantically close but contract-incompatible, create a bounded new endpoint for that use case.
|
|
260
|
+
- Mark endpoint lifecycle in docs via `API Type` classification (see `9B.8`).
|
|
261
|
+
|
|
262
|
+
### 9B.6 Namespace and Path Redundancy Rule
|
|
263
|
+
|
|
264
|
+
- Separate namespaces by bounded context/domain.
|
|
265
|
+
- Avoid repeating parent namespace meaning in child path segments.
|
|
266
|
+
- Keep paths concise but semantically clear.
|
|
267
|
+
|
|
268
|
+
### 9B.7 Screen-to-API Traceability Rule
|
|
269
|
+
|
|
270
|
+
- Every UI flow/action section must map:
|
|
271
|
+
- trigger/action
|
|
272
|
+
- called API
|
|
273
|
+
- response fields used for rendering
|
|
274
|
+
- Explicitly mark when a single endpoint serves multiple actions (initial load, search, refresh, etc.).
|
|
275
|
+
|
|
276
|
+
### 9B.8 API List Governance Rule (Markdown Specs)
|
|
277
|
+
|
|
278
|
+
- API summary tables must include at least:
|
|
279
|
+
- `No`
|
|
280
|
+
- `Method`
|
|
281
|
+
- `Endpoint`
|
|
282
|
+
- `API Type`
|
|
283
|
+
- `Description`
|
|
284
|
+
- Group APIs by delivery status for planning visibility:
|
|
285
|
+
1. `New`
|
|
286
|
+
2. `Deferred`
|
|
287
|
+
3. `Existing (reuse)`
|
|
288
|
+
- After regrouping, renumber `No` sequentially.
|
|
289
|
+
|
|
290
|
+
### 9B.9 Change Management Rule
|
|
291
|
+
|
|
292
|
+
- For every endpoint rename/add/remove/merge:
|
|
293
|
+
- update endpoint detail sections
|
|
294
|
+
- update API summary tables
|
|
295
|
+
- update screen-to-API mapping
|
|
296
|
+
- append a new row in document history
|
|
297
|
+
- Preserve old history rows; never rewrite historical entries.
|
|
298
|
+
|
|
299
|
+
### 9B.10 Canonical Response Envelope Rule
|
|
300
|
+
|
|
301
|
+
- Use one canonical response envelope across a bounded module/feature.
|
|
302
|
+
- Keep the envelope shape consistent in YAML examples, flowchart return nodes, and markdown endpoint tables.
|
|
303
|
+
- Recommended normalized envelope keys:
|
|
304
|
+
- `status`
|
|
305
|
+
- `msg`
|
|
306
|
+
- `data`
|
|
307
|
+
- `format_version`
|
|
308
|
+
- If a legacy API has a different wrapper, document it explicitly as an exception.
|
|
309
|
+
|
|
310
|
+
### 9B.11 Business Status Rule
|
|
311
|
+
|
|
312
|
+
- Business execution result must be represented in response body `status` (not only by HTTP code).
|
|
313
|
+
- Flowchart branches must map to business status outcomes, including validation and duplicate/conflict-like results.
|
|
314
|
+
- Document endpoint-level status code matrix in API docs when branching is non-trivial.
|
|
315
|
+
- HTTP status policy can vary by system profile, but body `status` must remain deterministic.
|
|
316
|
+
|
|
317
|
+
### 9B.12 Request Body Wrapper Rule
|
|
318
|
+
|
|
319
|
+
- For write/search APIs that use POST payloads, prefer a stable top-level wrapper object:
|
|
320
|
+
- `data: { ... }`
|
|
321
|
+
- Keep filter/search fields under `data` when criteria are complex or nested.
|
|
322
|
+
- If legacy contracts do not use wrapper objects, document exception and compatibility reason.
|
|
323
|
+
|
|
324
|
+
### 9B.13 Traceability Metadata Rule
|
|
325
|
+
|
|
326
|
+
- YAML should include explicit traceability metadata for each endpoint (for example `x-traceability`).
|
|
327
|
+
- Minimum mapping targets:
|
|
328
|
+
- BR (business rule)
|
|
329
|
+
- UC (use case)
|
|
330
|
+
- AC (acceptance criteria)
|
|
331
|
+
- Flow list and markdown API docs should preserve the same mapping IDs to keep cross-artifact traceability.
|
|
332
|
+
|
|
333
|
+
### 9B.14 Language and Encoding Governance
|
|
334
|
+
|
|
335
|
+
- EN artifact set must use English narrative consistently.
|
|
336
|
+
- Save generated markdown/YAML as UTF-8 and remove mojibake/corrupted characters before handoff.
|
|
337
|
+
- If source input is VI/JP, keep original text only in dedicated appendix/quotation blocks when needed for traceability.
|
|
338
|
+
|
|
339
|
+
### 9B.15 Abbreviations and Table Numbering Governance
|
|
340
|
+
|
|
341
|
+
- For generated markdown specs, include an `Abbreviations` section near the top when acronyms are used.
|
|
342
|
+
- Apply `No` column and sequential renumbering policy by following section `9B.8`.
|
|
343
|
+
|
|
344
|
+
## 9C. Project Profile Overlay Rule (Cross-Project Reuse)
|
|
345
|
+
|
|
346
|
+
- Separate reusable core rules from system-specific constraints.
|
|
347
|
+
- Keep system-specific choices in a project profile layer, for example:
|
|
348
|
+
- fixed HTTP policy patterns
|
|
349
|
+
- datetime timezone/local-naive policy
|
|
350
|
+
- method conventions such as POST-based edit/delete
|
|
351
|
+
- When reusing these rules for a new system, adopt core rules first, then explicitly decide profile overrides.
|
|
352
|
+
- Do not silently promote one system profile as global default for all projects.
|
|
353
|
+
|
|
354
|
+
## 10. Wording Rules
|
|
355
|
+
|
|
356
|
+
- Use concrete action verbs:
|
|
357
|
+
- `Select ...`
|
|
358
|
+
- `Update ...`
|
|
359
|
+
- `Insert ...`
|
|
360
|
+
- `Create api response;`
|
|
361
|
+
- For existing behavior preservation, use explicit wording:
|
|
362
|
+
- `Keep the current search logic handler: <function>();`
|
|
363
|
+
- Do not add redundant response details if globally standardized.
|
|
364
|
+
- Prefer `:Create api response;` over verbose wrappers.
|
|
365
|
+
|
|
366
|
+
## 11. Error/Status Rules in Flow Text
|
|
367
|
+
|
|
368
|
+
- Parameter validation error: usually `status = 100` (unless API-specific rule says otherwise).
|
|
369
|
+
- Temporary unknown error code policy may use `status = 900` if already agreed.
|
|
370
|
+
- Keep status usage consistent with confirmed project decisions.
|
|
371
|
+
|
|
372
|
+
## 12. Common Preview Errors and Fixes
|
|
373
|
+
|
|
374
|
+
- Error: `Cannot find group ... @enduml`
|
|
375
|
+
- Cause: missing `endif` or malformed action statement
|
|
376
|
+
- Fix: close all branches and ensure each action line ends with `;`
|
|
377
|
+
|
|
378
|
+
- Warning: `This syntax is deprecated...`
|
|
379
|
+
- Cause: old color syntax (`#pink:...`, `#lightGreen:...`)
|
|
380
|
+
- Fix: move color marker to end of action:
|
|
381
|
+
- `:...;<<#pink>>`
|
|
382
|
+
- `:...;<<#lightGreen>>`
|
|
383
|
+
|
|
384
|
+
## 13. Final Checklist Before Handoff
|
|
385
|
+
|
|
386
|
+
- Diagram renders in PlantUML Preview without error.
|
|
387
|
+
- No deprecated color syntax warnings.
|
|
388
|
+
- All `if` blocks have matching `endif`.
|
|
389
|
+
- New logic branch does not remove old logic path unless explicitly requested.
|
|
390
|
+
- SQL condition/order/paging statements match agreed spec.
|
|
391
|
+
- API path and method match the confirmed actual route (use YAML path only when they are identical).
|
|
392
|
+
- Response envelope is consistent with module-level canonical contract.
|
|
393
|
+
- Business `status` mapping is explicit in both YAML and flow branches.
|
|
394
|
+
- POST search/write payload wrapper (`data`) is consistent (or exception documented).
|
|
395
|
+
- Traceability links (BR/UC/AC) are present and consistent across artifacts.
|
|
396
|
+
- EN/UTF-8 quality check passed (no mixed-language drift, no mojibake).
|
|
397
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdtk-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 ARCH (Solution Architecture)
|
|
7
|
+
|
|
8
|
+
## Outputs
|
|
9
|
+
- `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
|
|
10
|
+
- If applicable:
|
|
11
|
+
- `docs/api/[FeaturePascal]_API.yaml`
|
|
12
|
+
- `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
|
|
13
|
+
- `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
|
|
14
|
+
- `docs/api/[feature_snake]_api_flow_list.txt`
|
|
15
|
+
- `docs/database/DATABASE_SPEC_[FEATURE_KEY].md`
|
|
16
|
+
- `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
|
|
17
|
+
- `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
|
|
18
|
+
|
|
19
|
+
## Process
|
|
20
|
+
1. Read BA spec + PRD/backlog.
|
|
21
|
+
2. Read `sdtk.config.json` for project stack assumptions (backend/frontend/db/auth).
|
|
22
|
+
3. If architecture output includes API contracts/flows, read and apply rules from `./references/FLOWCHART_CREATION_RULES.md` before defining endpoints/flows.
|
|
23
|
+
4. If architecture output includes screen flow-action specs, read and apply rules from `./references/FLOW_ACTION_SPEC_CREATION_RULES.md` (global numbering policy).
|
|
24
|
+
5. If API detail spec is required, use skill `sdtk-api-design-spec` to build/update `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md` using YAML + flow list.
|
|
25
|
+
6. For complex UI flow-action specs, use skill `sdtk-screen-design-spec` to build/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`.
|
|
26
|
+
7. Define:
|
|
27
|
+
- System components + data model
|
|
28
|
+
- API endpoints and flows (if backend changes)
|
|
29
|
+
- Screen layouts (if UI changes)
|
|
30
|
+
- Security/authz decisions
|
|
31
|
+
8. Create/update:
|
|
32
|
+
- OpenAPI YAML + API endpoint markdown
|
|
33
|
+
- API flow list
|
|
34
|
+
- API design detail spec (when `orchestration.apiDesignDetailMode` is `auto/on`)
|
|
35
|
+
- Database spec (if DB impact exists)
|
|
36
|
+
- Flow-action spec and design layout (if UI impact exists)
|
|
37
|
+
9. Ensure mapping UC/BR -> DB/API/screens and run output hygiene checks:
|
|
38
|
+
- EN artifacts use English narrative text (except clearly marked original-language appendix blocks).
|
|
39
|
+
- No mojibake/encoding corruption in markdown/yaml/txt outputs.
|
|
40
|
+
10. If anything is unclear: record OQ-xx in ARCH_DESIGN "Open Questions" and escalate to `@pm` for a decision (PM asks the user if still missing info).
|
|
41
|
+
11. Update shared state + Phase 3 checklist.
|
|
42
|
+
12. Handoff: `@dev please implement ...`.
|
|
43
|
+
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# API Design Creation Rules for AI Agents (Excel Template)
|
|
2
|
+
|
|
3
|
+
This document defines reusable rules for creating API design documents in Excel format based on `Example/Docs/API/API_design.xlsx`.
|
|
4
|
+
|
|
5
|
+
## 1. Scope and Goal
|
|
6
|
+
|
|
7
|
+
- Reuse one consistent Excel structure for API contract documentation.
|
|
8
|
+
- Keep flow, endpoint parameters, request schema, response schema, and revision history in one workbook.
|
|
9
|
+
- Keep generated sheets deterministic and review-friendly.
|
|
10
|
+
|
|
11
|
+
## 2. Source Template Baseline
|
|
12
|
+
|
|
13
|
+
| No | Sheet Pattern | Purpose |
|
|
14
|
+
| ---: | --- | --- |
|
|
15
|
+
| 1 | `History` | Global workbook change history |
|
|
16
|
+
| 2 | `API detail (...)` | One API per sheet |
|
|
17
|
+
|
|
18
|
+
Observed baseline in `API_design.xlsx`:
|
|
19
|
+
- 1 history sheet.
|
|
20
|
+
- 5 API detail sheets (list/create/detail/update/logical delete).
|
|
21
|
+
|
|
22
|
+
## 3. Workbook Rules
|
|
23
|
+
|
|
24
|
+
### 3.1 Sheet Naming
|
|
25
|
+
|
|
26
|
+
- Use one API per sheet.
|
|
27
|
+
- Recommended naming style:
|
|
28
|
+
- `API detail (<domain action>)`
|
|
29
|
+
- Keep API sheet order stable (for example: list -> create -> detail -> update -> delete).
|
|
30
|
+
|
|
31
|
+
### 3.2 History Sheet
|
|
32
|
+
|
|
33
|
+
- Keep `History` as the first sheet.
|
|
34
|
+
- Header layout:
|
|
35
|
+
- `A3=Date`
|
|
36
|
+
- `C3=Version`
|
|
37
|
+
- `F3=Editor`
|
|
38
|
+
- `M3=Edit content`
|
|
39
|
+
- Append rows only. Do not rewrite historical rows.
|
|
40
|
+
|
|
41
|
+
## 4. API Detail Sheet Layout
|
|
42
|
+
|
|
43
|
+
### 4.1 Header Metadata Block
|
|
44
|
+
|
|
45
|
+
Use this label/value map:
|
|
46
|
+
|
|
47
|
+
| No | Label Cell Group | Value Cell Group | Meaning |
|
|
48
|
+
| ---: | --- | --- | --- |
|
|
49
|
+
| 1 | `Q1:X1` | `Y1:AQ1` | System name |
|
|
50
|
+
| 2 | `Q2:X2` | `Y2:AQ2` | System ID |
|
|
51
|
+
| 3 | `Q3:X3` | `Y3:AQ3` | Subsystem name |
|
|
52
|
+
| 4 | `Q4:X4` | `Y4:AQ4` | Function name |
|
|
53
|
+
| 5 | `AR1:AV1` | `AW1:BC1` | Created by |
|
|
54
|
+
| 6 | `AR2:AV2` | `AW2:BC2` | Created date |
|
|
55
|
+
| 7 | `AR3:AV3` | `AW3:BC3` | Revised by |
|
|
56
|
+
| 8 | `AR4:AV4` | `AW4:BC4` | Revised date |
|
|
57
|
+
|
|
58
|
+
Also keep document title block:
|
|
59
|
+
- `A1:P4` = document title area.
|
|
60
|
+
|
|
61
|
+
### 4.2 Mandatory Section Order
|
|
62
|
+
|
|
63
|
+
Each API sheet must keep this order:
|
|
64
|
+
1. Process flow section
|
|
65
|
+
2. `Parameters:`
|
|
66
|
+
3. Request parameter section (JSON format)
|
|
67
|
+
4. Success response section (JSON format)
|
|
68
|
+
5. Error response section (JSON format)
|
|
69
|
+
|
|
70
|
+
### 4.3 Endpoint Title Placement
|
|
71
|
+
|
|
72
|
+
- Put endpoint summary at top flow area: `B7`.
|
|
73
|
+
- Format: `<METHOD> <PATH> <summary>`
|
|
74
|
+
- Repeat the same endpoint summary in contract area:
|
|
75
|
+
- Column `A`, one row above `Parameters:`.
|
|
76
|
+
- Both endpoint strings must be identical.
|
|
77
|
+
|
|
78
|
+
### 4.4 Flowchart Placement
|
|
79
|
+
|
|
80
|
+
- Put PlantUML text in `BG8` (multi-line content in one cell).
|
|
81
|
+
- `BG6` can contain tool/reference note.
|
|
82
|
+
- Helper + main flows can be placed in one cell value if clearly separated.
|
|
83
|
+
- Flow syntax/content standards follow:
|
|
84
|
+
- `Example/Docs/API/FLOWCHART_CREATION_RULES.md`
|
|
85
|
+
|
|
86
|
+
## 5. Endpoint and Parameter Rules
|
|
87
|
+
|
|
88
|
+
### 5.1 Path Parameter Block
|
|
89
|
+
|
|
90
|
+
- Anchor row: column `B` equals `Parameters:`.
|
|
91
|
+
- Parameter rows:
|
|
92
|
+
- parameter key in column `C`
|
|
93
|
+
- description in column `K`
|
|
94
|
+
- Include every path placeholder from endpoint path.
|
|
95
|
+
- Keep parameter order aligned with placeholder order.
|
|
96
|
+
|
|
97
|
+
### 5.2 Consistency Checks
|
|
98
|
+
|
|
99
|
+
- Every `{placeholder}` in path must exist exactly once in the parameter rows.
|
|
100
|
+
- Avoid duplicate parameter names unless explicitly documented.
|
|
101
|
+
- Remove stale parameter rows after endpoint rename.
|
|
102
|
+
|
|
103
|
+
## 6. Request/Response Table Rules
|
|
104
|
+
|
|
105
|
+
### 6.1 Common Column Model
|
|
106
|
+
|
|
107
|
+
| No | Column Group | Meaning |
|
|
108
|
+
| ---: | --- | --- |
|
|
109
|
+
| 1 | `A:B` | Row No |
|
|
110
|
+
| 2 | `C:J` | Item label |
|
|
111
|
+
| 3 | `K:N` | Hierarchy level 1 |
|
|
112
|
+
| 4 | `O:R` | Hierarchy level 2 |
|
|
113
|
+
| 5 | `S:V` | Hierarchy level 3 |
|
|
114
|
+
| 6 | `W:Z` | Hierarchy level 4 |
|
|
115
|
+
| 7 | `AA:AD` | Hierarchy level 5 |
|
|
116
|
+
| 8 | `AE:AH` | Hierarchy level 6 |
|
|
117
|
+
| 9 | `AI:AK` | Data type |
|
|
118
|
+
|
|
119
|
+
### 6.2 Request Header Mode
|
|
120
|
+
|
|
121
|
+
For write/search request tables, include:
|
|
122
|
+
- `No`
|
|
123
|
+
- `Item Name`
|
|
124
|
+
- `Item`
|
|
125
|
+
- `Type`
|
|
126
|
+
- `Format`
|
|
127
|
+
- `Length`
|
|
128
|
+
- `Required`
|
|
129
|
+
|
|
130
|
+
Column groups:
|
|
131
|
+
- `AL:AN` -> `Format`
|
|
132
|
+
- `AO:AP` -> `Length`
|
|
133
|
+
- `AQ:AR` -> `Required`
|
|
134
|
+
|
|
135
|
+
### 6.3 Response Header Mode
|
|
136
|
+
|
|
137
|
+
For response tables, include:
|
|
138
|
+
- `No`
|
|
139
|
+
- `Item Name`
|
|
140
|
+
- `Item`
|
|
141
|
+
- `Type`
|
|
142
|
+
- `Note`
|
|
143
|
+
|
|
144
|
+
Column group:
|
|
145
|
+
- `AL:AN` -> `Note`
|
|
146
|
+
|
|
147
|
+
### 6.4 GET Request Body Rule
|
|
148
|
+
|
|
149
|
+
- If API has no JSON request body, set request body to:
|
|
150
|
+
- `None`
|
|
151
|
+
|
|
152
|
+
### 6.5 Hierarchy Modeling Rule
|
|
153
|
+
|
|
154
|
+
- Use hierarchy columns (level 1 to level 6) to represent nesting.
|
|
155
|
+
- Represent root wrapper explicitly (for example `data`).
|
|
156
|
+
- For array object children, define parent array node first, then child fields at deeper levels.
|
|
157
|
+
|
|
158
|
+
## 7. Status and Error Contract Rules
|
|
159
|
+
|
|
160
|
+
- Success response must include `status` at minimum.
|
|
161
|
+
- Error response must include:
|
|
162
|
+
- `status`
|
|
163
|
+
- `data` (message or detail payload)
|
|
164
|
+
- If status detail references an external code table, note that in response notes.
|
|
165
|
+
|
|
166
|
+
## 8. Type and Format Rules
|
|
167
|
+
|
|
168
|
+
- Use stable type keywords:
|
|
169
|
+
- `string`
|
|
170
|
+
- `integer`
|
|
171
|
+
- `number`
|
|
172
|
+
- `object`
|
|
173
|
+
- `array`
|
|
174
|
+
- If datetime format is constrained, write it in `Format` or `Note` (for example `yyyymmddHHMMSS`).
|
|
175
|
+
- Business constraints (constant flags, nullable behavior, etc.) go to `Note`.
|
|
176
|
+
|
|
177
|
+
## 9. Recommended Generation Procedure
|
|
178
|
+
|
|
179
|
+
1. Duplicate an existing API detail sheet.
|
|
180
|
+
2. Update metadata fields (`Q..BC` blocks).
|
|
181
|
+
3. Update endpoint title in `B7`.
|
|
182
|
+
4. Update PlantUML in `BG8`.
|
|
183
|
+
5. Update repeated endpoint title above `Parameters:`.
|
|
184
|
+
6. Update path parameters (`C/K` rows).
|
|
185
|
+
7. Update request section:
|
|
186
|
+
- `None` for no-body APIs.
|
|
187
|
+
- request table for body APIs.
|
|
188
|
+
8. Update success response table.
|
|
189
|
+
9. Update error response table.
|
|
190
|
+
10. Append one new row in `History`.
|
|
191
|
+
|
|
192
|
+
## 10. Quality Gate Checklist Before Handoff
|
|
193
|
+
|
|
194
|
+
- Section order is complete and unchanged.
|
|
195
|
+
- Endpoint title in `B7` matches the endpoint title above `Parameters:`.
|
|
196
|
+
- Path placeholders and parameter rows are 1:1 matched.
|
|
197
|
+
- Request/response sections use correct header mode.
|
|
198
|
+
- `No` is sequential in every table.
|
|
199
|
+
- Hierarchy columns reflect actual payload nesting.
|
|
200
|
+
- `status` and error payload structure are documented.
|
|
201
|
+
- PlantUML in `BG8` matches endpoint behavior.
|
|
202
|
+
- `History` has a new appended entry.
|
|
203
|
+
|
|
204
|
+
## 11. Known Pitfalls and Prevention
|
|
205
|
+
|
|
206
|
+
| No | Pitfall | Prevention Rule |
|
|
207
|
+
| ---: | --- | --- |
|
|
208
|
+
| 1 | Endpoint placeholder renamed but parameter rows not synced | Run path-vs-parameter check for every API sheet |
|
|
209
|
+
| 2 | Request/response headers mixed (`Note` vs `Required`) | Use section-specific header mode only |
|
|
210
|
+
| 3 | Nested array fields placed at wrong hierarchy level | Define parent array first, then child fields deeper |
|
|
211
|
+
| 4 | Endpoint summary mismatch between top and contract blocks | Maintain a single canonical endpoint title string and reuse it |
|
|
212
|
+
|