sdtk-spec-kit 0.4.3 → 0.4.5

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 (127) hide show
  1. package/README.md +369 -376
  2. package/assets/atlas/build_atlas.py +880 -873
  3. package/assets/atlas/doc_atlas_viewer_template.html +3796 -3722
  4. package/assets/atlas/vendor/mermaid.min.js +2029 -2029
  5. package/assets/keys/spec-entitlement-public.pem +11 -11
  6. package/assets/manifest/toolkit-bundle.manifest.json +178 -178
  7. package/assets/manifest/toolkit-bundle.sha256.txt +83 -83
  8. package/assets/toolkit/toolkit/AGENTS.md +247 -245
  9. package/assets/toolkit/toolkit/README.md +50 -50
  10. package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +207 -208
  11. package/assets/toolkit/toolkit/install.ps1 +21 -21
  12. package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +92 -92
  13. package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +70 -70
  14. package/assets/toolkit/toolkit/scripts/agents/run-claude-task.ps1 +332 -332
  15. package/assets/toolkit/toolkit/scripts/agents/run-codex-task.ps1 +618 -618
  16. package/assets/toolkit/toolkit/scripts/agents/validate-mailbox-formal-artifact.py +86 -86
  17. package/assets/toolkit/toolkit/scripts/init-feature.ps1 +262 -262
  18. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +209 -209
  19. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +139 -139
  20. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +143 -143
  21. package/assets/toolkit/toolkit/sdtk-spec.config.json +27 -27
  22. package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +49 -49
  23. package/assets/toolkit/toolkit/session/SDTK_ACTIVE_BOOTSTRAP.md +47 -47
  24. package/assets/toolkit/toolkit/session/SDTK_AGENT_WORKING_RULES.md +49 -49
  25. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +111 -111
  26. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +732 -732
  27. package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +79 -79
  28. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +85 -85
  29. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +46 -46
  30. package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +91 -91
  31. package/assets/toolkit/toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py +246 -246
  32. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/code-quality-reviewer.md +34 -34
  33. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/implementer.md +60 -60
  34. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/spec-reviewer.md +41 -41
  35. package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +80 -80
  36. package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +80 -80
  37. package/assets/toolkit/toolkit/skills/sdtk-mailbox-dispatch/SKILL.md +2 -2
  38. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +17 -17
  39. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +106 -106
  40. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md +50 -50
  41. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md +53 -53
  42. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +28 -28
  43. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py +136 -136
  44. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +414 -414
  45. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +110 -110
  46. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py +97 -97
  47. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +330 -330
  48. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +116 -116
  49. package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +87 -87
  50. package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +59 -59
  51. package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +67 -67
  52. package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +91 -91
  53. package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +73 -73
  54. package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +73 -73
  55. package/assets/toolkit/toolkit/skills-claude/mailbox-dispatch/SKILL.md +2 -2
  56. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +40 -40
  57. package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +88 -88
  58. package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +58 -58
  59. package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +112 -112
  60. package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +115 -115
  61. package/assets/toolkit/toolkit/templates/README.md +68 -68
  62. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +21 -21
  63. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +67 -67
  64. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
  65. package/assets/toolkit/toolkit/templates/docs/api/API_ENDPOINTS_TEMPLATE.md +228 -228
  66. package/assets/toolkit/toolkit/templates/docs/api/FEATURE_API_TEMPLATE.yaml +20 -20
  67. package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +20 -20
  68. package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +128 -128
  69. package/assets/toolkit/toolkit/templates/docs/api/feature_api_flow_list_TEMPLATE.txt +12 -12
  70. package/assets/toolkit/toolkit/templates/docs/architecture/ARCH_DESIGN_TEMPLATE.md +107 -107
  71. package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +60 -60
  72. package/assets/toolkit/toolkit/templates/docs/dev/OPS_HANDOFF_CREATION_RULES.md +369 -369
  73. package/assets/toolkit/toolkit/templates/docs/discovery/REQUIREMENT_TEMPLATE.md +155 -155
  74. package/assets/toolkit/toolkit/templates/docs/product/BACKLOG_TEMPLATE.md +50 -50
  75. package/assets/toolkit/toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md +276 -276
  76. package/assets/toolkit/toolkit/templates/docs/product/PRD_TEMPLATE.md +66 -66
  77. package/assets/toolkit/toolkit/templates/docs/product/PROJECT_INITIATION_TEMPLATE.md +98 -98
  78. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md +129 -129
  79. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_TEMPLATE.md +104 -104
  80. package/assets/toolkit/toolkit/templates/docs/specs/BA_SPEC_TEMPLATE.md +139 -139
  81. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +197 -197
  82. package/assets/toolkit/toolkit/templates/handoffs/ARCH_TO_DEV.md +31 -31
  83. package/assets/toolkit/toolkit/templates/handoffs/BA_TO_ARCH.md +28 -28
  84. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE1_SPEC_REVIEW.md +26 -26
  85. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE2_CODE_QUALITY_REVIEW.md +20 -20
  86. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_QA.md +33 -33
  87. package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +29 -29
  88. package/assets/toolkit/toolkit/templates/handoffs/QA_RELEASE_DECISION.md +26 -26
  89. package/assets/toolkit/toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md +76 -76
  90. package/bin/sdtk.js +15 -15
  91. package/package.json +48 -48
  92. package/src/commands/activate.js +90 -90
  93. package/src/commands/analyze.js +11 -0
  94. package/src/commands/atlas.js +341 -352
  95. package/src/commands/auth.js +85 -85
  96. package/src/commands/entitlement.js +163 -163
  97. package/src/commands/generate.js +209 -147
  98. package/src/commands/help.js +41 -33
  99. package/src/commands/init.js +15 -15
  100. package/src/commands/project.js +51 -51
  101. package/src/commands/runtime.js +239 -239
  102. package/src/index.js +9 -6
  103. package/src/lib/activation-state.js +68 -68
  104. package/src/lib/args.js +116 -116
  105. package/src/lib/atlas-config.js +200 -200
  106. package/src/lib/atlas-runner.js +435 -355
  107. package/src/lib/browser-open.js +39 -39
  108. package/src/lib/capabilities.js +92 -92
  109. package/src/lib/entitlements.js +238 -238
  110. package/src/lib/errors.js +41 -41
  111. package/src/lib/github-access.js +143 -143
  112. package/src/lib/legacy-auth-migration.js +55 -55
  113. package/src/lib/license-activation.js +375 -351
  114. package/src/lib/powershell.js +85 -85
  115. package/src/lib/premium-loader.js +126 -126
  116. package/src/lib/premium-packs.js +331 -331
  117. package/src/lib/premium-sync.js +235 -235
  118. package/src/lib/project-audit.js +332 -332
  119. package/src/lib/project-config.js +108 -108
  120. package/src/lib/project-ingest.js +450 -450
  121. package/src/lib/project-refresh.js +666 -666
  122. package/src/lib/requirement-analysis.js +396 -0
  123. package/src/lib/scope.js +83 -83
  124. package/src/lib/state.js +73 -73
  125. package/src/lib/suite-state.js +70 -70
  126. package/src/lib/toolkit-payload.js +99 -99
  127. package/src/lib/atlas-ask.js +0 -170
