sdtk-spec-kit 0.4.11 → 0.4.14

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 (143) hide show
  1. package/README.md +353 -353
  2. package/assets/atlas/build_atlas.py +880 -880
  3. package/assets/atlas/doc_atlas_viewer_template.html +3796 -3796
  4. package/assets/atlas/vendor/mermaid.min.js +2029 -2029
  5. package/assets/keys/spec-entitlement-public.pem +9 -9
  6. package/assets/manifest/toolkit-bundle.manifest.json +496 -496
  7. package/assets/manifest/toolkit-bundle.sha256.txt +97 -97
  8. package/assets/toolkit/toolkit/AGENTS.md +157 -241
  9. package/assets/toolkit/toolkit/README.md +51 -51
  10. package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +206 -206
  11. package/assets/toolkit/toolkit/install.ps1 +362 -362
  12. package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +95 -91
  13. package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +70 -69
  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 +87 -87
  17. package/assets/toolkit/toolkit/scripts/generate-code-handoff.ps1 +317 -317
  18. package/assets/toolkit/toolkit/scripts/init-feature.ps1 +262 -262
  19. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +180 -180
  20. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +209 -209
  21. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +139 -139
  22. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +143 -143
  23. package/assets/toolkit/toolkit/sdtk-spec.config.json +28 -28
  24. package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +50 -50
  25. package/assets/toolkit/toolkit/session/SDTK_ACTIVE_BOOTSTRAP.md +46 -46
  26. package/assets/toolkit/toolkit/session/SDTK_AGENT_WORKING_RULES.md +48 -48
  27. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +111 -111
  28. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +732 -732
  29. package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +79 -79
  30. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +85 -85
  31. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +46 -46
  32. package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +91 -91
  33. package/assets/toolkit/toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py +246 -246
  34. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +133 -133
  35. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/code-quality-reviewer.md +34 -34
  36. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/implementer.md +60 -60
  37. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/spec-reviewer.md +41 -41
  38. package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +80 -80
  39. package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +80 -80
  40. package/assets/toolkit/toolkit/skills/sdtk-mailbox-dispatch/SKILL.md +73 -73
  41. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +176 -108
  42. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +74 -74
  43. package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +75 -75
  44. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +108 -107
  45. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md +51 -51
  46. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md +54 -54
  47. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +28 -28
  48. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py +136 -136
  49. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +414 -414
  50. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +110 -110
  51. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py +97 -97
  52. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +330 -330
  53. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +116 -116
  54. package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +87 -87
  55. package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +59 -59
  56. package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +67 -67
  57. package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +91 -91
  58. package/assets/toolkit/toolkit/skills-claude/dev/SKILL.md +59 -59
  59. package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +73 -73
  60. package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +73 -73
  61. package/assets/toolkit/toolkit/skills-claude/mailbox-dispatch/SKILL.md +73 -73
  62. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +88 -42
  63. package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +88 -88
  64. package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +58 -58
  65. package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +113 -112
  66. package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +115 -115
  67. package/assets/toolkit/toolkit/templates/QUALITY_CHECKLIST.md +124 -124
  68. package/assets/toolkit/toolkit/templates/README.md +68 -68
  69. package/assets/toolkit/toolkit/templates/SHARED_PLANNING.md +81 -81
  70. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +21 -21
  71. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +67 -67
  72. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
  73. package/assets/toolkit/toolkit/templates/docs/api/API_ENDPOINTS_TEMPLATE.md +229 -229
  74. package/assets/toolkit/toolkit/templates/docs/api/FEATURE_API_TEMPLATE.yaml +20 -20
  75. package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +20 -20
  76. package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +128 -128
  77. package/assets/toolkit/toolkit/templates/docs/api/feature_api_flow_list_TEMPLATE.txt +12 -12
  78. package/assets/toolkit/toolkit/templates/docs/architecture/ARCH_DESIGN_TEMPLATE.md +109 -109
  79. package/assets/toolkit/toolkit/templates/docs/database/DATABASE_SPEC_TEMPLATE.md +175 -175
  80. package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +60 -60
  81. package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +117 -117
  82. package/assets/toolkit/toolkit/templates/docs/dev/OPS_HANDOFF_CREATION_RULES.md +369 -369
  83. package/assets/toolkit/toolkit/templates/docs/discovery/REQUIREMENT_TEMPLATE.md +155 -155
  84. package/assets/toolkit/toolkit/templates/docs/product/BACKLOG_TEMPLATE.md +50 -50
  85. package/assets/toolkit/toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md +276 -276
  86. package/assets/toolkit/toolkit/templates/docs/product/PRD_TEMPLATE.md +66 -66
  87. package/assets/toolkit/toolkit/templates/docs/product/PROJECT_INITIATION_TEMPLATE.md +98 -98
  88. package/assets/toolkit/toolkit/templates/docs/qa/CONTROLLER_ACCEPTANCE_TEMPLATE.md +90 -90
  89. package/assets/toolkit/toolkit/templates/docs/qa/QA_RELEASE_REPORT_TEMPLATE.md +162 -162
  90. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md +129 -129
  91. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_TEMPLATE.md +104 -104
  92. package/assets/toolkit/toolkit/templates/docs/specs/BA_SPEC_TEMPLATE.md +139 -139
  93. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +220 -220
  94. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +197 -197
  95. package/assets/toolkit/toolkit/templates/handoffs/ARCH_TO_DEV.md +31 -31
  96. package/assets/toolkit/toolkit/templates/handoffs/BA_TO_ARCH.md +28 -28
  97. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE1_SPEC_REVIEW.md +26 -26
  98. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE2_CODE_QUALITY_REVIEW.md +20 -20
  99. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_QA.md +33 -33
  100. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_SDTK_CODE.md +60 -60
  101. package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +30 -30
  102. package/assets/toolkit/toolkit/templates/handoffs/QA_RELEASE_DECISION.md +26 -26
  103. package/assets/toolkit/toolkit/templates/mailbox/AGENT_REPORT_TEMPLATE.md +63 -63
  104. package/assets/toolkit/toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md +76 -76
  105. package/bin/sdtk.js +15 -15
  106. package/package.json +48 -48
  107. package/src/commands/activate.js +94 -94
  108. package/src/commands/atlas.js +339 -339
  109. package/src/commands/auth.js +85 -85
  110. package/src/commands/entitlement.js +170 -170
  111. package/src/commands/generate.js +191 -170
  112. package/src/commands/help.js +248 -246
  113. package/src/commands/init.js +117 -117
  114. package/src/commands/project.js +51 -51
  115. package/src/commands/runtime.js +239 -239
  116. package/src/commands/update.js +11 -11
  117. package/src/index.js +68 -68
  118. package/src/lib/activation-state.js +68 -68
  119. package/src/lib/args.js +116 -116
  120. package/src/lib/atlas-config.js +200 -200
  121. package/src/lib/atlas-runner.js +435 -435
  122. package/src/lib/browser-open.js +39 -39
  123. package/src/lib/capabilities.js +89 -89
  124. package/src/lib/entitlements.js +245 -245
  125. package/src/lib/errors.js +41 -41
  126. package/src/lib/github-access.js +143 -143
  127. package/src/lib/legacy-auth-migration.js +56 -56
  128. package/src/lib/license-activation.js +386 -386
  129. package/src/lib/powershell.js +85 -85
  130. package/src/lib/premium-loader.js +124 -124
  131. package/src/lib/premium-packs.js +333 -333
  132. package/src/lib/premium-sync.js +235 -235
  133. package/src/lib/project-audit.js +332 -332
  134. package/src/lib/project-config.js +108 -108
  135. package/src/lib/project-ingest.js +450 -450
  136. package/src/lib/project-refresh.js +666 -666
  137. package/src/lib/project-target-guard.js +79 -79
  138. package/src/lib/requirement-analysis.js +14 -4
  139. package/src/lib/scope.js +83 -83
  140. package/src/lib/state.js +74 -74
  141. package/src/lib/suite-state.js +70 -70
  142. package/src/lib/toolkit-payload.js +99 -99
  143. package/src/lib/update.js +333 -333
