sdtk-spec-kit 0.4.4 → 0.4.6

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 (128) hide show
  1. package/README.md +369 -376
  2. package/assets/atlas/build_atlas.py +880 -880
  3. package/assets/atlas/doc_atlas_viewer_template.html +3796 -3782
  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/design-handoff-provenance.js +189 -0
  110. package/src/lib/entitlements.js +238 -238
  111. package/src/lib/errors.js +41 -41
  112. package/src/lib/github-access.js +143 -143
  113. package/src/lib/legacy-auth-migration.js +55 -55
  114. package/src/lib/license-activation.js +375 -375
  115. package/src/lib/powershell.js +85 -85
  116. package/src/lib/premium-loader.js +126 -126
  117. package/src/lib/premium-packs.js +331 -331
  118. package/src/lib/premium-sync.js +235 -235
  119. package/src/lib/project-audit.js +332 -332
  120. package/src/lib/project-config.js +108 -108
  121. package/src/lib/project-ingest.js +450 -450
  122. package/src/lib/project-refresh.js +666 -666
  123. package/src/lib/requirement-analysis.js +472 -0
  124. package/src/lib/scope.js +83 -83
  125. package/src/lib/state.js +73 -73
  126. package/src/lib/suite-state.js +70 -70
  127. package/src/lib/toolkit-payload.js +99 -99
  128. package/src/lib/atlas-ask.js +0 -170
@@ -1,4 +1,4 @@
1
- ---
1
+ ---
2
2
  name: mailbox-dispatch
3
3
  description: Controller-owned mailbox delegation for SDTK-SPEC. Use when PM or Orchestrator needs to assign a bounded phase to Claude or Codex, preserve exact include/exclude boundaries, review raw reports against formal artifacts, and run a mandatory post-issue mailbox retrospective.
4
4
  ---
@@ -70,4 +70,4 @@ Read these shipped toolkit surfaces before dispatching or reviewing a run:
70
70
  4. `qa-review`
71
71
  5. `controller-acceptance`
72
72
  6. `commit/push`