@@ -1,106 +1,106 @@
1
- ---
2
- name: sdtk-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.
4
- ---
5
-
6
- # SDTK-SPEC Screen Flow Action Spec
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
- - I do not proceed on generated-draft screens if `DESIGN_LAYOUT_[FEATURE_KEY].md` does not exist.
16
-
17
- ## Outputs
18
- - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
19
- - Optional supporting docs:
20
- - `docs/specs/[FEATURE_KEY]_FIGMA_LAYOUT.md`
21
- - `docs/specs/[FEATURE_KEY]_DESIGN_SPEC_FROM_EXCEL.md`
22
- - `docs/specs/assets/[feature_snake]/screens/*`
23
-
24
- ## Required Inputs
25
- - Feature key/name
26
- - Primary requirement sources (BA spec, architecture, customer design docs)
27
- - Screen source references, using one of these design source modes:
28
- - `source-backed`: Figma URLs and/or requirement screenshots
29
- - `generated-draft`: generated layout from `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` (used when no Figma/screenshot is available for a UI-scope feature)
30
- - API endpoint source (`docs/api/[FEATURE_KEY]_ENDPOINTS.md`) when available
31
-
32
- ## When To Stop Or Escalate
33
- - Stop if no design source is available for a UI-scope screen (neither Figma/screenshot nor a completed DESIGN_LAYOUT); do not draft a flow-action spec against missing design sources.
34
- - Stop if `DESIGN_LAYOUT_[FEATURE_KEY].md` is referenced as a generated-draft source but does not exist; escalate to `sdtk-design-layout` before continuing.
35
- - Stop if the API mapping table cannot be completed because ENDPOINTS.md is missing; record as OQ-xx and continue with explicit gaps noted.
36
- - Stop if legacy PlantUML activity syntax is found in existing source sections; run renumber/migration scripts before adding new content.
37
- - Escalate to `@ba` if UC/BR coverage cannot be confirmed for a screen's flow.
38
- - Escalate to `@arch` if API assignment for a screen is architecturally ambiguous.
39
-
40
- ## Core Process
41
- 1. Read requirement sources and identify in-scope screens, dialogs, and transitions.
42
- 2. Read and apply rules from `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md`.
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`. That file must exist before finalizing the flow-action spec.
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`
52
- - Add UI item/action table with `No` column
53
- - Add API mapping table (trigger -> API -> data usage)
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. Update document history and handoff to ARCH/DEV.
58
-
59
- ## Validation / Quality Gates
60
- - Global numbering consistency: no screen-level reset in action-table `No` column.
61
- - No broken image paths; for generated-draft screens, verify `.svg` exists or use render-skipped note.
62
- - PlantUML renderability and new-style activity syntax consistency: no `(*)`, `-->`, or `[edge label]` mixing.
63
- - Consistency with API endpoints spec.
64
- - EN artifact hygiene: no VI leftovers, no mojibake, no merged heading lines.
65
- - Every UI-scope screen declares a Design Source Type (`source-backed` or `generated-draft`).
66
- - Every generated-draft screen with an embedded wireframe image includes a wireframe-marker mapping table to the global action-table `No`.
67
- - Run `validate_flow_action_spec_numbering.py` before finalizing.
68
-
69
- ## Order-Critical Hard Gate
70
- Do not finalize any screen section before applying `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md`. The rules define mandatory section structure; skipping them produces incomplete specs that will fail ARCH/DEV review.
71
-
72
- For generated-draft screens: do not set Design Source Type = `generated-draft` if `DESIGN_LAYOUT_[FEATURE_KEY].md` does not exist. Block until the layout doc is produced.
73
-
74
- Do not reset action-table numbering between screens. Numbering must be global across the entire document.
75
-
76
- ## Common Mistakes
77
-
78
- | Mistake | Why it is wrong | Do instead |
79
- |---|---|---|
80
- | Reset action-table `No` per screen | Breaks global traceability | Keep `No` sequential across the entire document |
81
- | Mix legacy PlantUML syntax (`-->`, `(*)`) with new-style | Renders incorrectly; fails syntax check | Use new-style activity syntax only; run migration script on legacy content |
82
- | Set `generated-draft` when DESIGN_LAYOUT does not exist | References a missing source | Block until `sdtk-design-layout` produces the layout doc |
83
- | Leave image path as a broken link | Breaks the rendered spec for reviewers | Verify `.svg` exists; use render-skipped note if unavailable |
84
- | Omit API mapping table for API-connected screens | Hides screen-to-API traceability | Add a complete API mapping table for every screen with API calls |
85
- | Apply FLOW_ACTION_SPEC rules from memory | Rules evolve; memory is stale | Always read `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md` first |
86
-
87
- ## Validation Scripts
88
- - `scripts/validate_flow_action_spec_numbering.py`
89
- - Checks duplicate/reset numbering in action tables.
90
- - Checks encoding/markdown hygiene.
91
- - Checks screen-image markdown path convention.
92
- - Checks mixed legacy/new-style PlantUML activity syntax in screen-flow diagrams.
93
- - For EN artifacts: `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`
94
- - `scripts/renumber_flow_action_spec_global.py`
95
- - Auto-migrates action table `No` fields to global numbering.
96
- - Dry-run: `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md"`
97
- - Apply: `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`
98
-
99
- ## Reference Loading Guidance
100
- Read at skill start:
101
- - `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md` (required before any screen section)
102
-
103
- Read on demand:
104
- - `./references/numbering-rules.md` (when resolving numbering migration questions)
105
- - `./references/figma-mcp.md` (when source-backed mode uses Figma)
106
- - `./references/excel-image-export.md` (when source includes Excel screenshots)
1
+ ---
2
+ name: sdtk-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.
4
+ ---
5
+
6
+ # SDTK-SPEC Screen Flow Action Spec
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
+ - I do not proceed on generated-draft screens if `DESIGN_LAYOUT_[FEATURE_KEY].md` does not exist.
16
+
17
+ ## Outputs
18
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
19
+ - Optional supporting docs:
20
+ - `docs/specs/[FEATURE_KEY]_FIGMA_LAYOUT.md`
21
+ - `docs/specs/[FEATURE_KEY]_DESIGN_SPEC_FROM_EXCEL.md`
22
+ - `docs/specs/assets/[feature_snake]/screens/*`
23
+
24
+ ## Required Inputs
25
+ - Feature key/name
26
+ - Primary requirement sources (BA spec, architecture, customer design docs)
27
+ - Screen source references, using one of these design source modes:
28
+ - `source-backed`: Figma URLs and/or requirement screenshots
29
+ - `generated-draft`: generated layout from `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` (used when no Figma/screenshot is available for a UI-scope feature)
30
+ - API endpoint source (`docs/api/[FEATURE_KEY]_ENDPOINTS.md`) when available
31
+
32
+ ## When To Stop Or Escalate
33
+ - Stop if no design source is available for a UI-scope screen (neither Figma/screenshot nor a completed DESIGN_LAYOUT); do not draft a flow-action spec against missing design sources.
34
+ - Stop if `DESIGN_LAYOUT_[FEATURE_KEY].md` is referenced as a generated-draft source but does not exist; escalate to `sdtk-design-layout` before continuing.
35
+ - Stop if the API mapping table cannot be completed because ENDPOINTS.md is missing; record as OQ-xx and continue with explicit gaps noted.
36
+ - Stop if legacy PlantUML activity syntax is found in existing source sections; run renumber/migration scripts before adding new content.
37
+ - Escalate to `@ba` if UC/BR coverage cannot be confirmed for a screen's flow.
38
+ - Escalate to `@arch` if API assignment for a screen is architecturally ambiguous.
39
+
40
+ ## Core Process
41
+ 1. Read requirement sources and identify in-scope screens, dialogs, and transitions.
42
+ 2. Read and apply rules from `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md`.
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`. That file must exist before finalizing the flow-action spec.
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`
52
+ - Add UI item/action table with `No` column
53
+ - Add API mapping table (trigger -> API -> data usage)
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. Update document history and handoff to ARCH/DEV.
58
+
59
+ ## Validation / Quality Gates
60
+ - Global numbering consistency: no screen-level reset in action-table `No` column.
61
+ - No broken image paths; for generated-draft screens, verify `.svg` exists or use render-skipped note.
62
+ - PlantUML renderability and new-style activity syntax consistency: no `(*)`, `-->`, or `[edge label]` mixing.
63
+ - Consistency with API endpoints spec.
64
+ - EN artifact hygiene: no VI leftovers, no mojibake, no merged heading lines.
65
+ - Every UI-scope screen declares a Design Source Type (`source-backed` or `generated-draft`).
66
+ - Every generated-draft screen with an embedded wireframe image includes a wireframe-marker mapping table to the global action-table `No`.
67
+ - Run `validate_flow_action_spec_numbering.py` before finalizing.
68
+
69
+ ## Order-Critical Hard Gate
70
+ Do not finalize any screen section before applying `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md`. The rules define mandatory section structure; skipping them produces incomplete specs that will fail ARCH/DEV review.
71
+
72
+ For generated-draft screens: do not set Design Source Type = `generated-draft` if `DESIGN_LAYOUT_[FEATURE_KEY].md` does not exist. Block until the layout doc is produced.
73
+
74
+ Do not reset action-table numbering between screens. Numbering must be global across the entire document.
75
+
76
+ ## Common Mistakes
77
+
78
+ | Mistake | Why it is wrong | Do instead |
79
+ |---|---|---|
80
+ | Reset action-table `No` per screen | Breaks global traceability | Keep `No` sequential across the entire document |
81
+ | Mix legacy PlantUML syntax (`-->`, `(*)`) with new-style | Renders incorrectly; fails syntax check | Use new-style activity syntax only; run migration script on legacy content |
82
+ | Set `generated-draft` when DESIGN_LAYOUT does not exist | References a missing source | Block until `sdtk-design-layout` produces the layout doc |
83
+ | Leave image path as a broken link | Breaks the rendered spec for reviewers | Verify `.svg` exists; use render-skipped note if unavailable |
84
+ | Omit API mapping table for API-connected screens | Hides screen-to-API traceability | Add a complete API mapping table for every screen with API calls |
85
+ | Apply FLOW_ACTION_SPEC rules from memory | Rules evolve; memory is stale | Always read `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md` first |
86
+
87
+ ## Validation Scripts
88
+ - `scripts/validate_flow_action_spec_numbering.py`
89
+ - Checks duplicate/reset numbering in action tables.
90
+ - Checks encoding/markdown hygiene.
91
+ - Checks screen-image markdown path convention.
92
+ - Checks mixed legacy/new-style PlantUML activity syntax in screen-flow diagrams.
93
+ - For EN artifacts: `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`
94
+ - `scripts/renumber_flow_action_spec_global.py`
95
+ - Auto-migrates action table `No` fields to global numbering.
96
+ - Dry-run: `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md"`
97
+ - Apply: `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`
98
+
99
+ ## Reference Loading Guidance
100
+ Read at skill start:
101
+ - `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md` (required before any screen section)
102
+
103
+ Read on demand:
104
+ - `./references/numbering-rules.md` (when resolving numbering migration questions)
105
+ - `./references/figma-mcp.md` (when source-backed mode uses Figma)
106
+ - `./references/excel-image-export.md` (when source includes Excel screenshots)
@@ -1,51 +1,51 @@
1
- # Export images from Excel sheets with pictures or shapes
2
-
3
- ## When to use this
4
-
5
- - The source sheet contains pictures or shapes instead of plain cell text.
6
- - You need a real image export for markdown embedding or numbered overlays.
7
-
8
- ## Known issues and root causes
9
-
10
- 1) `Chart.Export()` produces a blank PNG (~1.3KB)
11
- - Root cause: Excel COM chart/picture export is unreliable for complex grouped objects or pictures.
12
-
13
- 2) Wrong image folder path when using Save As HTML
14
- - Excel writes image assets to a folder named `<basename>.files`
15
- - Example: `export.html` -> folder `export.files` (not `export.html.files`).
16
-
17
- 3) Excel COM crash / OLE error `0x800a01a8`
18
- - Common root cause: calling `Quit()` on the wrong Excel instance, especially when using `Dispatch`.
19
-
20
- 4) Two-digit markers lose one digit (`10` displays like `1`)
21
- - Root cause: the oval is too small and the wrap/alignment settings are not appropriate.
22
-
23
- ## Recommended automated approach
24
-
25
- Use the repo script, for example:
26
- `Requirements/_generate_numbered_screen_images.py`
27
-
28
- The script should ensure:
29
- - Flatten grouped content and use Save As HTML to get a real PNG export and avoid blank PNG output.
30
- - Use `DispatchEx` when opening a dedicated Excel instance for overlay work to avoid quitting the wrong instance.
31
- - Increase oval size and disable `WordWrap` so 2-3 digit markers remain visible.
32
- - Use the correct `.files` folder convention when exporting HTML.
33
-
34
- Run it from the project root, for example:
35
- ```powershell
36
- python Requirements\_generate_numbered_screen_images.py
37
- ```
38
-
39
- ## Manual fallback approach
40
-
41
- 1) Open Excel -> select the UI area to export (picture/group) -> Copy as Picture.
42
- 2) Paste it into a blank sheet or a new workbook.
43
- 3) Save As -> "Web Page (*.htm; *.html)".
44
- 4) Open the `<basename>.files` folder -> choose the `imageXXX.png` file with the most appropriate size.
45
- 5) Copy it into `docs/specs/assets/[feature_snake]/screens/` and rename it according to the naming convention.
46
-
47
- ## If the script fails because Excel renamed a picture
48
-
49
- If the script references a `picture_name` such as `Picture 4` or `Picture 7`, and Excel renamed it:
50
- - Open Excel -> select the picture -> inspect or rename it in the Selection Pane, or
1
+ # Export images from Excel sheets with pictures or shapes
2
+
3
+ ## When to use this
4
+
5
+ - The source sheet contains pictures or shapes instead of plain cell text.
6
+ - You need a real image export for markdown embedding or numbered overlays.
7
+
8
+ ## Known issues and root causes
9
+
10
+ 1) `Chart.Export()` produces a blank PNG (~1.3KB)
11
+ - Root cause: Excel COM chart/picture export is unreliable for complex grouped objects or pictures.
12
+
13
+ 2) Wrong image folder path when using Save As HTML
14
+ - Excel writes image assets to a folder named `<basename>.files`
15
+ - Example: `export.html` -> folder `export.files` (not `export.html.files`).
16
+
17
+ 3) Excel COM crash / OLE error `0x800a01a8`
18
+ - Common root cause: calling `Quit()` on the wrong Excel instance, especially when using `Dispatch`.
19
+
20
+ 4) Two-digit markers lose one digit (`10` displays like `1`)
21
+ - Root cause: the oval is too small and the wrap/alignment settings are not appropriate.
22
+
23
+ ## Recommended automated approach
24
+
25
+ Use the repo script, for example:
26
+ `Requirements/_generate_numbered_screen_images.py`
27
+
28
+ The script should ensure:
29
+ - Flatten grouped content and use Save As HTML to get a real PNG export and avoid blank PNG output.
30
+ - Use `DispatchEx` when opening a dedicated Excel instance for overlay work to avoid quitting the wrong instance.
31
+ - Increase oval size and disable `WordWrap` so 2-3 digit markers remain visible.
32
+ - Use the correct `.files` folder convention when exporting HTML.
33
+
34
+ Run it from the project root, for example:
35
+ ```powershell
36
+ python Requirements\_generate_numbered_screen_images.py
37
+ ```
38
+
39
+ ## Manual fallback approach
40
+
41
+ 1) Open Excel -> select the UI area to export (picture/group) -> Copy as Picture.
42
+ 2) Paste it into a blank sheet or a new workbook.
43
+ 3) Save As -> "Web Page (*.htm; *.html)".
44
+ 4) Open the `<basename>.files` folder -> choose the `imageXXX.png` file with the most appropriate size.
45
+ 5) Copy it into `docs/specs/assets/[feature_snake]/screens/` and rename it according to the naming convention.
46
+
47
+ ## If the script fails because Excel renamed a picture
48
+
49
+ If the script references a `picture_name` such as `Picture 4` or `Picture 7`, and Excel renamed it:
50
+ - Open Excel -> select the picture -> inspect or rename it in the Selection Pane, or
51
51
  - Update the `picture_name` in the script.
