sdtk-spec-kit 0.3.14 → 0.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/assets/manifest/toolkit-bundle.manifest.json +69 -134
  2. package/assets/manifest/toolkit-bundle.sha256.txt +33 -46
  3. package/assets/toolkit/toolkit/AGENTS.md +17 -15
  4. package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +10 -6
  5. package/assets/toolkit/toolkit/install.ps1 +60 -50
  6. package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +2 -2
  7. package/assets/toolkit/toolkit/scripts/agents/run-claude-task.ps1 +332 -111
  8. package/assets/toolkit/toolkit/scripts/agents/run-codex-task.ps1 +618 -103
  9. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +179 -169
  10. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +111 -84
  11. package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +46 -10
  12. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +85 -85
  13. package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +42 -3
  14. package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +61 -5
  15. package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +63 -5
  16. package/assets/toolkit/toolkit/skills/sdtk-mailbox-dispatch/SKILL.md +73 -71
  17. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +53 -33
  18. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +60 -24
  19. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +9 -9
  20. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +116 -90
  21. package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +49 -9
  22. package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +3 -3
  23. package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +36 -2
  24. package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +58 -5
  25. package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +60 -5
  26. package/assets/toolkit/toolkit/skills-claude/mailbox-dispatch/SKILL.md +73 -71
  27. package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +49 -27
  28. package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +74 -20
  29. package/assets/toolkit/toolkit/templates/README.md +5 -1
  30. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +1 -2
  31. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
  32. package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +3 -3
  33. package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +128 -128
  34. package/assets/toolkit/toolkit/templates/mailbox/AGENT_REPORT_TEMPLATE.md +62 -49
  35. package/assets/toolkit/toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md +23 -10
  36. package/package.json +48 -48
  37. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +0 -22
  38. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  39. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/FLOWCHART_CREATION_RULES.md +0 -20
  40. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  41. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/FLOWCHART_CREATION_RULES.md +0 -20
  42. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/YAML_CREATION_RULES.md +0 -128
  43. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +0 -22
  44. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  45. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOWCHART_CREATION_RULES.md +0 -20
  46. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
  47. package/assets/toolkit/toolkit/skills/sdtk-arch/references/YAML_CREATION_RULES.md +0 -128
  48. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
  49. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md +0 -129
@@ -12,6 +12,7 @@ description: Create/update screen flow-action specifications from requirement so
12
12
  - I do not mix legacy and new-style PlantUML activity syntax in the screen flow diagram.
13
13
  - Do not mix legacy activity syntax such as `(*)`, `-->`, or `[edge label]` with new-style activity actions like `:Activity;`.
14
14
  - I keep action-table numbering global across the document even when wireframe markers reset per screen.
15
+ - I do not proceed on generated-draft screens if `DESIGN_LAYOUT_[FEATURE_KEY].md` does not exist.
15
16
 
16
17
  ## Outputs
17
18
  - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
@@ -28,9 +29,17 @@ description: Create/update screen flow-action specifications from requirement so
28
29
  - `generated-draft`: generated layout from `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` (used when no Figma/screenshot is available for a UI-scope feature)
29
30
  - API endpoint source (`docs/api/[FEATURE_KEY]_ENDPOINTS.md`) when available
30
31
 
31
- ## Process
32
+ ## When To Stop Or Escalate
33
+ - Stop if no design source is available for a UI-scope screen (neither Figma/screenshot nor a completed DESIGN_LAYOUT); do not draft a flow-action spec against missing design sources.
34
+ - Stop if `DESIGN_LAYOUT_[FEATURE_KEY].md` is referenced as a generated-draft source but does not exist; escalate to `sdtk-design-layout` before continuing.
35
+ - Stop if the API mapping table cannot be completed because ENDPOINTS.md is missing; record as OQ-xx and continue with explicit gaps noted.
36
+ - Stop if legacy PlantUML activity syntax is found in existing source sections; run renumber/migration scripts before adding new content.
37
+ - Escalate to `@ba` if UC/BR coverage cannot be confirmed for a screen's flow.
38
+ - Escalate to `@arch` if API assignment for a screen is architecturally ambiguous.
39
+
40
+ ## Core Process
32
41
  1. Read requirement sources and identify in-scope screens, dialogs, and transitions.
