sdtk-spec-kit 0.3.10 → 0.3.12

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 (40) hide show
  1. package/README.md +219 -197
  2. package/assets/manifest/toolkit-bundle.manifest.json +72 -57
  3. package/assets/manifest/toolkit-bundle.sha256.txt +30 -27
  4. package/assets/toolkit/toolkit/README.md +50 -0
  5. package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +185 -0
  6. package/assets/toolkit/toolkit/install.ps1 +347 -310
  7. package/assets/toolkit/toolkit/scripts/init-feature.ps1 +2 -1
  8. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +84 -84
  9. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
  10. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
  11. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/YAML_CREATION_RULES.md +127 -127
  12. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +85 -83
  13. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
  14. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +220 -220
  15. package/assets/toolkit/toolkit/skills/sdtk-arch/references/YAML_CREATION_RULES.md +127 -127
  16. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +108 -102
  17. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +97 -81
  18. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +37 -30
  19. package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +75 -61
  20. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +220 -220
  21. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +90 -90
  22. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +25 -53
  23. package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +12 -6
  24. package/assets/toolkit/toolkit/templates/QUALITY_CHECKLIST.md +124 -124
  25. package/assets/toolkit/toolkit/templates/README.md +1 -0
  26. package/assets/toolkit/toolkit/templates/SHARED_PLANNING.md +81 -81
  27. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
  28. package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +127 -127
  29. package/assets/toolkit/toolkit/templates/docs/database/DATABASE_SPEC_TEMPLATE.md +174 -174
  30. package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +106 -96
  31. package/assets/toolkit/toolkit/templates/docs/qa/CONTROLLER_ACCEPTANCE_TEMPLATE.md +90 -0
  32. package/assets/toolkit/toolkit/templates/docs/qa/QA_RELEASE_REPORT_TEMPLATE.md +162 -95
  33. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +220 -220
  34. package/package.json +20 -20
  35. package/src/commands/help.js +26 -10
  36. package/src/commands/init.js +108 -105
  37. package/src/commands/update.js +11 -0
  38. package/src/index.js +62 -59
  39. package/src/lib/project-target-guard.js +53 -0
  40. package/src/lib/update.js +333 -0
