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
@@ -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
@@ -1,71 +1,73 @@
1
- ---
2
- name: sdtk-mailbox-dispatch
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
- ---
5
-
6
- # SDTK Mailbox Dispatch
7
-
8
- Use this skill only for controller-owned delegation. It is the shipped SDTK-SPEC mailbox flow for bounded PM or Orchestrator dispatch, not a generic autonomous worker platform.
9
-
10
- ## Critical Constraints
11
- - I do not use mailbox dispatch for broad exploratory planning when the controller already has enough local context to plan safely.
12
- - I do not mix transient runtime files under `governance/ai/agent-mailbox/runtime/` into feature commit boundaries.
13
- - I do not widen include/exclude boundaries, fallback rules, or verification commands without an explicit controller decision.
14
- - I do not leak internal backlog IDs into runtime-facing docs, templates, samples, or public guidance.
15
-
16
- ## Use When
17
- - one bounded issue phase should be delegated through the mailbox runtime
18
- - runtime choice between Claude and Codex matters
19
- - the task needs exact include/exclude boundaries and a stable review packet
20
- - the phase is implementation, review, QA, or controller acceptance
21
- - you want the closeout loop to absorb new mailbox lessons automatically
22
-
23
- ## Do Not Use
24
- - broad exploratory planning when the controller already has enough local context
25
- - unbounded multi-issue orchestration or a generic worker platform
26
- - tasks that require a direct external-CLI-to-chat-session bridge
27
-
28
- ## Required Inputs
29
- Read these shipped toolkit surfaces before dispatching or reviewing a run:
30
- - `toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md`
31
- - `toolkit/templates/mailbox/AGENT_REPORT_TEMPLATE.md`
32
- - `toolkit/scripts/agents/run-claude-task.ps1`
33
- - `toolkit/scripts/agents/run-codex-task.ps1`
34
- - current issue spec/plan/review artifacts for the bounded phase
35
- - current git truth for the included surfaces
36
-
37
- ## Workflow
38
- 1. Decide whether the controller should plan locally first. Default to local planning when the codebase context is already strong.
39
- 2. Choose runtime:
40
- - Claude for controller spec drafting, wording-heavy review, and SDTK-SPEC shaping
41
- - Codex for code changes, tests, workflow/harness changes, and verification-heavy implementation
42
- 3. Write the task packet with exact boundary truth, boundary mode, carryover findings, formal artifact write expectation, an explicit runtime-stall budget plus fallback trigger, and a clear closeout mode (`full-issue` or `phase-only`).
43
- 4. Dispatch through the mailbox launcher into `governance/ai/agent-mailbox/runtime/...`.
44
- 5. Review the raw report against git truth and the formal artifact on disk. Prefer the formal artifact when console output is lossy.
45
- 6. For `controller-dev-review`, `qa-review`, and `controller-acceptance`, keep the primary formal artifact on the canonical filename family and canonical verdict vocabulary for that phase. The launcher validates `toolkit/scripts/agents/validate-mailbox-formal-artifact.py` automatically when the artifact exists.
46
- 7. Promote only approved code/docs/tests/artifacts into tracked paths.
47
- 8. Run a default post-issue retrospective before the next mailbox-driven issue:
48
- - update the mailbox contract/spec if a real new lesson appeared
49
- - otherwise record `no new mailbox lessons` in the closeout summary
50
-
51
- ## Boundary Rules
52
- - Treat runtime files under `governance/ai/agent-mailbox/runtime/` as transient.
53
- - Do not mix mailbox runtime dirt into feature commit boundaries.
54
- - State explicitly whether a batch is `canonical-only` or includes packaged distribution parity.
55
- - Keep internal backlog IDs out of runtime-facing docs, templates, and public guidance.
56
-
57
- ## Fallback Rules
58
- - If an external runtime stalls, use a bounded fallback path instead of blocking the issue.
59
- - For long implementation passes, one bounded external attempt is enough before controller-local or native fallback if the trigger defined in the task packet is reached.
60
- - If quota or permission prevents the agent from writing the formal artifact, the controller may author it directly, but the artifact must state the fallback reason.
61
- - QA and controller acceptance may inherit fresh controller verification only when the implementation scope is unchanged and the inheritance is declared explicitly.
62
- - If the controller fixes a bounded hygiene defect between phases, later mailbox tasks must review current repo truth and treat the resolved defect as fixed instead of repeating stale findings from earlier raw reports.
63
-
64
- ## Default Phase Order
65
- 1. `controller-spec` or `plan`
66
- 2. `implementation`
67
- 3. `controller-dev-review`
68
- 4. `qa-review`
69
- 5. `controller-acceptance`
70
- 6. `commit/push`
71
- 7. `post-issue-retrospective`
1
+ ---
2
+ name: sdtk-mailbox-dispatch
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
+ ---
5
+
6
+ # SDTK Mailbox Dispatch
7
+
8
+ Use this skill only for controller-owned delegation. It is the shipped SDTK-SPEC mailbox flow for bounded PM or Orchestrator dispatch, not a generic autonomous worker platform.
9
+
10
+ ## Critical Constraints
11
+ - I do not use mailbox dispatch for broad exploratory planning when the controller already has enough local context to plan safely.
12
+ - I do not mix transient runtime files under `governance/ai/agent-mailbox/runtime/` into feature commit boundaries.
13
+ - I do not widen include/exclude boundaries, fallback rules, or verification commands without an explicit controller decision.
14
+ - I do not leak internal backlog IDs into runtime-facing docs, templates, samples, or public guidance.
15
+
16
+ ## Use When
17
+ - one bounded issue phase should be delegated through the mailbox runtime
18
+ - runtime choice between Claude and Codex matters
19
+ - the task needs exact include/exclude boundaries and a stable review packet
20
+ - the phase is implementation, review, QA, or controller acceptance
21
+ - you want the closeout loop to absorb new mailbox lessons automatically
22
+
23
+ ## Do Not Use
24
+ - broad exploratory planning when the controller already has enough local context
25
+ - unbounded multi-issue orchestration or a generic worker platform
26
+ - tasks that require a direct external-CLI-to-chat-session bridge
27
+
28
+ ## Required Inputs
29
+ Read these shipped toolkit surfaces before dispatching or reviewing a run:
30
+ - `toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md`
31
+ - `toolkit/templates/mailbox/AGENT_REPORT_TEMPLATE.md`
32
+ - `toolkit/scripts/agents/run-claude-task.ps1`
33
+ - `toolkit/scripts/agents/run-codex-task.ps1`
34
+ - current issue spec/plan/review artifacts for the bounded phase
35
+ - current git truth for the included surfaces
36
+
37
+ ## Workflow
38
+ 1. Decide whether the controller should plan locally first. Default to local planning when the codebase context is already strong.
39
+ 2. Choose runtime:
40
+ - Claude for controller spec drafting, wording-heavy review, and SDTK-SPEC shaping
41
+ - Codex for code changes, tests, workflow/harness changes, and verification-heavy implementation
42
+ 3. Write the task packet with exact boundary truth, boundary mode, carryover findings, formal artifact write expectation, explicit execution permission, a complete approval record for any writable implementation run, an explicit runtime-stall budget plus fallback trigger, and a clear closeout mode (`full-issue` or `phase-only`).
43
+ 4. For implementation runs, list the exact authoritative input files needed to start the patch; do not rely on repo-wide example hunts as an unstated discovery step.`r`n5. Dispatch through the mailbox launcher into `governance/ai/agent-mailbox/runtime/...`.
44
+ 6. Review the raw report against git truth and the formal artifact on disk. Prefer the formal artifact when console output is lossy. If an implementation run timed out or exited without a usable report, expect a launcher-authored partial-failure blocker report instead of a missing report file.
45
+ 7. For `controller-dev-review`, `qa-review`, and `controller-acceptance`, keep the primary formal artifact on the canonical filename family and canonical verdict vocabulary for that phase. The launcher validates `toolkit/scripts/agents/validate-mailbox-formal-artifact.py` automatically when the artifact exists.
46
+ 8. Promote only approved code/docs/tests/artifacts into tracked paths.
47
+ 9. Run a default post-issue retrospective before the next mailbox-driven issue:
48
+ - update the mailbox contract/spec if a real new lesson appeared
49
+ - otherwise record `no new mailbox lessons` in the closeout summary
50
+
51
+ ## Boundary Rules
52
+ - Treat runtime files under `governance/ai/agent-mailbox/runtime/` as transient.
53
+ - Do not mix mailbox runtime dirt into feature commit boundaries.
54
+ - State explicitly whether a batch is `canonical-only` or includes packaged distribution parity.
55
+ - Keep review, QA, and controller-acceptance phases read-only by default; writable implementation runs require explicit human-approved permission metadata in the task packet.
56
+ - Keep internal backlog IDs out of runtime-facing docs, templates, and public guidance.
57
+ - Treat listed Inputs: as the authoritative starting source set for implementation runs; broad repo-wide discovery is a fallback only when a direct dependency is missing.
58
+
59
+ ## Fallback Rules
60
+ - If an external runtime stalls, use a bounded fallback path instead of blocking the issue. Long-running Codex implementation runs should now terminate within the declared stall budget and emit a launcher-authored partial-failure blocker report when a usable report is missing.
61
+ - For long implementation passes, one bounded external attempt is enough before controller-local or native fallback if the trigger defined in the task packet is reached.
62
+ - If quota or permission prevents the agent from writing the formal artifact, the controller may author it directly, but the artifact must state the fallback reason.
63
+ - QA and controller acceptance may inherit fresh controller verification only when the implementation scope is unchanged and the inheritance is declared explicitly.
64
+ - If the controller fixes a bounded hygiene defect between phases, later mailbox tasks must review current repo truth and treat the resolved defect as fixed instead of repeating stale findings from earlier raw reports.
65
+
66
+ ## Default Phase Order
67
+ 1. `controller-spec` or `plan`
68
+ 2. `implementation`
69
+ 3. `controller-dev-review`
70
+ 4. `qa-review`
71
+ 5. `controller-acceptance`
72
+ 6. `commit/push`
73
+ 7. `post-issue-retrospective`