33
- 2. Read and apply rules from `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
42
+ 2. Read and apply rules from `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md`.
34
43
  3. Determine design source mode per screen:
35
44
  - If Figma URL or screenshot exists: use `source-backed`.
36
45
  - If no Figma/screenshot but feature has UI scope: use `generated-draft` and reference the corresponding section in `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`. That file must exist before finalizing the flow-action spec.
@@ -45,42 +54,53 @@ description: Create/update screen flow-action specifications from requirement so
45
54
  6. Build/update `System processing flow` from use-case and process sources.
46
55
  7. Build/update `Open questions` for unresolved behavior/API/data points.
47
56
  8. Build/update `Screen - API Mapping` summary section.
48
- 9. Validate:
49
- - global numbering consistency (no screen-level reset)
50
- - no broken image paths (for `generated-draft` screens, verify `.svg` exists or use render-skipped note)
51
- - PlantUML renderability and new-style activity syntax consistency (no `(*)`, `-->`, or `[edge label]` mixing)
52
- - consistency with API endpoints spec
53
- - EN artifact hygiene (no VI leftovers, no mojibake, no merged heading lines)
54
- - for legacy specs with per-screen reset numbering: run renumber migration first
55
- - every UI-scope screen declares a Design Source Type (`source-backed` or `generated-draft`)
56
- - every generated-draft screen with an embedded wireframe image includes a wireframe-marker mapping table to the global action-table `No`
57
- 10. For `generated-draft` screens, set `Screen image:` to the rendered `.svg` path if the file exists:
58
- - Expected path (filesystem): `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
59
- - Markdown image path (file-relative): `assets/<feature_snake>/screens/<screen_id>.svg`
60
- - If the `.svg` does not exist (render unavailable), replace the image reference with: `> Screen image not rendered in this environment. See Design Source Reference for layout.`
61
- 11. For generated-draft screens, treat wireframe markers as screen-local visual references:
62
- - the local marker sequence may reset per screen
63
- - do not renumber the wireframe to fake equality with the global action-table `No`
64
- - publish the mapping table directly under the screen image so reviewers can cross-reference local markers to global action-table numbers
65
- 12. Update document history and handoff to ARCH/DEV.
57
+ 9. Update document history and handoff to ARCH/DEV.
58
+
59
+ ## Validation / Quality Gates
60
+ - Global numbering consistency: no screen-level reset in action-table `No` column.
61
+ - No broken image paths; for generated-draft screens, verify `.svg` exists or use render-skipped note.
62
+ - PlantUML renderability and new-style activity syntax consistency: no `(*)`, `-->`, or `[edge label]` mixing.
63
+ - Consistency with API endpoints spec.
64
+ - EN artifact hygiene: no VI leftovers, no mojibake, no merged heading lines.
65
+ - Every UI-scope screen declares a Design Source Type (`source-backed` or `generated-draft`).
66
+ - Every generated-draft screen with an embedded wireframe image includes a wireframe-marker mapping table to the global action-table `No`.
67
+ - Run `validate_flow_action_spec_numbering.py` before finalizing.
68
+
69
+ ## Order-Critical Hard Gate
70
+ Do not finalize any screen section before applying `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md`. The rules define mandatory section structure; skipping them produces incomplete specs that will fail ARCH/DEV review.
71
+
72
+ For generated-draft screens: do not set Design Source Type = `generated-draft` if `DESIGN_LAYOUT_[FEATURE_KEY].md` does not exist. Block until the layout doc is produced.
66
73
 
67
- ## Rule References
68
- - Core rules: `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`
69
- - Numbering reference: `./references/numbering-rules.md`
70
- - Figma reference: `./references/figma-mcp.md`
71
- - Excel image export reference: `./references/excel-image-export.md`
74
+ Do not reset action-table numbering between screens. Numbering must be global across the entire document.
72
75
 
73
- ## Validation Script
76
+ ## Common Mistakes
77
+
78
+ | Mistake | Why it is wrong | Do instead |
79
+ |---|---|---|
80
+ | Reset action-table `No` per screen | Breaks global traceability | Keep `No` sequential across the entire document |
81
+ | Mix legacy PlantUML syntax (`-->`, `(*)`) with new-style | Renders incorrectly; fails syntax check | Use new-style activity syntax only; run migration script on legacy content |
82
+ | Set `generated-draft` when DESIGN_LAYOUT does not exist | References a missing source | Block until `sdtk-design-layout` produces the layout doc |
83
+ | Leave image path as a broken link | Breaks the rendered spec for reviewers | Verify `.svg` exists; use render-skipped note if unavailable |
84
+ | Omit API mapping table for API-connected screens | Hides screen-to-API traceability | Add a complete API mapping table for every screen with API calls |
85
+ | Apply FLOW_ACTION_SPEC rules from memory | Rules evolve; memory is stale | Always read `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md` first |
86
+
87
+ ## Validation Scripts
74
88
  - `scripts/validate_flow_action_spec_numbering.py`
75
- - Checks duplicate/resetted numbering in action tables.
89
+ - Checks duplicate/reset numbering in action tables.
76
90
  - Checks encoding/markdown hygiene.
77
91
  - Checks screen-image markdown path convention.
78
92
  - Checks mixed legacy/new-style PlantUML activity syntax in screen-flow diagrams.
