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
@@ -1,36 +1,30 @@
1
1
  ---
2
2
  name: 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.
3
+ description: Solution Architect workflow for SDTK. Use when you need to convert BA_SPEC plus PM backlog into technical architecture, API contracts, and UI design docs; then hand off to DEV.
4
4
  ---
5
5
 
6
6
  ## SDTK Pipeline Rules (always apply)
7
7
  1. Pipeline: PM Initiation -> BA Analysis -> PM Planning -> Architecture Design -> Development + Review -> QA Validation
8
- 2. After completing phase work: update SHARED_PLANNING.md + QUALITY_CHECKLIST.md
9
- 3. If unclear: log OQ-xx in artifact, escalate to PM
8
+ 2. After completing phase work: update SHARED_PLANNING.md and QUALITY_CHECKLIST.md
9
+ 3. If unclear: log OQ-xx in artifact and escalate to PM
10
10
  4. Traceability: REQ -> BR/UC/AC -> design -> backlog -> code/tests -> QA
11
- 5. Code review must be COMPLETE before QA phase can start
11
+ 5. Code review must be complete before QA phase can start
12
12
  6. Do not skip phases. If inputs are missing, ask focused questions.
13
13
 
14
14
  ## Prerequisites (verify before proceeding)
15
15
  Read QUALITY_CHECKLIST.md and verify:
16
- - Phase 2 BA Analysis gate must show all items [x] Done.
17
- - Phase 2+ PM Planning gate must show all items [x] Done.
18
-
19
- If prerequisites are not met, report which gate is missing and suggest user run the prerequisite phase first.
20
-
21
- ## Current Context
22
- - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk.config.json','utf8'))}catch{process.stdout.write('{}')}"`
23
- - Pipeline: !`node -e "try{process.stdout.write(require('fs').readFileSync('SHARED_PLANNING.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
24
- - Gates: !`node -e "try{process.stdout.write(require('fs').readFileSync('QUALITY_CHECKLIST.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
25
- - State: !`node -e "try{process.stdout.write(require('fs').readFileSync('.sdtk/orchestration-state.json','utf8'))}catch{process.stdout.write('{}')}"`
16
+ - Phase 2 BA Analysis gate must show all items done
17
+ - Phase 2+ PM Planning gate must show all items done
26
18
 
27
19
  ## Input
28
20
  $ARGUMENTS
29
21
 
30
- If no arguments are provided, read current feature context from SHARED_PLANNING.md.
31
-
32
22
  # SDTK ARCH (Solution Architecture)
33
23
 
24
+ ## Critical Constraints
25
+ - I do not generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI-scope features.
26
+ - I do not silently skip render failures for generated-draft screen images.
27
+
34
28
  ## Outputs
35
29
  - `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
36
30
  - If applicable:
@@ -44,29 +38,22 @@ If no arguments are provided, read current feature context from SHARED_PLANNING.
44
38
 
45
39
  ## Process
46
40
  1. Read BA spec and PRD/backlog.
47
- 2. Read `sdtk.config.json` for project stack assumptions (backend/frontend/db/auth).
48
- 3. If architecture output includes API contracts/flows, read and apply:
41
+ 2. Read `sdtk.config.json` for project stack assumptions.
42
+ 3. If architecture output includes API contracts or flows, read and apply:
49
43
  - `.claude/skills/references/YAML_CREATION_RULES.md`
50
44
  - `.claude/skills/references/API_DESIGN_FLOWCHART_CREATION_RULES.md`
51
- - `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` for canonical resource naming and multi-word path style
52
45
  4. If architecture output includes screen flow-action specs, read and apply `.claude/skills/references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
