sdtk-spec-kit 0.3.13 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/manifest/toolkit-bundle.manifest.json +96 -156
- package/assets/manifest/toolkit-bundle.sha256.txt +45 -57
- package/assets/toolkit/toolkit/AGENTS.md +17 -15
- package/assets/toolkit/toolkit/README.md +3 -2
- package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +11 -1
- package/assets/toolkit/toolkit/install.ps1 +60 -50
- package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +2 -2
- package/assets/toolkit/toolkit/scripts/agents/run-claude-task.ps1 +110 -51
- package/assets/toolkit/toolkit/scripts/agents/run-codex-task.ps1 +76 -3
- package/assets/toolkit/toolkit/scripts/agents/validate-mailbox-formal-artifact.py +87 -0
- package/assets/toolkit/toolkit/scripts/generate-code-handoff.ps1 +9 -0
- package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +179 -169
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +111 -84
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +46 -10
- package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +85 -85
- package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +7 -0
- package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +42 -3
- package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +1 -0
- package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +61 -5
- package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +63 -5
- package/assets/toolkit/toolkit/skills/sdtk-mailbox-dispatch/SKILL.md +5 -4
- package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +22 -13
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +53 -33
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +60 -24
- package/assets/toolkit/toolkit/skills/skills.catalog.yaml +9 -9
- package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +116 -90
- package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +49 -9
- package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +3 -3
- package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +9 -1
- package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +36 -2
- package/assets/toolkit/toolkit/skills-claude/dev/SKILL.md +1 -0
- package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +58 -5
- package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +60 -5
- package/assets/toolkit/toolkit/skills-claude/mailbox-dispatch/SKILL.md +5 -4
- package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +9 -0
- package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +49 -27
- package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +74 -20
- package/assets/toolkit/toolkit/templates/README.md +5 -1
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +1 -2
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
- package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +3 -3
- package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +128 -128
- package/assets/toolkit/toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md +140 -0
- package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_SDTK_CODE.md +26 -0
- package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +2 -2
- package/assets/toolkit/toolkit/templates/mailbox/AGENT_REPORT_TEMPLATE.md +12 -8
- package/assets/toolkit/toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md +8 -2
- package/package.json +48 -48
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +0 -22
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/FLOWCHART_CREATION_RULES.md +0 -20
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/FLOWCHART_CREATION_RULES.md +0 -20
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/YAML_CREATION_RULES.md +0 -128
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +0 -22
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOWCHART_CREATION_RULES.md +0 -20
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/YAML_CREATION_RULES.md +0 -128
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md +0 -129
package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md
DELETED
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
# API DESIGN + FLOWCHART CREATION RULES FINAL
|
|
2
|
-
|
|
3
|
-
This file is the canonical rule set for:
|
|
4
|
-
- API flow source (`*_api_flow_list.txt`)
|
|
5
|
-
- PlantUML API flowcharts
|
|
6
|
-
- API design detail markdown (`*_API_DESIGN_DETAIL.md`)
|
|
7
|
-
|
|
8
|
-
Use `YAML_CREATION_RULES_FINAL.md` as the source of truth for endpoint contract design.
|
|
9
|
-
|
|
10
|
-
The rules below include the 2026-03-03 flow-style refinements extracted from the Whiteboard API flowchart review.
|
|
11
|
-
|
|
12
|
-
## 1. Final Review Result
|
|
13
|
-
|
|
14
|
-
After the final pass on `docs/api/work_planning_board_api_flow_list.txt`, there are no remaining critical style mismatches that should block reuse of the current flowchart-writing rules.
|
|
15
|
-
|
|
16
|
-
Current state:
|
|
17
|
-
- All API blocks use visible API header lines.
|
|
18
|
-
- Search-like APIs use query-builder style.
|
|
19
|
-
- CRUD/detail APIs no longer overuse search-style `fullQuery` construction.
|
|
20
|
-
- Batch create uses batch-create style instead of search-style query-builder.
|
|
21
|
-
- `api_design_detail.md` has been regenerated and is aligned with the current flow source.
|
|
22
|
-
|
|
23
|
-
Accepted low-priority exceptions:
|
|
24
|
-
- `POST /file-manager/env/{organization_uuid}` uses pseudo `UPSERT` wording. This is acceptable because it is a shared upsert-style API, not a search API.
|
|
25
|
-
- `GET /api/work-assignment/{organization_uuid}/{task_assignment_uuid}` still uses a fixed `query = ...` + `LEFT JOIN ...` style. This is intentional and acceptable for a fixed-detail API.
|
|
26
|
-
|
|
27
|
-
## 2. Source of Extracted Rules
|
|
28
|
-
|
|
29
|
-
These rules were extracted by comparing:
|
|
30
|
-
- `docs/api/work_planning_board_api_flow_list.txt`
|
|
31
|
-
- `docs/api/api_design_detail.md`
|
|
32
|
-
- `Example/Docs/API/resource-api-flowchart-list.txt`
|
|
33
|
-
|
|
34
|
-
Primary sample references:
|
|
35
|
-
- `POST /resource/{organization_uuid}` style
|
|
36
|
-
- `POST /resource/edit/{organization_uuid}/{resource_uuid}` style
|
|
37
|
-
- `POST /resource/delete-parmanent/{organization_uuid}/{resource_uuid}` style
|
|
38
|
-
- `GET /resource/info/{organization_uuid}/{resource_uuid}` style
|
|
39
|
-
- search API query-builder style shown in the Resource sample helper flow
|
|
40
|
-
|
|
41
|
-
## 2.1 API Design Detail Markdown Requirements
|
|
42
|
-
|
|
43
|
-
Generated `*_API_DESIGN_DETAIL.md` files must keep this minimum structure:
|
|
44
|
-
- `## 0. Abbreviations`
|
|
45
|
-
- `## 1. Document Scope`
|
|
46
|
-
- `## Assumptions`
|
|
47
|
-
- per-endpoint `## <n>. API Detail ...` sections
|
|
48
|
-
- `## 3. Generation Notes` or the current equivalent final notes section
|
|
49
|
-
|
|
50
|
-
`## Assumptions` must use this table shape:
|
|
51
|
-
|
|
52
|
-
```text
|
|
53
|
-
| # | Assumption | Verified | Risk if wrong |
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
If an assumption is not verified yet, keep it explicit and treat it as a downstream review risk instead of silently collapsing it into a fact.
|
|
57
|
-
|
|
58
|
-
## 3. Core Flowchart Writing Rules
|
|
59
|
-
|
|
60
|
-
### Rule A. Add a visible API header for every block
|
|
61
|
-
|
|
62
|
-
Every API block must start with a visible API header line, for example:
|
|
63
|
-
|
|
64
|
-
```text
|
|
65
|
-
API: <METHOD> <PATH> <Short Title>
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Project-specific variants such as `笆API:` are acceptable only when encoding is stable.
|
|
69
|
-
|
|
70
|
-
Reason:
|
|
71
|
-
- Matches the sample style.
|
|
72
|
-
- Makes raw flow-list files scannable before rendering.
|
|
73
|
-
- Reduces ambiguity when one file contains many APIs.
|
|
74
|
-
|
|
75
|
-
### Rule B. Use one `@startuml` block per API when generator mapping depends on block count
|
|
76
|
-
|
|
77
|
-
If the markdown/API-design generator maps flow blocks to API endpoints by block count/order:
|
|
78
|
-
- keep exactly one main `@startuml ... @enduml` block per API
|
|
79
|
-
- do not split helper flows into extra standalone blocks unless the generator is updated accordingly
|
|
80
|
-
|
|
81
|
-
Reason:
|
|
82
|
-
- Avoids breaking flow-to-endpoint mapping in generated `*_API_DESIGN_DETAIL.md`.
|
|
83
|
-
|
|
84
|
-
### Rule C. Flow style must match API type
|
|
85
|
-
|
|
86
|
-
Do not use one style for every API.
|
|
87
|
-
Choose the flow style based on the API purpose:
|
|
88
|
-
|
|
89
|
-
1. Search/List/Lookup APIs
|
|
90
|
-
- Use query-builder style.
|
|
91
|
-
|
|
92
|
-
2. Create APIs
|
|
93
|
-
- Use CRUD create style.
|
|
94
|
-
|
|
95
|
-
3. Edit APIs
|
|
96
|
-
- Use CRUD update style.
|
|
97
|
-
|
|
98
|
-
4. Delete APIs
|
|
99
|
-
- Use CRUD delete style.
|
|
100
|
-
|
|
101
|
-
5. Detail APIs
|
|
102
|
-
- Use fixed-record read style.
|
|
103
|
-
|
|
104
|
-
6. Batch create APIs
|
|
105
|
-
- Use batch-create style with loop.
|
|
106
|
-
|
|
107
|
-
Reason:
|
|
108
|
-
- This is the main difference between the sample Resource flowchart style and the over-generalized Whiteboard draft.
|
|
109
|
-
|
|
110
|
-
## 4. Search / List API Rules
|
|
111
|
-
|
|
112
|
-
Applies to:
|
|
113
|
-
- assignment search APIs
|
|
114
|
-
- reserve member/external-member search APIs
|
|
115
|
-
- duplicate-check / lookup APIs that are effectively query-based
|
|
116
|
-
- shared env lookup APIs when they dynamically build lookup conditions
|
|
117
|
-
|
|
118
|
-
### Rule D. Search APIs should use query-builder style
|
|
119
|
-
|
|
120
|
-
Preferred structure:
|
|
121
|
-
|
|
122
|
-
```text
|
|
123
|
-
:Create search query and condition statement from request.data.info;
|
|
124
|
-
:query = "SELECT ... FROM ...";
|
|
125
|
-
:query += " LEFT JOIN ...";
|
|
126
|
-
:condition = "WHERE ...";
|
|
127
|
-
...
|
|
128
|
-
:order_by = "ORDER BY ...";
|
|
129
|
-
:Compose full query:\nfullQuery = query + " " + condition;
|
|
130
|
-
:Add order_by into fullQuery;
|
|
131
|
-
:Execute fullQuery and get data;
|
|
132
|
-
:Close DB connection;
|
|
133
|
-
:Create api response;
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Rule E. Use uppercase table/column names inside pseudo-SQL
|
|
137
|
-
|
|
138
|
-
Inside SQL-like action text:
|
|
139
|
-
- use uppercase table names
|
|
140
|
-
- use uppercase column names where practical
|
|
141
|
-
|
|
142
|
-
Good:
|
|
143
|
-
- `APP_DATA_RESOURCE_INFO`
|
|
144
|
-
- `APP_DATA_RESOURCE_TASK_ASSIGNMENT_INFO`
|
|
145
|
-
|
|
146
|
-
Avoid:
|
|
147
|
-
- lowercase-only SQL object names in pseudo-SQL lines
|
|
148
|
-
|
|
149
|
-
Reason:
|
|
150
|
-
- Matches the sample style and improves visual separation between logic text and table identifiers.
|
|
151
|
-
|
|
152
|
-
### Rule E-1. Do not use fake helper-function wording unless a helper flow is defined
|
|
153
|
-
|
|
154
|
-
Do not write:
|
|
155
|
-
- `Call search_logic_function(parameters)`
|
|
156
|
-
- `Execute search_logic_function(parameters)`
|
|
157
|
-
|
|
158
|
-
unless the flow source also contains a real helper sub-flow block that defines that function logic.
|
|
159
|
-
|
|
160
|
-
If the helper is not actually defined in the same source:
|
|
161
|
-
- write the processing step directly inline
|
|
162
|
-
|
|
163
|
-
Good:
|
|
164
|
-
- `Create search query and condition statement from request.data.info;`
|
|
165
|
-
- `Create duplicate check query and condition statement from request.data.info;`
|
|
166
|
-
|
|
167
|
-
Reason:
|
|
168
|
-
- Avoids implying a reusable sub-flow that does not exist.
|
|
169
|
-
- Keeps the flow self-contained and accurate.
|
|
170
|
-
|
|
171
|
-
### Rule F. Dynamic array filters should use object-based wording
|
|
172
|
-
|
|
173
|
-
For array filters, use the sample-like loop style:
|
|
174
|
-
|
|
175
|
-
```text
|
|
176
|
-
if (data.info.team_uuids not null && data.info.team_uuids not empty) then (yes)
|
|
177
|
-
:condition += " AND ( 1 != 1 ";
|
|
178
|
-
repeat
|
|
179
|
-
:Get teamObject from data.info.team_uuids;
|
|
180
|
-
:condition += " OR E.TEAM_UUID = <teamObject.uuid>";
|
|
181
|
-
repeat while (more value data?) is (yes)
|
|
182
|
-
->no;
|
|
183
|
-
:condition += " )";
|
|
184
|
-
else (no)
|
|
185
|
-
endif
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
Do not use overly simplified wording like:
|
|
189
|
-
- `Add team filter`
|
|
190
|
-
|
|
191
|
-
Reason:
|
|
192
|
-
- The sample explicitly shows how OR-group conditions are built.
|
|
193
|
-
|
|
194
|
-
### Rule G. Search APIs should not describe response shaping internals
|
|
195
|
-
|
|
196
|
-
Avoid lines such as:
|
|
197
|
-
- `Compute duplicate_assign ...`
|
|
198
|
-
- `Group data into ...`
|
|
199
|
-
- `Return data.xxx[]`
|
|
200
|
-
- `Aggregate created_count ...` (for non-batch search flows)
|
|
201
|
-
|
|
202
|
-
Instead end the flow at:
|
|
203
|
-
- query completed
|
|
204
|
-
- DB connection closed
|
|
205
|
-
- API response created
|
|
206
|
-
|
|
207
|
-
Reason:
|
|
208
|
-
- The response structure is already defined in YAML.
|
|
209
|
-
- Flowchart should focus on processing logic, not renderer-side or response-object assembly internals.
|
|
210
|
-
|
|
211
|
-
### Rule H. Explicit `ORDER BY` is required when output order matters
|
|
212
|
-
|
|
213
|
-
If the endpoint contract depends on a specific order:
|
|
214
|
-
- define `order_by = "ORDER BY ..."`
|
|
215
|
-
- then add it into `fullQuery`
|
|
216
|
-
|
|
217
|
-
Do not leave ordering implicit.
|
|
218
|
-
|
|
219
|
-
## 5. Create API Rules
|
|
220
|
-
|
|
221
|
-
Applies to:
|
|
222
|
-
- single create APIs
|
|
223
|
-
|
|
224
|
-
### Rule I. Create APIs should use `Insert into ... with parameter value`
|
|
225
|
-
|
|
226
|
-
Preferred style:
|
|
227
|
-
|
|
228
|
-
```text
|
|
229
|
-
:Insert into APP_DATA_XXX with parameter value
|
|
230
|
-
field_a = param.data.info.field_a
|
|
231
|
-
field_b = param.data.info.field_b
|
|
232
|
-
create_dt = now;
|
|
233
|
-
:GET inserted_xxx_uuid = XXX_UUID value when Insert into APP_DATA_XXX;
|
|
234
|
-
:Close DB connection;
|
|
235
|
-
:Create api response;
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
### Rule J. Do not over-describe query-builder logic inside create flows
|
|
239
|
-
|
|
240
|
-
Avoid using:
|
|
241
|
-
- `query = "SELECT 1 ..."`
|
|
242
|
-
- `condition = ...`
|
|
243
|
-
- `Compose full query ...`
|
|
244
|
-
|
|
245
|
-
inside normal create flows.
|
|
246
|
-
|
|
247
|
-
If duplicate/business validation is needed:
|
|
248
|
-
- describe it as a business step only
|
|
249
|
-
|
|
250
|
-
Example:
|
|
251
|
-
- `Check overlap conflicts with current parameter value;`
|
|
252
|
-
|
|
253
|
-
Reason:
|
|
254
|
-
- This matches the sample create style and keeps flow readable.
|
|
255
|
-
|
|
256
|
-
## 6. Edit API Rules
|
|
257
|
-
|
|
258
|
-
Applies to:
|
|
259
|
-
- update APIs
|
|
260
|
-
|
|
261
|
-
### Rule K. Edit APIs should follow `Select existing -> Update with parameter value`
|
|
262
|
-
|
|
263
|
-
Preferred structure:
|
|
264
|
-
|
|
265
|
-
```text
|
|
266
|
-
:Get target_uuid from endpoint;
|
|
267
|
-
:Select from APP_DATA_XXX with target_uuid and del_flg = 0;
|
|
268
|
-
if (record exists) then (yes)
|
|
269
|
-
else (no)
|
|
270
|
-
:Return error status = 140 ...;
|
|
271
|
-
stop
|
|
272
|
-
endif
|
|
273
|
-
:Check business rule if needed;
|
|
274
|
-
:Update APP_DATA_XXX with parameter value
|
|
275
|
-
field_a = param.data.info.field_a
|
|
276
|
-
field_b = param.data.info.field_b
|
|
277
|
-
update_dt = now
|
|
278
|
-
where target_uuid = target_uuid;
|
|
279
|
-
:Close DB connection;
|
|
280
|
-
:Create api response;
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
### Rule L. Keep business checks short inside edit flows
|
|
284
|
-
|
|
285
|
-
If edit has duplicate overlap or other business validation:
|
|
286
|
-
- keep it as one business step
|
|
287
|
-
- do not expand it into a full search-style query-builder
|
|
288
|
-
|
|
289
|
-
Good:
|
|
290
|
-
- `Check overlap conflicts excluding current xxx_uuid;`
|
|
291
|
-
|
|
292
|
-
Avoid:
|
|
293
|
-
- full `query/condition/fullQuery` sequence inside edit flow
|
|
294
|
-
|
|
295
|
-
## 7. Delete API Rules
|
|
296
|
-
|
|
297
|
-
Applies to:
|
|
298
|
-
- logical delete
|
|
299
|
-
- physical delete
|
|
300
|
-
|
|
301
|
-
### Rule M. Delete APIs should follow `Select existing -> Delete/Update -> Close -> Response`
|
|
302
|
-
|
|
303
|
-
Preferred structure:
|
|
304
|
-
|
|
305
|
-
```text
|
|
306
|
-
:Get target_uuid from endpoint;
|
|
307
|
-
:Select from APP_DATA_XXX with target_uuid and del_flg = 0;
|
|
308
|
-
if (record exists) then (yes)
|
|
309
|
-
else (no)
|
|
310
|
-
:Return error status = 140 ...;
|
|
311
|
-
stop
|
|
312
|
-
endif
|
|
313
|
-
:Update APP_DATA_XXX with parameter value
|
|
314
|
-
del_flg = 1,
|
|
315
|
-
update_dt = now
|
|
316
|
-
where target_uuid = target_uuid;
|
|
317
|
-
:Close DB connection;
|
|
318
|
-
:Create api response;
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
If the API is truly permanent delete:
|
|
322
|
-
- use `Delete ... with key is ...`
|
|
323
|
-
|
|
324
|
-
Rule:
|
|
325
|
-
- style may mirror permanent-delete sample
|
|
326
|
-
- but business semantics must still match the actual API contract
|
|
327
|
-
|
|
328
|
-
## 8. Detail API Rules
|
|
329
|
-
|
|
330
|
-
Applies to:
|
|
331
|
-
- read-one / detail APIs
|
|
332
|
-
|
|
333
|
-
### Rule N. Detail APIs may use a fixed query, but not search-style dynamic query-builder
|
|
334
|
-
|
|
335
|
-
Allowed:
|
|
336
|
-
|
|
337
|
-
```text
|
|
338
|
-
:Get target_uuid from endpoint;
|
|
339
|
-
:query = "SELECT ... FROM APP_DATA_XXX WHERE TARGET_UUID = target_uuid";
|
|
340
|
-
:query += " LEFT JOIN ...";
|
|
341
|
-
:Execute query and get data;
|
|
342
|
-
if (record exists) then (yes)
|
|
343
|
-
...
|
|
344
|
-
:Close DB connection;
|
|
345
|
-
:Create api response;
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
Avoid:
|
|
349
|
-
- `condition = ...`
|
|
350
|
-
- `Compose full query ...`
|
|
351
|
-
- dynamic filter loops
|
|
352
|
-
|
|
353
|
-
Reason:
|
|
354
|
-
- Detail APIs are fixed-record lookups, not flexible searches.
|
|
355
|
-
|
|
356
|
-
## 9. Batch Create API Rules
|
|
357
|
-
|
|
358
|
-
Applies to:
|
|
359
|
-
- APIs that create multiple records in one request
|
|
360
|
-
|
|
361
|
-
### Rule O. Batch create APIs should use create-style logic with a loop
|
|
362
|
-
|
|
363
|
-
Preferred structure:
|
|
364
|
-
|
|
365
|
-
```text
|
|
366
|
-
:Create target date list ...;
|
|
367
|
-
...
|
|
368
|
-
repeat
|
|
369
|
-
:Build per-item datetime/value;
|
|
370
|
-
:Check business conflict with current target date parameter value;
|
|
371
|
-
if (duplicate and skip = false) then (yes)
|
|
372
|
-
:Append skipped result ...;
|
|
373
|
-
else (no)
|
|
374
|
-
:Insert into APP_DATA_XXX with parameter value
|
|
375
|
-
...
|
|
376
|
-
:GET inserted_xxx_uuid = XXX_UUID value when Insert into APP_DATA_XXX;
|
|
377
|
-
:Append created result ...;
|
|
378
|
-
endif
|
|
379
|
-
repeat while (has next target item?) is (yes)
|
|
380
|
-
:Build batch result list and summary counts;
|
|
381
|
-
:Close DB connection;
|
|
382
|
-
:Create api response;
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
### Rule P. Do not use search-style query-builder in batch-create loops
|
|
386
|
-
|
|
387
|
-
Avoid inside the loop:
|
|
388
|
-
- `query = "SELECT 1 ..."`
|
|
389
|
-
- `condition = ...`
|
|
390
|
-
- `Compose full query ...`
|
|
391
|
-
|
|
392
|
-
Even when duplicate validation exists, batch create should still read like a create flow with looped business validation.
|
|
393
|
-
|
|
394
|
-
## 10. Shared System API Rules
|
|
395
|
-
|
|
396
|
-
Applies to:
|
|
397
|
-
- APIs reused from another module but documented in feature flowchart
|
|
398
|
-
|
|
399
|
-
### Rule Q. Shared lookup APIs may still use query-builder style if they behave like lookup/search
|
|
400
|
-
|
|
401
|
-
Example:
|
|
402
|
-
- environment lookup APIs that build conditions from request array items
|
|
403
|
-
|
|
404
|
-
Allowed:
|
|
405
|
-
- `query = ...`
|
|
406
|
-
- `condition = ...`
|
|
407
|
-
- `Compose full query ...`
|
|
408
|
-
|
|
409
|
-
### Rule R. Shared upsert APIs should use action-oriented wording, not search wording
|
|
410
|
-
|
|
411
|
-
Example:
|
|
412
|
-
|
|
413
|
-
```text
|
|
414
|
-
:Create Environment Manager upsert statement from request.data;
|
|
415
|
-
:query = "UPSERT APP_DATA_ENV_INFO";
|
|
416
|
-
:Resolve target row by ...;
|
|
417
|
-
:Set VALUE / NUMVALUE ...;
|
|
418
|
-
:Execute upsert statement;
|
|
419
|
-
:Close DB connection;
|
|
420
|
-
:Create api response;
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
Reason:
|
|
424
|
-
- Keeps style aligned with operation type.
|
|
425
|
-
|
|
426
|
-
## 11. Error / Connection / Ending Rules
|
|
427
|
-
|
|
428
|
-
### Rule S. Keep auth and validation at the top
|
|
429
|
-
|
|
430
|
-
Use the common pattern:
|
|
431
|
-
- authentication
|
|
432
|
-
- permission
|
|
433
|
-
- validation
|
|
434
|
-
- business processing
|
|
435
|
-
- DB close
|
|
436
|
-
- response
|
|
437
|
-
|
|
438
|
-
### Rule T. `Close DB connection;` should be near the end of the main flow
|
|
439
|
-
|
|
440
|
-
Preferred:
|
|
441
|
-
- after DB processing finishes
|
|
442
|
-
- before `Create api response;`
|
|
443
|
-
|
|
444
|
-
Avoid:
|
|
445
|
-
- excessive `Close DB connection;` inside every inner loop branch unless the logic truly requires separate connections
|
|
446
|
-
|
|
447
|
-
### Rule U. End with `Create api response;`
|
|
448
|
-
|
|
449
|
-
Use a simple terminal response action.
|
|
450
|
-
|
|
451
|
-
Do not over-specify:
|
|
452
|
-
- HTTP 200
|
|
453
|
-
- response JSON object construction
|
|
454
|
-
- field-by-field response shaping
|
|
455
|
-
|
|
456
|
-
unless there is a concrete reason the sample style requires it.
|
|
457
|
-
|
|
458
|
-
## 12. Non-Flow Logic That Should Stay Out of the Flowchart
|
|
459
|
-
|
|
460
|
-
Do not put these into the flow unless they are the core processing logic:
|
|
461
|
-
- FE-only rendering logic
|
|
462
|
-
- detailed response nesting assembly
|
|
463
|
-
- UI display-specific transformations already described by YAML schema
|
|
464
|
-
|
|
465
|
-
Reason:
|
|
466
|
-
- Flowchart should describe processing logic.
|
|
467
|
-
- YAML and endpoint docs already define the response contract.
|
|
468
|
-
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# FLOWCHART CREATION RULES (Compatibility Note)
|
|
2
|
-
|
|
3
|
-
This file is kept only for backward compatibility.
|
|
4
|
-
|
|
5
|
-
Do not use this file as the primary source of truth anymore.
|
|
6
|
-
The rule set has been split into two files:
|
|
7
|
-
- `YAML_CREATION_RULES_FINAL.md` (root) / `templates/docs/api/YAML_CREATION_RULES.md` (toolkit)
|
|
8
|
-
- `API_DESIGN_FLOWCHART_CREATION_RULES_FINAL.md` (root) / `templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` (toolkit)
|
|
9
|
-
|
|
10
|
-
Use the YAML rules file for:
|
|
11
|
-
- endpoint path/method conventions
|
|
12
|
-
- request/response schema design
|
|
13
|
-
- contract-level API rules
|
|
14
|
-
|
|
15
|
-
Use the API design + flowchart rules file for:
|
|
16
|
-
- flow list writing
|
|
17
|
-
- PlantUML flow depth and wording
|
|
18
|
-
- API design detail markdown rules
|
|
19
|
-
|
|
20
|
-
This compatibility note should remain only until all references are migrated.
|
package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
# Flow Action Spec Creation Rules for AI Agents
|
|
2
|
-
|
|
3
|
-
This document defines reusable rules for creating and updating screen flow-action specifications
|
|
4
|
-
(for example `docs/specs/*_FLOW_ACTION_SPEC.md`).
|
|
5
|
-
|
|
6
|
-
## 1. Scope and Goal
|
|
7
|
-
|
|
8
|
-
- Produce a screen-level specification that is traceable from BA/ARCH to FE/BE implementation.
|
|
9
|
-
- Keep one source of truth for:
|
|
10
|
-
- screen flow
|
|
11
|
-
- UI items and actions
|
|
12
|
-
- API calls per action
|
|
13
|
-
- screen-to-API mapping
|
|
14
|
-
- Keep documentation implementation-aware and review-friendly.
|
|
15
|
-
|
|
16
|
-
## 2. Mandatory Document Structure
|
|
17
|
-
|
|
18
|
-
A flow-action spec should include, at minimum:
|
|
19
|
-
|
|
20
|
-
1. `Abbreviations`
|
|
21
|
-
2. `Feature overview`
|
|
22
|
-
3. `Assumptions`
|
|
23
|
-
4. `Screen flow action` (with PlantUML)
|
|
24
|
-
5. `Screen layout spec by flow action`
|
|
25
|
-
6. `System processing flow`
|
|
26
|
-
7. `Open questions`
|
|
27
|
-
8. `Screen - API mapping`
|
|
28
|
-
9. `Document history`
|
|
29
|
-
|
|
30
|
-
If a section is not in scope, keep the section and mark explicitly as `N/A` with reason.
|
|
31
|
-
|
|
32
|
-
## 3. Table Standards
|
|
33
|
-
|
|
34
|
-
- Every table must include a `No` column (sequential numbering).
|
|
35
|
-
- Use stable headers for action tables:
|
|
36
|
-
- `No | Item Name | Item Type | Attribute | DB Column | Size | Default Value | Action | Description | Note`
|
|
37
|
-
- Use stable headers for API mapping tables:
|
|
38
|
-
- `No | Trigger/When | UI item (No / Item Name) | API to call | Data usage / Notes`
|
|
39
|
-
- Use stable headers for screen mapping:
|
|
40
|
-
- `No | Screen (section) | Screen ID | Read/Search APIs | Write APIs | Notes / Q&A refs`
|
|
41
|
-
- Table rows must keep column count consistent with the header (no broken or merged rows).
|
|
42
|
-
- Avoid single-line merged content that collapses multiple logical items into one table row.
|
|
43
|
-
|
|
44
|
-
### 3.1 Action Table Mapping Completion Rules
|
|
45
|
-
|
|
46
|
-
- After API endpoint spec and database spec are available, the action-table columns `Attribute`, `DB Column`, `Size`, and `Default Value` must not be left blank when the mapping can be derived from current source-of-truth inputs.
|
|
47
|
-
- Fill these four columns only after the relevant API contract and DB schema are stable enough to be treated as the current source of truth for the active phase.
|
|
48
|
-
- Source priority for filling the four columns:
|
|
49
|
-
1. `docs/api/*_ENDPOINTS.md` and OpenAPI YAML for request/response contract
|
|
50
|
-
2. `docs/database/DATABASE_SPEC_*.md` for physical column names, nullability, storage shape, and query-source aliases
|
|
51
|
-
3. confirmed flow/business rules for default state and behavior
|
|
52
|
-
4. design source (Figma/Excel) for screen label and control type only
|
|
53
|
-
- `Attribute` rules:
|
|
54
|
-
- input item: use the canonical request payload path
|
|
55
|
-
- display item: use the canonical response path
|
|
56
|
-
- UI-only item: use `ui.*` namespace
|
|
57
|
-
- `DB Column` rules:
|
|
58
|
-
- use physical DB column names or query-source aliases from the API/database spec
|
|
59
|
-
- if multiple columns participate, list them explicitly
|
|
60
|
-
- if the control is UI-only, write `N/A`
|
|
61
|
-
- `Size` rules:
|
|
62
|
-
- document data format/type, not pixel width
|
|
63
|
-
- prefer canonical forms such as `uuid`, `DATE (YYYY-MM-DD)`, `DATETIME`, `TIME (HH:mm)`, `boolean`, `array[uuid]`, `enum(...)`, `JSON string`
|
|
64
|
-
- prefer DB storage type first; if not available, fall back to API schema type/format
|
|
65
|
-
- `Default Value` rules:
|
|
66
|
-
- use confirmed business, UI, or runtime defaults
|
|
67
|
-
- if the default comes from settings or environment, state that clearly
|
|
68
|
-
- if not finalized, use `TBD` and keep or raise an open-question reference in `Note`
|
|
69
|
-
- If screen labels conflict with canonical API/DB naming, preserve the original screen label in the visible screen columns, but keep `Attribute` and `DB Column` aligned to API/DB source of truth and explain the mismatch in `Note`.
|
|
70
|
-
|
|
71
|
-
### 3.2 Language and Encoding Standards (EN Artifacts)
|
|
72
|
-
|
|
73
|
-
- For EN artifacts (`docs/en/**` or explicitly requested EN version), narrative text must be English.
|
|
74
|
-
- JP labels, if provided by the input, should be kept in a clearly marked appendix or note column, not in the default item table columns.
|
|
75
|
-
- Do not leave mixed-language fragments in one sentence/cell (for example VI+EN mixed text).
|
|
76
|
-
- If original VI/JP text is required for traceability, keep it in a clearly marked appendix block (`Original Text`), then provide EN translation.
|
|
77
|
-
- Save files as UTF-8 and avoid mojibake/broken glyphs (`�`, `ↁE`, garbled sequences).
|
|
78
|
-
- Keep canonical terminology stable across documents (for example: `resource`, `task`, `external member`).
|
|
79
|
-
|
|
80
|
-
### 3.3 Markdown Structure Hygiene
|
|
81
|
-
|
|
82
|
-
- Keep each heading on its own line; do not concatenate multiple headings/sections on one line.
|
|
83
|
-
- Keep metadata blocks (`Information`, `Note`, `Behavior notes`) as structured bullet blocks, not single compressed lines.
|
|
84
|
-
- Keep image, table, and separator (`---`) boundaries explicit to preserve parser/render stability.
|
|
85
|
-
|
|
86
|
-
### 3.4 Assumptions Section
|
|
87
|
-
|
|
88
|
-
- Every flow-action spec must include a top-level `## Assumptions` section.
|
|
89
|
-
- Use this table format exactly: `# | Assumption | Verified | Risk if wrong`.
|
|
90
|
-
- Keep assumptions explicit when downstream mapping or behavior depends on an unresolved decision.
|
|
91
|
-
- If an assumption affects UI behavior, API mapping, or DB mapping, reflect the risk in `Note` and keep or raise the related `OQ-xx` item.
|
|
92
|
-
|
|
93
|
-
## 4. Item Numbering and Duplication Rules
|
|
94
|
-
|
|
95
|
-
- Use one numbering mode only: `global across document`.
|
|
96
|
-
- Number values must increase across all action tables in the document.
|
|
97
|
-
- DESIGN_LAYOUT wireframe markers are a separate screen-local visual system. They may reset per screen and do not need to numerically equal the global action-table `No`.
|
|
98
|
-
- Avoid duplicate item descriptions for the same UI control across screens unless behavior differs.
|
|
99
|
-
- If duplicate number is intentional (rare), annotate reason in `Note`.
|
|
100
|
-
|
|
101
|
-
## 5. Screen Section Rules
|
|
102
|
-
|
|
103
|
-
For each screen section:
|
|
104
|
-
|
|
105
|
-
- Provide metadata:
|
|
106
|
-
- official screen name
|
|
107
|
-
- Screen ID
|
|
108
|
-
- Design Source Type
|
|
109
|
-
- Design Source Reference
|
|
110
|
-
- Embed one representative image per screen (from Figma, screenshot, or generated layout).
|
|
111
|
-
- Provide one action table.
|
|
112
|
-
- Provide one API mapping table.
|
|
113
|
-
- If a screen has dialogs, create explicit dialog sub-sections with their own tables and API mapping.
|
|
114
|
-
|
|
115
|
-
## 5.1 Design Source Modes
|
|
116
|
-
|
|
117
|
-
Each screen section must declare a design source using one of these modes:
|
|
118
|
-
|
|
119
|
-
| Mode | When | Design Source Reference |
|
|
120
|
-
|------|------|----------------------|
|
|
121
|
-
| `source-backed` | Figma URL or screenshot is available | Figma URL or screenshot path |
|
|
122
|
-
| `generated-draft` | No Figma/screenshot, but feature has UI scope | Section reference in `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` |
|
|
123
|
-
| `none` | Feature has no UI scope for this screen | State `N/A - no UI scope` |
|
|
124
|
-
|
|
125
|
-
Rules:
|
|
126
|
-
- For UI-scope features, `none` is only valid when the specific screen truly has no visual layout.
|
|
127
|
-
- When using `generated-draft`, the `DESIGN_LAYOUT_[FEATURE_KEY].md` must exist before the flow-action spec is finalized.
|
|
128
|
-
- The flow-action spec and the design-layout doc must remain separate documents.
|
|
129
|
-
- When Figma becomes available later, update the source mode from `generated-draft` to `source-backed`.
|
|
130
|
-
|
|
131
|
-
## 5.2 Wireframe Marker Mapping for Generated-Draft Screens
|
|
132
|
-
|
|
133
|
-
For generated-draft screens with rendered design-layout images:
|
|
134
|
-
|
|
135
|
-
- Treat wireframe markers as screen-local visual references only.
|
|
136
|
-
- Keep action-table `No` global across the document per section 4.
|
|
137
|
-
- Add a wireframe marker mapping table directly under the screen image.
|
|
138
|
-
- Use this stable header:
|
|
139
|
-
- `No | Wireframe Marker | Action Table No | Item Name | Notes`
|
|
140
|
-
- Map only the items visibly present on the wireframe image.
|
|
141
|
-
- If an action-table row is not visible on the wireframe, state `Not shown on wireframe` in `Notes` instead of inventing a marker.
|
|
142
|
-
- If the wireframe label and the action-table label differ slightly, keep the action-table item name and explain the label difference in `Notes`.
|
|
143
|
-
|
|
144
|
-
## 6. API Traceability Rules
|
|
145
|
-
|
|
146
|
-
- Every actionable UI event that changes state must map to a write API.
|
|
147
|
-
- Every data-loading UI event must map to a read/search API.
|
|
148
|
-
- If one endpoint serves multiple actions (initial load, search, refresh), state this explicitly.
|
|
149
|
-
- If no API is called for an action, state `No API` and explain why.
|
|
150
|
-
|
|
151
|
-
## 7. PlantUML Rules for Screen Flow
|
|
152
|
-
|
|
153
|
-
- Use new-style PlantUML activity diagram syntax only for screen-flow diagrams.
|
|
154
|
-
- Allowed activity constructs include: `start`, `stop`, `partition "..." {}`, `:Activity;`, `->`, `if/then/else/endif`, `fork`, `fork again`, `end fork`, and `note right/left`.
|
|
155
|
-
- Do not mix legacy activity syntax such as `(*)`, `-->`, or `[edge label]` with new-style activity actions like `:Activity;`.
|
|
156
|
-
- Validate renderability before handoff. If a renderer is unavailable in the current environment, at minimum keep the block internally consistent with new-style activity syntax only.
|
|
157
|
-
- Use `\\n` for multi-line labels in activity nodes and notes.
|
|
158
|
-
- Keep diagram at navigation/action level (not low-level SQL or backend internals).
|
|
159
|
-
- Ensure screen names in PlantUML match section names in layout spec.
|
|
160
|
-
|
|
161
|
-
## 8. Data Source and Asset Rules
|
|
162
|
-
|
|
163
|
-
- Prioritize source order:
|
|
164
|
-
1. Confirmed design source (for example Figma)
|
|
165
|
-
2. Confirmed requirement files (Excel/spec)
|
|
166
|
-
3. User-provided screenshots
|
|
167
|
-
- Store images in repository-relative filesystem paths.
|
|
168
|
-
- Reference images in markdown using file-relative paths from the spec file's directory.
|
|
169
|
-
- Do not keep temporary local absolute paths in markdown.
|
|
170
|
-
|
|
171
|
-
### 8.1 Rendered Screen Images for Generated-Draft Screens
|
|
172
|
-
|
|
173
|
-
When `Design Source Type` is `generated-draft`:
|
|
174
|
-
- Screen preview images may be rendered from `DESIGN_LAYOUT_[FEATURE_KEY].md` PlantUML SALT wireframes.
|
|
175
|
-
- Renderer: `toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py`
|
|
176
|
-
- Expected output path (filesystem): `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
|
|
177
|
-
- Markdown image path (file-relative from `docs/specs/*_FLOW_ACTION_SPEC.md`): `assets/<feature_snake>/screens/<screen_id>.svg`
|
|
178
|
-
- DESIGN_LAYOUT markers inside the image are screen-local visual references and may reset per screen; use the wireframe mapping table to bridge them to the global action-table `No`.
|
|
179
|
-
- If the rendered `.svg` file exists, use the file-relative markdown path in the `Screen image:` reference.
|
|
180
|
-
- If rendering is unavailable or the `.svg` does not exist, replace the image line with:
|
|
181
|
-
`> Screen image not rendered in this environment. See Design Source Reference for layout.`
|
|
182
|
-
- Do not leave a broken image reference pointing to a non-existent file.
|
|
183
|
-
|
|
184
|
-
## 9. Consistency with Other Specs
|
|
185
|
-
|
|
186
|
-
- Align terms with:
|
|
187
|
-
- BA spec glossary
|
|
188
|
-
- API endpoints spec
|
|
189
|
-
- Database spec
|
|
190
|
-
- If terminology differs across docs, raise an open question and add a temporary mapping note.
|
|
191
|
-
- Keep endpoint paths in flow-action spec consistent with API endpoint spec.
|
|
192
|
-
|
|
193
|
-
## 10. Open Questions and Uncertainty Handling
|
|
194
|
-
|
|
195
|
-
- Capture unresolved items in `Open questions` table.
|
|
196
|
-
- Do not invent UI behavior or API contracts when source is ambiguous.
|
|
197
|
-
- Mark uncertain mappings as `Draft` and include impacted files/sections.
|
|
198
|
-
|
|
199
|
-
## 11. Change Management
|
|
200
|
-
|
|
201
|
-
- On each update:
|
|
202
|
-
- update impacted screen sections
|
|
203
|
-
- update API mapping tables
|
|
204
|
-
- update screen-to-API mapping summary
|
|
205
|
-
- append one row in document history
|
|
206
|
-
- Never overwrite past history rows.
|
|
207
|
-
|
|
208
|
-
## 12. Final Checklist Before Handoff
|
|
209
|
-
|
|
210
|
-
- PlantUML renders successfully.
|
|
211
|
-
- All mandatory sections exist.
|
|
212
|
-
- All tables include `No`.
|
|
213
|
-
- Numbering is global across the document (no resets).
|
|
214
|
-
- No broken image links (for `generated-draft` screens: `.svg` exists or render-skipped note is present).
|
|
215
|
-
- Screen/API mappings are consistent with `*_ENDPOINTS.md`.
|
|
216
|
-
- Assumptions section exists and unresolved assumptions are traceable.
|
|
217
|
-
- Open questions are explicit and traceable.
|
|
218
|
-
- For EN artifact: no leftover VI text outside allowed `Original Text` appendix blocks.
|
|
219
|
-
- No mojibake/encoding corruption markers.
|
|
220
|
-
- Headings/tables are structurally clean (no merged lines that break readability/traceability).
|