sdtk-spec-kit 0.3.14 → 0.3.15

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 (45) hide show
  1. package/assets/manifest/toolkit-bundle.manifest.json +61 -126
  2. package/assets/manifest/toolkit-bundle.sha256.txt +29 -42
  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-codex-task.ps1 +117 -103
  8. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +179 -169
  9. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +111 -84
  10. package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +46 -10
  11. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +85 -85
  12. package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +42 -3
  13. package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +61 -5
  14. package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +63 -5
  15. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +53 -33
  16. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +60 -24
  17. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +9 -9
  18. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +116 -90
  19. package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +49 -9
  20. package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +3 -3
  21. package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +36 -2
  22. package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +58 -5
  23. package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +60 -5
  24. package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +49 -27
  25. package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +74 -20
  26. package/assets/toolkit/toolkit/templates/README.md +5 -1
  27. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +1 -2
  28. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
  29. package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +3 -3
  30. package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +128 -128
  31. package/assets/toolkit/toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md +3 -1
  32. package/package.json +46 -46
  33. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +0 -22
  34. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  35. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/FLOWCHART_CREATION_RULES.md +0 -20
  36. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  37. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/FLOWCHART_CREATION_RULES.md +0 -20
  38. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/YAML_CREATION_RULES.md +0 -128
  39. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +0 -22
  40. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  41. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOWCHART_CREATION_RULES.md +0 -20
  42. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
  43. package/assets/toolkit/toolkit/skills/sdtk-arch/references/YAML_CREATION_RULES.md +0 -128
  44. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
  45. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md +0 -129
