sdtk-kit 0.3.8 → 1.0.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.
Files changed (113) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +123 -177
  3. package/package.json +52 -46
  4. package/scripts/postinstall.js +40 -0
  5. package/assets/manifest/toolkit-bundle.manifest.json +0 -473
  6. package/assets/manifest/toolkit-bundle.sha256.txt +0 -93
  7. package/assets/toolkit/toolkit/AGENTS.md +0 -131
  8. package/assets/toolkit/toolkit/install.ps1 +0 -270
  9. package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +0 -54
  10. package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +0 -32
  11. package/assets/toolkit/toolkit/scripts/init-feature.ps1 +0 -261
  12. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +0 -129
  13. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +0 -189
  14. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +0 -139
  15. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +0 -116
  16. package/assets/toolkit/toolkit/sdtk.config.json +0 -28
  17. package/assets/toolkit/toolkit/sdtk.config.profiles.example.json +0 -50
  18. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +0 -84
  19. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +0 -22
  20. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  21. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/FLOWCHART_CREATION_RULES.md +0 -20
  22. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +0 -656
  23. package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +0 -43
  24. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  25. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/FLOWCHART_CREATION_RULES.md +0 -20
  26. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/YAML_CREATION_RULES.md +0 -128
  27. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +0 -83
  28. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +0 -22
  29. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  30. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOWCHART_CREATION_RULES.md +0 -20
  31. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -200
  32. package/assets/toolkit/toolkit/skills/sdtk-arch/references/YAML_CREATION_RULES.md +0 -128
  33. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +0 -29
  34. package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +0 -41
  35. package/assets/toolkit/toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py +0 -213
  36. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +0 -90
  37. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/code-quality-reviewer.md +0 -35
  38. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/implementer.md +0 -61
  39. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/spec-reviewer.md +0 -42
  40. package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +0 -21
  41. package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +0 -19
  42. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +0 -80
  43. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +0 -30
  44. package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +0 -53
  45. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +0 -73
  46. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -200
  47. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md +0 -51
  48. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md +0 -54
  49. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +0 -76
  50. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py +0 -136
  51. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +0 -249
  52. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +0 -74
  53. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md +0 -129
  54. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py +0 -97
  55. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +0 -302
  56. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +0 -76
  57. package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +0 -47
  58. package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +0 -72
  59. package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +0 -50
  60. package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +0 -25
  61. package/assets/toolkit/toolkit/skills-claude/dev/SKILL.md +0 -45
  62. package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +0 -20
  63. package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +0 -18
  64. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +0 -63
  65. package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +0 -52
  66. package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +0 -48
  67. package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +0 -68
  68. package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +0 -61
  69. package/assets/toolkit/toolkit/templates/QUALITY_CHECKLIST.md +0 -124
  70. package/assets/toolkit/toolkit/templates/README.md +0 -63
  71. package/assets/toolkit/toolkit/templates/SHARED_PLANNING.md +0 -80
  72. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +0 -22
  73. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +0 -67
  74. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  75. package/assets/toolkit/toolkit/templates/docs/api/API_ENDPOINTS_TEMPLATE.md +0 -229
  76. package/assets/toolkit/toolkit/templates/docs/api/FEATURE_API_TEMPLATE.yaml +0 -20
  77. package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +0 -20
  78. package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +0 -128
  79. package/assets/toolkit/toolkit/templates/docs/api/feature_api_flow_list_TEMPLATE.txt +0 -12
  80. package/assets/toolkit/toolkit/templates/docs/architecture/ARCH_DESIGN_TEMPLATE.md +0 -109
  81. package/assets/toolkit/toolkit/templates/docs/database/DATABASE_SPEC_TEMPLATE.md +0 -175
  82. package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +0 -49
  83. package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +0 -73
  84. package/assets/toolkit/toolkit/templates/docs/product/BACKLOG_TEMPLATE.md +0 -50
  85. package/assets/toolkit/toolkit/templates/docs/product/PRD_TEMPLATE.md +0 -66
  86. package/assets/toolkit/toolkit/templates/docs/product/PROJECT_INITIATION_TEMPLATE.md +0 -98
  87. package/assets/toolkit/toolkit/templates/docs/qa/QA_RELEASE_REPORT_TEMPLATE.md +0 -61
  88. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md +0 -129
  89. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_TEMPLATE.md +0 -104
  90. package/assets/toolkit/toolkit/templates/docs/specs/BA_SPEC_TEMPLATE.md +0 -139
  91. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -200
  92. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +0 -172
  93. package/assets/toolkit/toolkit/templates/handoffs/ARCH_TO_DEV.md +0 -31
  94. package/assets/toolkit/toolkit/templates/handoffs/BA_TO_ARCH.md +0 -28
  95. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE1_SPEC_REVIEW.md +0 -26
  96. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE2_CODE_QUALITY_REVIEW.md +0 -20
  97. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_QA.md +0 -23
  98. package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +0 -26
  99. package/assets/toolkit/toolkit/templates/handoffs/QA_RELEASE_DECISION.md +0 -21
  100. package/bin/sdtk.js +0 -15
  101. package/src/commands/auth.js +0 -85
  102. package/src/commands/generate.js +0 -177
  103. package/src/commands/help.js +0 -101
  104. package/src/commands/init.js +0 -97
  105. package/src/commands/runtime.js +0 -217
  106. package/src/index.js +0 -59
  107. package/src/lib/args.js +0 -116
  108. package/src/lib/errors.js +0 -41
  109. package/src/lib/github-access.js +0 -68
  110. package/src/lib/powershell.js +0 -85
  111. package/src/lib/scope.js +0 -68
  112. package/src/lib/state.js +0 -83
  113. package/src/lib/toolkit-payload.js +0 -99