73
- 7. `post-issue-retrospective`
73
+ 7. `post-issue-retrospective`
@@ -1,42 +1,42 @@
1
- ---
2
- name: orchestrator
3
- description: Orchestrate the SDTK-SPEC 6-phase workflow in Claude Code using SHARED_PLANNING.md + QUALITY_CHECKLIST.md + docs/* artifacts + explicit /dev -> SDTK-CODE -> /qa handoffs.
4
- ---
5
-
6
- ## Critical Constraints
7
- - I do not skip mandatory phases or hand off without current-phase evidence.
8
- - I do not treat visible-list presence as proof of a working direct invocation.
9
- - I do not treat planned commands as equivalent to completed work.
10
- - I preserve truthful fallback behavior and do not overclaim universal helper-dispatch or universal built-in exposure across every Claude surface.
11
-
12
- ## Claude Runtime Entrypoint Truth
13
- - Visible-list presence of `orchestrator` does not prove `/orchestrator` or any other direct alias.
14
- - `visible` and `working` are separate checks; `working` requires observable controller action from a bounded request.
15
- - Until a Claude-specific direct syntax is validated, the supported controller path remains the repo-local orchestrator contract in the current session.
16
- - Run `sdtk-spec generate --feature-key <KEY> --feature-name "<NAME>" --project-path .` to create skeleton artifacts before phase work begins.
17
-
18
- ## Execute pipeline (one phase per turn)
19
- - Default role: `PM` if the user did not specify one.
20
- - Respect role tags: `PM`, `BA`, `ARCH`, `DEV`, `QA`.
21
- - For each phase:
22
- - Create or update the current-phase artifact in `docs/`.
23
- - If phase is `ARCH` and API contract or flow is in scope, invoke `sdtk-api-doc`.
24
- - If phase is `ARCH` and API detail spec is in scope, invoke `sdtk-api-design-spec`.
25
- - If phase is `ARCH` and UI flow behavior is in scope, invoke `sdtk-screen-design-spec`.
26
- - If phase is `DEV`, stop at `FEATURE_IMPL_PLAN + CODE_HANDOFF`; downstream implementation runs in SDTK-CODE, not here.
27
- - If phase is `QA` and test-case specification is in scope, invoke `sdtk-test-case-spec`.
28
- - Update `SHARED_PLANNING.md` and `QUALITY_CHECKLIST.md`.
29
- - Hand off only after the current phase has fresh evidence.
30
-
31
- ## Optional: Mailbox Dispatch
32
- - Use `mailbox-dispatch` when one bounded controller-owned phase should be delegated to Claude or Codex.
33
- - Keep planning local when the controller already has enough repo context.
34
- - Lock exact include/exclude boundaries, fallback triggers, and verification commands before dispatch.
35
- - Keep mailbox runtime files transient under `governance/ai/agent-mailbox/runtime/`.
1
+ ---
2
+ name: orchestrator
3
+ description: Orchestrate the SDTK-SPEC 6-phase workflow in Claude Code using SHARED_PLANNING.md + QUALITY_CHECKLIST.md + docs/* artifacts + explicit /dev -> SDTK-CODE -> /qa handoffs.
4
+ ---
5
+
6
+ ## Critical Constraints
7
+ - I do not skip mandatory phases or hand off without current-phase evidence.
8
+ - I do not treat visible-list presence as proof of a working direct invocation.
9
+ - I do not treat planned commands as equivalent to completed work.
10
+ - I preserve truthful fallback behavior and do not overclaim universal helper-dispatch or universal built-in exposure across every Claude surface.
11
+
12
+ ## Claude Runtime Entrypoint Truth
13
+ - Visible-list presence of `orchestrator` does not prove `/orchestrator` or any other direct alias.
14
+ - `visible` and `working` are separate checks; `working` requires observable controller action from a bounded request.
15
+ - Until a Claude-specific direct syntax is validated, the supported controller path remains the repo-local orchestrator contract in the current session.
16
+ - Run `sdtk-spec generate --feature-key <KEY> --feature-name "<NAME>" --project-path .` to create skeleton artifacts before phase work begins.
17
+
18
+ ## Execute pipeline (one phase per turn)
19
+ - Default role: `PM` if the user did not specify one.
20
+ - Respect role tags: `PM`, `BA`, `ARCH`, `DEV`, `QA`.
21
+ - For each phase:
22
+ - Create or update the current-phase artifact in `docs/`.
23
+ - If phase is `ARCH` and API contract or flow is in scope, invoke `sdtk-api-doc`.
24
+ - If phase is `ARCH` and API detail spec is in scope, invoke `sdtk-api-design-spec`.
25
+ - If phase is `ARCH` and UI flow behavior is in scope, invoke `sdtk-screen-design-spec`.
26
+ - If phase is `DEV`, stop at `FEATURE_IMPL_PLAN + CODE_HANDOFF`; downstream implementation runs in SDTK-CODE, not here.
27
+ - If phase is `QA` and test-case specification is in scope, invoke `sdtk-test-case-spec`.
28
+ - Update `SHARED_PLANNING.md` and `QUALITY_CHECKLIST.md`.
29
+ - Hand off only after the current phase has fresh evidence.
30
+
31
+ ## Optional: Mailbox Dispatch
32
+ - Use `mailbox-dispatch` when one bounded controller-owned phase should be delegated to Claude or Codex.
33
+ - Keep planning local when the controller already has enough repo context.
34
+ - Lock exact include/exclude boundaries, fallback triggers, and verification commands before dispatch.
35
+ - Keep mailbox runtime files transient under `governance/ai/agent-mailbox/runtime/`.
36
36
  - Run the default post-issue mailbox retrospective after repo truth is closed and before the next mailbox-driven issue.
37
37
 
38
- ## Guardrails
39
- - Keep traceability: `REQ -> BR/UC/AC -> design -> backlog -> FEATURE_IMPL_PLAN -> CODE_HANDOFF -> downstream implementation evidence -> QA report`.
40
- - Preserve the repo-local orchestrator contract as the exact fallback when direct built-in exposure or invocation is absent or unvalidated.
41
- - Do not claim that Claude visible-list presence proves `/orchestrator`.
42
- - Do not claim built-in exposure parity across every Claude surface.
38
+ ## Guardrails
39
+ - Keep traceability: `REQ -> BR/UC/AC -> design -> backlog -> FEATURE_IMPL_PLAN -> CODE_HANDOFF -> downstream implementation evidence -> QA report`.
40
+ - Preserve the repo-local orchestrator contract as the exact fallback when direct built-in exposure or invocation is absent or unvalidated.
41
+ - Do not claim that Claude visible-list presence proves `/orchestrator`.
42
+ - Do not claim built-in exposure parity across every Claude surface.
@@ -1,88 +1,88 @@
1
- ---
2
- name: pm
3
- description: Product Manager + meta-orchestrator workflow for SDTK-SPEC. Use when you need to start a new feature (Phase 1) or produce PM planning artifacts (PRD + BACKLOG) and update SHARED_PLANNING.md / QUALITY_CHECKLIST.md with correct phase handoffs.
4
- ---
5
-
6
- ## SDTK-SPEC Pipeline Rules (always apply)
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 (PM asks user if needed)
10
- 4. Traceability: REQ 竊・BR/UC/AC 竊・design 竊・backlog 竊・code/tests 竊・QA
11
- 5. Code review must be COMPLETE before QA phase can start
12
- 6. Do not skip phases. If inputs missing, ask focused questions.
13
-
14
- ## Prerequisites (verify before proceeding)
15
- Read QUALITY_CHECKLIST.md and verify:
16
- - Phase 1 (PM Init): No prerequisites required.
17
- - Phase 2+ (PM Planning): BA Analysis gate must show all items [x] Done.
18
-
19
- If prerequisites NOT met: report which gate is missing, suggest user run the prerequisite phase first.
20
-
21
- ## Current Context
22
- - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk-spec.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('{}')}"`
26
-
27
- ## Input
28
- $ARGUMENTS
29
-
30
- If no arguments provided, read current feature context from SHARED_PLANNING.md.
31
-
32
- # SDTK-SPEC PM (Entry Point + Planning)
33
-
34
- ## Outputs
35
- - Phase 1: `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md`
36
- - Phase 2+ (after BA spec): `docs/product/PRD_[FEATURE_KEY].md` + `docs/product/BACKLOG_[FEATURE_KEY].md`
37
-
38
- ## Process
39
- 1. Confirm `FEATURE_KEY` + `FEATURE_NAME` + Phase-1 scope in/out.
40
- 2. Create/update PM artifact(s).
41
- 3. Ensure REQ-xx list is clear and testable.
42
- 4. If requirements are provided in VI/JP: keep the original text in an appendix and add an EN translation (literal) for traceability.
43
- 5. Update `SHARED_PLANNING.md` + `QUALITY_CHECKLIST.md`.
44
- 6. Handoff:
45
- - After Project Initiation -> suggest user run `/ba` to analyze requirements
46
- - After PRD/Backlog -> suggest user run `/arch` to design architecture
47
-
48
- ## Optional: Condensed Upstream Input
49
-
50
- If a basic product brief is provided before PM initiation, a condensed upstream
51
- input package may be produced first using:
52
- `toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md`
53
-
54
- The condensed output must carry the REQUIRES_HUMAN_REVIEW label (Gate H2) and
55
- must be reviewed before the PM phase proceeds. Do not auto-advance to PM or BA
56
- without explicit human confirmation. If the brief is outside the bounded domain,
57
- stop and surface a boundary flag (Gate H1) rather than proceeding.
58
-
59
- Deliver the condensed output as:
60
- `docs/product/CONDENSED_UPSTREAM_INPUT_[FEATURE_KEY].md`
61
-
62
- For approval/workflow domain briefs, apply the Approval/Workflow Domain
63
- Extension defined in the template. The extended condensed package must include
64
- the Role Matrix, State Set, State Transitions, and Policy And Approval Rules
65
- sections, plus an Open Questions For Human Review section in place of the
66
- standard Gaps section. Gate H3 (Policy Open Questions Review) applies to all
67
- approval/workflow condensed outputs and requires explicit PM or maintainer review
68
- of all open policy questions before the SPEC phase proceeds. Open questions must
69
- not be silently dropped.
70
-
71
- ## Optional: Mailbox Delegation
72
-
73
- Use `mailbox-dispatch` when PM needs bounded external-agent help without
74
- opening a full orchestration platform loop.
75
-
76
- Rules:
77
- - keep PM planning local when the controller already has enough context
78
- - delegate only one bounded phase at a time with exact include/exclude truth
79
- - prefer Claude for controller-spec, wording-heavy review, and SDTK-SPEC shaping
80
- - prefer Codex for code, tests, harness, or verification-heavy implementation
81
- - review the formal artifact on disk before trusting raw console output
82
- - keep governance/ai/agent-mailbox/runtime/ transient and out of feature commits
83
- - run the post-issue mailbox retrospective before the next mailbox-driven issue
84
- ## Clarification And Decisions (PM responsibility)
85
- - Collect OQ-xx items raised by BA/ARCH/DEV/QA in their respective artifacts.
86
- - Try to resolve OQ-xx using existing docs and reasonable product/tech decisions.
87
- - If still missing information from the original input: ask the user (final stakeholder) and record the answer as the resolution.
88
- - Record decisions in PRD `Decision Log` and update OQ-xx `Resolution` fields in the originating docs.
1
+ ---
2
+ name: pm
3
+ description: Product Manager + meta-orchestrator workflow for SDTK-SPEC. Use when you need to start a new feature (Phase 1) or produce PM planning artifacts (PRD + BACKLOG) and update SHARED_PLANNING.md / QUALITY_CHECKLIST.md with correct phase handoffs.
4
+ ---
5
+
6
+ ## SDTK-SPEC Pipeline Rules (always apply)
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 (PM asks user if needed)
10
+ 4. Traceability: REQ 竊・BR/UC/AC 竊・design 竊・backlog 竊・code/tests 竊・QA
11
+ 5. Code review must be COMPLETE before QA phase can start
12
+ 6. Do not skip phases. If inputs missing, ask focused questions.
13
+
14
+ ## Prerequisites (verify before proceeding)
15
+ Read QUALITY_CHECKLIST.md and verify:
16
+ - Phase 1 (PM Init): No prerequisites required.
17
+ - Phase 2+ (PM Planning): BA Analysis gate must show all items [x] Done.
18
+
19
+ If prerequisites NOT met: report which gate is missing, suggest user run the prerequisite phase first.
20
+
21
+ ## Current Context
22
+ - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk-spec.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('{}')}"`
26
+
27
+ ## Input
28
+ $ARGUMENTS
29
+
30
+ If no arguments provided, read current feature context from SHARED_PLANNING.md.
31
+
32
+ # SDTK-SPEC PM (Entry Point + Planning)
33
+
34
+ ## Outputs
35
+ - Phase 1: `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md`
36
+ - Phase 2+ (after BA spec): `docs/product/PRD_[FEATURE_KEY].md` + `docs/product/BACKLOG_[FEATURE_KEY].md`
37
+
38
+ ## Process
39
+ 1. Confirm `FEATURE_KEY` + `FEATURE_NAME` + Phase-1 scope in/out.
40
+ 2. Create/update PM artifact(s).
41
+ 3. Ensure REQ-xx list is clear and testable.
42
+ 4. If requirements are provided in VI/JP: keep the original text in an appendix and add an EN translation (literal) for traceability.
43
+ 5. Update `SHARED_PLANNING.md` + `QUALITY_CHECKLIST.md`.
44
+ 6. Handoff:
45
+ - After Project Initiation -> suggest user run `/ba` to analyze requirements
46
+ - After PRD/Backlog -> suggest user run `/arch` to design architecture
47
+
48
+ ## Optional: Condensed Upstream Input
49
+
50
+ If a basic product brief is provided before PM initiation, a condensed upstream
51
+ input package may be produced first using:
52
+ `toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md`
53
+
54
+ The condensed output must carry the REQUIRES_HUMAN_REVIEW label (Gate H2) and
55
+ must be reviewed before the PM phase proceeds. Do not auto-advance to PM or BA
56
+ without explicit human confirmation. If the brief is outside the bounded domain,
57
+ stop and surface a boundary flag (Gate H1) rather than proceeding.
58
+
59
+ Deliver the condensed output as:
60
+ `docs/product/CONDENSED_UPSTREAM_INPUT_[FEATURE_KEY].md`
61
+
62
+ For approval/workflow domain briefs, apply the Approval/Workflow Domain
63
+ Extension defined in the template. The extended condensed package must include
64
+ the Role Matrix, State Set, State Transitions, and Policy And Approval Rules
65
+ sections, plus an Open Questions For Human Review section in place of the
66
+ standard Gaps section. Gate H3 (Policy Open Questions Review) applies to all
67
+ approval/workflow condensed outputs and requires explicit PM or maintainer review
68
+ of all open policy questions before the SPEC phase proceeds. Open questions must
69
+ not be silently dropped.
70
+
71
+ ## Optional: Mailbox Delegation
72
+
73
+ Use `mailbox-dispatch` when PM needs bounded external-agent help without
74
+ opening a full orchestration platform loop.
75
+
76
+ Rules:
77
+ - keep PM planning local when the controller already has enough context
78
+ - delegate only one bounded phase at a time with exact include/exclude truth
79
+ - prefer Claude for controller-spec, wording-heavy review, and SDTK-SPEC shaping
80
+ - prefer Codex for code, tests, harness, or verification-heavy implementation
81
+ - review the formal artifact on disk before trusting raw console output
82
+ - keep governance/ai/agent-mailbox/runtime/ transient and out of feature commits
83
+ - run the post-issue mailbox retrospective before the next mailbox-driven issue
84
+ ## Clarification And Decisions (PM responsibility)
85
+ - Collect OQ-xx items raised by BA/ARCH/DEV/QA in their respective artifacts.
86
+ - Try to resolve OQ-xx using existing docs and reasonable product/tech decisions.
87
+ - If still missing information from the original input: ask the user (final stakeholder) and record the answer as the resolution.
88
+ - Record decisions in PRD `Decision Log` and update OQ-xx `Resolution` fields in the originating docs.
@@ -1,58 +1,58 @@
1
- ---
2
- name: qa
3
- description: QA workflow for SDTK-SPEC. Use when you need to validate downstream implementation evidence against BA/PRD/Backlog, run quality gates, document defects, and produce a QA_RELEASE_REPORT with a release decision.
4
- ---
5
-
6
- ## SDTK-SPEC Pipeline Rules (always apply)
7
- 1. Pipeline: PM Initiation -> BA Analysis -> PM Planning -> Architecture Design -> Development Planning + SDTK-CODE Handoff -> 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
10
- 4. Traceability: REQ -> BR/UC/AC -> design -> backlog -> FEATURE_IMPL_PLAN -> CODE_HANDOFF -> downstream implementation evidence -> OPS_HANDOFF + downstream OPS evidence -> QA
11
- 5. QA waits for downstream implementation evidence, normally from SDTK-CODE, plus downstream OPS evidence in the current formal suite flow
12
- 6. Do not skip phases. If inputs are missing, ask focused questions.
13
-
14
- ## Prerequisites (verify before proceeding)
15
- Read QUALITY_CHECKLIST.md and verify:
16
- - Phase 4 DEV gate must show planning/handoff completion.
17
- - Downstream implementation evidence exists for the same feature scope.
18
- - `docs/dev/REVIEW_PACKET_[FEATURE_KEY].md` exists for the same feature scope when `SDTK-CODE verify` has run.
19
- - `OPS_HANDOFF` and downstream OPS evidence exist for the same feature scope.
20
-
21
- If prerequisites are not met, report which gate or downstream evidence is missing and suggest user complete `/dev` or the SDTK-CODE flow first.
22
-
23
- ## Current Context
24
- - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk-spec.config.json','utf8'))}catch{process.stdout.write('{}')}"`
25
- - Pipeline: !`node -e "try{process.stdout.write(require('fs').readFileSync('SHARED_PLANNING.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
26
- - Gates: !`node -e "try{process.stdout.write(require('fs').readFileSync('QUALITY_CHECKLIST.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
27
- - State: !`node -e "try{process.stdout.write(require('fs').readFileSync('.sdtk/orchestration-state.json','utf8'))}catch{process.stdout.write('{}')}"`
28
-
29
- ## Input
30
- $ARGUMENTS
31
-
32
- If no arguments are provided, read current feature context from SHARED_PLANNING.md.
33
-
34
- # SDTK-SPEC QA (Testing + Release Decision)
35
-
36
- ## Output
37
- - `docs/qa/QA_RELEASE_REPORT_[FEATURE_KEY].md`
38
- - `docs/qa/CONTROLLER_ACCEPTANCE_[FEATURE_KEY].md` remains a separate downstream controller artifact and does not replace the primary QA output
39
- - Optional (when detailed test design spec is requested):
40
- - `docs/qa/[FEATURE_KEY]_TEST_CASE.md` via `/test-case-spec`
41
-
42
- ## Process
43
- 1. Validate prerequisites: `FEATURE_IMPL_PLAN`, `CODE_HANDOFF`, `REVIEW_PACKET`, `OPS_HANDOFF`, downstream implementation evidence, and downstream OPS evidence are available and aligned.
44
- 2. Treat SDTK-CODE workflow evidence as the normal bridge into QA. In the current formal suite flow, `OPS_HANDOFF` plus downstream OPS evidence are also required before final QA approval.
45
- 3. Create test strategy mapped to UC/AC.
46
- 4. If test-case specification artifact is required, invoke `/test-case-spec` and align counts/coverage with release testing scope. Keep the structured TEST_CASE total consistent with the release-report baseline; track E2E separately if needed.
47
- 5. Apply `governance/ai/core/SDTK_BENCHMARK_QA_MODE_POLICY.md` for benchmark-mode verdict rules when no executable build exists.
48
- 6. If acceptance criteria / expected behavior is unclear, record OQ-xx in QA report and preserve benchmark-expected ambiguity per `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`; escalate to PM.
49
- 7. Execute/record results (unit/integration/e2e as applicable).
50
- 8. Persist the five mandatory review lanes inside `QA_RELEASE_REPORT_[FEATURE_KEY].md` under `3.1 Contract Review`, `3.2 Behavior Review`, `3.3 Evidence Review`, `3.4 Truth-Sync Review`, and `3.5 Closeout Hygiene Review`.
51
- 9. In each lane subsection, fill `Scope Checked`, `Findings`, `Severity`, `Evidence Refs`, and `Residual Risk / Notes`.
52
- 10. Record defects with severity and status.
53
- 11. Record `CODE_HANDOFF`, `REVIEW_PACKET`, `OPS_HANDOFF`, CODE evidence, and OPS evidence in the QA release artifact.
54
- 12. If the controller requests a bounded audit, answer one narrow evidence question only, cite exact refs, and do not issue the final verdict from that audit response.
55
- 13. Missing helper dispatch is not a QA blocker by itself; continue the review directly with the available artifacts and evidence.
56
- 14. Decide: APPROVED vs REJECTED (with reasons). `OPS_HANDOFF` alone is not sufficient final release evidence, and missing required OPS evidence blocks approval.
57
- 15. Update shared state + Phase 5 checklist.
58
- 16. Handoff: notify PM and stakeholders of the QA verdict and follow-up without reassigning final QA release authority.
1
+ ---
2
+ name: qa
3
+ description: QA workflow for SDTK-SPEC. Use when you need to validate downstream implementation evidence against BA/PRD/Backlog, run quality gates, document defects, and produce a QA_RELEASE_REPORT with a release decision.
4
+ ---
5
+
6
+ ## SDTK-SPEC Pipeline Rules (always apply)
7
+ 1. Pipeline: PM Initiation -> BA Analysis -> PM Planning -> Architecture Design -> Development Planning + SDTK-CODE Handoff -> 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
10
+ 4. Traceability: REQ -> BR/UC/AC -> design -> backlog -> FEATURE_IMPL_PLAN -> CODE_HANDOFF -> downstream implementation evidence -> OPS_HANDOFF + downstream OPS evidence -> QA
11
+ 5. QA waits for downstream implementation evidence, normally from SDTK-CODE, plus downstream OPS evidence in the current formal suite flow
12
+ 6. Do not skip phases. If inputs are missing, ask focused questions.
13
+
14
+ ## Prerequisites (verify before proceeding)
15
+ Read QUALITY_CHECKLIST.md and verify:
16
+ - Phase 4 DEV gate must show planning/handoff completion.
17
+ - Downstream implementation evidence exists for the same feature scope.
18
+ - `docs/dev/REVIEW_PACKET_[FEATURE_KEY].md` exists for the same feature scope when `SDTK-CODE verify` has run.
19
+ - `OPS_HANDOFF` and downstream OPS evidence exist for the same feature scope.
20
+
21
+ If prerequisites are not met, report which gate or downstream evidence is missing and suggest user complete `/dev` or the SDTK-CODE flow first.
22
+
23
+ ## Current Context
24
+ - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk-spec.config.json','utf8'))}catch{process.stdout.write('{}')}"`
25
+ - Pipeline: !`node -e "try{process.stdout.write(require('fs').readFileSync('SHARED_PLANNING.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
26
+ - Gates: !`node -e "try{process.stdout.write(require('fs').readFileSync('QUALITY_CHECKLIST.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
27
+ - State: !`node -e "try{process.stdout.write(require('fs').readFileSync('.sdtk/orchestration-state.json','utf8'))}catch{process.stdout.write('{}')}"`
28
+
29
+ ## Input
30
+ $ARGUMENTS
31
+
32
+ If no arguments are provided, read current feature context from SHARED_PLANNING.md.
33
+
34
+ # SDTK-SPEC QA (Testing + Release Decision)
35
+
36
+ ## Output
37
+ - `docs/qa/QA_RELEASE_REPORT_[FEATURE_KEY].md`
38
+ - `docs/qa/CONTROLLER_ACCEPTANCE_[FEATURE_KEY].md` remains a separate downstream controller artifact and does not replace the primary QA output
39
+ - Optional (when detailed test design spec is requested):
40
+ - `docs/qa/[FEATURE_KEY]_TEST_CASE.md` via `/test-case-spec`
41
+
42
+ ## Process
43
+ 1. Validate prerequisites: `FEATURE_IMPL_PLAN`, `CODE_HANDOFF`, `REVIEW_PACKET`, `OPS_HANDOFF`, downstream implementation evidence, and downstream OPS evidence are available and aligned.
44
+ 2. Treat SDTK-CODE workflow evidence as the normal bridge into QA. In the current formal suite flow, `OPS_HANDOFF` plus downstream OPS evidence are also required before final QA approval.
45
+ 3. Create test strategy mapped to UC/AC.
46
+ 4. If test-case specification artifact is required, invoke `/test-case-spec` and align counts/coverage with release testing scope. Keep the structured TEST_CASE total consistent with the release-report baseline; track E2E separately if needed.
47
+ 5. Apply `governance/ai/core/SDTK_BENCHMARK_QA_MODE_POLICY.md` for benchmark-mode verdict rules when no executable build exists.
48
+ 6. If acceptance criteria / expected behavior is unclear, record OQ-xx in QA report and preserve benchmark-expected ambiguity per `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`; escalate to PM.
49
+ 7. Execute/record results (unit/integration/e2e as applicable).
50
+ 8. Persist the five mandatory review lanes inside `QA_RELEASE_REPORT_[FEATURE_KEY].md` under `3.1 Contract Review`, `3.2 Behavior Review`, `3.3 Evidence Review`, `3.4 Truth-Sync Review`, and `3.5 Closeout Hygiene Review`.
51
+ 9. In each lane subsection, fill `Scope Checked`, `Findings`, `Severity`, `Evidence Refs`, and `Residual Risk / Notes`.
52
+ 10. Record defects with severity and status.
53
+ 11. Record `CODE_HANDOFF`, `REVIEW_PACKET`, `OPS_HANDOFF`, CODE evidence, and OPS evidence in the QA release artifact.
54
+ 12. If the controller requests a bounded audit, answer one narrow evidence question only, cite exact refs, and do not issue the final verdict from that audit response.
55
+ 13. Missing helper dispatch is not a QA blocker by itself; continue the review directly with the available artifacts and evidence.
56
+ 14. Decide: APPROVED vs REJECTED (with reasons). `OPS_HANDOFF` alone is not sufficient final release evidence, and missing required OPS evidence blocks approval.
57
+ 15. Update shared state + Phase 5 checklist.
58
+ 16. Handoff: notify PM and stakeholders of the QA verdict and follow-up without reassigning final QA release authority.
@@ -1,112 +1,112 @@
1
- ---
2
- name: screen-design-spec
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
- ---
5
-
6
- ## Required Inputs (read before proceeding)
7
- Read the following artifacts for the current feature:
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
-
12
- ## Input
13
- $ARGUMENTS
14
-
15
- # SDTK-SPEC Screen Flow Action Spec
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
- - I do not proceed on generated-draft screens if `DESIGN_LAYOUT_[FEATURE_KEY].md` does not exist.
25
-
26
- ## Outputs
27
- - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
28
- - Optional supporting docs:
29
- - `docs/specs/[FEATURE_KEY]_FIGMA_LAYOUT.md`
30
- - `docs/specs/[FEATURE_KEY]_DESIGN_SPEC_FROM_EXCEL.md`
31
- - `docs/specs/assets/[feature_snake]/screens/*`
32
-
33
- ## Required Inputs
34
- - Feature key/name
35
- - Primary requirement sources (BA spec, architecture, customer design docs)
36
- - Screen source references, using one of these design source modes:
37
- - `source-backed`: Figma URLs and/or requirement screenshots
38
- - `generated-draft`: generated layout from `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
39
- - API endpoint source (`docs/api/[FEATURE_KEY]_ENDPOINTS.md`) when available
40
-
41
- ## When To Stop Or Escalate
42
- - 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.
43
- - Stop if `DESIGN_LAYOUT_[FEATURE_KEY].md` is referenced as a generated-draft source but does not exist; escalate to `/design-layout` before continuing.
44
- - Stop if the API mapping table cannot be completed because ENDPOINTS.md is missing; record as OQ-xx and continue with explicit gaps noted.
45
- - Stop if legacy PlantUML activity syntax is found in existing source sections; run renumber/migration scripts before adding new content.
46
- - Escalate to `@ba` if UC/BR coverage cannot be confirmed for a screen's flow.
47
- - Escalate to `@arch` if API assignment for a screen is architecturally ambiguous.
48
-
49
- ## Core Process
50
- 1. Read requirement sources and identify in-scope screens, dialogs, and transitions.
51
- 2. Read and apply rules from `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
52
- 3. Determine design source mode per screen:
53
- - If Figma URL or screenshot exists: use `source-backed`.
54
- - 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`.
55
- - If screen has no UI scope: use `none`.
56
- 4. Build/update section `Feature overview` and `Screen flow action` (PlantUML).
57
- 5. For each screen/dialog:
58
- - Add metadata (screen ID, Design Source Type, Design Source Reference)
59
- - Add screen image reference (from Figma, screenshot, or rendered `.svg` from generated layout)
60
- - For generated-draft wireframes, add a wireframe-marker mapping table from the screen-local wireframe markers to the global action-table `No`
61
- - Add UI item/action table with `No` column
62
- - Add API mapping table (trigger -> API -> data usage)
63
- 6. Build/update `System processing flow` from use-case and process sources.
64
- 7. Build/update `Open questions` for unresolved behavior/API/data points.
65
- 8. Build/update `Screen - API Mapping` summary section.
66
- 9. Update document history and handoff to ARCH/DEV.
67
-
68
- ## Validation / Quality Gates
69
- - Global numbering consistency: no screen-level reset in action-table `No` column.
70
- - No broken image paths; for generated-draft screens, verify `.svg` exists or use render-skipped note.
71
- - PlantUML renderability and new-style activity syntax consistency: no `(*)`, `-->`, or `[edge label]` mixing.
72
- - Consistency with API endpoints spec.
73
- - EN artifact hygiene: no VI leftovers, no mojibake, no merged heading lines.
74
- - Every UI-scope screen declares a Design Source Type (`source-backed` or `generated-draft`).
75
- - Every generated-draft screen with an embedded wireframe image includes a wireframe-marker mapping table to the global action-table `No`.
76
- - Run validation script before finalizing.
77
-
78
- ## Order-Critical Hard Gate
79
- Do not finalize any screen section before applying `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`. The rules define mandatory section structure; skipping them produces incomplete specs that will fail ARCH/DEV review.
80
-
81
- 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.
82
-
83
- Do not reset action-table numbering between screens. Numbering must be global across the entire document.
84
-
85
- ## Common Mistakes
86
-
87
- | Mistake | Why it is wrong | Do instead |
88
- |---|---|---|
89
- | Reset action-table `No` per screen | Breaks global traceability | Keep `No` sequential across the entire document |
90
- | Mix legacy PlantUML syntax (`-->`, `(*)`) with new-style | Renders incorrectly; fails syntax check | Use new-style activity syntax only; run migration script on legacy content |
91
- | Set `generated-draft` when DESIGN_LAYOUT does not exist | References a missing source | Block until `/design-layout` produces the layout doc |
92
- | Leave image path as a broken link | Breaks the rendered spec for reviewers | Verify `.svg` exists; use render-skipped note if unavailable |
93
- | 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 |
94
- | Apply FLOW_ACTION_SPEC rules from memory | Rules evolve; memory is stale | Always read `./references/FLOW_ACTION_SPEC_CREATION_RULES.md` first |
95
-
96
- ## Validation Script
97
- - `.claude/skills/screen-design-spec/scripts/validate_flow_action_spec_numbering.py`
98
- - `python ".claude/skills/screen-design-spec/scripts/validate_flow_action_spec_numbering.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --en-check`
99
- - `.claude/skills/screen-design-spec/scripts/renumber_flow_action_spec_global.py`
100
- - Dry-run:
101
- - `python ".claude/skills/screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md"`
102
- - Apply:
103
- - `python ".claude/skills/screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`
104
-
105
- ## Reference Loading Guidance
106
- Read at skill start:
107
- - `./references/FLOW_ACTION_SPEC_CREATION_RULES.md` (required before any screen section)
108
-
109
- Read on demand:
110
- - `./references/numbering-rules.md` (when resolving numbering migration questions)
111
- - `./references/figma-mcp.md` (when source-backed mode uses Figma)
112
- - `./references/excel-image-export.md` (when source includes Excel screenshots)
1
+ ---
2
+ name: screen-design-spec
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
+ ---
5
+
6
+ ## Required Inputs (read before proceeding)
7
+ Read the following artifacts for the current feature:
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
+
12
+ ## Input
13
+ $ARGUMENTS
14
+
15
+ # SDTK-SPEC Screen Flow Action Spec
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
+ - I do not proceed on generated-draft screens if `DESIGN_LAYOUT_[FEATURE_KEY].md` does not exist.
25
+
26
+ ## Outputs
27
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
28
+ - Optional supporting docs:
29
+ - `docs/specs/[FEATURE_KEY]_FIGMA_LAYOUT.md`
30
+ - `docs/specs/[FEATURE_KEY]_DESIGN_SPEC_FROM_EXCEL.md`
31
+ - `docs/specs/assets/[feature_snake]/screens/*`
32
+
33
+ ## Required Inputs
34
+ - Feature key/name
35
+ - Primary requirement sources (BA spec, architecture, customer design docs)
36
+ - Screen source references, using one of these design source modes:
37
+ - `source-backed`: Figma URLs and/or requirement screenshots
38
+ - `generated-draft`: generated layout from `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
39
+ - API endpoint source (`docs/api/[FEATURE_KEY]_ENDPOINTS.md`) when available
40
+
41
+ ## When To Stop Or Escalate
42
+ - 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.
43
+ - Stop if `DESIGN_LAYOUT_[FEATURE_KEY].md` is referenced as a generated-draft source but does not exist; escalate to `/design-layout` before continuing.
44
+ - Stop if the API mapping table cannot be completed because ENDPOINTS.md is missing; record as OQ-xx and continue with explicit gaps noted.
45
+ - Stop if legacy PlantUML activity syntax is found in existing source sections; run renumber/migration scripts before adding new content.
46
+ - Escalate to `@ba` if UC/BR coverage cannot be confirmed for a screen's flow.
47
+ - Escalate to `@arch` if API assignment for a screen is architecturally ambiguous.
48
+
49
+ ## Core Process
50
+ 1. Read requirement sources and identify in-scope screens, dialogs, and transitions.
51
+ 2. Read and apply rules from `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
52
+ 3. Determine design source mode per screen:
53
+ - If Figma URL or screenshot exists: use `source-backed`.
54
+ - 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`.
55
+ - If screen has no UI scope: use `none`.
56
+ 4. Build/update section `Feature overview` and `Screen flow action` (PlantUML).
57
+ 5. For each screen/dialog:
58
+ - Add metadata (screen ID, Design Source Type, Design Source Reference)
59
+ - Add screen image reference (from Figma, screenshot, or rendered `.svg` from generated layout)
60
+ - For generated-draft wireframes, add a wireframe-marker mapping table from the screen-local wireframe markers to the global action-table `No`
61
+ - Add UI item/action table with `No` column
62
+ - Add API mapping table (trigger -> API -> data usage)
63
+ 6. Build/update `System processing flow` from use-case and process sources.
64
+ 7. Build/update `Open questions` for unresolved behavior/API/data points.
65
+ 8. Build/update `Screen - API Mapping` summary section.
66
+ 9. Update document history and handoff to ARCH/DEV.
67
+
68
+ ## Validation / Quality Gates
69
+ - Global numbering consistency: no screen-level reset in action-table `No` column.
70
+ - No broken image paths; for generated-draft screens, verify `.svg` exists or use render-skipped note.
71
+ - PlantUML renderability and new-style activity syntax consistency: no `(*)`, `-->`, or `[edge label]` mixing.
72
+ - Consistency with API endpoints spec.
73
+ - EN artifact hygiene: no VI leftovers, no mojibake, no merged heading lines.
74
+ - Every UI-scope screen declares a Design Source Type (`source-backed` or `generated-draft`).
75
+ - Every generated-draft screen with an embedded wireframe image includes a wireframe-marker mapping table to the global action-table `No`.
76
+ - Run validation script before finalizing.
77
+
78
+ ## Order-Critical Hard Gate
79
+ Do not finalize any screen section before applying `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`. The rules define mandatory section structure; skipping them produces incomplete specs that will fail ARCH/DEV review.
80
+
81
+ 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.
82
+
83
+ Do not reset action-table numbering between screens. Numbering must be global across the entire document.
84
+
85
+ ## Common Mistakes
86
+
87
+ | Mistake | Why it is wrong | Do instead |
88
+ |---|---|---|
89
+ | Reset action-table `No` per screen | Breaks global traceability | Keep `No` sequential across the entire document |
90
+ | Mix legacy PlantUML syntax (`-->`, `(*)`) with new-style | Renders incorrectly; fails syntax check | Use new-style activity syntax only; run migration script on legacy content |
91
+ | Set `generated-draft` when DESIGN_LAYOUT does not exist | References a missing source | Block until `/design-layout` produces the layout doc |
92
+ | Leave image path as a broken link | Breaks the rendered spec for reviewers | Verify `.svg` exists; use render-skipped note if unavailable |
93
+ | 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 |
94
+ | Apply FLOW_ACTION_SPEC rules from memory | Rules evolve; memory is stale | Always read `./references/FLOW_ACTION_SPEC_CREATION_RULES.md` first |
95
+
96
+ ## Validation Script
97
+ - `.claude/skills/screen-design-spec/scripts/validate_flow_action_spec_numbering.py`
98
+ - `python ".claude/skills/screen-design-spec/scripts/validate_flow_action_spec_numbering.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --en-check`
99
+ - `.claude/skills/screen-design-spec/scripts/renumber_flow_action_spec_global.py`
100
+ - Dry-run:
101
+ - `python ".claude/skills/screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md"`
102
+ - Apply:
103
+ - `python ".claude/skills/screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`
104
+
105
+ ## Reference Loading Guidance
106
+ Read at skill start:
107
+ - `./references/FLOW_ACTION_SPEC_CREATION_RULES.md` (required before any screen section)
108
+
109
+ Read on demand:
110
+ - `./references/numbering-rules.md` (when resolving numbering migration questions)
111
+ - `./references/figma-mcp.md` (when source-backed mode uses Figma)
112
+ - `./references/excel-image-export.md` (when source includes Excel screenshots)