@@ -1,85 +1,85 @@
1
- ---
2
- name: sdtk-arch
3
- description: Solution Architect workflow for SDTK-SPEC. Use when you need to convert BA_SPEC + PM backlog into technical architecture, API contracts (OpenAPI), and UI layout docs; update SHARED_PLANNING.md / QUALITY_CHECKLIST.md and handoff to DEV.
4
- ---
5
-
6
- # SDTK-SPEC ARCH (Solution Architecture)
7
-
8
- ## Critical Constraints
9
- - I do not generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI-scope features.
10
- - I do not let API, DB, and UI artifacts drift from the same BA and PM source of truth.
11
-
12
- ## Outputs
13
- - `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
14
- - If applicable:
15
- - `docs/api/[FeaturePascal]_API.yaml`
16
- - `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
17
- - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
18
- - `docs/api/[feature_snake]_api_flow_list.txt`
19
- - `docs/database/DATABASE_SPEC_[FEATURE_KEY].md`
20
- - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
21
- - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
22
-
23
- ## Flow Overview
24
-
25
- ```dot
26
- digraph sdtk_arch_flow {
27
- rankdir=TB;
28
- BA_SPEC -> ARCH_DESIGN;
29
- ARCH_DESIGN -> DESIGN_LAYOUT;
30
- DESIGN_LAYOUT -> FLOW_ACTION_SPEC;
31
- ARCH_DESIGN -> API_YAML;
32
- API_YAML -> API_DETAIL;
33
- }
34
- ```
35
-
36
- ## Process
37
- 1. Read BA spec and PRD/backlog.
38
- 2. Read `sdtk-spec.config.json` for project stack assumptions (backend/frontend/db/auth).
39
- 3. If architecture output includes API contracts/flows, read and apply:
40
- - `./references/YAML_CREATION_RULES.md`
41
- - `./references/API_DESIGN_FLOWCHART_CREATION_RULES.md`
42
- - `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` for canonical resource naming and multi-word path style
43
- 4. If architecture output includes screen flow-action specs, read and apply `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
44
- 5. If API detail spec is required, use `sdtk-api-design-spec` to build/update `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md` using YAML + flow list.
45
- 6. For UI-scope features, enforce this generation sequence:
46
- a. Generate/update `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` first (using `sdtk-design-layout`).
47
- b. Attempt to render screen preview images from the layout using `render_design_layout_images.py`. Output: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`. If rendering fails (no Java/plantuml.jar), fall back to the render-skipped note -- do not silently skip.
48
- c. Then generate/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` (using `sdtk-screen-design-spec`).
49
- d. The flow-action spec must reference the design-layout doc as its design source when no Figma/screenshot is available (Design Source Type: `generated-draft`). Use rendered `.svg` files as the screen image. If render failed, use the render-skipped note instead of a broken image reference.
50
- 7. For complex UI flow-action specs, use `sdtk-screen-design-spec` to build/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`.
51
- 8. Define:
52
- - System components + data model
53
- - API endpoints and flows
54
- - Screen layouts
55
- - Security/authz decisions
56
- 9. Create/update:
57
- - OpenAPI YAML + API endpoint markdown
58
- - API flow list
59
- - API design detail spec (when `orchestration.apiDesignDetailMode` is `auto/on`)
60
- - Database spec (if DB impact exists)
61
- - Design layout (if UI impact exists) - must be created before flow-action spec
62
- - Flow-action spec (if UI impact exists) - must reference design layout as fallback source
63
- 10. Ensure mapping UC/BR -> DB/API/screens and run output hygiene checks:
64
- - EN artifacts use English narrative text (except clearly marked original-language appendix blocks)
65
- - No mojibake/encoding corruption in markdown/yaml/txt outputs
66
- 11. For workflow/tooling hardening batches that stop before `/dev`, lock the validator matrix, exact approved DEV surfaces, exact out-of-scope list, and explicit stop-before-`/dev` wording inside `ARCH_DESIGN_[FEATURE_KEY].md` before handoff.
67
- 12. For benchmark runs, apply `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`: keep benchmark-expected open questions explicitly OPEN unless the requirement source resolves them.
68
- 13. If anything is unclear, record OQ-xx in ARCH_DESIGN "Open Questions" and escalate to `@pm` for a decision.
69
- 14. Update shared state + Phase 3 checklist.
70
- 15. Handoff: `@dev please prepare FEATURE_IMPL_PLAN + CODE_HANDOFF for SDTK-CODE ...`.
71
-
72
- ## Order-Critical Hard Gate
73
- For UI-scope features, do not generate or update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` until `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` already exists and is current enough to serve as the design source for the same scope.
74
-
75
- If the layout is missing, stale, or cannot support the flow-action spec, stop and fix the layout first. Do not reverse the order and repair it later.
76
-
77
-
78
- ## Common Mistakes
79
-
80
- | Mistake | Why it is wrong | Do instead |
81
- |---|---|---|
82
- | Generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI scope | Forces the spec to invent screen behavior without a design source | Create or refresh the layout first, then derive the flow-action spec |
83
- | Treat API YAML, API detail, and flow-action outputs as independent documents | Causes naming and traceability drift across artifacts | Keep ARCH outputs linked through shared requirements and path policy |
84
- | Close open questions silently during ARCH | Hides unresolved design decisions from downstream roles | Record `OQ-xx` explicitly and escalate through `@pm` |
85
- | Hand off a workflow/tooling hardening batch without a validator matrix or exact DEV surface list | Leaves `/dev` and SDTK-CODE with an under-specified contract boundary | Lock the validator matrix, exact DEV surfaces, exact out-of-scope list, and stop-before-`/dev` wording before handoff |
1
+ ---
2
+ name: sdtk-arch
3
+ description: Solution Architect workflow for SDTK-SPEC. Use when you need to convert BA_SPEC + PM backlog into technical architecture, API contracts (OpenAPI), and UI layout docs; update SHARED_PLANNING.md / QUALITY_CHECKLIST.md and handoff to DEV.
4
+ ---
5
+
6
+ # SDTK-SPEC ARCH (Solution Architecture)
7
+
8
+ ## Critical Constraints
9
+ - I do not generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI-scope features.
10
+ - I do not let API, DB, and UI artifacts drift from the same BA and PM source of truth.
11
+
12
+ ## Outputs
13
+ - `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md`
14
+ - If applicable:
15
+ - `docs/api/[FeaturePascal]_API.yaml`
16
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
17
+ - `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
18
+ - `docs/api/[feature_snake]_api_flow_list.txt`
19
+ - `docs/database/DATABASE_SPEC_[FEATURE_KEY].md`
20
+ - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
21
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
22
+
23
+ ## Flow Overview
24
+
25
+ ```dot
26
+ digraph sdtk_arch_flow {
27
+ rankdir=TB;
28
+ BA_SPEC -> ARCH_DESIGN;
29
+ ARCH_DESIGN -> DESIGN_LAYOUT;
30
+ DESIGN_LAYOUT -> FLOW_ACTION_SPEC;
31
+ ARCH_DESIGN -> API_YAML;
32
+ API_YAML -> API_DETAIL;
33
+ }
34
+ ```
35
+
36
+ ## Process
37
+ 1. Read BA spec and PRD/backlog.
38
+ 2. Read `sdtk-spec.config.json` for project stack assumptions (backend/frontend/db/auth).
39
+ 3. If architecture output includes API contracts/flows, read and apply:
40
+ - `toolkit/templates/docs/api/YAML_CREATION_RULES.md`
41
+ - `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md`
42
+ - `governance/ai/core/SDTK_API_PATH_STYLE_POLICY.md` for canonical resource naming and multi-word path style
43
+ 4. If architecture output includes screen flow-action specs, read and apply `toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md`.
44
+ 5. If API detail spec is required, use `sdtk-api-design-spec` to build/update `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md` using YAML + flow list.
45
+ 6. For UI-scope features, enforce this generation sequence:
46
+ a. Generate/update `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` first (using `sdtk-design-layout`).
47
+ b. Attempt to render screen preview images from the layout using `render_design_layout_images.py`. Output: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`. If rendering fails (no Java/plantuml.jar), fall back to the render-skipped note -- do not silently skip.
48
+ c. Then generate/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` (using `sdtk-screen-design-spec`).
49
+ d. The flow-action spec must reference the design-layout doc as its design source when no Figma/screenshot is available (Design Source Type: `generated-draft`). Use rendered `.svg` files as the screen image. If render failed, use the render-skipped note instead of a broken image reference.
50
+ 7. For complex UI flow-action specs, use `sdtk-screen-design-spec` to build/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`.
51
+ 8. Define:
52
+ - System components + data model
53
+ - API endpoints and flows
54
+ - Screen layouts
55
+ - Security/authz decisions
56
+ 9. Create/update:
57
+ - OpenAPI YAML + API endpoint markdown
58
+ - API flow list
59
+ - API design detail spec (when `orchestration.apiDesignDetailMode` is `auto/on`)
60
+ - Database spec (if DB impact exists)
61
+ - Design layout (if UI impact exists) - must be created before flow-action spec
62
+ - Flow-action spec (if UI impact exists) - must reference design layout as fallback source
63
+ 10. Ensure mapping UC/BR -> DB/API/screens and run output hygiene checks:
64
+ - EN artifacts use English narrative text (except clearly marked original-language appendix blocks)
65
+ - No mojibake/encoding corruption in markdown/yaml/txt outputs
66
+ 11. For workflow/tooling hardening batches that stop before `/dev`, lock the validator matrix, exact approved DEV surfaces, exact out-of-scope list, and explicit stop-before-`/dev` wording inside `ARCH_DESIGN_[FEATURE_KEY].md` before handoff.
67
+ 12. For benchmark runs, apply `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`: keep benchmark-expected open questions explicitly OPEN unless the requirement source resolves them.
68
+ 13. If anything is unclear, record OQ-xx in ARCH_DESIGN "Open Questions" and escalate to `@pm` for a decision.
69
+ 14. Update shared state + Phase 3 checklist.
70
+ 15. Handoff: `@dev please prepare FEATURE_IMPL_PLAN + CODE_HANDOFF for SDTK-CODE ...`.
71
+
72
+ ## Order-Critical Hard Gate
73
+ For UI-scope features, do not generate or update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` until `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` already exists and is current enough to serve as the design source for the same scope.
74
+
75
+ If the layout is missing, stale, or cannot support the flow-action spec, stop and fix the layout first. Do not reverse the order and repair it later.
76
+
77
+
78
+ ## Common Mistakes
79
+
80
+ | Mistake | Why it is wrong | Do instead |
81
+ |---|---|---|
82
+ | Generate `FLOW_ACTION_SPEC` before `DESIGN_LAYOUT` for UI scope | Forces the spec to invent screen behavior without a design source | Create or refresh the layout first, then derive the flow-action spec |
83
+ | Treat API YAML, API detail, and flow-action outputs as independent documents | Causes naming and traceability drift across artifacts | Keep ARCH outputs linked through shared requirements and path policy |
84
+ | Close open questions silently during ARCH | Hides unresolved design decisions from downstream roles | Record `OQ-xx` explicitly and escalate through `@pm` |
85
+ | Hand off a workflow/tooling hardening batch without a validator matrix or exact DEV surface list | Leaves `/dev` and SDTK-CODE with an under-specified contract boundary | Lock the validator matrix, exact DEV surfaces, exact out-of-scope list, and stop-before-`/dev` wording before handoff |
@@ -10,11 +10,23 @@ description: Generate UI screen layout documentation for a feature, including Pl
10
10
  - I do not hide render limitations; I record when screen preview rendering is unavailable.