53
- 5. If API detail spec is required, use `/api-design-spec` to build/update `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md` using YAML + flow list.
54
- 6. For complex UI flow-action specs, use `/screen-design-spec` to build/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`.
55
- 7. Define:
56
- - System components + data model
57
- - API endpoints and flows
58
- - Screen layouts
59
- - Security/authz decisions
60
- 8. Create/update:
61
- - OpenAPI YAML + API endpoint markdown
62
- - API flow list
63
- - API design detail spec (when `orchestration.apiDesignDetailMode` is `auto/on`)
64
- - Database spec (if DB impact exists)
65
- - Flow-action spec and design layout (if UI impact exists)
66
- 9. Ensure mapping UC/BR -> DB/API/screens and run output hygiene checks:
67
- - EN artifacts use English narrative text (except clearly marked original-language appendix blocks)
68
- - No mojibake/encoding corruption in markdown/yaml/txt outputs
69
- 10. 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.
70
- 11. If anything is unclear, record OQ-xx in ARCH_DESIGN "Open Questions" and escalate to PM.
71
- 12. Update shared state + Phase 3 checklist.
72
- 13. Handoff: suggest user run `/dev` to implement the design.
46
+ 5. For API scope:
47
+ - generate or update YAML, endpoints markdown, and flow list
48
+ - if API detail is required, use `/api-design-spec`
49
+ 6. For UI scope:
50
+ - generate or update `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
51
+ - run `.claude/skills/design-layout/scripts/render_design_layout_images.py` to attempt screen preview rendering
52
+ - then generate or update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` using `/screen-design-spec`
53
+ - when no Figma or screenshot exists, use `generated-draft` with `DESIGN_LAYOUT` as the design source
54
+ - if rendering fails, use the render-skipped note instead of a broken image reference
55
+ 7. Define system components, data model, API endpoints, flows, screen layouts, and security decisions.
56
+ 8. Ensure mapping UC/BR to DB/API/screens and keep EN artifact hygiene.
57
+ 9. If anything is unclear, record OQ-xx in `ARCH_DESIGN` and escalate to PM.
58
+ 10. Update shared state and Phase 3 checklist.
59
+ 11. Handoff: suggest `/dev` after the design is complete.
@@ -1,25 +1,57 @@
1
1
  ---
2
2
  name: design-layout
3
- description: Generate UI screen layout documentation for a feature, including PlantUML @startsalt wireframes and item tables. Use when a feature includes frontend/admin screens and you need docs/design/* deliverables.
3
+ description: Generate UI screen layout documentation for a feature, including PlantUML SALT wireframes and item tables. Use when a feature includes frontend or admin screens and you need docs/design deliverables.
4
4
  ---
5
5
 
6
6
  ## Required Inputs (read before proceeding)
7
7
  Read the following artifacts for the current feature:
8
- 1. `docs/specs/BA_SPEC_*.md` screens + fields
9
- 2. `docs/api/[FEATURE_KEY]_ENDPOINTS.md` API list
8
+ 1. `docs/specs/BA_SPEC_*.md` - screens and fields
9
+ 2. `docs/api/[FEATURE_KEY]_ENDPOINTS.md` - API list
10
10
 
11
11
  ## Input
12
12
  $ARGUMENTS
13
13
 
14
14
  # SDTK Screen Layout Design
15
15
 
16
+ ## Critical Constraints
17
+ - I do not skip screen IDs or item numbering alignment with the wireframe.
18
+ - I do not hide render limitations; I record when screen preview rendering is unavailable.
19
+ - I do not leave rendered wireframes without visible local item markers that map back to the `Items` table.
20
+ - I do not pretend wireframe markers are the same thing as `FLOW_ACTION_SPEC` global action-table numbers.
21
+
16
22
  ## Output
17
23
  - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
18
24
 
19
25
  ## Process
20
26
  1. Read BA spec (screens + fields) and API list.
21
27
  2. For each screen, include:
22
- - PlantUML `@startsalt` wireframe first
28
+ - PlantUML `@startsalt` wireframe first, with visible screen-local markers embedded directly in the SALT labels
23
29
  - API list table
24
- - Item table with numbering that matches the wireframe
25
- 3. Keep screen IDs consistent (A-*, B-*, C-*).
30
+ - Item table whose `No` values exactly match the local marker sequence used in the wireframe for that screen
31
+ 3. Use this wireframe-marker convention so the rendered SVG can be cross-referenced visually:
32
+ - markers are screen-local visual references and reset per screen
33
+ - prefer Unicode circled-number markers in generated docs; avoid parenthetical `(N)` markers because they blend into UI text and can conflict with SALT parsing
34
+ - text label or input prompt: prefix the visible label with the local marker
35
+ - button: place the local marker inside the visible button label
36
+ - table header: prefix the header text with the local marker
37
+ - standalone control, pagination, toggle, or status chip: prefix the visible label with the local marker
38
+ - do not rely on prose, comments, or a separate legend; the marker must be visible inside the rendered wireframe itself
39
+ - the local marker does not need to equal the `FLOW_ACTION_SPEC` global `No`; `screen-design-spec` publishes the mapping table
40
+ 4. Keep screen IDs consistent (A-*, B-*, C-*).
41
+ 5. After writing `DESIGN_LAYOUT`, attempt to render screen preview images by default:
42
+ - Run `.claude/skills/design-layout/scripts/render_design_layout_images.py` to extract `@startsalt` blocks and render `.svg` files.
43
+ - Output path: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
44
+ - The renderer warns if a screen wireframe has no visible local markers or still uses legacy `(N)` markers.
45
+ - If PlantUML is unavailable, rendering is skipped with a warning and the render-skipped note is used in `FLOW_ACTION_SPEC`.
46
+
47
+ ## Screen Image Renderer
48
+ - Script: `.claude/skills/design-layout/scripts/render_design_layout_images.py`
49
+ - Usage:
50
+ ```
51
+ python ".claude/skills/design-layout/scripts/render_design_layout_images.py" \
52
+ --design-layout "docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md" \
53
+ --feature-key [FEATURE_KEY]
54
+ ```
55
+ - Requires: Java + `plantuml.jar`
56
+ - Output: `.svg` files under `docs/specs/assets/<feature_snake>/screens/`
57
+ - Failure policy: non-blocking. Warns and continues if rendering is unavailable.
@@ -1,19 +1,27 @@
1
1
  ---
2
2
  name: screen-design-spec
3
- description: Create/update screen flow-action specifications from requirement sources (Excel/Figma/spec docs), including screen flow PlantUML, UI item/action tables, API mapping tables, and screen-to-API traceability.
3
+ description: Create or update screen flow-action specifications from requirement sources, including screen flow PlantUML, UI item tables, API mapping tables, and screen-to-API traceability.
4
4
  ---
5
5
 
6
6
  ## Required Inputs (read before proceeding)
7
7
  Read the following artifacts for the current feature:
8
- 1. `docs/specs/BA_SPEC_*.md` business rules, use cases
9
- 2. `docs/architecture/ARCH_DESIGN_*.md` system components
10
- 3. `docs/api/[FEATURE_KEY]_ENDPOINTS.md` API endpoints (when available)
8
+ 1. `docs/specs/BA_SPEC_*.md` - business rules and use cases
9
+ 2. `docs/architecture/ARCH_DESIGN_*.md` - system components
10
+ 3. `docs/api/[FEATURE_KEY]_ENDPOINTS.md` - API endpoints, when available
11
11
 
12
12
  ## Input
13
13
  $ARGUMENTS
14
14
 
15
15
  # SDTK Screen Flow Action Spec
16
16
 
17
+ ## Critical Constraints
18
+ - I do not finalize UI-scope screens without a valid design source type and reference.
19
+ - I do not leave broken image paths or incomplete API mappings in the flow-action spec.
20
+ - I use new-style PlantUML activity diagram syntax only for the screen flow diagram.
21
+ - I do not mix legacy and new-style PlantUML activity syntax in the screen flow diagram.
22
+ - Do not mix legacy activity syntax such as `(*)`, `-->`, or `[edge label]` with new-style activity actions like `:Activity;`.
23
+ - I keep action-table numbering global across the document even when wireframe markers reset per screen.
24
+
17
25
  ## Outputs
18
26
  - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
19
27
  - Optional supporting docs:
@@ -24,29 +32,47 @@ $ARGUMENTS
24
32
  ## Required Inputs
25
33
  - Feature key/name
26
34
  - Primary requirement sources (BA spec, architecture, customer design docs)
27
- - Screen source references (Figma URLs and/or requirement screenshots)
35
+ - Screen source references, using one of these design source modes:
36
+ - `source-backed`: Figma URLs and/or requirement screenshots
37
+ - `generated-draft`: generated layout from `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
28
38
  - API endpoint source (`docs/api/[FEATURE_KEY]_ENDPOINTS.md`) when available
