sdtk-kit 0.3.7 → 0.3.9

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 (49) hide show
  1. package/README.md +4 -2
  2. package/assets/manifest/toolkit-bundle.manifest.json +118 -78
  3. package/assets/manifest/toolkit-bundle.sha256.txt +45 -37
  4. package/assets/toolkit/toolkit/AGENTS.md +10 -2
  5. package/assets/toolkit/toolkit/install.ps1 +44 -4
  6. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +43 -3
  7. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +5 -1
  8. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +7 -1
  9. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +17 -0
  10. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +87 -11
  11. package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +4 -0
  12. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +17 -0
  13. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +4 -0
  14. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +7 -1
  15. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +17 -0
  16. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +69 -13
  17. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +4 -0
  18. package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +20 -5
  19. package/assets/toolkit/toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py +34 -1
  20. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +4 -0
  21. package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +4 -0
  22. package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +4 -0
  23. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +4 -0
  24. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +4 -0
  25. package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +17 -4
  26. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +21 -4
  27. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +69 -13
  28. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +20 -68
  29. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +168 -3
  30. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +11 -0
  31. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +302 -0
  32. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +22 -8
  33. package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +26 -39
  34. package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +38 -6
  35. package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +47 -25
  36. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +7 -1
  37. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +6 -0
  38. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +17 -0
  39. package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +12 -1
  40. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +69 -13
  41. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +40 -9
  42. package/assets/toolkit/toolkit/templates/handoffs/ARCH_TO_DEV.md +31 -0
  43. package/assets/toolkit/toolkit/templates/handoffs/BA_TO_ARCH.md +28 -0
  44. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE1_SPEC_REVIEW.md +26 -0
  45. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE2_CODE_QUALITY_REVIEW.md +20 -0
  46. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_QA.md +23 -0
  47. package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +26 -0
  48. package/assets/toolkit/toolkit/templates/handoffs/QA_RELEASE_DECISION.md +21 -0
  49. package/package.json +1 -1
@@ -21,6 +21,10 @@ from pathlib import Path
21
21
  from typing import List, Optional, Tuple
22
22
 
23
23
 
24
+ CIRCLED_ITEM_MARKER_RE = re.compile(r"[\u2460-\u2473\u3251-\u325F\u32B1-\u32BF]")
25
+ LEGACY_ITEM_MARKER_RE = re.compile(r"\(\d+\)")
26
+
27
+
24
28
  def parse_args() -> argparse.Namespace:
25
29
  parser = argparse.ArgumentParser(
26
30
  description="Render screen images from DESIGN_LAYOUT PlantUML SALT blocks."
@@ -100,12 +104,20 @@ def extract_screens(text: str) -> List[Tuple[str, str]]:
100
104
  return screens
101
105
 
102
106
 
107
+ def count_visible_item_markers(salt_block: str) -> int:
108
+ return len(CIRCLED_ITEM_MARKER_RE.findall(salt_block))
109
+
110
+
111
+ def count_legacy_item_markers(salt_block: str) -> int:
112
+ return len(LEGACY_ITEM_MARKER_RE.findall(salt_block))
113
+
114
+
103
115
  def render_svg(
104
116
  plantuml_jar: Path, puml_path: Path, output_dir: Path
105
117
  ) -> Optional[str]:
106
118
  """Render a single .puml to .svg. Returns error string or None on success."""
107
119
  proc = subprocess.run(
108
- ["java", "-jar", str(plantuml_jar), "-tsvg", str(puml_path)],
120
+ ["java", "-Dfile.encoding=UTF-8", "-jar", str(plantuml_jar), "-charset", "UTF-8", "-tsvg", str(puml_path)],
109
121
  stdout=subprocess.PIPE,
110
122
  stderr=subprocess.STDOUT,
111
123
  text=True,
@@ -166,6 +178,19 @@ def main() -> int:
166
178
 
167
179
  print(f"[OK] Found {len(screens)} screen(s) with SALT wireframes.")
168
180
 
181
+ numbering_warnings: List[str] = []
182
+ for screen_id, salt_block in screens:
183
+ marker_count = count_visible_item_markers(salt_block)
184
+ legacy_marker_count = count_legacy_item_markers(salt_block)
185
+ if legacy_marker_count > 0:
186
+ numbering_warnings.append(
187
+ f"{screen_id}: legacy `(N)` markers detected; prefer circled-number markers to avoid SALT ambiguity."
188
+ )
189
+ elif marker_count == 0:
190
+ numbering_warnings.append(
191
+ f"{screen_id}: no visible wireframe item markers found."
192
+ )
193
+
169
194
  # Write .puml files
170
195
  puml_files: List[Path] = []
171
196
  for screen_id, salt_block in screens:
@@ -176,6 +201,10 @@ def main() -> int:
176
201
 
177
202
  if args.skip_render:
178
203
  print(f"[OK] Wrote {len(puml_files)} .puml file(s). Render skipped (--skip-render).")
204
+ if numbering_warnings:
205
+ print("[WARN] Wireframe numbering issues:")
206
+ for item in numbering_warnings:
207
+ print(f" - {item}")
179
208
  return 0
180
209
 
181
210
  # Find PlantUML
@@ -201,6 +230,10 @@ def main() -> int:
201
230
  print("[WARN] Render issues:")
202
231
  for item in errors:
203
232
  print(f" - {item}")
233
+ if numbering_warnings:
234
+ print("[WARN] Wireframe numbering issues:")
235
+ for item in numbering_warnings:
236
+ print(f" - {item}")
204
237
 
205
238
  return 0
206
239
 
@@ -5,6 +5,10 @@ description: Developer workflow for SDTK. Use when you need to implement a featu
5
5
 
6
6
  # SDTK DEV (Implementation + Code Review)
7
7
 
8
+ ## Critical Constraints
9
+ - I do not start implementation before the current `FEATURE_IMPL_PLAN` scope is approved.
10
+ - I do not claim implementation is complete without fresh verification evidence.
11
+
8
12
  ## Outputs
9
13
  - `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md`
10
14
  - Code + tests (follow repo conventions)
@@ -5,6 +5,10 @@ description: Generate/modify Python Django REST Framework backend code following
5
5
 
6
6
  # SDTK Backend (Toolkit conventions)
7
7
 
8
+ ## Critical Constraints
9
+ - I do not generate backend code without approved API and data-contract sources.
10
+ - I do not ignore established repository patterns when adding backend modules.
11
+
8
12
  ## Process
9
13
  1. Check whether this repository already has a backend reference module and follow its patterns.
10
14
  2. Follow module structure: `src/backend/<module>/{models,view,service,serializers,validation,enum,urls.py}`.
@@ -5,6 +5,10 @@ description: Generate/modify React frontend code following the toolkit conventio
5
5
 
6
6
  # SDTK Frontend (Toolkit conventions)
7
7
 
8
+ ## Critical Constraints
9
+ - I do not implement screens without current layout and flow-action sources.
10
+ - I do not bypass existing frontend patterns for loading, permissions, or labels.
11
+
8
12
  ## Process
9
13
  1. Check whether this repository already has a frontend reference module and follow its patterns.
10
14
  2. Follow structure:
@@ -5,6 +5,10 @@ description: Orchestrate a full 6-phase SDLC multi-agent workflow (PM/BA/ARCH/DE
5
5
 
6
6
  # SDTK Orchestrator (multi-agent workflow)
7
7
 
8
+ ## Critical Constraints
9
+ - I do not skip mandatory phases or hand off without current-phase evidence.
10
+ - I do not treat planned commands as equivalent to completed work.
11
+
8
12
  ## Initialize
9
13
  - Ensure feature key + feature name exist (ask if missing).
10
14
  - Read `sdtk.config.json` (project stack + commands) if present.
@@ -5,6 +5,10 @@ description: Product Manager + meta-orchestrator workflow for SDTK. Use when you
5
5
 
6
6
  # SDTK PM (Entry Point + Planning)
7
7
 
8
+ ## Critical Constraints
9
+ - I do not hand off PM work until `SHARED_PLANNING.md` and `QUALITY_CHECKLIST.md` reflect the current phase.
10
+ - I do not hide unresolved scope or decision gaps; I record them as `OQ-xx` items for downstream roles.
11
+
8
12
  ## Outputs
9
13
  - Phase 1: `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md`
10
14
  - Phase 2+ (after BA spec): `docs/product/PRD_[FEATURE_KEY].md` + `docs/product/BACKLOG_[FEATURE_KEY].md`
@@ -5,6 +5,10 @@ description: QA workflow for SDTK. Use when you need to validate an implemented
5
5
 
6
6
  # SDTK QA (Testing + Release Decision)
7
7
 
8
+ ## Critical Constraints
9
+ - I do not start QA handoff or release decision work until both DEV review gates PASS.
10
+ - I do not approve without exact specification quotes and fresh verification evidence.
11
+
8
12
  ## Output
9
13
  - `docs/qa/QA_RELEASE_REPORT_[FEATURE_KEY].md`
10
14
  - Optional (when detailed test design spec is requested):
@@ -17,10 +21,11 @@ description: QA workflow for SDTK. Use when you need to validate an implemented
17
21
  4. Apply `governance/ai/core/SDTK_BENCHMARK_QA_MODE_POLICY.md` for benchmark-mode verdict rules when no executable build exists.
18
22
  5. If acceptance criteria / expected behavior is unclear, record OQ-xx in QA report and preserve benchmark-expected ambiguity per `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`; escalate to `@pm` if still missing info.
19
23
  6. Execute the required checks, record the commands used, and capture the actual results (unit/integration/e2e or document review evidence as applicable).
20
- 7. Record defects with severity and status.
21
- 8. Decide: APPROVED vs REJECTED only after fresh verification evidence supports the verdict.
22
- 9. Update shared state + Phase 5 checklist.
23
- 10. Handoff: `@pm please finalize release status ...` if approved.
24
+ 7. When validating requirement behavior, quote the exact specification text before recording a match or mismatch.
25
+ 8. Record defects with severity and status.
26
+ 9. Decide: APPROVED vs REJECTED only after fresh verification evidence supports the verdict.
27
+ 10. Update shared state + Phase 5 checklist.
28
+ 11. Handoff: `@pm please finalize release status ...` if approved.
24
29
 
25
30
  ## Verification Before Completion
26
31
  Apply `governance/ai/core/SDTK_VERIFICATION_BEFORE_COMPLETION_POLICY.md` and require fresh verification evidence before any QA verdict or handoff.
@@ -32,6 +37,14 @@ Do not:
32
37
 
33
38
  If the environment cannot run the proving checks, follow the benchmark QA mode policy explicitly and state that the result is not fully verified at runtime.
34
39
 
40
+ ## Specification Quoting
41
+ When validating a requirement, quote the exact source text before judging the evidence.
42
+
43
+ Use this format:
44
+ - `Spec says: "[exact quote]" -> Evidence: [match/mismatch + file reference]`
45
+
46
+ Apply it to BA, PRD or BACKLOG, ARCH, API, DB, and flow-action sources whenever they define the expected behavior.
47
+
35
48
  ## Order-Critical Hard Gate
36
49
  Do not start QA handoff, release testing, or release decision work until both DEV review gates are documented as PASS:
37
50
  - Stage 1 artifact/spec compliance review
@@ -5,6 +5,14 @@ description: Create/update screen flow-action specifications from requirement so
5
5
 
6
6
  # SDTK Screen Flow Action Spec
7
7
 
8
+ ## Critical Constraints
9
+ - I do not finalize UI-scope screens without a valid design source type and reference.
10
+ - I do not leave broken image paths or incomplete API mappings in the flow-action spec.
11
+ - I use new-style PlantUML activity diagram syntax only for the screen flow diagram.
12
+ - I do not mix legacy and new-style PlantUML activity syntax in the screen flow diagram.
13
+ - Do not mix legacy activity syntax such as `(*)`, `-->`, or `[edge label]` with new-style activity actions like `:Activity;`.
14
+ - I keep action-table numbering global across the document even when wireframe markers reset per screen.
15
+
8
16
  ## Outputs
9
17
  - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
10
18
  - Optional supporting docs:
@@ -31,6 +39,7 @@ description: Create/update screen flow-action specifications from requirement so
31
39
  5. For each screen/dialog:
32
40
  - Add metadata (screen ID, Design Source Type, Design Source Reference)
33
41
  - Add screen image reference (from Figma, screenshot, or rendered `.svg` from generated layout)
42
+ - For generated-draft wireframes, add a wireframe-marker mapping table from the screen-local wireframe markers to the global action-table `No`
34
43
  - Add UI item/action table with `No` column
35
44
  - Add API mapping table (trigger -> API -> data usage)
36
45
  6. Build/update `System processing flow` from use-case and process sources.
@@ -39,15 +48,21 @@ description: Create/update screen flow-action specifications from requirement so
39
48
  9. Validate:
40
49
  - global numbering consistency (no screen-level reset)
41
50
  - no broken image paths (for `generated-draft` screens, verify `.svg` exists or use render-skipped note)
42
- - PlantUML renderability
51
+ - PlantUML renderability and new-style activity syntax consistency (no `(*)`, `-->`, or `[edge label]` mixing)
43
52
  - consistency with API endpoints spec
44
53
  - EN artifact hygiene (no VI leftovers, no mojibake, no merged heading lines)
45
54
  - for legacy specs with per-screen reset numbering: run renumber migration first
46
55
  - every UI-scope screen declares a Design Source Type (`source-backed` or `generated-draft`)
56
+ - every generated-draft screen with an embedded wireframe image includes a wireframe-marker mapping table to the global action-table `No`
47
57
  10. For `generated-draft` screens, set `Screen image:` to the rendered `.svg` path if the file exists:
48
- - Expected path: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
58
+ - Expected path (filesystem): `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
59
+ - Markdown image path (file-relative): `assets/<feature_snake>/screens/<screen_id>.svg`
49
60
  - If the `.svg` does not exist (render unavailable), replace the image reference with: `> Screen image not rendered in this environment. See Design Source Reference for layout.`
50
- 11. Update document history and handoff to ARCH/DEV.
61
+ 11. For generated-draft screens, treat wireframe markers as screen-local visual references:
62
+ - the local marker sequence may reset per screen
63
+ - do not renumber the wireframe to fake equality with the global action-table `No`
64
+ - publish the mapping table directly under the screen image so reviewers can cross-reference local markers to global action-table numbers
65
+ 12. Update document history and handoff to ARCH/DEV.
51
66
 
52
67
  ## Rule References
53
68
  - Core rules: `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`
@@ -59,6 +74,8 @@ description: Create/update screen flow-action specifications from requirement so
59
74
  - `scripts/validate_flow_action_spec_numbering.py`
60
75
  - Checks duplicate/resetted numbering in action tables.
61
76
  - Checks encoding/markdown hygiene.
77
+ - Checks screen-image markdown path convention.
78
+ - Checks mixed legacy/new-style PlantUML activity syntax in screen-flow diagrams.
62
79
  - For EN artifacts, run with `--en-check`:
63
80
  - `python "toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --en-check`
64
81
  - `scripts/renumber_flow_action_spec_global.py`
@@ -66,4 +83,4 @@ description: Create/update screen flow-action specifications from requirement so
66
83
  - Dry-run:
67
84
  - `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md"`
68
85
  - Apply:
69
- - `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`
86
+ - `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`
@@ -19,12 +19,13 @@ A flow-action spec should include, at minimum:
19
19
 
20
20
  1. `Abbreviations`
21
21
  2. `Feature overview`
22
- 3. `Screen flow action` (with PlantUML)
23
- 4. `Screen layout spec by flow action`
24
- 5. `System processing flow`
25
- 6. `Open questions`
26
- 7. `Screen - API mapping`
27
- 8. `Document history`
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`
28
29
 
29
30
  If a section is not in scope, keep the section and mark explicitly as `N/A` with reason.
30
31
 
@@ -40,7 +41,34 @@ If a section is not in scope, keep the section and mark explicitly as `N/A` with
40
41
  - Table rows must keep column count consistent with the header (no broken or merged rows).
41
42
  - Avoid single-line merged content that collapses multiple logical items into one table row.
42
43
 
43
- ### 3.1 Language and Encoding Standards (EN Artifacts)
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)
44
72
 
45
73
  - For EN artifacts (`docs/en/**` or explicitly requested EN version), narrative text must be English.
46
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.
@@ -49,16 +77,24 @@ If a section is not in scope, keep the section and mark explicitly as `N/A` with
49
77
  - Save files as UTF-8 and avoid mojibake/broken glyphs (`�`, `ↁE`, garbled sequences).
50
78
  - Keep canonical terminology stable across documents (for example: `bukken`, `sagyo`, `customer employee`).
51
79
 
52
- ### 3.2 Markdown Structure Hygiene
80
+ ### 3.3 Markdown Structure Hygiene
53
81
 
54
82
  - Keep each heading on its own line; do not concatenate multiple headings/sections on one line.
55
83
  - Keep metadata blocks (`Information`, `Note`, `Behavior notes`) as structured bullet blocks, not single compressed lines.
56
84
  - Keep image, table, and separator (`---`) boundaries explicit to preserve parser/render stability.
57
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
+
58
93
  ## 4. Item Numbering and Duplication Rules
59
94
 
60
95
  - Use one numbering mode only: `global across document`.
61
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`.
62
98
  - Avoid duplicate item descriptions for the same UI control across screens unless behavior differs.
63
99
  - If duplicate number is intentional (rare), annotate reason in `Note`.
64
100
 
@@ -92,6 +128,19 @@ Rules:
92
128
  - The flow-action spec and the design-layout doc must remain separate documents.
93
129
  - When Figma becomes available later, update the source mode from `generated-draft` to `source-backed`.
94
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
+
95
144
  ## 6. API Traceability Rules
96
145
 
97
146
  - Every actionable UI event that changes state must map to a write API.
@@ -101,8 +150,11 @@ Rules:
101
150
 
102
151
  ## 7. PlantUML Rules for Screen Flow
103
152
 
104
- - Use valid PlantUML syntax and renderability checks before handoff.
105
- - Use `\\n` for multi-line labels in nodes.
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.
106
158
  - Keep diagram at navigation/action level (not low-level SQL or backend internals).
107
159
  - Ensure screen names in PlantUML match section names in layout spec.
108
160
 
@@ -112,7 +164,8 @@ Rules:
112
164
  1. Confirmed design source (for example Figma)
113
165
  2. Confirmed requirement files (Excel/spec)
114
166
  3. User-provided screenshots
115
- - Store images in repository-relative paths.
167
+ - Store images in repository-relative filesystem paths.
168
+ - Reference images in markdown using file-relative paths from the spec file's directory.
116
169
  - Do not keep temporary local absolute paths in markdown.
117
170
 
118
171
  ### 8.1 Rendered Screen Images for Generated-Draft Screens
@@ -120,8 +173,10 @@ Rules:
120
173
  When `Design Source Type` is `generated-draft`:
121
174
  - Screen preview images may be rendered from `DESIGN_LAYOUT_[FEATURE_KEY].md` PlantUML SALT wireframes.
122
175
  - Renderer: `toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py`
123
- - Expected output path: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
124
- - If the rendered `.svg` file exists, use it as the `Screen image:` reference.
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.
125
180
  - If rendering is unavailable or the `.svg` does not exist, replace the image line with:
126
181
  `> Screen image not rendered in this environment. See Design Source Reference for layout.`
127
182
  - Do not leave a broken image reference pointing to a non-existent file.
@@ -158,6 +213,7 @@ When `Design Source Type` is `generated-draft`:
158
213
  - Numbering is global across the document (no resets).
159
214
  - No broken image links (for `generated-draft` screens: `.svg` exists or render-skipped note is present).
160
215
  - Screen/API mappings are consistent with `*_ENDPOINTS.md`.
216
+ - Assumptions section exists and unresolved assumptions are traceable.
161
217
  - Open questions are explicit and traceable.
162
218
  - For EN artifact: no leftover VI text outside allowed `Original Text` appendix blocks.
163
219
  - No mojibake/encoding corruption markers.
@@ -1,76 +1,28 @@
1
- # Quy tắc đánh số UI item (Flow Action Spec)
1
+ # UI Numbering Policy
2
2
 
3
- ## Mục tiêu
3
+ ## Scope
4
4
 
5
- - Gắn số lên ảnh màn hình để người đọc map nhanh sang bảng action.
6
- - Đánh số **toàn cục**, tăng dần theo thứ tự màn hình trong flow.
7
- - **Không trùng số** giữa các item mới.
8
- - **Không lặp mô tả** item đã xuất hiện ở màn hình trước.
5
+ - `FLOW_ACTION_SPEC` action tables use one numbering mode only: global across the full document.
6
+ - `DESIGN_LAYOUT` wireframe markers are screen-local visual references and may reset per screen.
7
+ - Do not force wireframe marker values to numerically equal the global action-table `No`.
9
8
 
10
- ## Quy ước “item đã xuất hiện”
9
+ ## DESIGN_LAYOUT Rules
11
10
 
12
- Xem item “đã xuất hiện” nếu:
13
- - Cùng ý nghĩa chức năng cùng vị trí/khu vực UI (dù ở chế độ view khác).
14
- - Đã được đánh số trong một màn hình trước đó.
11
+ - Every visible wireframe control should have a visible local marker.
12
+ - Prefer Unicode circled-number markers in generated design docs.
13
+ - Avoid parenthetical `(N)` markers because they blend into UI text and can conflict with SALT parser behavior.
14
+ - Local wireframe markers only cover items visibly present on that screen.
15
15
 
16
- Hệ quả:
17
- - Màn hình sau **không thêm dòng mới** vào bảng action cho item này.
18
- - Nếu cần người đọc định vị, vẫn có thể giữ số trên ảnh (để đối chiếu), nhưng ghi chú trong section: “Đã mô tả ở màn X (No Y)”.
16
+ ## FLOW_ACTION_SPEC Rules
19
17
 
20
- ## Cách làm chuẩn (không đoán khi thiếu dữ liệu)
18
+ - Keep action-table `No` values global across the document.
19
+ - For each generated-draft screen with an embedded wireframe image, add a wireframe marker mapping table:
20
+ - `No | Wireframe Marker | Action Table No | Item Name | Notes`
21
+ - The mapping table bridges screen-local wireframe markers to global action-table numbers.
22
+ - If an action-table item is not visible on the wireframe, note that explicitly instead of inventing a marker.
21
23
 
22
- 1) Xác định thứ tự màn hình trong flow (mặc định theo danh sách Figma + luồng `画面遷移`).
23
- 2) Tạo “sổ tay đánh số” (mapping) dạng:
24
- - `key` (tên/nhãn JP + loại control + khu vực)
25
- - `value` (số No)
26
- 3) Với từng màn hình:
27
- - Liệt kê item tương tác cần mô tả (button/link/selectbox/checkbox…).
28
- - Nếu item mới: cấp số tiếp theo và thêm vào mapping.
29
- - Nếu item cũ: không cấp số mới, không lặp mô tả.
30
- 4) Nếu **chưa xác định được vị trí đặt số trên ảnh**:
31
- - Yêu cầu user cung cấp ảnh có đánh dấu hoặc chỉ rõ vị trí (tỷ lệ/tọa độ/ô Excel).
32
- - Không tự suy đoán vị trí.
24
+ ## Non-1:1 Mapping Cases
33
25
 
34
- ## Nguồn dữ liệu tham khảo
35
-
36
- - Excel: sheet `画面|作業員割付` (bảng tả + cột BK thường chứa hiệu số tròn ㉕/㉖…)
37
- - Ví dụ:
38
- - `BK205`: `㉕リスト表示切替ボタン`
39
- - `BK245`: `㉖マグネット表示切替ボタン`
40
- - Ảnh/screenshot đã được user đánh số (nguồn xác thực tốt nhất).
41
- - Ảnh export từ Figma/Excel để overlay số.
42
-
43
- ## Case lỗi đã gặp & cách tránh
44
-
45
- ### 1) Trùng số “1” trong màn Search / Edit
46
-
47
- Nguyên nhân thường gặp:
48
- - Overlay tool chỉ đọc được “1” khi marker là 2 chữ số (10,11,12…).
49
-
50
- Cách tránh:
51
- - Khi tạo marker (oval) cho 2+ chữ số, tăng kích thước tối thiểu (>= 32px) và tắt WordWrap.
52
- - Nếu lấy marker từ Excel, đảm bảo marker trong Excel hiển thị đúng 2 chữ số trước khi export.
53
-
54
- ### 2) Excel spec bị “duplicate numbering” (ví dụ ㉑ xuất hiện 2 lần)
55
-
56
- Nguyên nhân:
57
- - Dữ liệu Excel gốc bị trùng ký hiệu số.
58
-
59
- Cách xử lý:
60
- - Ưu tiên theo logic UI + screenshot user xác nhận.
61
- - Renumber phần bị duplicate theo số tiếp theo (vd: 21 bị trùng → “đóng/xoá/search” thành 22/23/24 theo thứ tự thao tác).
62
- - Ghi chú rõ “Excel có duplicate; đã chuẩn hoá lại theo sequence toàn cục”.
63
-
64
- ### 3) Item đã mô tả ở màn trước vẫn bị lặp trong bảng màn sau
65
-
66
- Cách tránh:
67
- - Trước khi thêm dòng vào bảng, đối chiếu mapping toàn cục.
68
- - Nếu cần nhắc lại, chỉ thêm bullet note “đã mô tả ở …”, không thêm dòng mới trong bảng.
69
-
70
- ## Ví dụ theo dự án tham chiếu
71
-
72
- - Màn 3.1 (Bukken View): đã đánh số 1–9.
73
- - Màn 3.2 (Search): tiếp tục 10–24.
74
- - Màn 3.3 (Bukken Magnet): chỉ đánh số 25 cho nút chuyển List.
75
- - Màn 3.4 (Bukken List): chỉ đánh số 26 cho nút chuyển Magnet.
76
- - Màn 3.7 (Worker Magnet): chỉ đánh số các item mới theo yêu cầu (vd: selectbox 物件名, nút 検索, checkbox 複数日登録モード).
26
+ - If the wireframe label and the action-table label differ slightly, use the action-table item name in the mapping table and explain the label difference in `Notes`.
27
+ - If multiple action-table rows map to one visual region, spell that out in `Notes`.
28
+ - If a dialog, hidden state, or validation item is not shown on the wireframe, mark it as `Not shown on wireframe`.