11
11
  - I do not leave rendered wireframes without visible local item markers that map back to the `Items` table.
12
12
  - I do not pretend wireframe markers are the same thing as `FLOW_ACTION_SPEC` global action-table numbers.
13
+ - I do not invent screens or fields not present in BA_SPEC or the feature scope.
13
14
 
14
15
  ## Output
15
16
  - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
16
17
 
17
- ## Process
18
+ ## Required Inputs
19
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` (screens, fields, business rules)
20
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (API list for each screen, when available)
21
+ - Feature key and feature name
22
+
23
+ ## When To Stop Or Escalate
24
+ - Stop if BA_SPEC does not exist or does not contain screen/field definitions for the current feature; surface as a blocker before drafting any wireframe.
25
+ - Stop if a required screen's field list or behavior is ambiguous in the source; record as OQ-xx and escalate to `@ba` or `@pm`.
26
+ - Stop if PlantUML rendering is unavailable and the feature team requires rendered images before proceeding; record rendering as skipped and note the dependency.
27
+ - Escalate to `@arch` if screen scope or API assignment is architecturally uncertain.
28
+
29
+ ## Core Process
18
30
  1. Read BA spec (screens + fields) and API list.
19
31
  2. For each screen, include:
20
32
  - PlantUML `@startsalt` wireframe first, with visible screen-local markers embedded directly in the SALT labels
@@ -36,6 +48,28 @@ description: Generate UI screen layout documentation for a feature, including Pl
36
48
  - The renderer warns if a screen wireframe has no visible local markers or still uses legacy `(N)` markers.
37
49
  - If PlantUML is unavailable, rendering is skipped with a warning and the render-skipped note is used in `FLOW_ACTION_SPEC`. The layout doc remains valid.
38
50
 
51
+ ## Validation / Quality Gates
52
+ - Every screen in BA scope has a corresponding wireframe section in the layout doc.
53
+ - Every `@startsalt` block contains visible screen-local markers; no unlabeled items.
54
+ - Item table `No` values match the wireframe local marker sequence for each screen exactly.
55
+ - Screen IDs follow the A-*, B-*, C-* convention without gaps or duplicates.
56
+ - API list table is present for every screen that makes API calls.
57
+ - Render-skipped note is explicit when PlantUML is unavailable; no silent omission.
58
+ - No `(N)` parenthetical markers in generated wireframes.
59
+
60
+ ## Order-Critical Hard Gate
61
+ Do not write wireframes before reading BA_SPEC screen definitions. Wireframes generated from memory introduce field drift that must be corrected before the flow-action spec can be authored.
62
+
63
+ ## Common Mistakes
64
+
65
+ | Mistake | Why it is wrong | Do instead |
66
+ |---|---|---|
67
+ | Use `(N)` parenthetical markers in wireframes | Conflicts with SALT parsing; indistinguishable from UI text | Use Unicode circled-number markers instead |
68
+ | Let Item table `No` drift from wireframe markers | Breaks the cross-reference between table and visual | Align item table `No` to the local marker sequence exactly |
69
+ | Claim wireframe markers equal FLOW_ACTION_SPEC global numbers | They are different numbering systems | Always note that markers are screen-local; screen-design-spec publishes the global mapping |
70
+ | Skip render attempt without noting the skip | Leaves downstream consumers uncertain about image availability | Always record render-skipped note when PlantUML is unavailable |
71
+ | Invent screens or fields not in BA_SPEC | Creates untracked scope | Only add screens and fields explicitly listed in the BA source |
72
+
39
73
  ## Screen Image Renderer
40
74
  - Script: `toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py`
41
75
  - Usage:
@@ -48,5 +82,10 @@ description: Generate UI screen layout documentation for a feature, including Pl
48
82
  - Output: `.svg` files under `docs/specs/assets/<feature_snake>/screens/`
49
83
  - Failure policy: non-blocking. Warns and continues if rendering is unavailable.
50
84
 
51
- ## Template
52
- - Use `toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md` as starting structure.
85
+ ## Reference Loading Guidance
86
+ Read at skill start:
87
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` (required)
88
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (required when API scope exists)
89
+
90
+ Read on demand:
91
+ - `toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md` (starting structure reference)
@@ -10,15 +10,71 @@ description: Generate/modify Python Django REST Framework backend code following
10
10
  - I do not generate backend code without approved API and data-contract sources.