29
39
 
30
40
  ## Process
31
41
  1. Read requirement sources and identify in-scope screens, dialogs, and transitions.
32
42
  2. Read and apply rules from `.claude/skills/references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
33
- 3. Build/update section `Feature overview` and `Screen flow action` (PlantUML).
34
- 4. For each screen/dialog:
35
- - Add metadata (screen ID, source link)
36
- - Add screen image reference
43
+ 3. Determine design source mode per screen:
44
+ - If Figma URL or screenshot exists: use `source-backed`.
45
+ - If no Figma/screenshot but feature has UI scope: use `generated-draft` and reference the corresponding section in `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`.
46
+ - If screen has no UI scope: use `none`.
47
+ 4. Build/update section `Feature overview` and `Screen flow action` (PlantUML).
48
+ 5. For each screen/dialog:
49
+ - Add metadata (screen ID, Design Source Type, Design Source Reference)
50
+ - Add screen image reference (from Figma, screenshot, or rendered `.svg` from generated layout)
51
+ - For generated-draft wireframes, add a wireframe-marker mapping table from the screen-local wireframe markers to the global action-table `No`
37
52
  - Add UI item/action table with `No` column
38
53
  - Add API mapping table (trigger -> API -> data usage)
39
- 5. Build/update `System processing flow` from use-case and process sources.
40
- 6. Build/update `Open questions` for unresolved behavior/API/data points.
41
- 7. Build/update `Screen - API Mapping` summary section.
42
- 8. Validate:
54
+ 6. Build/update `System processing flow` from use-case and process sources.
55
+ 7. Build/update `Open questions` for unresolved behavior/API/data points.
56
+ 8. Build/update `Screen - API Mapping` summary section.
57
+ 9. Validate:
43
58
  - global numbering consistency (no screen-level reset)
44
- - no broken image paths
45
- - PlantUML renderability
59
+ - no broken image paths (for `generated-draft` screens, verify `.svg` exists or use render-skipped note)
60
+ - PlantUML renderability and new-style activity syntax consistency (no `(*)`, `-->`, or `[edge label]` mixing)
46
61
  - consistency with API endpoints spec
47
62
  - EN artifact hygiene (no VI leftovers, no mojibake, no merged heading lines)
48
63
  - for legacy specs with per-screen reset numbering: run renumber migration first
49
- 9. Update document history and handoff to ARCH/DEV.
64
+ - every UI-scope screen declares a Design Source Type (`source-backed` or `generated-draft`)
65
+ - every generated-draft screen with an embedded wireframe image includes a wireframe-marker mapping table to the global action-table `No`
66
+ 10. For `generated-draft` screens, set `Screen image:` to the rendered `.svg` path if the file exists:
67
+ - Expected path (filesystem): `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
68
+ - Markdown image path (file-relative): `assets/<feature_snake>/screens/<screen_id>.svg`
69
+ - If the `.svg` does not exist, replace the image reference with:
70
+ `> Screen image not rendered in this environment. See Design Source Reference for layout.`
71
+ 11. For generated-draft screens, treat wireframe markers as screen-local visual references:
72
+ - the local marker sequence may reset per screen
73
+ - do not renumber the wireframe to fake equality with the global action-table `No`
74
+ - publish the mapping table directly under the screen image so reviewers can cross-reference local markers to global action-table numbers
75
+ 12. Update document history and handoff to ARCH/DEV.
50
76
 