@@ -1,79 +1,79 @@
1
- ---
2
- name: sdtk-api-doc
3
- description: Generate OpenAPI 3.x YAML and PlantUML flow diagrams for a feature following this toolkit's API conventions. Use when you need to create/update docs/api/* (API spec + flow list) from BA_SPEC/ARCH_DESIGN.
4
- ---
5
-
6
- # SDTK-SPEC API Documentation
7
-
8
- ## Critical Constraints
9
- - I do not invent API paths or payload contracts that contradict BA or ARCH artifacts.
10
- - I do not leave YAML, endpoint markdown, and flow-list outputs out of sync.
11
- - I do not emit a final API doc without applying canonical YAML and flowchart rules.
12
- - I do not proceed if BA_SPEC or ARCH_DESIGN is absent or clearly incomplete for the current feature scope.
13
-
14
- ## Outputs
15
- - `docs/api/[FeaturePascal]_API.yaml`
16
- - `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
17
- - `docs/api/[feature_snake]_api_flow_list.txt`
18
- - Optional downstream (via `sdtk-api-design-spec`):
19
- - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
20
-
21
- ## Required Inputs
22
- - Feature name and key
23
- - Entities and key fields
24
- - Use cases (UC-xx) and business rules (BR-xx)
25
- - Auth/permission model
26
- - `docs/specs/BA_SPEC_[FEATURE_KEY].md` or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
27
-
28
- ## When To Stop Or Escalate
29
- - Stop if no BA_SPEC or ARCH_DESIGN exists for the current feature; surface as a blocker before generating any artifact.
30
- - Stop if path naming policy from `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` cannot be resolved without a product decision; record as OQ-xx and escalate to `@pm`.
31
- - Stop if required UC/BR coverage cannot be confirmed from available sources; do not invent coverage.
32
- - Escalate to `@arch` if the data model or endpoint scope is structurally ambiguous.
33
-
34
- ## Core Process
35
- 1. Read `docs/specs/BA_SPEC_[FEATURE_KEY].md` and/or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`.
36
- 2. Load reference rules:
37
- - `toolkit/templates/docs/api/YAML_CREATION_RULES.md` for YAML contract rules
38
- - `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` for flow list / flowchart rules
39
- 3. Define endpoints mapped to UC-xx; keep path naming consistent across CRUD/search/list/mst patterns and apply `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` for canonical resource naming.
40
- 4. For each endpoint, document request/response schema and error cases.
41
- 5. Generate/update endpoint markdown (`[FEATURE_KEY]_ENDPOINTS.md`) with summary tables, API type grouping, and screen-logic mapping.
42
- 6. Generate PlantUML flows including auth, permission check, validation, main logic, and error exits.
43
- 7. Ensure traceability notes reference UC/BR where relevant.
44
- 8. For benchmark runs, if the requirement or upstream artifacts mark an OQ as expected OPEN, keep that ambiguity explicit in flow list / endpoint docs instead of silently collapsing it.
45
- 9. Validate English output hygiene when generating English artifacts:
46
- - no mixed-language leftovers in narrative text
47
- - no mojibake/encoding corruption markers
48
- - terminology consistency across endpoint detail, summary tables, and flow labels
49
- 10. If orchestrator mode requires API design detail generation (`apiDesignDetailMode=auto/on`), handoff to `sdtk-api-design-spec` after YAML + flow list are updated.
50
-
51
- ## Validation / Quality Gates
52
- - YAML, ENDPOINTS.md, and flow list are consistent: the same resource uses the same path segment across all three.
53
- - Every UC-xx in scope has at least one endpoint mapped.
54
- - Every endpoint has a defined success response and at least one error case.
55
- - All path segments match the canonical naming policy in `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md`.
56
- - No OQ-xx is silently collapsed; unresolved items remain explicit.
57
- - English artifact hygiene passes (no language leftovers, no mojibake).
58
-
59
- ## Order-Critical Hard Gate
60
- Do not finalize YAML or ENDPOINTS.md before reading and applying both reference rule files. Generating endpoints without `toolkit/templates/docs/api/YAML_CREATION_RULES.md` and `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` produces non-conformant output that will fail downstream review.
61
-
62
- ## Common Mistakes
63
-
64
- | Mistake | Why it is wrong | Do instead |
65
- |---|---|---|
66
- | Invent endpoint paths not in BA/ARCH | Creates untracked contract drift | Map every endpoint to an explicit UC-xx or BR-xx |
67
- | Apply path naming from memory without reading policy | Policy details evolve; memory is stale | Always read `SDTK_API_PATH_STYLE_POLICY.md` first |
68
- | Leave YAML and ENDPOINTS.md out of sync | Downstream tools depend on consistency | Cross-check path/method/schema for each endpoint across all three outputs |
69
- | Silently collapse an OQ-xx marked as OPEN | Hides unresolved decisions | Keep OQ-xx explicit; escalate to `@pm` if resolution is needed |
70
- | Skip flowchart rules and free-style PlantUML | Produces flows that deviate from SDTK conventions | Apply `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` before generating any flow |
71
-
72
- ## Reference Loading Guidance
73
- Read these files at skill start, not on demand:
74
- - `toolkit/templates/docs/api/YAML_CREATION_RULES.md`
75
- - `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md`
76
-
77
- Read on demand when needed:
78
- - `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` (always required for path naming)
79
- - `docs/specs/API_DOC_SKILL_ANALYSIS.md` (if present; deeper domain analysis only)
1
+ ---
2
+ name: sdtk-api-doc
3
+ description: Generate OpenAPI 3.x YAML and PlantUML flow diagrams for a feature following this toolkit's API conventions. Use when you need to create/update docs/api/* (API spec + flow list) from BA_SPEC/ARCH_DESIGN.
4
+ ---
5
+
6
+ # SDTK-SPEC API Documentation
7
+
8
+ ## Critical Constraints
9
+ - I do not invent API paths or payload contracts that contradict BA or ARCH artifacts.
10
+ - I do not leave YAML, endpoint markdown, and flow-list outputs out of sync.
11
+ - I do not emit a final API doc without applying canonical YAML and flowchart rules.
12
+ - I do not proceed if BA_SPEC or ARCH_DESIGN is absent or clearly incomplete for the current feature scope.
13
+
14
+ ## Outputs
15
+ - `docs/api/[FeaturePascal]_API.yaml`
16
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
17
+ - `docs/api/[feature_snake]_api_flow_list.txt`
18
+ - Optional downstream (via `sdtk-api-design-spec`):
19
+ - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
20
+
21
+ ## Required Inputs
22
+ - Feature name and key
23
+ - Entities and key fields
24
+ - Use cases (UC-xx) and business rules (BR-xx)
25
+ - Auth/permission model
26
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
27
+
28
+ ## When To Stop Or Escalate
29
+ - Stop if no BA_SPEC or ARCH_DESIGN exists for the current feature; surface as a blocker before generating any artifact.
30
+ - Stop if path naming policy from `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` cannot be resolved without a product decision; record as OQ-xx and escalate to `@pm`.
31
+ - Stop if required UC/BR coverage cannot be confirmed from available sources; do not invent coverage.
32
+ - Escalate to `@arch` if the data model or endpoint scope is structurally ambiguous.
33
+
34
+ ## Core Process
35
+ 1. Read `docs/specs/BA_SPEC_[FEATURE_KEY].md` and/or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`.
36
+ 2. Load reference rules:
37
+ - `toolkit/templates/docs/api/YAML_CREATION_RULES.md` for YAML contract rules
38
+ - `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` for flow list / flowchart rules
39
+ 3. Define endpoints mapped to UC-xx; keep path naming consistent across CRUD/search/list/mst patterns and apply `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` for canonical resource naming.
40
+ 4. For each endpoint, document request/response schema and error cases.
41
+ 5. Generate/update endpoint markdown (`[FEATURE_KEY]_ENDPOINTS.md`) with summary tables, API type grouping, and screen-logic mapping.
42
+ 6. Generate PlantUML flows including auth, permission check, validation, main logic, and error exits.
43
+ 7. Ensure traceability notes reference UC/BR where relevant.
44
+ 8. For benchmark runs, if the requirement or upstream artifacts mark an OQ as expected OPEN, keep that ambiguity explicit in flow list / endpoint docs instead of silently collapsing it.
45
+ 9. Validate English output hygiene when generating English artifacts:
46
+ - no mixed-language leftovers in narrative text
47
+ - no mojibake/encoding corruption markers
48
+ - terminology consistency across endpoint detail, summary tables, and flow labels
49
+ 10. If orchestrator mode requires API design detail generation (`apiDesignDetailMode=auto/on`), handoff to `sdtk-api-design-spec` after YAML + flow list are updated.
50
+
51
+ ## Validation / Quality Gates
52
+ - YAML, ENDPOINTS.md, and flow list are consistent: the same resource uses the same path segment across all three.
53
+ - Every UC-xx in scope has at least one endpoint mapped.
54
+ - Every endpoint has a defined success response and at least one error case.
55
+ - All path segments match the canonical naming policy in `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md`.
56
+ - No OQ-xx is silently collapsed; unresolved items remain explicit.
57
+ - English artifact hygiene passes (no language leftovers, no mojibake).
58
+
59
+ ## Order-Critical Hard Gate
60
+ Do not finalize YAML or ENDPOINTS.md before reading and applying both reference rule files. Generating endpoints without `toolkit/templates/docs/api/YAML_CREATION_RULES.md` and `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` produces non-conformant output that will fail downstream review.
61
+
62
+ ## Common Mistakes
63
+
64
+ | Mistake | Why it is wrong | Do instead |
65
+ |---|---|---|
66
+ | Invent endpoint paths not in BA/ARCH | Creates untracked contract drift | Map every endpoint to an explicit UC-xx or BR-xx |
67
+ | Apply path naming from memory without reading policy | Policy details evolve; memory is stale | Always read `SDTK_API_PATH_STYLE_POLICY.md` first |
68
+ | Leave YAML and ENDPOINTS.md out of sync | Downstream tools depend on consistency | Cross-check path/method/schema for each endpoint across all three outputs |
69
+ | Silently collapse an OQ-xx marked as OPEN | Hides unresolved decisions | Keep OQ-xx explicit; escalate to `@pm` if resolution is needed |
70
+ | Skip flowchart rules and free-style PlantUML | Produces flows that deviate from SDTK conventions | Apply `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` before generating any flow |
71
+
72
+ ## Reference Loading Guidance
73
+ Read these files at skill start, not on demand:
74
+ - `toolkit/templates/docs/api/YAML_CREATION_RULES.md`
75
+ - `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md`
76
+
77
+ Read on demand when needed:
78
+ - `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` (always required for path naming)
79
+ - `docs/specs/API_DOC_SKILL_ANALYSIS.md` (if present; deeper domain analysis only)
@@ -1,85 +1,85 @@
1
- ---
2
- name: sdtk-arch
3
- description: Solution Architect workflow for SDTK-SPEC. 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.
4
- ---
5
-
6
- # SDTK-SPEC ARCH (Solution Architecture)
7
-
8
- ## Critical Constraints
9
- - I do not generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI-scope features.
10
- - I do not let API, DB, and UI artifacts drift from the same BA and PM source of truth.
11
-
12
- ## Outputs
13
- - `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
14
- - If applicable:
15
- - `docs/api/[FeaturePascal]_API.yaml`
16
- - `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
17
- - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
18
- - `docs/api/[feature_snake]_api_flow_list.txt`
19
- - `docs/database/DATABASE_SPEC_[FEATURE_KEY].md`
20
- - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
21
- - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
22
-
23
- ## Flow Overview
24
-
25
- ```dot
26
- digraph sdtk_arch_flow {
27
- rankdir=TB;
28
- BA_SPEC -> ARCH_DESIGN;
29
- ARCH_DESIGN -> DESIGN_LAYOUT;
30
- DESIGN_LAYOUT -> FLOW_ACTION_SPEC;
31
- ARCH_DESIGN -> API_YAML;
32
- API_YAML -> API_DETAIL;
33
- }
34
- ```
35
-
36
- ## Process
37
- 1. Read BA spec and PRD/backlog.
38
- 2. Read `sdtk-spec.config.json` for project stack assumptions (backend/frontend/db/auth).
39
- 3. If architecture output includes API contracts/flows, read and apply:
40
- - `toolkit/templates/docs/api/YAML_CREATION_RULES.md`
41
- - `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md`
42
- - `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` for canonical resource naming and multi-word path style
43
- 4. If architecture output includes screen flow-action specs, read and apply `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md`.
44
- 5. If API detail spec is required, use `sdtk-api-design-spec` to build/update `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md` using YAML + flow list.
45
- 6. For UI-scope features, enforce this generation sequence:
46
- a. Generate/update `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` first (using `sdtk-design-layout`).
47
- b. Attempt to render screen preview images from the layout using `render_design_layout_images.py`. Output: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`. If rendering fails (no Java/plantuml.jar), fall back to the render-skipped note -- do not silently skip.
48
- c. Then generate/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` (using `sdtk-screen-design-spec`).
49
- d. The flow-action spec must reference the design-layout doc as its design source when no Figma/screenshot is available (Design Source Type: `generated-draft`). Use rendered `.svg` files as the screen image. If render failed, use the render-skipped note instead of a broken image reference.
50
- 7. For complex UI flow-action specs, use `sdtk-screen-design-spec` to build/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`.
51
- 8. Define:
52
- - System components + data model
53
- - API endpoints and flows
54
- - Screen layouts
55
- - Security/authz decisions
56
- 9. Create/update:
57
- - OpenAPI YAML + API endpoint markdown
58
- - API flow list
59
- - API design detail spec (when `orchestration.apiDesignDetailMode` is `auto/on`)
60
- - Database spec (if DB impact exists)
61
- - Design layout (if UI impact exists) - must be created before flow-action spec
62
- - Flow-action spec (if UI impact exists) - must reference design layout as fallback source
63
- 10. Ensure mapping UC/BR -> DB/API/screens and run output hygiene checks:
64
- - EN artifacts use English narrative text (except clearly marked original-language appendix blocks)
65
- - No mojibake/encoding corruption in markdown/yaml/txt outputs
66
- 11. For workflow/tooling hardening batches that stop before `/dev`, lock the validator matrix, exact approved DEV surfaces, exact out-of-scope list, and explicit stop-before-`/dev` wording inside `ARCH_DESIGN_[FEATURE_KEY].md` before handoff.
67
- 12. 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.
68
- 13. If anything is unclear, record OQ-xx in ARCH_DESIGN "Open Questions" and escalate to `@pm` for a decision.
69
- 14. Update shared state + Phase 3 checklist.
70
- 15. Handoff: `@dev please prepare FEATURE_IMPL_PLAN + CODE_HANDOFF for SDTK-CODE ...`.
71
-
72
- ## Order-Critical Hard Gate
73
- For UI-scope features, do not generate or update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` until `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` already exists and is current enough to serve as the design source for the same scope.
74
-
75
- If the layout is missing, stale, or cannot support the flow-action spec, stop and fix the layout first. Do not reverse the order and repair it later.
76
-
77
-
78
- ## Common Mistakes
79
-
80
- | Mistake | Why it is wrong | Do instead |
81
- |---|---|---|
82
- | Generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI scope | Forces the spec to invent screen behavior without a design source | Create or refresh the layout first, then derive the flow-action spec |
83
- | Treat API YAML, API detail, and flow-action outputs as independent documents | Causes naming and traceability drift across artifacts | Keep ARCH outputs linked through shared requirements and path policy |
84
- | Close open questions silently during ARCH | Hides unresolved design decisions from downstream roles | Record `OQ-xx` explicitly and escalate through `@pm` |
85
- | Hand off a workflow/tooling hardening batch without a validator matrix or exact DEV surface list | Leaves `/dev` and SDTK-CODE with an under-specified contract boundary | Lock the validator matrix, exact DEV surfaces, exact out-of-scope list, and stop-before-`/dev` wording before handoff |
1
+ ---
2
+ name: sdtk-arch
3
+ description: Solution Architect workflow for SDTK-SPEC. 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.
4
+ ---
5
+
6
+ # SDTK-SPEC ARCH (Solution Architecture)
7
+
8
+ ## Critical Constraints
9
+ - I do not generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI-scope features.
10
+ - I do not let API, DB, and UI artifacts drift from the same BA and PM source of truth.
11
+
12
+ ## Outputs
13
+ - `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
14
+ - If applicable:
15
+ - `docs/api/[FeaturePascal]_API.yaml`
16
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
17
+ - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
18
+ - `docs/api/[feature_snake]_api_flow_list.txt`
19
+ - `docs/database/DATABASE_SPEC_[FEATURE_KEY].md`
20
+ - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
21
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
22
+
23
+ ## Flow Overview
24
+
25
+ ```dot
26
+ digraph sdtk_arch_flow {
27
+ rankdir=TB;
28
+ BA_SPEC -> ARCH_DESIGN;
29
+ ARCH_DESIGN -> DESIGN_LAYOUT;
30
+ DESIGN_LAYOUT -> FLOW_ACTION_SPEC;
31
+ ARCH_DESIGN -> API_YAML;
32
+ API_YAML -> API_DETAIL;
33
+ }
34
+ ```
35
+
36
+ ## Process
37
+ 1. Read BA spec and PRD/backlog.
38
+ 2. Read `sdtk-spec.config.json` for project stack assumptions (backend/frontend/db/auth).
39
+ 3. If architecture output includes API contracts/flows, read and apply:
40
+ - `toolkit/templates/docs/api/YAML_CREATION_RULES.md`
41
+ - `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md`
42
+ - `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` for canonical resource naming and multi-word path style
43
+ 4. If architecture output includes screen flow-action specs, read and apply `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md`.
44
+ 5. If API detail spec is required, use `sdtk-api-design-spec` to build/update `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md` using YAML + flow list.
45
+ 6. For UI-scope features, enforce this generation sequence:
46
+ a. Generate/update `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` first (using `sdtk-design-layout`).
47
+ b. Attempt to render screen preview images from the layout using `render_design_layout_images.py`. Output: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`. If rendering fails (no Java/plantuml.jar), fall back to the render-skipped note -- do not silently skip.
48
+ c. Then generate/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` (using `sdtk-screen-design-spec`).
49
+ d. The flow-action spec must reference the design-layout doc as its design source when no Figma/screenshot is available (Design Source Type: `generated-draft`). Use rendered `.svg` files as the screen image. If render failed, use the render-skipped note instead of a broken image reference.
50
+ 7. For complex UI flow-action specs, use `sdtk-screen-design-spec` to build/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`.
51
+ 8. Define:
52
+ - System components + data model
53
+ - API endpoints and flows
54
+ - Screen layouts
55
+ - Security/authz decisions
56
+ 9. Create/update:
57
+ - OpenAPI YAML + API endpoint markdown
58
+ - API flow list
59
+ - API design detail spec (when `orchestration.apiDesignDetailMode` is `auto/on`)
60
+ - Database spec (if DB impact exists)
61
+ - Design layout (if UI impact exists) - must be created before flow-action spec
62
+ - Flow-action spec (if UI impact exists) - must reference design layout as fallback source
63
+ 10. Ensure mapping UC/BR -> DB/API/screens and run output hygiene checks:
64
+ - EN artifacts use English narrative text (except clearly marked original-language appendix blocks)
65
+ - No mojibake/encoding corruption in markdown/yaml/txt outputs
66
+ 11. For workflow/tooling hardening batches that stop before `/dev`, lock the validator matrix, exact approved DEV surfaces, exact out-of-scope list, and explicit stop-before-`/dev` wording inside `ARCH_DESIGN_[FEATURE_KEY].md` before handoff.
67
+ 12. 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.
68
+ 13. If anything is unclear, record OQ-xx in ARCH_DESIGN "Open Questions" and escalate to `@pm` for a decision.
69
+ 14. Update shared state + Phase 3 checklist.
70
+ 15. Handoff: `@dev please prepare FEATURE_IMPL_PLAN + CODE_HANDOFF for SDTK-CODE ...`.
71
+
72
+ ## Order-Critical Hard Gate
73
+ For UI-scope features, do not generate or update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` until `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` already exists and is current enough to serve as the design source for the same scope.
74
+
75
+ If the layout is missing, stale, or cannot support the flow-action spec, stop and fix the layout first. Do not reverse the order and repair it later.
76
+
77
+
78
+ ## Common Mistakes
79
+
80
+ | Mistake | Why it is wrong | Do instead |
81
+ |---|---|---|
82
+ | Generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI scope | Forces the spec to invent screen behavior without a design source | Create or refresh the layout first, then derive the flow-action spec |
83
+ | Treat API YAML, API detail, and flow-action outputs as independent documents | Causes naming and traceability drift across artifacts | Keep ARCH outputs linked through shared requirements and path policy |
84
+ | Close open questions silently during ARCH | Hides unresolved design decisions from downstream roles | Record `OQ-xx` explicitly and escalate through `@pm` |
85
+ | Hand off a workflow/tooling hardening batch without a validator matrix or exact DEV surface list | Leaves `/dev` and SDTK-CODE with an under-specified contract boundary | Lock the validator matrix, exact DEV surfaces, exact out-of-scope list, and stop-before-`/dev` wording before handoff |
@@ -1,46 +1,46 @@
1
- ---
2
- name: sdtk-ba
3
- description: Business Analyst workflow for SDTK-SPEC. Use when you need to turn PM initiation into BA_SPEC with glossary, business rules (BR-xx), use cases (UC-xx), acceptance criteria (AC-xx), NFRs, risks, open questions, and a traceability matrix.
4
- ---
5
-
6
- # SDTK-SPEC BA (Business Analysis)
7
-
8
- ## Critical Constraints
9
- - I do not mark BA analysis complete until `REQ`, `UC`, `BR`, and `AC` traceability is explicit.
10
- - I do not silently resolve business ambiguities that belong to PM or the user.
11
-
12
- ## Output
13
- - `docs/specs/BA_SPEC_[FEATURE_KEY].md`
14
-
15
- ## Optional: Condensed Upstream Input
16
-
17
- If a condensed upstream input package was produced before PM initiation, read it
18
- alongside `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md`. The package is at:
19
- `docs/product/CONDENSED_UPSTREAM_INPUT_[FEATURE_KEY].md`
20
-
21
- The condensed package is a DRAFT accelerator only. All derived actors, entities,
22
- rules, and acceptance criteria require human review before adoption. Do not treat
23
- draft content as authoritative without explicit PM or maintainer confirmation.
24
-
25
- For approval/workflow domain packages, the condensed package also includes a
26
- Role Matrix, State Set, State Transitions, and Policy And Approval Rules
27
- sections. When producing BR-xx and UC-xx items in BA_SPEC, read these sections
28
- alongside the Actors and Workflow Entities sections. Any unresolved open
29
- questions from the Open Questions For Human Review section must be carried
30
- forward as explicit OQ-xx items in BA_SPEC rather than silently resolved.
31
-
32
- ## Process
33
- 1. Read `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md` and any source requirements.
34
- 2. Produce:
35
- - Glossary
36
- - BR-xx (numbered)
37
- - UC-xx (cover 100% REQ-xx)
38
- - AC-xx (mapped to UC/BR)
39
- - NFR-xx
40
- - Risks + Open Questions
41
- - Traceability summary table (REQ -> UC/BR/AC)
42
- 3. If source requirements are VI/JP, preserve the original text and add a literal EN translation in appendices.
43
- 4. For benchmark runs, apply `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`: keep benchmark-expected open questions explicitly OPEN and do not silently resolve them in BA output.
44
- 5. If anything is unclear, record OQ-xx in BA_SPEC "Open Questions" and escalate to `@pm` for a decision.
45
- 6. Update `SHARED_PLANNING.md` and `QUALITY_CHECKLIST.md` Phase 2.
46
- 7. Handoff: `@pm specs ready for PRD`.
1
+ ---
2
+ name: sdtk-ba
3
+ description: Business Analyst workflow for SDTK-SPEC. Use when you need to turn PM initiation into BA_SPEC with glossary, business rules (BR-xx), use cases (UC-xx), acceptance criteria (AC-xx), NFRs, risks, open questions, and a traceability matrix.
4
+ ---
5
+
6
+ # SDTK-SPEC BA (Business Analysis)
7
+
8
+ ## Critical Constraints
9
+ - I do not mark BA analysis complete until `REQ`, `UC`, `BR`, and `AC` traceability is explicit.
10
+ - I do not silently resolve business ambiguities that belong to PM or the user.
11
+
12
+ ## Output
13
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md`
14
+
15
+ ## Optional: Condensed Upstream Input
16
+
17
+ If a condensed upstream input package was produced before PM initiation, read it
18
+ alongside `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md`. The package is at:
19
+ `docs/product/CONDENSED_UPSTREAM_INPUT_[FEATURE_KEY].md`
20
+
21
+ The condensed package is a DRAFT accelerator only. All derived actors, entities,
22
+ rules, and acceptance criteria require human review before adoption. Do not treat
23
+ draft content as authoritative without explicit PM or maintainer confirmation.
24
+
25
+ For approval/workflow domain packages, the condensed package also includes a
26
+ Role Matrix, State Set, State Transitions, and Policy And Approval Rules
27
+ sections. When producing BR-xx and UC-xx items in BA_SPEC, read these sections
28
+ alongside the Actors and Workflow Entities sections. Any unresolved open
29
+ questions from the Open Questions For Human Review section must be carried
30
+ forward as explicit OQ-xx items in BA_SPEC rather than silently resolved.
31
+
32
+ ## Process
33
+ 1. Read `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md` and any source requirements.
34
+ 2. Produce:
35
+ - Glossary
36
+ - BR-xx (numbered)
37
+ - UC-xx (cover 100% REQ-xx)
38
+ - AC-xx (mapped to UC/BR)
39
+ - NFR-xx
40
+ - Risks + Open Questions
41
+ - Traceability summary table (REQ -> UC/BR/AC)
42
+ 3. If source requirements are VI/JP, preserve the original text and add a literal EN translation in appendices.
43
+ 4. For benchmark runs, apply `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`: keep benchmark-expected open questions explicitly OPEN and do not silently resolve them in BA output.
44
+ 5. If anything is unclear, record OQ-xx in BA_SPEC "Open Questions" and escalate to `@pm` for a decision.
45
+ 6. Update `SHARED_PLANNING.md` and `QUALITY_CHECKLIST.md` Phase 2.
46
+ 7. Handoff: `@pm specs ready for PRD`.
@@ -1,91 +1,91 @@
1
- ---
2
- name: sdtk-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.
4
- ---
5
-
6
- # SDTK-SPEC Screen Layout Design
7
-
8
- ## Critical Constraints
9
- - I do not skip screen IDs or item numbering alignment with the wireframe.
10
- - I do not hide render limitations; I record when screen preview rendering is unavailable.
11
- - I do not leave rendered wireframes without visible local item markers that map back to the `Items` table.
12
- - I do not pretend wireframe markers are the same thing as `FLOW_ACTION_SPEC` global action-table numbers.
13
- - I do not invent screens or fields not present in BA_SPEC or the feature scope.
14
-
15
- ## Output
16
- - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
17
-
18
- ## Required Inputs
19
- - `docs/specs/BA_SPEC_[FEATURE_KEY].md` (screens, fields, business rules)
20
- - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (API list for each screen, when available)
21
- - Feature key and feature name
22
-
23
- ## When To Stop Or Escalate
24
- - Stop if BA_SPEC does not exist or does not contain screen/field definitions for the current feature; surface as a blocker before drafting any wireframe.
25
- - Stop if a required screen's field list or behavior is ambiguous in the source; record as OQ-xx and escalate to `@ba` or `@pm`.
26
- - Stop if PlantUML rendering is unavailable and the feature team requires rendered images before proceeding; record rendering as skipped and note the dependency.
27
- - Escalate to `@arch` if screen scope or API assignment is architecturally uncertain.
28
-
29
- ## Core Process
30
- 1. Read BA spec (screens + fields) and API list.
31
- 2. For each screen, include:
32
- - PlantUML `@startsalt` wireframe first, with visible screen-local markers embedded directly in the SALT labels
33
- - API list table
34
- - Item table whose `No` values exactly match the local marker sequence used in the wireframe for that screen
35
- 3. Use this wireframe-marker convention so the rendered SVG can be cross-referenced visually:
36
- - markers are screen-local visual references and reset per screen
37
- - prefer Unicode circled-number markers in generated docs; avoid parenthetical `(N)` markers because they blend into UI text and can conflict with SALT parsing
38
- - text label or input prompt: prefix the visible label with the local marker
39
- - button: place the local marker inside the visible button label
40
- - table header: prefix the header text with the local marker
41
- - standalone control, pagination, toggle, or status chip: prefix the visible label with the local marker
42
- - do not rely on prose, comments, or a separate legend; the marker must be visible inside the rendered wireframe itself
43
- - the local marker does not need to equal the `FLOW_ACTION_SPEC` global `No`; `screen-design-spec` publishes the mapping table
44
- 4. Keep screen IDs consistent (A-*, B-*, C-*).
45
- 5. After writing `DESIGN_LAYOUT`, attempt to render screen preview images by default:
46
- - Run `render_design_layout_images.py` to extract `@startsalt` blocks and render `.svg` files.
47
- - Output path: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
48
- - The renderer warns if a screen wireframe has no visible local markers or still uses legacy `(N)` markers.
49
- - If PlantUML is unavailable, rendering is skipped with a warning and the render-skipped note is used in `FLOW_ACTION_SPEC`. The layout doc remains valid.
50
-
51
- ## Validation / Quality Gates
52
- - Every screen in BA scope has a corresponding wireframe section in the layout doc.
53
- - Every `@startsalt` block contains visible screen-local markers; no unlabeled items.
54
- - Item table `No` values match the wireframe local marker sequence for each screen exactly.
55
- - Screen IDs follow the A-*, B-*, C-* convention without gaps or duplicates.
56
- - API list table is present for every screen that makes API calls.
57
- - Render-skipped note is explicit when PlantUML is unavailable; no silent omission.
58
- - No `(N)` parenthetical markers in generated wireframes.
59
-
60
- ## Order-Critical Hard Gate
61
- Do not write wireframes before reading BA_SPEC screen definitions. Wireframes generated from memory introduce field drift that must be corrected before the flow-action spec can be authored.
62
-
63
- ## Common Mistakes
64
-
65
- | Mistake | Why it is wrong | Do instead |
66
- |---|---|---|
67
- | Use `(N)` parenthetical markers in wireframes | Conflicts with SALT parsing; indistinguishable from UI text | Use Unicode circled-number markers instead |
68
- | Let Item table `No` drift from wireframe markers | Breaks the cross-reference between table and visual | Align item table `No` to the local marker sequence exactly |
69
- | Claim wireframe markers equal FLOW_ACTION_SPEC global numbers | They are different numbering systems | Always note that markers are screen-local; screen-design-spec publishes the global mapping |
70
- | Skip render attempt without noting the skip | Leaves downstream consumers uncertain about image availability | Always record render-skipped note when PlantUML is unavailable |
71
- | Invent screens or fields not in BA_SPEC | Creates untracked scope | Only add screens and fields explicitly listed in the BA source |
72
-
73
- ## Screen Image Renderer
74
- - Script: `toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py`
75
- - Usage:
76
- ```
77
- python "toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py" \
78
- --design-layout "docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md" \
79
- --feature-key [FEATURE_KEY]
80
- ```
81
- - Requires: Java + `plantuml.jar` (auto-detected from VSCode PlantUML extension, or pass `--plantuml-jar`)
82
- - Output: `.svg` files under `docs/specs/assets/<feature_snake>/screens/`
83
- - Failure policy: non-blocking. Warns and continues if rendering is unavailable.
84
-
85
- ## Reference Loading Guidance
86
- Read at skill start:
87
- - `docs/specs/BA_SPEC_[FEATURE_KEY].md` (required)
88
- - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (required when API scope exists)
89
-
90
- Read on demand:
91
- - `toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md` (starting structure reference)
1
+ ---
2
+ name: sdtk-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.
4
+ ---
5
+
6
+ # SDTK-SPEC Screen Layout Design
7
+
8
+ ## Critical Constraints
9
+ - I do not skip screen IDs or item numbering alignment with the wireframe.
10
+ - I do not hide render limitations; I record when screen preview rendering is unavailable.
11
+ - I do not leave rendered wireframes without visible local item markers that map back to the `Items` table.
12
+ - I do not pretend wireframe markers are the same thing as `FLOW_ACTION_SPEC` global action-table numbers.
13
+ - I do not invent screens or fields not present in BA_SPEC or the feature scope.
14
+
15
+ ## Output
16
+ - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
17
+
18
+ ## Required Inputs
19
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` (screens, fields, business rules)
20
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (API list for each screen, when available)
21
+ - Feature key and feature name
22
+
23
+ ## When To Stop Or Escalate
24
+ - Stop if BA_SPEC does not exist or does not contain screen/field definitions for the current feature; surface as a blocker before drafting any wireframe.
25
+ - Stop if a required screen's field list or behavior is ambiguous in the source; record as OQ-xx and escalate to `@ba` or `@pm`.
26
+ - Stop if PlantUML rendering is unavailable and the feature team requires rendered images before proceeding; record rendering as skipped and note the dependency.
27
+ - Escalate to `@arch` if screen scope or API assignment is architecturally uncertain.
28
+
29
+ ## Core Process
30
+ 1. Read BA spec (screens + fields) and API list.
31
+ 2. For each screen, include:
32
+ - PlantUML `@startsalt` wireframe first, with visible screen-local markers embedded directly in the SALT labels
33
+ - API list table
34
+ - Item table whose `No` values exactly match the local marker sequence used in the wireframe for that screen
35
+ 3. Use this wireframe-marker convention so the rendered SVG can be cross-referenced visually:
36
+ - markers are screen-local visual references and reset per screen
37
+ - prefer Unicode circled-number markers in generated docs; avoid parenthetical `(N)` markers because they blend into UI text and can conflict with SALT parsing
38
+ - text label or input prompt: prefix the visible label with the local marker
39
+ - button: place the local marker inside the visible button label
40
+ - table header: prefix the header text with the local marker
41
+ - standalone control, pagination, toggle, or status chip: prefix the visible label with the local marker
42
+ - do not rely on prose, comments, or a separate legend; the marker must be visible inside the rendered wireframe itself
43
+ - the local marker does not need to equal the `FLOW_ACTION_SPEC` global `No`; `screen-design-spec` publishes the mapping table
44
+ 4. Keep screen IDs consistent (A-*, B-*, C-*).
45
+ 5. After writing `DESIGN_LAYOUT`, attempt to render screen preview images by default:
46
+ - Run `render_design_layout_images.py` to extract `@startsalt` blocks and render `.svg` files.
47
+ - Output path: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
48
+ - The renderer warns if a screen wireframe has no visible local markers or still uses legacy `(N)` markers.
49
+ - If PlantUML is unavailable, rendering is skipped with a warning and the render-skipped note is used in `FLOW_ACTION_SPEC`. The layout doc remains valid.
50
+
51
+ ## Validation / Quality Gates
52
+ - Every screen in BA scope has a corresponding wireframe section in the layout doc.
53
+ - Every `@startsalt` block contains visible screen-local markers; no unlabeled items.
54
+ - Item table `No` values match the wireframe local marker sequence for each screen exactly.
55
+ - Screen IDs follow the A-*, B-*, C-* convention without gaps or duplicates.
56
+ - API list table is present for every screen that makes API calls.
57
+ - Render-skipped note is explicit when PlantUML is unavailable; no silent omission.
58
+ - No `(N)` parenthetical markers in generated wireframes.
59
+
60
+ ## Order-Critical Hard Gate
61
+ Do not write wireframes before reading BA_SPEC screen definitions. Wireframes generated from memory introduce field drift that must be corrected before the flow-action spec can be authored.
62
+
63
+ ## Common Mistakes
64
+
65
+ | Mistake | Why it is wrong | Do instead |
66
+ |---|---|---|
67
+ | Use `(N)` parenthetical markers in wireframes | Conflicts with SALT parsing; indistinguishable from UI text | Use Unicode circled-number markers instead |
68
+ | Let Item table `No` drift from wireframe markers | Breaks the cross-reference between table and visual | Align item table `No` to the local marker sequence exactly |
69
+ | Claim wireframe markers equal FLOW_ACTION_SPEC global numbers | They are different numbering systems | Always note that markers are screen-local; screen-design-spec publishes the global mapping |
70
+ | Skip render attempt without noting the skip | Leaves downstream consumers uncertain about image availability | Always record render-skipped note when PlantUML is unavailable |
71
+ | Invent screens or fields not in BA_SPEC | Creates untracked scope | Only add screens and fields explicitly listed in the BA source |
72
+
73
+ ## Screen Image Renderer
74
+ - Script: `toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py`
75
+ - Usage:
76
+ ```
77
+ python "toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py" \
78
+ --design-layout "docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md" \
79
+ --feature-key [FEATURE_KEY]
80
+ ```
81
+ - Requires: Java + `plantuml.jar` (auto-detected from VSCode PlantUML extension, or pass `--plantuml-jar`)
82
+ - Output: `.svg` files under `docs/specs/assets/<feature_snake>/screens/`
83
+ - Failure policy: non-blocking. Warns and continues if rendering is unavailable.
84
+
85
+ ## Reference Loading Guidance
86
+ Read at skill start:
87
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` (required)
88
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (required when API scope exists)
89
+
90
+ Read on demand:
91
+ - `toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md` (starting structure reference)