11
11
  - I do not ignore established repository patterns when adding backend modules.
12
12
  - I do not replace the default `sdtk-dev -> CODE_HANDOFF -> SDTK-CODE` path unless the user explicitly asks for a bounded specialist intervention inside current DEV scope.
13
+ - I do not invent models, fields, or business rules that are not present in the approved upstream artifacts.
13
14
 
14
- ## Process
15
+ ## Outputs
16
+ - Backend module files under `src/backend/<module>/`:
17
+ - `models.py`, `views.py` or `viewsets.py`, `services.py`, `serializers.py`, `validation.py`, `enums.py`, `urls.py`
18
+ - Unit/integration test files for critical business rules and state transitions
19
+
20
+ ## Required Inputs
21
+ - Approved `docs/api/[FeaturePascal]_API.yaml` (endpoint contracts)
22
+ - Approved `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (detail + schema)
23
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md` (business rules, data model)
24
+ - Confirmation that this slice is within approved DEV scope
25
+
26
+ ## When To Stop Or Escalate
27
+ - Stop if approved API YAML or ENDPOINTS.md does not exist for the current slice; do not generate code against unreviewed contracts.
28
+ - Stop if the data model in BA/ARCH contradicts the YAML schema; surface the discrepancy as a blocker before writing any model.
29
+ - Escalate to `sdtk-dev` if the implementation slice scope is unclear or if new design decisions are required.
30
+ - Escalate to `@arch` if an existing repository pattern cannot satisfy the new module requirements without architectural change.
31
+ - Stop if a business rule requires a state transition or permission model not defined in the upstream sources; record as OQ-xx.
32
+
33
+ ## Core Process
15
34
  1. Confirm this backend slice is a bounded specialist intervention under current DEV scope, not a replacement for `sdtk-dev` ownership or the default downstream `SDTK-CODE` path.