51
77
  ## Rule References
52
78
  - Core rules: `.claude/skills/references/FLOW_ACTION_SPEC_CREATION_RULES.md`
@@ -55,14 +81,10 @@ $ARGUMENTS
55
81
  - Excel image export reference: `.claude/skills/references/excel-image-export.md`
56
82
 
57
83
  ## Validation Script
58
- - `scripts/validate_flow_action_spec_numbering.py`
59
- - Checks duplicate/resetted numbering in action tables.
60
- - Checks encoding/markdown hygiene.
61
- - For EN artifacts, run with `--en-check`:
62
- - `python scripts/validate_flow_action_spec_numbering.py --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --en-check`
63
- - `scripts/renumber_flow_action_spec_global.py`
64
- - Auto-migrates action table `No` fields to global numbering.
84
+ - `.claude/skills/screen-design-spec/scripts/validate_flow_action_spec_numbering.py`
85
+ - `python ".claude/skills/screen-design-spec/scripts/validate_flow_action_spec_numbering.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --en-check`
86
+ - `.claude/skills/screen-design-spec/scripts/renumber_flow_action_spec_global.py`
65
87
  - Dry-run:
66
- - `python scripts/renumber_flow_action_spec_global.py --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md"`
88
+ - `python ".claude/skills/screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md"`
67
89
  - Apply:
68
- - `python scripts/renumber_flow_action_spec_global.py --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`
90
+ - `python ".claude/skills/screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`
@@ -7,10 +7,16 @@ The active rule source for API design detail and API flowchart behavior is now:
7
7
  - `API_DESIGN_FLOWCHART_CREATION_RULES_FINAL.md` (root)
8
8
  - `templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` (toolkit)
9
9
 
10
- Use that file for:
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:
11
16
  - API design detail markdown structure
12
17
  - flowchart integration and synchronization rules
13
18
  - error section rules
14
19
  - flow summary / notes / login rules
20
+ - assumptions-section requirements
15
21
 
16
22
  This compatibility note should remain only until all references are migrated.
@@ -16,6 +16,12 @@
16
16
  | ---: | --- | --- | --- |
17
17
  | 1 | TBD | TBD | `API_design.xlsx` |
18
18
 
19
+ ## Assumptions
20
+
21
+ | # | Assumption | Verified | Risk if wrong |
22
+ | ---: | --- | --- | --- |
23
+ | 1 | TBD | No | TBD |
24
+
19
25
  ## 2. API Detail 1 - TBD
20
26
 
21
27
  **Endpoint:** `TBD`
@@ -38,6 +38,23 @@ Primary sample references:
38
38
  - `GET /bukken/info/{company_uuid}/{bukken_uuid}` style
39
39
  - search API query-builder style shown in the Bukken sample helper flow
40
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
+
41
58
  ## 3. Core Flowchart Writing Rules
42
59
 
43
60
  ### Rule A. Add a visible API header for every block
@@ -28,10 +28,21 @@
28
28
 
29
29
  ## A-1. TBD
30
30
 
31
+ > Generated outputs should use screen-local visual markers that reset per screen. Prefer Unicode circled-number markers in the real doc. The ASCII placeholders below keep this template PowerShell-safe, and `FLOW_ACTION_SPEC` will map the local markers to its global action-table numbers.
32
+
31
33
  ```plantuml
32
34
  @startsalt
33
35
  {
34
- { "(1) TBD" | [(2) Action] }
36
+ {+
37
+ <b>Sample Screen</b>
38
+ ---
39
+ { "WF1 Keyword:" | " " } | [ WF2 Search ]
40
+ ---
41
+ {#
42
+ <b>WF3 Name</b> | <b>WF4 Status</b>
43
+ Sample | Active
44
+ }
45
+ }
35
46
  }
36
47
  @endsalt
37
48
  ```
@@ -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.
@@ -33,6 +33,12 @@
33
33
  ### 1.3 Implementation direction
34
34
  - TBD
35
35
 
36
+ ## Assumptions
37
+
38
+ | # | Assumption | Verified | Risk if wrong |
39
+ | ---: | --- | --- | --- |
40
+ | 1 | TBD | No | TBD |
41
+
36
42
  ---
37
43
 
38
44
  ## 2) Screen flow action
@@ -41,16 +47,22 @@
41
47
 
42
48
  ```plantuml
43
49
  @startuml
44
- left to right direction
45
50
  skinparam shadowing false
46
- skinparam packageStyle rectangle
47
-
48
- rectangle "Screen A" as A
49
- rectangle "Screen B" as B
50
- rectangle "Dialog C" as C
51
-
52
- A --> B : action
53
- B --> C : open dialog
51
+ skinparam activityBackgroundColor #FEFEFE
52
+ skinparam activityBorderColor #333333
53
+
54
+ title {{FEATURE_NAME}} - Screen Flow Action
55
+
56
+ start
57
+ partition "Main Flow" {
58
+ :SCR-01 Screen A;
59
+ note right
60
+ User reviews the main list and selects an action.
61
+ end note
62
+ -> Open detail;
63
+ :SCR-02 Screen B;
64
+ }
65
+ stop
54
66
  @enduml
55
67
  ```
56
68
 
@@ -76,11 +88,21 @@ Information:
76
88
  - Design Source Reference: Figma URL | screenshot path | `docs/design/DESIGN_LAYOUT_{{FEATURE_KEY}}.md` section reference | `N/A - no UI scope`