79
- - For EN artifacts, run with `--en-check`:
80
- - `python "toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --en-check`
93
+ - For EN artifacts: `python "toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --en-check`
81
94
  - `scripts/renumber_flow_action_spec_global.py`
82
95
  - Auto-migrates action table `No` fields to global numbering.
83
- - Dry-run:
84
- - `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md"`
85
- - Apply:
86
- - `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`
96
+ - Dry-run: `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md"`
97
+ - Apply: `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`
98
+
99
+ ## Reference Loading Guidance
100
+ Read at skill start:
101
+ - `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md` (required before any screen section)
102
+
103
+ Read on demand:
104
+ - `./references/numbering-rules.md` (when resolving numbering migration questions)
105
+ - `./references/figma-mcp.md` (when source-backed mode uses Figma)
106
+ - `./references/excel-image-export.md` (when source includes Excel screenshots)
@@ -8,6 +8,8 @@ description: Generate screen-based QA test-case markdown (`[FEATURE_KEY]_TEST_CA
8
8
  ## Critical Constraints
9
9
  - I do not invent test coverage beyond BA, flow-action, and API sources.
10
10
  - I do not let test totals drift away from worksheet rows or the QA baseline.
11
+ - I do not emit a final TEST_CASE artifact without applying `toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md`.
12
+ - I do not renumber stable case IDs only because of regrouping; stable IDs preserve traceability.
11
13
 
12
14
  ## Outputs
13
15
  - `docs/qa/[FEATURE_KEY]_TEST_CASE.md`
@@ -25,29 +27,43 @@ description: Generate screen-based QA test-case markdown (`[FEATURE_KEY]_TEST_CA
25
27
  - Clarification source:
26
28
  - `docs/specs/Q&A.md` or `docs/en/specs/Q&A.md` when available
27
29
 
28
- ## Core Rules
29
- 1. Apply `./references/TEST_CASE_CREATION_RULES.md` first.
30
- 2. Keep section order fixed (Statistic -> Abbreviations -> Scope -> References -> Environment -> Coverage -> Screen-based UTC/ITC -> OQ -> STC/UAT note).
31
- 3. Use screen-first layout to mirror worksheet structure.
32
- 4. Keep one unified 18-column schema for UTC/ITC rows.
33
- 5. Keep stable case IDs; do not renumber only because of regrouping.
34
- 6. Track unresolved decisions via `OQ-xx` and keep benchmark-expected OQs explicitly OPEN per `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`.
35
- 7. Quote exact BA, API, or flow-action requirement text when a testcase or coverage claim depends on that requirement.
36
-
37
- ## Procedure
38
- 1. Resolve output path:
30
+ ## When To Stop Or Escalate
31
+ - Stop if `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` does not exist; do not design test cases without a finalized flow-action spec as the primary source of truth for UI coverage.
32
+ - Stop if the Statistic Summary cannot be completed because test counts cannot be verified against the available flow/action rows; surface the gap rather than estimating.
33
+ - Stop if a coverage claim requires a requirement that is marked OQ-xx and still OPEN; track the gap explicitly in the Open Questions section rather than assuming resolution.
34
+ - Escalate to `@qa` or `sdtk-qa` if the test-case scope intersects a release decision that requires the QA Release Report.
35
+ - Escalate to `@ba` if a BA requirement is ambiguous for a test case that depends on it.
36
+
37
+ ## Core Process
38
+ 1. Apply `toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md` first.
39
+ 2. Resolve output path:
39
40
  - default `docs/qa/[FEATURE_KEY]_TEST_CASE.md`
40
41
  - use `docs/en/qa/...` only if the repo already follows `docs/en/**`.
41
- 2. Build/refresh `Statistic Summary (Excel-aligned)` with UT total, IT total, and grand total.
42
- 3. Build `Feature Coverage Matrix` from flow/action and API docs.
43
- 4. Split UTC/ITC by screen sections (`screen-first`), not by test type only.
44
- 5. Fill conflict/permission/error-path cases from Q&A decisions and API contracts.
45
- 6. Record unresolved items in section `Open Questions`.
46
- 7. Validate:
47
- - counts in summary match table rows
48
- - structured TEST_CASE total stays aligned with the QA release-report baseline; if E2E is tracked separately, label it separately instead of inflating grand total
49
- - no placeholder tokens like `??`
50
- - out-of-scope boundaries are explicit
42
+ 3. Build/refresh `Statistic Summary (Excel-aligned)` with UT total, IT total, and grand total.
43
+ 4. Build `Feature Coverage Matrix` from flow/action and API docs.
44
+ 5. Split UTC/ITC by screen sections (`screen-first`), not by test type only.
45
+ 6. Fill conflict/permission/error-path cases from Q&A decisions and API contracts.
46
+ 7. Record unresolved items in section `Open Questions`.
47
+ 8. Keep section order fixed: Statistic -> Abbreviations -> Scope -> References -> Environment -> Coverage -> Screen-based UTC/ITC -> OQ -> STC/UAT note.
48
+ 9. Use screen-first layout to mirror worksheet structure.
49
+ 10. Keep one unified 18-column schema for UTC/ITC rows.
50
+ 11. Keep stable case IDs; do not renumber only because of regrouping.
51
+ 12. Track unresolved decisions via `OQ-xx` and keep benchmark-expected OQs explicitly OPEN per `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`.
52
+ 13. Quote exact BA, API, or flow-action requirement text when a testcase or coverage claim depends on that requirement.
53
+
54
+ ## Validation / Quality Gates
55
+ - Statistic Summary totals match the actual row counts in UTC/ITC tables.
56
+ - Structured TEST_CASE total stays aligned with the QA release-report baseline; E2E tracked separately if applicable.
57
+ - No placeholder tokens such as `??` remain in any field.
58
+ - Out-of-scope boundaries are explicitly stated.
59
+ - Every coverage claim has a corresponding source quote.
60
+ - Open OQ-xx items are explicitly listed and not silently collapsed.
61
+ - Run `scripts/validate_test_case_spec.py` before finalizing.
62
+
63
+ ## Order-Critical Hard Gate
64
+ Do not build the coverage matrix or test rows before applying `toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md`. The rules define mandatory column schema and section order; skipping them produces non-Excel-aligned output that must be reformatted before QA handoff.
65
+
66
+ Do not finalize the artifact before verifying Statistic Summary totals match table row counts. Drifted totals are a hard failure at QA review.
51
67
 
52
68
  ## Specification Quoting
53
69
  When a testcase, coverage note, or defect check depends on a requirement, quote the exact source text before stating coverage or mismatch.
@@ -60,9 +76,16 @@ Use this format:
60
76
  - `/qa` uses this skill to design/update reusable test-case specs.
61
77
  - `sdtk-qa` still owns release decision artifact (`QA_RELEASE_REPORT_*`).
62
78
 
63
- ## Notes
64
- - This skill is for test-case specification artifacts, not test execution logs.
65
- - For release approval and defect triage, continue with `sdtk-qa`.
79
+ ## Common Mistakes
80
+
81
+ | Mistake | Why it is wrong | Do instead |
82
+ |---|---|---|
83
+ | Skip `toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md` and free-form the layout | Produces non-conformant column schema | Always read and apply the rules before writing any row |
84
+ | Let Statistic Summary totals drift from table row counts | Hard failure at QA review | Verify totals against actual rows before finalizing |
85
+ | Renumber stable case IDs during regrouping | Breaks traceability with existing defect refs | Preserve case IDs; regroup without renumbering |
86
+ | Leave `??` placeholders in any field | Incomplete test cases cannot be executed | Resolve or escalate every ambiguity before finalizing |
87
+ | Invent coverage beyond available sources | Creates untraceable test claims | Only claim coverage for requirements present in BA/flow/API sources |
88
+ | Collapse OPEN OQ-xx items silently | Hides unresolved gaps from QA | Keep OQ-xx explicitly OPEN in the Open Questions section |
66
89
 
67
90
  ## Validator Script
68
91
  - `scripts/validate_test_case_spec.py`
@@ -72,3 +95,16 @@ Use this format:
72
95
  python "toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py" `
73
96
  --file "docs/qa/[FEATURE_KEY]_TEST_CASE.md"
74
97
  ```
98
+
99
+ ## Reference Loading Guidance
100
+ Read at skill start:
101
+ - `toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md` (required before any row generation)
102
+
103
+ Read at slice start:
104
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` (required)
105
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` (required)
106
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (required)
107
+
108
+ Read on demand:
109
+ - `docs/specs/Q&A.md` or `docs/en/specs/Q&A.md` (when clarification is needed)
110
+ - `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md` (when OQ-xx items need policy guidance)
@@ -61,9 +61,9 @@ skills:
61
61
  - For UI scope, DESIGN_LAYOUT must exist before FLOW_ACTION_SPEC.
62
62
  - Keep API, DB, and screen outputs aligned to the same source requirements.
63
63
  references:
64
- - toolkit/skills/sdtk-arch/references/YAML_CREATION_RULES.md
65
- - toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md
66
- - toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md
64
+ - toolkit/templates/docs/api/YAML_CREATION_RULES.md
65
+ - toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md
66
+ - toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md
67
67
  prompts: []
68
68
  scripts: []
69
69
  runtime_support: [claude, codex]
@@ -227,8 +227,8 @@ skills:
227
227
  - Do not invent API paths or schemas that contradict BA or ARCH source.
228
228
  - Keep YAML, endpoint markdown, and flow list synchronized.
229
229
  references:
230
- - toolkit/skills/sdtk-api-doc/references/YAML_CREATION_RULES.md
231
- - toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md
230
+ - toolkit/templates/docs/api/YAML_CREATION_RULES.md
231
+ - toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md
232
232
  prompts: []
233
233
  scripts: []
234
234
  runtime_support: [claude, codex]
@@ -250,8 +250,8 @@ skills:
250
250
  - Do not drift from the source YAML or flow list.
251
251
  - Do not leave broken flow image embeds in the generated markdown.
252
252
  references:
253
- - toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md
254
- - toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md
253
+ - toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md
254
+ - toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md
255
255
  prompts: []
256
256
  scripts:
257
257
  - toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py
@@ -295,7 +295,7 @@ skills:
295
295
  - Do not finalize UI-scope screens without a valid design source type and reference.
296
296
  - Do not leave broken image paths or missing API mappings in the spec.
297
297
  references:
298
- - toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md
298
+ - toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md
299
299
  - toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md
300
300
  - toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md
301
301
  - toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md
@@ -321,7 +321,7 @@ skills:
321
321
  - Do not invent test coverage that is not grounded in BA, flow-action, or API sources.
322
322
  - Keep totals and structured coverage counts consistent with the QA baseline.
323
323
  references:
324
- - toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md
324
+ - toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md
325
325
  prompts: []
326
326
  scripts:
327
327
  - toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py
@@ -1,90 +1,116 @@
1
- ---
2
- name: api-design-spec
3
- description: Generate detailed API design markdown from OpenAPI YAML and API flow list. Use when you need field-level request/response tables plus one visible process-flow diagram per API.
4
- ---
5
-
6
- ## Required Inputs (read before proceeding)
7
- Read the following artifacts for the current feature:
8
- 1. `docs/api/[FeaturePascal]_API.yaml` - API contract
9
- 2. `docs/api/[feature_snake]_api_flow_list.txt` - flow list
10
-
11
- ## Input
12
- $ARGUMENTS
13
-
14
- # SDTK-SPEC API Design Detail Spec
15
-
16
- ## Critical Constraints
17
- - I do not drift from the source YAML or flow list.
18
- - I do not leave broken flow image embeds in the generated markdown.
19
-
20
- ## Outputs
21
- - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
22
- - Supporting generated assets:
23
- - `docs/api/flows/*.puml`
24
- - `docs/api/images/*.svg`
25
-
26
- ## Required Inputs
27
- - Feature key (`FEATURE_KEY`)
28
- - API contract YAML:
29
- - Preferred: `docs/api/[FeaturePascal]_API.yaml`
30
- - Fallback: a specified YAML file path
31
- - API flow list:
32
- - Preferred: `docs/api/[feature_snake]_api_flow_list.txt`
33
- - Fallback: a specified flow list path
34
-
35
- ## Core Rules
36
- - Apply `.claude/skills/references/API_DESIGN_FLOWCHART_CREATION_RULES.md` first.
37
- - Keep endpoint contracts consistent with source YAML.
38
- - Keep process flow source synchronized with flow list (`*_api_flow_list.txt`).
39
- - Keep one visible flowchart per API section (embed image), avoid duplicate preview rendering.
40
- - Keep `Process Flow` sections implementation-readable:
41
- - include YAML-derived flow summary / notes / login bullets
42
- - keep error sections aligned with actual flow exits, not `None`
43
-
44
- ## Generation Procedure
45
- 1. Resolve input files (`yaml`, `flow_list`, `output`).
46
- 2. Parse YAML endpoints (method, path, request schema, success/error schema).
47
- 3. Parse flow blocks from flow list and map them by normalized `METHOD + path`.
48
- 4. Generate detailed markdown sections per API:
49
- - Flow summary / notes / login bullets from YAML `description`
50
- - Process flow source block (`text` fenced block)
51
- - Embedded flowchart image
52
- - Path parameter table
53
- - Request table
54
- - Success response table
55
- - Error response table
56
- 5. Generate/update `.puml` per API under `docs/api/flows`.
57
- 6. Render `.svg` images under `docs/api/images`.
58
- 7. Validate:
59
- - every API section has one embedded image
60
- - every embed path exists
61
- - no render error image output
62
- - markdown tables keep `No` sequential numbering
63
-
64
- ## Script
65
- - `.claude/skills/api-design-spec/scripts/generate_api_design_detail.py`
66
-
67
- ### Typical command
68
- ```bash
69
- python ".claude/skills/api-design-spec/scripts/generate_api_design_detail.py" \
70
- --feature-key WORK_PLANNING_BOARD \
71
- --yaml "docs/api/WorkPlanningBoard_API.yaml" \
72
- --flow-list "docs/api/work_planning_board_api_flow_list.txt" \
73
- --output "docs/api/WORK_PLANNING_BOARD_API_DESIGN_DETAIL.md"
74
- ```
75
-
76
- ### Optional subset generation
77
- ```bash
78
- python ".claude/skills/api-design-spec/scripts/generate_api_design_detail.py" \
79
- --feature-key WORK_PLANNING_BOARD \
80
- --yaml "docs/api/WorkPlanningBoard_API.yaml" \
81
- --flow-list "docs/api/work_planning_board_api_flow_list.txt" \
82
- --output "docs/api/WORK_PLANNING_BOARD_API_DESIGN_DETAIL.md" \
83
- --include "POST /api/work-assignment/{organization_uuid}"
84
- ```
85
-
86
- ## Orchestrator Integration (Hybrid)
87
- - `apiDesignDetailMode` in `sdtk-spec.config.json` controls orchestration behavior:
88
- - `auto` (default): generate API design detail when ARCH has API scope and YAML/flow sources are available.
89
- - `on`: always generate API design detail for API scope (fail if required sources are missing).
90
- - `off`: skip unless user explicitly requests.
1
+ ---
2
+ name: api-design-spec
3
+ description: Generate detailed API design markdown from OpenAPI YAML and API flow list. Use when you need field-level request/response tables plus one visible process-flow diagram per API.
4
+ ---
5
+
6
+ ## Required Inputs (read before proceeding)
7
+ Read the following artifacts for the current feature:
8
+ 1. `docs/api/[FeaturePascal]_API.yaml` - API contract
9
+ 2. `docs/api/[feature_snake]_api_flow_list.txt` - flow list
10
+
11
+ ## Input
12
+ $ARGUMENTS
13
+
14
+ # SDTK-SPEC API Design Detail Spec
15
+
16
+ ## Critical Constraints
17
+ - I do not drift from the source YAML or flow list.
18
+ - I do not leave broken flow image embeds or missing assumptions in the API design detail.
19
+ - I do not generate API design detail without a valid YAML source and matching flow list.
20
+ - I do not skip the flowchart creation rules; freehand flow sections that bypass `API_DESIGN_FLOWCHART_CREATION_RULES.md` are non-conformant.
21
+
22
+ ## Outputs
23
+ - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
24
+ - Supporting generated assets:
25
+ - `docs/api/flows/*.puml`
26
+ - `docs/api/images/*.svg`
27
+
28
+ ## Required Inputs
29
+ - Feature key (`FEATURE_KEY`)
30
+ - API contract YAML:
31
+ - Preferred: `docs/api/[FeaturePascal]_API.yaml`
32
+ - Fallback: a specified YAML file path
33
+ - API flow list:
34
+ - Preferred: `docs/api/[feature_snake]_api_flow_list.txt`
35
+ - Fallback: a specified flow list path
36
+
37
+ ## When To Stop Or Escalate
38
+ - Stop if the required YAML file does not exist or cannot be resolved; do not fabricate an endpoint table.
39
+ - Stop if the flow list is missing or contains no parseable `@startuml ... @enduml` blocks; record the gap and escalate to `/api-doc` for regeneration.
40
+ - Stop if YAML and flow list describe fundamentally different endpoint sets; surface the discrepancy as a blocker before generating any section.
41
+ - Escalate to `@arch` if a flow block is ambiguous about business logic that would change how a table row is authored.
42
+
43
+ ## Core Process
44
+ 1. Resolve input files (`yaml`, `flow_list`, `output`).
45
+ 2. Load and apply `./references/API_DESIGN_FLOWCHART_CREATION_RULES.md` before generating any section.
46
+ 3. Parse YAML endpoints (method, path, request schema, success/error schema).
47
+ 4. Parse flow blocks from flow list and map them by normalized `METHOD + path`.
48
+ 5. Generate detailed markdown sections per API:
49
+ - Flow summary / notes / login bullets from YAML `description`
50
+ - Process flow source block (`text` fenced block)
51
+ - Embedded flowchart image
52
+ - Path parameter table
53
+ - Request table (hierarchy levels + type + format + required)
54
+ - Success response table
55
+ - Error response table (explicit schema if defined, otherwise shared envelope + inferred business statuses from flow)
56
+ 6. Generate/update `.puml` per API under `docs/api/flows`.
57
+ 7. Render `.svg` images under `docs/api/images`.
58
+
59
+ ## Validation / Quality Gates
60
+ - Every API section has exactly one embedded image; no section is left without a flow visual.
61
+ - Every embed path exists on disk; broken image links are a hard failure.
62
+ - No render error image output is accepted.
63
+ - Markdown tables keep `No` sequential numbering.
64
+ - YAML-derived field tables match the YAML source exactly; no invented fields.
65
+ - Error response table aligns with actual flow exits, not placeholder `None` values.
66
+
67
+ ## Order-Critical Hard Gate
68
+ Do not generate any API section before reading and applying `./references/API_DESIGN_FLOWCHART_CREATION_RULES.md`. Sections generated without that reference produce structurally incorrect output that will fail implementation review.
69
+
70
+ Do not emit `API_DESIGN_DETAIL.md` if the input YAML and flow list describe incompatible endpoint sets. Fix the upstream sources before proceeding.
71
+
72
+ ## Common Mistakes
73
+
74
+ | Mistake | Why it is wrong | Do instead |
75
+ |---|---|---|
76
+ | Generate sections without reading flowchart rules | Produces non-conformant flow blocks | Always read `API_DESIGN_FLOWCHART_CREATION_RULES.md` first |
77
+ | Leave error table as `None` or empty | Hides actual error paths from implementers | Derive error rows from the flow list and YAML error schemas |
78
+ | Embed image paths that do not exist on disk | Breaks document rendering for reviewers | Verify `.svg` exists before embedding; fail loudly if missing |
79
+ | Invent request fields not present in YAML | Introduces contract drift | Only table fields that exist in the parsed YAML schema |
80
+ | Run on an outdated YAML source | Generates stale API design detail | Always confirm the YAML was produced from the current BA/ARCH pass |
81
+
82
+ ## Script
83
+ - `.claude/skills/api-design-spec/scripts/generate_api_design_detail.py`
84
+
85
+ ### Typical command
86
+ ```bash
87
+ python ".claude/skills/api-design-spec/scripts/generate_api_design_detail.py" \
88
+ --feature-key WORK_PLANNING_BOARD \
89
+ --yaml "docs/api/WorkPlanningBoard_API.yaml" \
90
+ --flow-list "docs/api/work_planning_board_api_flow_list.txt" \
91
+ --output "docs/api/WORK_PLANNING_BOARD_API_DESIGN_DETAIL.md"
92
+ ```
93
+
94
+ ### Optional subset generation
95
+ ```bash
96
+ python ".claude/skills/api-design-spec/scripts/generate_api_design_detail.py" \
97
+ --feature-key WORK_PLANNING_BOARD \
98
+ --yaml "docs/api/WorkPlanningBoard_API.yaml" \
99
+ --flow-list "docs/api/work_planning_board_api_flow_list.txt" \
100
+ --output "docs/api/WORK_PLANNING_BOARD_API_DESIGN_DETAIL.md" \
101
+ --include "POST /api/work-assignment/{organization_uuid}"
102
+ ```
103
+
104
+ ## Orchestrator Integration (Hybrid)
105
+ - `apiDesignDetailMode` in `sdtk-spec.config.json` controls orchestration behavior:
106
+ - `auto` (default): generate API design detail when ARCH has API scope and YAML/flow sources are available.
107
+ - `on`: always generate API design detail for API scope (fail if required sources are missing).
108
+ - `off`: skip unless user explicitly requests.
109
+
110
+ ## Reference Loading Guidance
111
+ Read at skill start:
112
+ - `./references/API_DESIGN_FLOWCHART_CREATION_RULES.md` (required before any section generation)
113
+
114
+ Read on demand:
115
+ - `docs/api/[FeaturePascal]_API.yaml` (required input)
116
+ - `docs/api/[feature_snake]_api_flow_list.txt` (required input)
@@ -13,6 +13,12 @@ $ARGUMENTS
13
13
 
14
14
  # SDTK-SPEC API Documentation
15
15
 
16
+ ## Critical Constraints
17
+ - I do not invent API paths or payload contracts that contradict BA or ARCH artifacts.
18
+ - I do not leave YAML, endpoint markdown, and flow-list outputs out of sync.
19
+ - I do not emit a final API doc without applying canonical YAML and flowchart rules.
20
+ - I do not proceed if BA_SPEC or ARCH_DESIGN is absent or clearly incomplete for the current feature scope.
21
+
16
22
  ## Outputs
17
23
  - `docs/api/[FeaturePascal]_API.yaml`
18
24
  - `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
@@ -20,17 +26,24 @@ $ARGUMENTS
20
26
  - Optional downstream (via `/api-design-spec`):
21
27
  - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
22
28
 
23
- ## Inputs (minimum)
24
- - Feature name/key
25
- - Entities + key fields
26
- - Use cases (UC-xx) + business rules (BR-xx)
29
+ ## Required Inputs
30
+ - Feature name and key
31
+ - Entities and key fields
32
+ - Use cases (UC-xx) and business rules (BR-xx)
27
33
  - Auth/permission model
34
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
35
+
36
+ ## When To Stop Or Escalate
37
+ - Stop if no BA_SPEC or ARCH_DESIGN exists for the current feature; surface as a blocker before generating any artifact.
38
+ - Stop if path naming policy cannot be resolved without a product decision; record as OQ-xx and escalate to `@pm`.
39
+ - Stop if required UC/BR coverage cannot be confirmed from available sources; do not invent coverage.
40
+ - Escalate to `@arch` if the data model or endpoint scope is structurally ambiguous.
28
41
 
29
- ## Process
42
+ ## Core Process
30
43
  1. Read `docs/specs/BA_SPEC_[FEATURE_KEY].md` and/or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`.
31
44
  2. Read and apply split API rule sources:
32
- - `.claude/skills/references/YAML_CREATION_RULES.md` for YAML contract rules
33
- - `.claude/skills/references/API_DESIGN_FLOWCHART_CREATION_RULES.md` for flow list / flowchart rules
45
+ - `./references/YAML_CREATION_RULES.md` for YAML contract rules
46
+ - `./references/API_DESIGN_FLOWCHART_CREATION_RULES.md` for flow list / flowchart rules
34
47
  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.
35
48
  4. For each endpoint, document request/response schema and error cases.
36
49
  5. Generate/update endpoint markdown (`[FEATURE_KEY]_ENDPOINTS.md`) with summary tables, API type grouping, and screen-logic mapping.
@@ -43,5 +56,32 @@ $ARGUMENTS
43
56
  - terminology consistency across endpoint detail, summary tables, and flow labels
44
57
  10. If orchestrator mode requires API design detail generation (`apiDesignDetailMode=auto/on`), handoff to `/api-design-spec` after YAML + flow list are updated.
45
58
 
46
- ## Reference
47
- - Deeper analysis: `docs/specs/API_DOC_SKILL_ANALYSIS.md` (if present).
59
+ ## Validation / Quality Gates
60
+ - YAML, ENDPOINTS.md, and flow list are consistent: the same resource uses the same path segment across all three.
61
+ - Every UC-xx in scope has at least one endpoint mapped.
62
+ - Every endpoint has a defined success response and at least one error case.
63
+ - All path segments match the canonical naming policy.
64
+ - No OQ-xx is silently collapsed; unresolved items remain explicit.
65
+ - English artifact hygiene passes (no language leftovers, no mojibake).
66
+
67
+ ## Order-Critical Hard Gate
68
+ Do not finalize YAML or ENDPOINTS.md before reading and applying both reference rule files. Generating endpoints without `YAML_CREATION_RULES.md` and `API_DESIGN_FLOWCHART_CREATION_RULES.md` produces non-conformant output that will fail downstream review.
69
+
70
+ ## Common Mistakes
71
+
72
+ | Mistake | Why it is wrong | Do instead |
73
+ |---|---|---|
74
+ | Invent endpoint paths not in BA/ARCH | Creates untracked contract drift | Map every endpoint to an explicit UC-xx or BR-xx |
75
+ | Apply path naming from memory without reading policy | Policy details evolve; memory is stale | Always read `SDTK_API_PATH_STYLE_POLICY.md` first |
76
+ | 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 |
77
+ | Silently collapse an OQ-xx marked as OPEN | Hides unresolved decisions | Keep OQ-xx explicit; escalate to `@pm` if resolution is needed |
78
+ | Skip flowchart rules and free-style PlantUML | Produces flows that deviate from SDTK conventions | Apply `API_DESIGN_FLOWCHART_CREATION_RULES.md` before generating any flow |
79
+
80
+ ## Reference Loading Guidance
81
+ Read at skill start:
82
+ - `./references/YAML_CREATION_RULES.md`
83
+ - `./references/API_DESIGN_FLOWCHART_CREATION_RULES.md`
84
+
85
+ Read on demand:
86
+ - `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` (always required for path naming)
87
+ - `docs/specs/API_DOC_SKILL_ANALYSIS.md` (if present; deeper domain analysis only)
@@ -40,9 +40,9 @@ $ARGUMENTS
40
40
  1. Read BA spec and PRD/backlog.
41
41
  2. Read `sdtk-spec.config.json` for project stack assumptions.
42
42
  3. If architecture output includes API contracts or flows, read and apply:
43
- - `.claude/skills/references/YAML_CREATION_RULES.md`
44
- - `.claude/skills/references/API_DESIGN_FLOWCHART_CREATION_RULES.md`
45
- 4. If architecture output includes screen flow-action specs, read and apply `.claude/skills/references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
43
+ - `./references/YAML_CREATION_RULES.md`
44
+ - `./references/API_DESIGN_FLOWCHART_CREATION_RULES.md`
45
+ 4. If architecture output includes screen flow-action specs, read and apply `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
46
46
  5. For API scope:
47
47
  - generate or update YAML, endpoints markdown, and flow list
48
48
  - if API detail is required, use `/api-design-spec`