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,22 +0,0 @@
1
- # API DESIGN 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 active rule source for API design detail and API flowchart behavior is now:
7
- - `API_DESIGN_FLOWCHART_CREATION_RULES_FINAL.md` (root)
8
- - `templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` (toolkit)
9
-
10
- Even in compatibility mode, generated API design detail docs must still include:
11
- - a top-level `## Assumptions` section
12
- - this table format: `| # | Assumption | Verified | Risk if wrong |`
13
- - explicit unresolved assumptions when downstream review depends on them
14
-
15
- Use the active rule file for:
16
- - API design detail markdown structure
17
- - flowchart integration and synchronization rules
18
- - error section rules
19
- - flow summary / notes / login rules
20
- - assumptions-section requirements
21
-
22
- This compatibility note should remain only until all references are migrated.
@@ -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.