@@ -1,54 +1,54 @@
1
- # Figma MCP: extract layout, styling, tokens, and screen images
2
-
3
- ## Parse the Figma URL
4
-
5
- Example URL:
6
- `https://www.figma.com/design/<fileKey>/<fileName>?node-id=<nodeId>&m=dev&t=...`
7
-
8
- - `fileKey` = the segment after `/design/`.
9
- - `nodeId`:
10
- - query param `node-id=1-2695`
11
- - convert to API format: `1:2695` (replace `-` with `:`).
12
-
13
- ## Fetch layout and styling data first
14
-
15
- Use MCP:
16
- - `mcp__figma__get_figma_data`
17
- - Input: `fileKey`, `nodeId`
18
- - Recommendation: try `depth=2` or `depth=3` first, then increase only if data is missing.
19
-
20
- When summarizing into `docs/specs/[FEATURE_KEY]_FIGMA_LAYOUT.md`, keep this structure:
21
- - Design Structure: frame dimensions, components/instances, key layers, variants/properties.
22
- - Styling Data: color (Hex/RGB), typography (font/size/weight/line-height), shadow/opacity/border.
23
- - Layout Information: padding/gap/alignment, width/height, border radius.
24
- - Design Tokens: color/typography/spacing tokens when named styles exist (for example `style_...`).
25
-
26
- ## Handle `429` and partial data
27
-
28
- If you hit `429 Too Many Requests`:
29
- 1) Reduce `depth` and try again.
30
- 2) Wait and retry with backoff (20s -> 40s -> 80s).
31
- 3) If it still fails, leave the unavailable sections blank and record a clear note that the omission is due to `429`.
32
-
33
- Do not invent colors, typography, or tokens when the source data is unavailable.
34
-
35
- ## Export screen images
36
-
37
- Use MCP:
38
- - `mcp__figma__download_figma_images`
39
- - Input: `fileKey`, list of `nodes` (`nodeId`), `fileName` (`png`), `pngScale` (usually `2`).
40
-
41
- Notes for `localPath`:
42
- - Some environments block absolute paths.
43
- - Use a repo-relative temp folder first, for example `Requirements/_tmp/figma_downloads`, then copy the images into:
44
- - `docs/specs/assets/[feature_snake]/screens/`
45
-
46
- ## Image naming convention
47
-
48
- Use stable filenames so markdown embeds do not need frequent updates, for example:
49
- - `screen_3_1_main.png`
50
- - `screen_3_2_search.png`
51
- - `screen_3_3_dialog.png`
52
- - `screen_3_3_dialog_numbered.png`
53
-
1
+ # Figma MCP: extract layout, styling, tokens, and screen images
2
+
3
+ ## Parse the Figma URL
4
+
5
+ Example URL:
6
+ `https://www.figma.com/design/<fileKey>/<fileName>?node-id=<nodeId>&m=dev&t=...`
7
+
8
+ - `fileKey` = the segment after `/design/`.
9
+ - `nodeId`:
10
+ - query param `node-id=1-2695`
11
+ - convert to API format: `1:2695` (replace `-` with `:`).
12
+
13
+ ## Fetch layout and styling data first
14
+
15
+ Use MCP:
16
+ - `mcp__figma__get_figma_data`
17
+ - Input: `fileKey`, `nodeId`
18
+ - Recommendation: try `depth=2` or `depth=3` first, then increase only if data is missing.
19
+
20
+ When summarizing into `docs/specs/[FEATURE_KEY]_FIGMA_LAYOUT.md`, keep this structure:
21
+ - Design Structure: frame dimensions, components/instances, key layers, variants/properties.
22
+ - Styling Data: color (Hex/RGB), typography (font/size/weight/line-height), shadow/opacity/border.
23
+ - Layout Information: padding/gap/alignment, width/height, border radius.
24
+ - Design Tokens: color/typography/spacing tokens when named styles exist (for example `style_...`).
25
+
26
+ ## Handle `429` and partial data
27
+
28
+ If you hit `429 Too Many Requests`:
29
+ 1) Reduce `depth` and try again.
30
+ 2) Wait and retry with backoff (20s -> 40s -> 80s).
31
+ 3) If it still fails, leave the unavailable sections blank and record a clear note that the omission is due to `429`.
32
+
33
+ Do not invent colors, typography, or tokens when the source data is unavailable.
34
+
35
+ ## Export screen images
36
+
37
+ Use MCP:
38
+ - `mcp__figma__download_figma_images`
39
+ - Input: `fileKey`, list of `nodes` (`nodeId`), `fileName` (`png`), `pngScale` (usually `2`).
40
+
41
+ Notes for `localPath`:
42
+ - Some environments block absolute paths.
43
+ - Use a repo-relative temp folder first, for example `Requirements/_tmp/figma_downloads`, then copy the images into:
44
+ - `docs/specs/assets/[feature_snake]/screens/`
45
+
46
+ ## Image naming convention
47
+
48
+ Use stable filenames so markdown embeds do not need frequent updates, for example:
49
+ - `screen_3_1_main.png`
50
+ - `screen_3_2_search.png`
51
+ - `screen_3_3_dialog.png`
52
+ - `screen_3_3_dialog_numbered.png`
53
+
54
54
  If an image is later replaced by an Excel-derived export, keep the same filename to avoid rewriting multiple markdown links.
@@ -1,28 +1,28 @@
1
- # UI Numbering Policy
2
-
3
- ## Scope
4
-
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`.
8
-
9
- ## DESIGN_LAYOUT Rules
10
-
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
-
16
- ## FLOW_ACTION_SPEC Rules
17
-
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.
23
-
24
- ## Non-1:1 Mapping Cases
25
-
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`.
1
+ # UI Numbering Policy
2
+
3
+ ## Scope
4
+
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`.
8
+
9
+ ## DESIGN_LAYOUT Rules
10
+
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
+
16
+ ## FLOW_ACTION_SPEC Rules
17
+
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.
23
+
24
+ ## Non-1:1 Mapping Cases
25
+
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`.