16
- 2. Check whether this repository already has a backend reference module and follow its patterns.
17
- 3. Follow module structure: `src/backend/<module>/{models,view,service,serializers,validation,enum,urls.py}`.
18
- 4. Apply conventions:
35
+ 2. Read approved API YAML and ENDPOINTS.md for the current slice.
36
+ 3. Read BA_SPEC or ARCH_DESIGN for business rules, data model, and permission model.
37
+ 4. Check whether this repository already has a backend reference module and follow its patterns exactly.
38
+ 5. Follow module structure: `src/backend/<module>/{models,view,service,serializers,validation,enum,urls.py}`.
39
+ 6. Apply conventions:
19
40
  - Soft delete via `del_flg`
20
41
  - Audit fields (creator/updater/del timestamps)
21
42
  - Permission checks before operations
22
43
  - `transaction.atomic()` for writes
23
44
  - Logging decorator on public endpoints
24
- 5. Add tests for critical business rules and state transitions.
45
+ 7. Add tests for critical business rules and state transitions.
46
+ 8. Verify the generated code satisfies the endpoint contracts defined in YAML before declaring the slice done.
47
+
48
+ ## Validation / Quality Gates
49
+ - Every new endpoint has a matching serializer, view/viewset, and URL route.
50
+ - Permission checks are present for every write operation.
51
+ - `transaction.atomic()` wraps every multi-step write.
52
+ - Soft delete fields (`del_flg`) are consistent with existing model conventions.
53
+ - Tests cover critical business rules and state transitions for the current slice.
54
+ - No model field or business rule has been invented without a corresponding source in BA/ARCH or API YAML.
55
+
56
+ ## Order-Critical Hard Gate
57
+ Do not write model definitions before reading the approved data model from BA_SPEC or ARCH_DESIGN. Models authored from memory or inferred from vague requirements produce contract drift that is expensive to fix downstream.
58
+
59
+ Do not declare a slice done without verifying the generated endpoints satisfy the contracts in the approved YAML.
60
+
61
+ ## Common Mistakes
62
+
63
+ | Mistake | Why it is wrong | Do instead |
64
+ |---|---|---|
65
+ | Generate code without reading approved YAML | Produces endpoints that contradict the approved contract | Always read YAML and ENDPOINTS.md first |
66
+ | Invent model fields not in BA/ARCH | Creates undocumented contract drift | Only implement fields explicitly defined in the upstream sources |
67
+ | Skip permission checks on write endpoints | Security gap that will fail review | Always add permission guard before business logic |
68
+ | Omit `transaction.atomic()` on multi-step writes | Risk of partial writes and data corruption | Wrap every write sequence in an atomic block |
69
+ | Use a different module pattern than the existing repo reference | Inconsistency that maintainers must correct | Read the reference module and match its structure exactly |
70
+ | Treat this skill as a replacement for `sdtk-dev` | Collapses bounded specialist scope into general DEV ownership | Keep scope explicitly bounded to the current slice |
71
+
72
+ ## Reference Loading Guidance
73
+ Read at slice start:
74
+ - `docs/api/[FeaturePascal]_API.yaml` (required)
75
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (required)
76
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md` (required)
77
+
78
+ Read on demand:
79
+ - Existing backend reference module in `src/backend/` (match its patterns)
80
+ - `sdtk-spec.config.json` for stack-specific test/lint commands
@@ -10,13 +10,71 @@ description: Generate/modify React frontend code following the toolkit conventio
10
10
  - I do not implement screens without current layout and flow-action sources.
11
11
  - I do not bypass existing frontend patterns for loading, permissions, or labels.
12
12
  - I do not replace the default `sdtk-dev -> CODE_HANDOFF -> SDTK-CODE` path unless the user explicitly asks for a bounded specialist intervention inside current DEV scope.
13
+ - I do not invent screen layout, field labels, or API calls that are not present in the approved upstream artifacts.
13
14
 
14
- ## Process
15
+ ## Outputs
16
+ - Frontend feature files under:
17
+ - `src/frontend/features/{feature}/` (pages, components)
18
+ - `src/frontend/services/{feature}/{feature}Service.js`
19
+ - `src/frontend/services/apiHook/{feature}.js`
20
+
21
+ ## Required Inputs
22
+ - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` (screen layout and item tables)
23
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` (UI actions and API mapping)
24
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (API contracts for hook/service binding)
25
+ - Confirmation that this slice is within approved DEV scope
26
+
27
+ ## When To Stop Or Escalate
28
+ - Stop if `DESIGN_LAYOUT_[FEATURE_KEY].md` does not exist or has no screen sections for the current slice; do not implement screens against memory or assumptions.
29
+ - Stop if the flow-action spec is missing or incomplete for the screens being implemented; surface as a blocker.
30
+ - Stop if an API endpoint required by the screen is not present in ENDPOINTS.md; do not invent API calls.
31
+ - Escalate to `sdtk-dev` if the implementation slice scope is unclear or if design decisions are required that go beyond the approved layout.
32
+ - Escalate to `@arch` or `sdtk-design-layout` if the existing layout file does not cover a screen required by the current slice.
33
+
34
+ ## Core Process
15
35
  1. Confirm this frontend slice is a bounded specialist intervention under current DEV scope, not a replacement for `sdtk-dev` ownership or the default downstream `SDTK-CODE` path.
16
- 2. Check whether this repository already has a frontend reference module and follow its patterns.
17
- 3. Follow structure:
36
+ 2. Read `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` for screen structure and item tables.
37
+ 3. Read `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` for UI actions, API mapping, and flow context.
38
+ 4. Read `docs/api/[FEATURE_KEY]_ENDPOINTS.md` for API contracts.
39
+ 5. Check whether this repository already has a frontend reference module and follow its patterns exactly.
40
+ 6. Follow structure:
18
41
  - `src/frontend/features/{feature}/...`
19
42
  - `src/frontend/services/{feature}/{feature}Service.js`
20
43
  - `src/frontend/services/apiHook/{feature}.js`
21
- 4. Implement screens based on `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`.
22
- 5. Preserve patterns: React Query hooks, loading states, permission checks, consistent labels.
44
+ 7. Implement screens based on `DESIGN_LAYOUT_[FEATURE_KEY].md`; do not add or remove fields without a corresponding layout update.
45
+ 8. Preserve patterns: React Query hooks, loading states, permission checks, consistent labels.
46
+ 9. Verify the implemented screens satisfy the flow-action mappings before declaring the slice done.
47
+
48
+ ## Validation / Quality Gates
49
+ - Every screen section in the layout spec has a matching page/component implemented.
50
+ - React Query hooks exist for every API call made by the feature.
51
+ - Loading and error states are handled consistently with existing patterns.
52
+ - Permission checks guard all protected actions.
53
+ - Field labels match the layout and flow-action spec exactly; no free-form label invention.
54
+ - No API call exists in the implementation that is not present in ENDPOINTS.md.
55
+
56
+ ## Order-Critical Hard Gate
57
+ Do not implement a screen before reading the corresponding section in `DESIGN_LAYOUT_[FEATURE_KEY].md`. Screens built without a layout reference produce inconsistent UX that must be corrected before QA.
58
+
59
+ Do not declare a slice done without verifying all implemented screens satisfy the API mappings in the flow-action spec.
60
+
61
+ ## Common Mistakes
62
+
63
+ | Mistake | Why it is wrong | Do instead |
64
+ |---|---|---|
65
+ | Implement screens without reading DESIGN_LAYOUT | Introduces layout drift from spec | Always read the layout doc before implementing any screen |
66
+ | Invent API calls not in ENDPOINTS.md | Creates untracked contract dependencies | Only call APIs explicitly defined in the ENDPOINTS file |
67
+ | Skip permission checks on protected actions | Security gap that will fail review | Always guard protected actions with the existing permission pattern |
68
+ | Use a different structure than the existing frontend reference | Inconsistency maintainers must correct | Read the reference module and match its structure exactly |
69
+ | Treat this skill as a replacement for `sdtk-dev` | Collapses bounded specialist scope into general DEV ownership | Keep scope explicitly bounded to the current slice |
70
+ | Add field labels from memory | Labels drift from the spec | Copy field label text exactly from the layout or flow-action doc |
71
+
72
+ ## Reference Loading Guidance
73
+ Read at slice start:
74
+ - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` (required)
75
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` (required)
76
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (required)
77
+
78
+ Read on demand:
79
+ - Existing frontend reference module in `src/frontend/` (match its patterns)
80
+ - `sdtk-spec.config.json` for stack-specific commands
@@ -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)