@@ -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/schedule_whiteboard_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/{company_uuid}` uses pseudo `UPSERT` wording. This is acceptable because it is a shared upsert-style API, not a search API.
25
- - `GET /api/whiteboard/assignment/{company_uuid}/{sagyo_assign_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/schedule_whiteboard_api_flow_list.txt`
31
- - `docs/api/api_design_detail.md`
32
- - `Example/Docs/API/bukken-api-flowchart-list.txt`
33
-
34
- Primary sample references:
35
- - `POST /bukken/{company_uuid}` style
36
- - `POST /bukken/edit/{company_uuid}/{bukken_uuid}` style
37
- - `POST /bukken/delete-parmanent/{company_uuid}/{bukken_uuid}` style
38
- - `GET /bukken/info/{company_uuid}/{bukken_uuid}` style
39
- - search API query-builder style shown in the Bukken 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 Bukken 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 employee/customer-employee 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
- - `CLD_DAT_BUKKEN_INFO`
144
- - `CLD_DAT_BUKKEN_SAGYO_ASSIGN_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.department_uuids not null && data.info.department_uuids not empty) then (yes)
177
- :condition += " AND ( 1 != 1 ";
178
- repeat
179
- :Get departmentObject from data.info.department_uuids;
180
- :condition += " OR E.DEPARTMENT_UUID = <departmentObject.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 department 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 CLD_DAT_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 CLD_DAT_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 CLD_DAT_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 CLD_DAT_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 CLD_DAT_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 CLD_DAT_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 CLD_DAT_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 CLD_DAT_XXX with parameter value
375
- ...
376
- :GET inserted_xxx_uuid = XXX_UUID value when Insert into CLD_DAT_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 CLD_DAT_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.
@@ -1,128 +0,0 @@
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/{company_uuid}/{parent_uuid}`
41
- - search: `POST /{resource}/search/{company_uuid}`
42
- - view-specific search: `POST /{resource}/bukken-view/search/{company_uuid}`
43
- - create: `POST /{resource}/{company_uuid}`
44
- - detail: `GET /{resource}/{company_uuid}/{resource_uuid}`
45
- - edit: `POST /{resource}/edit/{company_uuid}/{resource_uuid}`
46
- - delete: `POST /{resource}/delete/{company_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 + sagyo_assign_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
- - `bukken`
73
- - `sagyo`
74
- - `sagyoin`
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
- - Search/list APIs document filter semantics and ordering when relevant.
@@ -1,83 +0,0 @@
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
- ## 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.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 benchmark runs, apply `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`: keep benchmark-expected open questions explicitly OPEN unless the requirement source resolves them.
67
- 12. If anything is unclear, record OQ-xx in ARCH_DESIGN "Open Questions" and escalate to `@pm` for a decision.
68
- 13. Update shared state + Phase 3 checklist.
69
- 14. Handoff: `@dev please implement ...`.
70
-
71
- ## Order-Critical Hard Gate
72
- 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.
73
-
74
- 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.
75
-
76
-
77
- ## Common Mistakes
78
-
79
- | Mistake | Why it is wrong | Do instead |
80
- |---|---|---|
81
- | 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 |
82
- | 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 |
83
- | Close open questions silently during ARCH | Hides unresolved design decisions from downstream roles | Record `OQ-xx` explicitly and escalate through `@pm` |