77
89
 
78
90
  Screen image:
91
+ <!-- Use a file-relative markdown path from docs/specs/, not a project-root docs/specs/assets/... path. -->
79
92
  ![3.1 Screen A](assets/{{FEATURE_SNAKE}}/screens/scr_01.svg)
80
93
 
81
94
  <!-- If the .svg file does not exist (render unavailable), replace the image line above with: -->
82
95
  <!-- > Screen image not rendered in this environment. See Design Source Reference for layout. -->
83
96
 
97
+ #### Wireframe Marker Mapping (Draft)
98
+
99
+ > Generated-draft wireframe markers are screen-local visual references. Map each visible marker to the global action-table `No` used below.
100
+
101
+ | No | Wireframe Marker | Action Table No | Item Name | Notes |
102
+ | ---: | --- | ---: | --- | --- |
103
+ | 1 | marker-1 | 1 | Item A | Visible on wireframe |
104
+ | 2 | marker-2 | 2 | Item B | Visible on wireframe |
105
+
84
106
  | No | Item Name | Item Type | Attribute | DB Column | Size | Default Value | Action | Description | Note |
85
107
  | ---: | --- | --- | --- | --- | --- | --- | --- | --- | --- |
86
108
  | 1 | Item A | Button | - | - | - | - | Click | TBD | TBD |
@@ -103,11 +125,20 @@ Information:
103
125
  - Design Source Reference: Figma URL | screenshot path | `docs/design/DESIGN_LAYOUT_{{FEATURE_KEY}}.md` section reference | `N/A - no UI scope`
104
126
 
105
127
  Screen image:
128
+ <!-- Use a file-relative markdown path from docs/specs/, not a project-root docs/specs/assets/... path. -->
106
129
  ![3.2 Screen B](assets/{{FEATURE_SNAKE}}/screens/scr_02.svg)
107
130
 
108
131
  <!-- If the .svg file does not exist (render unavailable), replace the image line above with: -->
109
132
  <!-- > Screen image not rendered in this environment. See Design Source Reference for layout. -->
110
133
 
134
+ #### Wireframe Marker Mapping (Draft)
135
+
136
+ > Generated-draft wireframe markers are screen-local visual references. Map each visible marker to the global action-table `No` used below.
137
+
138
+ | No | Wireframe Marker | Action Table No | Item Name | Notes |
139
+ | ---: | --- | ---: | --- | --- |
140
+ | 1 | marker-1 | 3 | Item C | Visible on wireframe |
141
+
111
142
  | No | Item Name | Item Type | Attribute | DB Column | Size | Default Value | Action | Description | Note |
112
143
  | ---: | --- | --- | --- | --- | --- | --- | --- | --- | --- |
113
144
  | 3 | Item C | Toggle | boolean | flag_a | - | false | Toggle | TBD | TBD |
@@ -0,0 +1,31 @@
1
+ # ARCH to DEV Handoff
2
+
3
+ ## Required Inputs
4
+ - `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
5
+ - `docs/product/BACKLOG_[FEATURE_KEY].md`
6
+ - when applicable:
7
+ - `docs/api/[FeaturePascal]_API.yaml`
8
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
9
+ - `docs/database/DATABASE_SPEC_[FEATURE_KEY].md`
10
+ - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
11
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
12
+
13
+ ## Required Outputs
14
+ - `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md`
15
+ - code and tests
16
+ - Stage 1 and Stage 2 review evidence before QA handoff
17
+
18
+ ## Mandatory Checks
19
+ - ARCH outputs are current and reference the same feature scope.
20
+ - UI scope includes `DESIGN_LAYOUT` before `FLOW_ACTION_SPEC`.
21
+ - API and DB source-of-truth files are available when implementation depends on them.
22
+
23
+ ## Forbidden Shortcuts
24
+ - Do not start implementation before `FEATURE_IMPL_PLAN` is written and approved.
25
+ - Do not treat architecture assumptions as verified facts without citing the source.
26
+
27
+ ## Handoff Message Shape
28
+ - Feature: `[FEATURE_KEY]`
29
+ - Required implementation slice: file or module scope
30
+ - Required proving checks: test or lint or build commands
31
+ - Upstream blockers or assumptions: explicit list