@@ -1,128 +1,128 @@
1
- # YAML CREATION RULES FINAL
2
-
3
- This file is the canonical rule set for designing and maintaining feature-level OpenAPI YAML.
4
-
5
- Use this file for:
6
- - OpenAPI YAML contract design
7
- - endpoint path/method decisions
8
- - request/response schema design
9
- - endpoint summary and contract consistency checks
10
-
11
- Do not use this file as the primary rule source for:
12
- - flowchart writing details
13
- - API design detail markdown layout
14
-
15
- Use `API_DESIGN_FLOWCHART_CREATION_RULES_FINAL.md` for those.
16
-
17
- ## 1. Rule Precedence
18
- - Priority 1: follow the existing system's real route, method, payload, and response conventions.
19
- - Priority 2: match the current source code and runtime behavior.
20
- - Priority 3: apply the reusable standards in this document.
21
- - If a reusable rule conflicts with the target system, keep the system rule and document the exception explicitly.
22
-
23
- ## 2. API Scope Classification
24
- - Every endpoint must be classified as one of:
25
- - `New`
26
- - `Deferred`
27
- - `Existing (reuse)`
28
- - Do not silently create a new feature-local API if an existing system API already provides the same behavior with a compatible contract.
29
- - If the existing API is close in purpose but payload or response is incompatible with the feature need, create a bounded new API.
30
-
31
- ## 3. Endpoint Path Design
32
- - Use singular resource names in endpoint paths.
33
- - Use explicit action segments only when needed by system convention:
34
- - `list`
35
- - `search`
36
- - `edit`
37
- - `delete`
38
- - `multi-create`
39
- - Prefer stable system-style patterns such as:
40
- - list: `GET /{resource}/list/{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.
1
+ # YAML CREATION RULES FINAL
2
+
3
+ This file is the canonical rule set for designing and maintaining feature-level OpenAPI YAML.
4
+
5
+ Use this file for:
6
+ - OpenAPI YAML contract design
7
+ - endpoint path/method decisions
8
+ - request/response schema design
9
+ - endpoint summary and contract consistency checks
10
+
11
+ Do not use this file as the primary rule source for:
12
+ - flowchart writing details
13
+ - API design detail markdown layout
14
+
15
+ Use `API_DESIGN_FLOWCHART_CREATION_RULES_FINAL.md` for those.
16
+
17
+ ## 1. Rule Precedence
18
+ - Priority 1: follow the existing system's real route, method, payload, and response conventions.
19
+ - Priority 2: match the current source code and runtime behavior.
20
+ - Priority 3: apply the reusable standards in this document.
21
+ - If a reusable rule conflicts with the target system, keep the system rule and document the exception explicitly.
22
+
23
+ ## 2. API Scope Classification
24
+ - Every endpoint must be classified as one of:
25
+ - `New`
26
+ - `Deferred`
27
+ - `Existing (reuse)`
28
+ - Do not silently create a new feature-local API if an existing system API already provides the same behavior with a compatible contract.
29
+ - If the existing API is close in purpose but payload or response is incompatible with the feature need, create a bounded new API.
30
+
31
+ ## 3. Endpoint Path Design
32
+ - Use singular resource names in endpoint paths.
33
+ - Use explicit action segments only when needed by system convention:
34
+ - `list`
35
+ - `search`
36
+ - `edit`
37
+ - `delete`
38
+ - `multi-create`
39
+ - Prefer stable system-style patterns such as:
40
+ - list: `GET /{resource}/list/{organization_uuid}/{parent_uuid}`
41
+ - search: `POST /{resource}/search/{organization_uuid}`
42
+ - view-specific search: `POST /{resource}/resource-view/search/{organization_uuid}`
43
+ - create: `POST /{resource}/{organization_uuid}`
44
+ - detail: `GET /{resource}/{organization_uuid}/{resource_uuid}`
45
+ - edit: `POST /{resource}/edit/{organization_uuid}/{resource_uuid}`
46
+ - delete: `POST /{resource}/delete/{organization_uuid}/{resource_uuid}`
47
+ - Separate namespaces by bounded context.
48
+ - Do not repeat namespace meaning in child path segments.
49
+
50
+ ## 4. Request Contract Rules
51
+ - For feature-owned POST search and write APIs, prefer a stable wrapper:
52
+ - `data: { ... }`
53
+ - For complex filters, place fields under:
54
+ - `data.info`
55
+ - If reusing an existing system API, keep the owning module's contract shape exactly as-is.
56
+ - Do not force reused APIs into the feature wrapper pattern.
57
+ - If a payload field changes behavior, the field must be explicit in the schema and must not remain only in examples.
58
+
59
+ ## 5. Response Contract Rules
60
+ - Success responses must include `status` at minimum.
61
+ - Create APIs should return the minimum new identifier required by the caller.
62
+ - Example: `status + task_assignment_uuid`
63
+ - Edit and delete APIs should return status-only unless the target system has a stronger standard.
64
+ - Pre-check or validation helper APIs should return only the minimum boolean or status needed by the UI.
65
+ - Do not return detail payloads the UI does not consume.
66
+ - Do not add FE-only visual helper payloads when the client can derive them safely.
67
+ - Example: remove `timeline_backgrounds` if the frontend renders timeline lines from existing data.
68
+
69
+ ## 6. Naming and Field Mapping Rules
70
+ - Use canonical business-domain terminology from the system glossary and database.
71
+ - Prefer actual system terms such as:
72
+ - `resource`
73
+ - `task`
74
+ - `assignee`
75
+ - `certification`
76
+ - Avoid legacy aliases when an official term already exists.
77
+ - Field names should align with database semantics when they represent the same concept.
78
+ - If the DB uses a string state code, the API field must not be modeled as an integer.
79
+ - If a field is date-only (`format: date`), include the display format in the description.
80
+ - Example: `Start date (YYYYMMDD)`
81
+
82
+ ## 7. Search and List API Rules
83
+ - One search API may serve multiple UI actions when the logic is the same:
84
+ - initial load
85
+ - search button
86
+ - refresh after mode/date change
87
+ - If one endpoint serves multiple UI actions, document that explicitly in YAML description and endpoint docs.
88
+ - Search APIs must define filter combination semantics clearly:
89
+ - AND across different fields
90
+ - OR within each `*_uuids` array
91
+ - If UI rendering depends on stable order, the YAML description must state the confirmed ORDER BY logic.
92
+
93
+ ## 8. Split vs Reuse Rules
94
+ - Split read/search endpoints when the FE needs materially different grouped or view-shaped datasets.
95
+ - Merge or remove helper payloads when they add maintenance cost without business value.
96
+ - Reuse existing platform APIs when behavior already exists and only a feature-level mapping layer is needed.
97
+ - Example: reuse shared environment setting APIs instead of creating feature-local setting APIs.
98
+
99
+ ## 9. Sample Data Rules
100
+ - For fields declared as `format: uuid`, use canonical UUID samples.
101
+ - Example: `123e4567-e89b-12d3-a456-426614174000`
102
+ - Do not use placeholder UUID-like labels such as:
103
+ - `customer-uuid-001`
104
+ - `assign-uuid-001`
105
+ - Keep sample data deterministic and internally consistent across request and response examples.
106
+
107
+ ## 10. Cross-Artifact Consistency Rules
108
+ - The YAML contract is the source of truth for:
109
+ - endpoint path
110
+ - method
111
+ - request wrapper
112
+ - response shape
113
+ - After any YAML contract change, sync these artifacts:
114
+ - endpoint markdown
115
+ - flow list
116
+ - PlantUML flow assets
117
+ - API design detail markdown
118
+ - If any artifact cannot yet be synced, note the mismatch explicitly rather than leaving stale content.
119
+
120
+ ## 11. Minimum YAML Quality Gate
121
+ - Path/method follow the target system convention.
122
+ - API type is classified (`New`, `Deferred`, `Existing (reuse)`).
123
+ - Request/response wrappers are stable and explicit.
124
+ - FE-only helper payloads are removed.
125
+ - Field names and types match DB semantics.
126
+ - UUID examples are valid UUIDs.
127
+ - Date descriptions include display format where needed.
128
128
  - Search/list APIs document filter semantics and ordering when relevant.
@@ -1,175 +1,175 @@
1
- # DATABASE SPECIFICATION: {{FEATURE_KEY}}
2
-
3
- **Document ID:** DATABASE_SPEC_{{FEATURE_KEY}}
4
- **Version:** 1.0.0
5
- **Date:** {{DATE}}
6
- **Author:** ARCH Agent
7
- **Status:** DRAFT
8
- **Source:** `docs/specs/BA_SPEC_{{FEATURE_KEY}}.md`, `docs/architecture/ARCH_DESIGN_{{FEATURE_KEY}}.md`
9
-
10
- ---
11
-
12
- ## Abbreviations
13
-
14
- | No | Abbreviation | Meaning |
15
- | ---: | --- | --- |
16
- | 1 | DB | Database |
17
- | 2 | PK | Primary Key |
18
- | 3 | FK | Foreign Key |
19
- | 4 | ERD | Entity Relationship Diagram |
20
- | 5 | OQ | Open Question |
21
-
22
- ---
23
-
24
- ## Table of Contents
25
-
26
- 1. [Overview](#1-overview)
27
- 2. [ERD Diagram (PlantUML)](#2-erd-diagram-plantuml)
28
- 3. [Core Tables](#3-core-tables)
29
- 4. [Related/Referenced Tables](#4-relatedreferenced-tables)
30
- 5. [Settings Storage](#5-settings-storage)
31
- 6. [Indexes & Constraints](#6-indexes--constraints)
32
- 7. [Open Questions](#7-open-questions)
33
- 8. [Document History](#document-history)
34
-
35
- ---
36
-
37
- ## 1. Overview
38
-
39
- ### 1.1 Scope
40
- - Describe database scope for `{{FEATURE_NAME}}`.
41
- - Clarify whether each table is new/modified/reused.
42
-
43
- ### 1.2 Table Categories
44
-
45
- | No | Category | Tables | Purpose |
46
- | ---: | --- | --- | --- |
47
- | 1 | Core (New/Modified) | TBD | Main feature tables |
48
- | 2 | Referenced (Existing) | TBD | Existing tables reused by feature |
49
- | 3 | Settings | TBD | Configuration storage |
50
-
51
- ### 1.3 Naming Conventions
52
-
53
- | No | Prefix | Type | Example |
54
- | ---: | --- | --- | --- |
55
- | 1 | `cld_dat_` | Data table | `cld_dat_example_info` |
56
- | 2 | `cld_mst_` | Master table | `cld_mst_example_info` |
57
-
58
- ---
59
-
60
- ## 2. ERD Diagram (PlantUML)
61
-
62
- ```plantuml
63
- @startuml {{FEATURE_KEY}}_ERD
64
- !define TABLE(name) entity name << (T,#FFAAAA) >>
65
- !define PK(x) <b><u>x</u></b>
66
- !define FK(x) <i>x</i>
67
-
68
- skinparam linetype ortho
69
- skinparam entity {
70
- BackgroundColor #FEFEFE
71
- BorderColor #333333
72
- ArrowColor #666666
73
- }
74
-
75
- title {{FEATURE_NAME}} - Entity Relationship Diagram
76
-
77
- TABLE(cld_dat_example_info) {
78
- PK(example_uuid) : UUID
79
- --
80
- FK(parent_uuid) : UUID <<nullable>>
81
- name : VARCHAR
82
- start_dt : DATETIME <<nullable>>
83
- end_dt : DATETIME <<nullable>>
84
- --
85
- CREATE_DT : DATETIME
86
- UPDATE_DT : DATETIME
87
- }
88
-
89
- @enduml
90
- ```
91
-
92
- ### 2.1 ERD Summary
93
- - Summarize key relations and ownership boundaries.
94
-
95
- ---
96
-
97
- ## 3. Core Tables
98
-
99
- ### 3.1 cld_dat_example_info (Example Info)
100
-
101
- | No | Column Name (JP) | Column Name | Data Type | Size | Key | Nullable | Default | Description |
102
- | ---: | --- | --- | --- | --- | --- | --- | --- | --- |
103
- | 1 | Example UUID (JP) | example_uuid | UUID | - | PK | No | - | Primary key |
104
- | 2 | Parent UUID (JP) | parent_uuid | UUID | - | FK | Yes | NULL | Parent reference |
105
-
106
- ### 3.2 cld_dat_example_detail_info (Example Detail)
107
-
108
- | No | Column Name (JP) | Column Name | Data Type | Size | Key | Nullable | Default | Description |
109
- | ---: | --- | --- | --- | --- | --- | --- | --- | --- |
110
- | 1 | Detail UUID (JP) | example_detail_uuid | UUID | - | PK | No | - | Primary key |
111
-
112
- ---
113
-
114
- ## 4. Related/Referenced Tables
115
-
116
- ### 4.1 cld_dat_related_info (Related Entity)
117
-
118
- | No | Key Column | Type | Description |
119
- | ---: | --- | --- | --- |
120
- | 1 | related_uuid | UUID | Referenced by core table |
121
-
122
- ---
123
-
124
- ## 5. Settings Storage
125
-
126
- ### 5.1 Environment Settings Table
127
-
128
- | No | Setting | category1 | category2 | key | value_type | Example Value | Description |
129
- | ---: | --- | --- | --- | --- | --- | --- | --- |
130
- | 1 | TBD | TBD | TBD | TBD | string | TBD | TBD |
131
-
132
- ---
133
-
134
- ## 6. Indexes & Constraints
135
-
136
- ### 6.1 Recommended Indexes
137
-
138
- #### cld_dat_example_info
139
-
140
- | No | Index Name | Columns | Type | Purpose |
141
- | ---: | --- | --- | --- | --- |
142
- | 1 | idx_example_parent | parent_uuid | BTREE | Parent lookup |
143
-
144
- ### 6.2 Foreign Key Constraints
145
-
146
- | No | Constraint Name | From Table.Column | To Table.Column | On Update | On Delete |
147
- | ---: | --- | --- | --- | --- | --- |
148
- | 1 | fk_example_parent | cld_dat_example_info.parent_uuid | cld_dat_related_info.related_uuid | RESTRICT | SET NULL |
149
-
150
- ### 6.3 Check Constraints
151
-
152
- | No | Constraint Name | Expression | Purpose |
153
- | ---: | --- | --- | --- |
154
- | 1 | chk_example_range | start_dt < end_dt | Validate datetime range |
155
-
156
- ---
157
-
158
- ## 7. Open Questions
159
-
160
- ### 7.1 Questions Requiring Clarification
161
-
162
- | No | Q-ID | Area | Question | Impact | Priority | Status | Resolution |
163
- | ---: | --- | --- | --- | --- | --- | --- | --- |
164
- | 1 | Q-01 | Schema | TBD | TBD | High | OPEN | TBD |
165
-
166
- ### 7.2 Missing Information
167
- - List unresolved schema details (size/default/nullability/code maps).
168
-
169
- ---
170
-
171
- ## Document History
172
-
173
- | No | Version | Date | Author | Changes |
174
- | ---: | --- | --- | --- | --- |
1
+ # DATABASE SPECIFICATION: {{FEATURE_KEY}}
2
+
3
+ **Document ID:** DATABASE_SPEC_{{FEATURE_KEY}}
4
+ **Version:** 1.0.0
5
+ **Date:** {{DATE}}
6
+ **Author:** ARCH Agent
7
+ **Status:** DRAFT
8
+ **Source:** `docs/specs/BA_SPEC_{{FEATURE_KEY}}.md`, `docs/architecture/ARCH_DESIGN_{{FEATURE_KEY}}.md`
9
+
10
+ ---
11
+
12
+ ## Abbreviations
13
+
14
+ | No | Abbreviation | Meaning |
15
+ | ---: | --- | --- |
16
+ | 1 | DB | Database |
17
+ | 2 | PK | Primary Key |
18
+ | 3 | FK | Foreign Key |
19
+ | 4 | ERD | Entity Relationship Diagram |
20
+ | 5 | OQ | Open Question |
21
+
22
+ ---
23
+
24
+ ## Table of Contents
25
+
26
+ 1. [Overview](#1-overview)
27
+ 2. [ERD Diagram (PlantUML)](#2-erd-diagram-plantuml)
28
+ 3. [Core Tables](#3-core-tables)
29
+ 4. [Related/Referenced Tables](#4-relatedreferenced-tables)
30
+ 5. [Settings Storage](#5-settings-storage)
31
+ 6. [Indexes & Constraints](#6-indexes--constraints)
32
+ 7. [Open Questions](#7-open-questions)
33
+ 8. [Document History](#document-history)
34
+
35
+ ---
36
+
37
+ ## 1. Overview
38
+
39
+ ### 1.1 Scope
40
+ - Describe database scope for `{{FEATURE_NAME}}`.
41
+ - Clarify whether each table is new/modified/reused.
42
+
43
+ ### 1.2 Table Categories
44
+
45
+ | No | Category | Tables | Purpose |
46
+ | ---: | --- | --- | --- |
47
+ | 1 | Core (New/Modified) | TBD | Main feature tables |
48
+ | 2 | Referenced (Existing) | TBD | Existing tables reused by feature |
49
+ | 3 | Settings | TBD | Configuration storage |
50
+
51
+ ### 1.3 Naming Conventions
52
+
53
+ | No | Prefix | Type | Example |
54
+ | ---: | --- | --- | --- |
55
+ | 1 | `app_data_` | Data table | `app_data_example_info` |
56
+ | 2 | `app_master_` | Master table | `app_master_example_info` |
57
+
58
+ ---
59
+
60
+ ## 2. ERD Diagram (PlantUML)
61
+
62
+ ```plantuml
63
+ @startuml {{FEATURE_KEY}}_ERD
64
+ !define TABLE(name) entity name << (T,#FFAAAA) >>
65
+ !define PK(x) <b><u>x</u></b>
66
+ !define FK(x) <i>x</i>
67
+
68
+ skinparam linetype ortho
69
+ skinparam entity {
70
+ BackgroundColor #FEFEFE
71
+ BorderColor #333333
72
+ ArrowColor #666666
73
+ }
74
+
75
+ title {{FEATURE_NAME}} - Entity Relationship Diagram
76
+
77
+ TABLE(app_data_example_info) {
78
+ PK(example_uuid) : UUID
79
+ --
80
+ FK(parent_uuid) : UUID <<nullable>>
81
+ name : VARCHAR
82
+ start_dt : DATETIME <<nullable>>
83
+ end_dt : DATETIME <<nullable>>
84
+ --
85
+ CREATE_DT : DATETIME
86
+ UPDATE_DT : DATETIME
87
+ }
88
+
89
+ @enduml
90
+ ```
91
+
92
+ ### 2.1 ERD Summary
93
+ - Summarize key relations and ownership boundaries.
94
+
95
+ ---
96
+
97
+ ## 3. Core Tables
98
+
99
+ ### 3.1 app_data_example_info (Example Info)
100
+
101
+ | No | Column Name (JP) | Column Name | Data Type | Size | Key | Nullable | Default | Description |
102
+ | ---: | --- | --- | --- | --- | --- | --- | --- | --- |
103
+ | 1 | Example UUID (JP) | example_uuid | UUID | - | PK | No | - | Primary key |
104
+ | 2 | Parent UUID (JP) | parent_uuid | UUID | - | FK | Yes | NULL | Parent reference |
105
+
106
+ ### 3.2 app_data_example_detail_info (Example Detail)
107
+
108
+ | No | Column Name (JP) | Column Name | Data Type | Size | Key | Nullable | Default | Description |
109
+ | ---: | --- | --- | --- | --- | --- | --- | --- | --- |
110
+ | 1 | Detail UUID (JP) | example_detail_uuid | UUID | - | PK | No | - | Primary key |
111
+
112
+ ---
113
+
114
+ ## 4. Related/Referenced Tables
115
+
116
+ ### 4.1 app_data_related_info (Related Entity)
117
+
118
+ | No | Key Column | Type | Description |
119
+ | ---: | --- | --- | --- |
120
+ | 1 | related_uuid | UUID | Referenced by core table |
121
+
122
+ ---
123
+
124
+ ## 5. Settings Storage
125
+
126
+ ### 5.1 Environment Settings Table
127
+
128
+ | No | Setting | category1 | category2 | key | value_type | Example Value | Description |
129
+ | ---: | --- | --- | --- | --- | --- | --- | --- |
130
+ | 1 | TBD | TBD | TBD | TBD | string | TBD | TBD |
131
+
132
+ ---
133
+
134
+ ## 6. Indexes & Constraints
135
+
136
+ ### 6.1 Recommended Indexes
137
+
138
+ #### app_data_example_info
139
+
140
+ | No | Index Name | Columns | Type | Purpose |
141
+ | ---: | --- | --- | --- | --- |
142
+ | 1 | idx_example_parent | parent_uuid | BTREE | Parent lookup |
143
+
144
+ ### 6.2 Foreign Key Constraints
145
+
146
+ | No | Constraint Name | From Table.Column | To Table.Column | On Update | On Delete |
147
+ | ---: | --- | --- | --- | --- | --- |
148
+ | 1 | fk_example_parent | app_data_example_info.parent_uuid | app_data_related_info.related_uuid | RESTRICT | SET NULL |
149
+
150
+ ### 6.3 Check Constraints
151
+
152
+ | No | Constraint Name | Expression | Purpose |
153
+ | ---: | --- | --- | --- |
154
+ | 1 | chk_example_range | start_dt < end_dt | Validate datetime range |
155
+
156
+ ---
157
+
158
+ ## 7. Open Questions
159
+
160
+ ### 7.1 Questions Requiring Clarification
161
+
162
+ | No | Q-ID | Area | Question | Impact | Priority | Status | Resolution |
163
+ | ---: | --- | --- | --- | --- | --- | --- | --- |
164
+ | 1 | Q-01 | Schema | TBD | TBD | High | OPEN | TBD |
165
+
166
+ ### 7.2 Missing Information
167
+ - List unresolved schema details (size/default/nullability/code maps).
168
+
169
+ ---
170
+
171
+ ## Document History
172
+
173
+ | No | Version | Date | Author | Changes |
174
+ | ---: | --- | --- | --- | --- |
175
175
  | 1 | 1.0.0 | {{DATE}} | ARCH Agent | Initial template-based version |