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
@@ -18,11 +18,23 @@ $ARGUMENTS
18
18
  - I do not hide render limitations; I record when screen preview rendering is unavailable.
19
19
  - I do not leave rendered wireframes without visible local item markers that map back to the `Items` table.
20
20
  - I do not pretend wireframe markers are the same thing as `FLOW_ACTION_SPEC` global action-table numbers.
21
+ - I do not invent screens or fields not present in BA_SPEC or the feature scope.
21
22
 
22
23
  ## Output
23
24
  - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
24
25
 
25
- ## Process
26
+ ## Required Inputs
27
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` (screens, fields, business rules)
28
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (API list for each screen, when available)
29
+ - Feature key and feature name
30
+
31
+ ## When To Stop Or Escalate
32
+ - 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.
33
+ - 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`.
34
+ - Stop if PlantUML rendering is unavailable and the feature team requires rendered images before proceeding; record rendering as skipped and note the dependency.
35
+ - Escalate to `@arch` if screen scope or API assignment is architecturally uncertain.
36
+
37
+ ## Core Process
26
38
  1. Read BA spec (screens + fields) and API list.
27
39
  2. For each screen, include:
28
40
  - PlantUML `@startsalt` wireframe first, with visible screen-local markers embedded directly in the SALT labels
@@ -42,7 +54,29 @@ $ARGUMENTS
42
54
  - Run `.claude/skills/design-layout/scripts/render_design_layout_images.py` to extract `@startsalt` blocks and render `.svg` files.
43
55
  - Output path: `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
44
56
  - The renderer warns if a screen wireframe has no visible local markers or still uses legacy `(N)` markers.
45
- - If PlantUML is unavailable, rendering is skipped with a warning and the render-skipped note is used in `FLOW_ACTION_SPEC`.
57
+ - 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.
58
+
59
+ ## Validation / Quality Gates
60
+ - Every screen in BA scope has a corresponding wireframe section in the layout doc.
61
+ - Every `@startsalt` block contains visible screen-local markers; no unlabeled items.
62
+ - Item table `No` values match the wireframe local marker sequence for each screen exactly.
63
+ - Screen IDs follow the A-*, B-*, C-* convention without gaps or duplicates.
64
+ - API list table is present for every screen that makes API calls.
65
+ - Render-skipped note is explicit when PlantUML is unavailable; no silent omission.
66
+ - No `(N)` parenthetical markers in generated wireframes.
67
+
68
+ ## Order-Critical Hard Gate
69
+ 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.
70
+
71
+ ## Common Mistakes
72
+
73
+ | Mistake | Why it is wrong | Do instead |
74
+ |---|---|---|
75
+ | Use `(N)` parenthetical markers in wireframes | Conflicts with SALT parsing; indistinguishable from UI text | Use Unicode circled-number markers instead |
76
+ | 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 |
77
+ | 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 |
78
+ | Skip render attempt without noting the skip | Leaves downstream consumers uncertain about image availability | Always record render-skipped note when PlantUML is unavailable |
79
+ | Invent screens or fields not in BA_SPEC | Creates untracked scope | Only add screens and fields explicitly listed in the BA source |
46
80
 
47
81
  ## Screen Image Renderer
48
82
  - Script: `.claude/skills/design-layout/scripts/render_design_layout_images.py`
@@ -8,13 +8,66 @@ $ARGUMENTS
8
8
 
9
9
  # SDTK-SPEC Backend (Toolkit conventions)
10
10
 
11
- ## Process
12
- 1. Check whether this repository already has a backend reference module and follow its patterns.
13
- 2. Follow module structure: `src/backend/<module>/{models,view,service,serializers,validation,enum,urls.py}`.
14
- 3. Apply conventions:
11
+ ## Critical Constraints
12
+ - I am a bounded DEV specialist aid inside `SDTK-SPEC`, not a separate suite-owner identity.
13
+ - I do not generate backend code without approved API and data-contract sources.
14
+ - I do not ignore established repository patterns when adding backend modules.
15
+ - 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.
16
+ - I do not invent models, fields, or business rules that are not present in the approved upstream artifacts.
17
+
18
+ ## Outputs
19
+ - Backend module files under `src/backend/<module>/`:
20
+ - `models.py`, `views.py` or `viewsets.py`, `services.py`, `serializers.py`, `validation.py`, `enums.py`, `urls.py`
21
+ - Unit/integration test files for critical business rules and state transitions
22
+
23
+ ## Required Inputs
24
+ - Approved `docs/api/[FeaturePascal]_API.yaml` (endpoint contracts)
25
+ - Approved `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (detail + schema)
26
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` or `docs/architecture/ARCH_DESIGN_[FEATURE_KEY].md` (business rules, data model)
27
+ - Confirmation that this slice is within approved DEV scope
28
+
29
+ ## When To Stop Or Escalate
30
+ - Stop if approved API YAML or ENDPOINTS.md does not exist for the current slice; do not generate code against unreviewed contracts.
31
+ - Stop if the data model in BA/ARCH contradicts the YAML schema; surface the discrepancy as a blocker before writing any model.
32
+ - Escalate to `sdtk-dev` if the implementation slice scope is unclear or if new design decisions are required.
33
+ - Escalate to `@arch` if an existing repository pattern cannot satisfy the new module requirements without architectural change.
34
+ - Stop if a business rule requires a state transition or permission model not defined in the upstream sources; record as OQ-xx.
35
+
36
+ ## Core Process
37
+ 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.
38
+ 2. Read approved API YAML and ENDPOINTS.md for the current slice.
39
+ 3. Read BA_SPEC or ARCH_DESIGN for business rules, data model, and permission model.
40
+ 4. Check whether this repository already has a backend reference module and follow its patterns exactly.
41
+ 5. Follow module structure: `src/backend/<module>/{models,view,service,serializers,validation,enum,urls.py}`.
42
+ 6. Apply conventions:
15
43
  - Soft delete via `del_flg`
16
44
  - Audit fields (creator/updater/del timestamps)
17
45
  - Permission checks before operations
18
46
  - `transaction.atomic()` for writes
19
47
  - Logging decorator on public endpoints
20
- 4. Add tests for critical business rules and state transitions.
48
+ 7. Add tests for critical business rules and state transitions.
49
+ 8. Verify the generated code satisfies the endpoint contracts defined in YAML before declaring the slice done.
50
+
51
+ ## Validation / Quality Gates
52
+ - Every new endpoint has a matching serializer, view/viewset, and URL route.
53
+ - Permission checks are present for every write operation.
54
+ - `transaction.atomic()` wraps every multi-step write.
55
+ - Soft delete fields (`del_flg`) are consistent with existing model conventions.
56
+ - Tests cover critical business rules and state transitions for the current slice.
57
+ - No model field or business rule has been invented without a corresponding source in BA/ARCH or API YAML.
58
+
59
+ ## Order-Critical Hard Gate
60
+ 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.
61
+
62
+ Do not declare a slice done without verifying the generated endpoints satisfy the contracts in the approved YAML.
63
+
64
+ ## Common Mistakes
65
+
66
+ | Mistake | Why it is wrong | Do instead |
67
+ |---|---|---|
68
+ | Generate code without reading approved YAML | Produces endpoints that contradict the approved contract | Always read YAML and ENDPOINTS.md first |
69
+ | Invent model fields not in BA/ARCH | Creates undocumented contract drift | Only implement fields explicitly defined in the upstream sources |
70
+ | Skip permission checks on write endpoints | Security gap that will fail review | Always add permission guard before business logic |
71
+ | Omit `transaction.atomic()` on multi-step writes | Risk of partial writes and data corruption | Wrap every write sequence in an atomic block |
72
+ | Use a different module pattern than the existing repo reference | Inconsistency that maintainers must correct | Read the reference module and match its structure exactly |
73
+ | 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 |
@@ -8,11 +8,66 @@ $ARGUMENTS
8
8
 
9
9
  # SDTK-SPEC Frontend (Toolkit conventions)
10
10
 
11
- ## Process
12
- 1. Check whether this repository already has a frontend reference module and follow its patterns.
13
- 2. Follow structure:
11
+ ## Critical Constraints
12
+ - I am a bounded DEV specialist aid inside `SDTK-SPEC`, not a separate suite-owner identity.
13
+ - I do not implement screens without current layout and flow-action sources.
14
+ - I do not bypass existing frontend patterns for loading, permissions, or labels.
15
+ - 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.
16
+ - I do not invent screen layout, field labels, or API calls that are not present in the approved upstream artifacts.
17
+
18
+ ## Outputs
19
+ - Frontend feature files under:
20
+ - `src/frontend/features/{feature}/` (pages, components)
21
+ - `src/frontend/services/{feature}/{feature}Service.js`
22
+ - `src/frontend/services/apiHook/{feature}.js`
23
+
24
+ ## Required Inputs
25
+ - `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` (screen layout and item tables)
26
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` (UI actions and API mapping)
27
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (API contracts for hook/service binding)
28
+ - Confirmation that this slice is within approved DEV scope
29
+
30
+ ## When To Stop Or Escalate
31
+ - 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.
32
+ - Stop if the flow-action spec is missing or incomplete for the screens being implemented; surface as a blocker.
33
+ - Stop if an API endpoint required by the screen is not present in ENDPOINTS.md; do not invent API calls.
34
+ - Escalate to `sdtk-dev` if the implementation slice scope is unclear or if design decisions are required that go beyond the approved layout.
35
+ - Escalate to `@arch` or `sdtk-design-layout` if the existing layout file does not cover a screen required by the current slice.
36
+
37
+ ## Core Process
38
+ 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.
39
+ 2. Read `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` for screen structure and item tables.
40
+ 3. Read `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` for UI actions, API mapping, and flow context.
41
+ 4. Read `docs/api/[FEATURE_KEY]_ENDPOINTS.md` for API contracts.
42
+ 5. Check whether this repository already has a frontend reference module and follow its patterns exactly.
43
+ 6. Follow structure:
14
44
  - `src/frontend/features/{feature}/...`
15
45
  - `src/frontend/services/{feature}/{feature}Service.js`
16
46
  - `src/frontend/services/apiHook/{feature}.js`
17
- 3. Implement screens based on `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`.
18
- 4. Preserve patterns: React Query hooks, loading states, permission checks, consistent labels.
47
+ 7. Implement screens based on `DESIGN_LAYOUT_[FEATURE_KEY].md`; do not add or remove fields without a corresponding layout update.
48
+ 8. Preserve patterns: React Query hooks, loading states, permission checks, consistent labels.
49
+ 9. Verify the implemented screens satisfy the flow-action mappings before declaring the slice done.
50
+
51
+ ## Validation / Quality Gates
52
+ - Every screen section in the layout spec has a matching page/component implemented.
53
+ - React Query hooks exist for every API call made by the feature.
54
+ - Loading and error states are handled consistently with existing patterns.
55
+ - Permission checks guard all protected actions.
56
+ - Field labels match the layout and flow-action spec exactly; no free-form label invention.
57
+ - No API call exists in the implementation that is not present in ENDPOINTS.md.
58
+
59
+ ## Order-Critical Hard Gate
60
+ 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.
61
+
62
+ Do not declare a slice done without verifying all implemented screens satisfy the API mappings in the flow-action spec.
63
+
64
+ ## Common Mistakes
65
+
66
+ | Mistake | Why it is wrong | Do instead |
67
+ |---|---|---|
68
+ | Implement screens without reading DESIGN_LAYOUT | Introduces layout drift from spec | Always read the layout doc before implementing any screen |
69
+ | Invent API calls not in ENDPOINTS.md | Creates untracked contract dependencies | Only call APIs explicitly defined in the ENDPOINTS file |
70
+ | Skip permission checks on protected actions | Security gap that will fail review | Always guard protected actions with the existing permission pattern |
71
+ | Use a different structure than the existing frontend reference | Inconsistency maintainers must correct | Read the reference module and match its structure exactly |
72
+ | 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 |
73
+ | Add field labels from memory | Labels drift from the spec | Copy field label text exactly from the layout or flow-action doc |
@@ -1,71 +1,73 @@
1
- ---
2
- name: 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: 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`
@@ -21,6 +21,7 @@ $ARGUMENTS
21
21
  - I do not mix legacy and new-style PlantUML activity syntax in the screen flow diagram.
22
22
  - Do not mix legacy activity syntax such as `(*)`, `-->`, or `[edge label]` with new-style activity actions like `:Activity;`.
23
23
  - I keep action-table numbering global across the document even when wireframe markers reset per screen.
24
+ - I do not proceed on generated-draft screens if `DESIGN_LAYOUT_[FEATURE_KEY].md` does not exist.
24
25
 
25
26
  ## Outputs
26
27
  - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
@@ -37,9 +38,17 @@ $ARGUMENTS
37
38
  - `generated-draft`: generated layout from `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`
38
39
  - API endpoint source (`docs/api/[FEATURE_KEY]_ENDPOINTS.md`) when available
39
40
 
40
- ## Process
41
+ ## When To Stop Or Escalate
42
+ - Stop if no design source is available for a UI-scope screen (neither Figma/screenshot nor a completed DESIGN_LAYOUT); do not draft a flow-action spec against missing design sources.
43
+ - Stop if `DESIGN_LAYOUT_[FEATURE_KEY].md` is referenced as a generated-draft source but does not exist; escalate to `/design-layout` before continuing.
44
+ - Stop if the API mapping table cannot be completed because ENDPOINTS.md is missing; record as OQ-xx and continue with explicit gaps noted.
45
+ - Stop if legacy PlantUML activity syntax is found in existing source sections; run renumber/migration scripts before adding new content.
46
+ - Escalate to `@ba` if UC/BR coverage cannot be confirmed for a screen's flow.
47
+ - Escalate to `@arch` if API assignment for a screen is architecturally ambiguous.
48
+
49
+ ## Core Process
41
50
  1. Read requirement sources and identify in-scope screens, dialogs, and transitions.
42
- 2. Read and apply rules from `.claude/skills/references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
51
+ 2. Read and apply rules from `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
43
52
  3. Determine design source mode per screen:
44
53
  - If Figma URL or screenshot exists: use `source-backed`.
45
54
  - If no Figma/screenshot but feature has UI scope: use `generated-draft` and reference the corresponding section in `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`.
@@ -54,31 +63,35 @@ $ARGUMENTS
54
63
  6. Build/update `System processing flow` from use-case and process sources.
55
64
  7. Build/update `Open questions` for unresolved behavior/API/data points.
56
65
  8. Build/update `Screen - API Mapping` summary section.
57
- 9. Validate:
58
- - global numbering consistency (no screen-level reset)
59
- - no broken image paths (for `generated-draft` screens, verify `.svg` exists or use render-skipped note)
60
- - PlantUML renderability and new-style activity syntax consistency (no `(*)`, `-->`, or `[edge label]` mixing)
61
- - consistency with API endpoints spec
62
- - EN artifact hygiene (no VI leftovers, no mojibake, no merged heading lines)
63
- - for legacy specs with per-screen reset numbering: run renumber migration first
64
- - every UI-scope screen declares a Design Source Type (`source-backed` or `generated-draft`)
65
- - every generated-draft screen with an embedded wireframe image includes a wireframe-marker mapping table to the global action-table `No`
66
- 10. For `generated-draft` screens, set `Screen image:` to the rendered `.svg` path if the file exists:
67
- - Expected path (filesystem): `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
68
- - Markdown image path (file-relative): `assets/<feature_snake>/screens/<screen_id>.svg`
69
- - If the `.svg` does not exist, replace the image reference with:
70
- `> Screen image not rendered in this environment. See Design Source Reference for layout.`
71
- 11. For generated-draft screens, treat wireframe markers as screen-local visual references:
72
- - the local marker sequence may reset per screen
73
- - do not renumber the wireframe to fake equality with the global action-table `No`
74
- - publish the mapping table directly under the screen image so reviewers can cross-reference local markers to global action-table numbers
75
- 12. Update document history and handoff to ARCH/DEV.
76
-
77
- ## Rule References
78
- - Core rules: `.claude/skills/references/FLOW_ACTION_SPEC_CREATION_RULES.md`
79
- - Numbering reference: `.claude/skills/references/numbering-rules.md`
80
- - Figma reference: `.claude/skills/references/figma-mcp.md`
81
- - Excel image export reference: `.claude/skills/references/excel-image-export.md`
66
+ 9. Update document history and handoff to ARCH/DEV.
67
+
68
+ ## Validation / Quality Gates
69
+ - Global numbering consistency: no screen-level reset in action-table `No` column.
70
+ - No broken image paths; for generated-draft screens, verify `.svg` exists or use render-skipped note.
71
+ - PlantUML renderability and new-style activity syntax consistency: no `(*)`, `-->`, or `[edge label]` mixing.
72
+ - Consistency with API endpoints spec.
73
+ - EN artifact hygiene: no VI leftovers, no mojibake, no merged heading lines.
74
+ - Every UI-scope screen declares a Design Source Type (`source-backed` or `generated-draft`).
75
+ - Every generated-draft screen with an embedded wireframe image includes a wireframe-marker mapping table to the global action-table `No`.
76
+ - Run validation script before finalizing.
77
+
78
+ ## Order-Critical Hard Gate
79
+ Do not finalize any screen section before applying `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`. The rules define mandatory section structure; skipping them produces incomplete specs that will fail ARCH/DEV review.
80
+
81
+ For generated-draft screens: do not set Design Source Type = `generated-draft` if `DESIGN_LAYOUT_[FEATURE_KEY].md` does not exist. Block until the layout doc is produced.
82
+
83
+ Do not reset action-table numbering between screens. Numbering must be global across the entire document.
84
+
85
+ ## Common Mistakes
86
+
87
+ | Mistake | Why it is wrong | Do instead |
88
+ |---|---|---|
89
+ | Reset action-table `No` per screen | Breaks global traceability | Keep `No` sequential across the entire document |
90
+ | Mix legacy PlantUML syntax (`-->`, `(*)`) with new-style | Renders incorrectly; fails syntax check | Use new-style activity syntax only; run migration script on legacy content |
91
+ | Set `generated-draft` when DESIGN_LAYOUT does not exist | References a missing source | Block until `/design-layout` produces the layout doc |
92
+ | Leave image path as a broken link | Breaks the rendered spec for reviewers | Verify `.svg` exists; use render-skipped note if unavailable |
93
+ | Omit API mapping table for API-connected screens | Hides screen-to-API traceability | Add a complete API mapping table for every screen with API calls |
94
+ | Apply FLOW_ACTION_SPEC rules from memory | Rules evolve; memory is stale | Always read `./references/FLOW_ACTION_SPEC_CREATION_RULES.md` first |
82
95
 
83
96
  ## Validation Script
84
97
  - `.claude/skills/screen-design-spec/scripts/validate_flow_action_spec_numbering.py`
@@ -88,3 +101,12 @@ $ARGUMENTS
88
101
  - `python ".claude/skills/screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md"`
89
102
  - Apply:
90
103
  - `python ".claude/skills/screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`
104
+
105
+ ## Reference Loading Guidance
106
+ Read at skill start:
107
+ - `./references/FLOW_ACTION_SPEC_CREATION_RULES.md` (required before any screen section)
108
+
109
+ Read on demand:
110
+ - `./references/numbering-rules.md` (when resolving numbering migration questions)
111
+ - `./references/figma-mcp.md` (when source-backed mode uses Figma)
112
+ - `./references/excel-image-export.md` (when source includes Excel screenshots)
@@ -15,33 +15,73 @@ $ARGUMENTS
15
15
 
16
16
  # SDTK-SPEC Test Case Spec
17
17
 
18
+ ## Critical Constraints
19
+ - I do not invent test coverage beyond BA, flow-action, and API sources.
20
+ - I do not let test totals drift away from worksheet rows or the QA baseline.
21
+ - I do not emit a final TEST_CASE artifact without applying `./references/TEST_CASE_CREATION_RULES.md`.
22
+ - I do not renumber stable case IDs only because of regrouping; stable IDs preserve traceability.
23
+
18
24
  ## Outputs
19
25
  - `docs/qa/[FEATURE_KEY]_TEST_CASE.md`
20
26
  - Optional project variant:
21
27
  - `docs/en/qa/[FEATURE_KEY]_TEST_CASE.md` (only when project uses `docs/en/**`)
22
28
 
23
- ## Core Rules
24
- 1. Apply `.claude/skills/references/TEST_CASE_CREATION_RULES.md` first.
25
- 2. Keep section order fixed (Statistic -> Abbreviations -> Scope -> References -> Environment -> Coverage -> Screen-based UTC/ITC -> OQ -> STC/UAT note).
26
- 3. Use screen-first layout to mirror worksheet structure.
27
- 4. Keep one unified 18-column schema for UTC/ITC rows.
28
- 5. Keep stable case IDs; do not renumber only because of regrouping.
29
- 6. Track unresolved decisions via `OQ-xx` and keep benchmark-expected OQs explicitly OPEN per `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`.
29
+ ## Required Inputs
30
+ - Feature key (`FEATURE_KEY`)
31
+ - Screen/flow references:
32
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
33
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md`
34
+ - API reference:
35
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md`
36
+ - (optional) `docs/api/[FeaturePascal]_API.yaml`
37
+ - Clarification source:
38
+ - `docs/specs/Q&A.md` or `docs/en/specs/Q&A.md` when available
39
+
40
+ ## When To Stop Or Escalate
41
+ - 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.
42
+ - 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.
43
+ - 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.
44
+ - Escalate to `/qa` or `sdtk-qa` if the test-case scope intersects a release decision that requires the QA Release Report.
45
+ - Escalate to `@ba` if a BA requirement is ambiguous for a test case that depends on it.
30
46
 
31
- ## Procedure
32
- 1. Resolve output path:
47
+ ## Core Process
48
+ 1. Apply `./references/TEST_CASE_CREATION_RULES.md` first.
49
+ 2. Resolve output path:
33
50
  - default `docs/qa/[FEATURE_KEY]_TEST_CASE.md`
34
51
  - use `docs/en/qa/...` only if the repo already follows `docs/en/**`.
35
- 2. Build/refresh `Statistic Summary (Excel-aligned)` with UT total, IT total, and grand total.
36
- 3. Build `Feature Coverage Matrix` from flow/action and API docs.
37
- 4. Split UTC/ITC by screen sections (`screen-first`), not by test type only.
38
- 5. Fill conflict/permission/error-path cases from Q&A decisions and API contracts.
39
- 6. Record unresolved items in section `Open Questions`.
40
- 7. Validate:
41
- - counts in summary match table rows
42
- - 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
43
- - no placeholder tokens like `??`
44
- - out-of-scope boundaries are explicit
52
+ 3. Build/refresh `Statistic Summary (Excel-aligned)` with UT total, IT total, and grand total.
53
+ 4. Build `Feature Coverage Matrix` from flow/action and API docs.
54
+ 5. Split UTC/ITC by screen sections (`screen-first`), not by test type only.
55
+ 6. Fill conflict/permission/error-path cases from Q&A decisions and API contracts.
56
+ 7. Record unresolved items in section `Open Questions`.
57
+ 8. Keep section order fixed: Statistic -> Abbreviations -> Scope -> References -> Environment -> Coverage -> Screen-based UTC/ITC -> OQ -> STC/UAT note.
58
+ 9. Keep one unified 18-column schema for UTC/ITC rows.
59
+ 10. Keep stable case IDs; do not renumber only because of regrouping.
60
+ 11. Track unresolved decisions via `OQ-xx` and keep benchmark-expected OQs explicitly OPEN per `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`.
61
+
62
+ ## Validation / Quality Gates
63
+ - Statistic Summary totals match the actual row counts in UTC/ITC tables.
64
+ - Structured TEST_CASE total stays aligned with the QA release-report baseline; E2E tracked separately if applicable.
65
+ - No placeholder tokens such as `??` remain in any field.
66
+ - Out-of-scope boundaries are explicitly stated.
67
+ - Open OQ-xx items are explicitly listed and not silently collapsed.
68
+ - Run `scripts/validate_test_case_spec.py` before finalizing.
69
+
70
+ ## Order-Critical Hard Gate
71
+ Do not build the coverage matrix or test rows before applying `./references/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.
72
+
73
+ Do not finalize the artifact before verifying Statistic Summary totals match table row counts. Drifted totals are a hard failure at QA review.
74
+
75
+ ## Common Mistakes
76
+
77
+ | Mistake | Why it is wrong | Do instead |
78
+ |---|---|---|
79
+ | Skip 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 |
80
+ | Let Statistic Summary totals drift from table row counts | Hard failure at QA review | Verify totals against actual rows before finalizing |
81
+ | Renumber stable case IDs during regrouping | Breaks traceability with existing defect refs | Preserve case IDs; regroup without renumbering |
82
+ | Leave `??` placeholders in any field | Incomplete test cases cannot be executed | Resolve or escalate every ambiguity before finalizing |
83
+ | Invent coverage beyond available sources | Creates untraceable test claims | Only claim coverage for requirements present in BA/flow/API sources |
84
+ | Collapse OPEN OQ-xx items silently | Hides unresolved gaps from QA | Keep OQ-xx explicitly OPEN in the Open Questions section |
45
85
 
46
86
  ## Role Integration
47
87
  - Primary owner: `/qa`.
@@ -57,5 +97,19 @@ $ARGUMENTS
57
97
 
58
98
  ### Typical command
59
99
  ```bash
60
- python scripts/validate_test_case_spec.py --file "docs/qa/[FEATURE_KEY]_TEST_CASE.md"
100
+ python scripts/validate_test_case_spec.py \
101
+ --file "docs/qa/[FEATURE_KEY]_TEST_CASE.md"
61
102
  ```
103
+
104
+ ## Reference Loading Guidance
105
+ Read at skill start:
106
+ - `./references/TEST_CASE_CREATION_RULES.md` (required before any row generation)
107
+
108
+ Read at slice start:
109
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md` (required)
110
+ - `docs/specs/BA_SPEC_[FEATURE_KEY].md` (required)
111
+ - `docs/api/[FEATURE_KEY]_ENDPOINTS.md` (required)
112
+
113
+ Read on demand:
114
+ - `docs/specs/Q&A.md` or `docs/en/specs/Q&A.md` (when clarification is needed)
115
+ - `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md` (when OQ-xx items need policy guidance)
@@ -61,4 +61,8 @@ The script renders templates into `docs/**` and updates:
61
61
  - `templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md`
62
62
  - Numbering mode is fixed: global numbering across full document (no screen-level reset).
63
63
  - QA test-case spec rules:
64
- - `templates/docs/qa/TEST_CASE_CREATION_RULES.md`
64
+ - `templates/docs/qa/TEST_CASE_CREATION_RULES.md`
65
+ - Skill-specific local helper refs retained outside `templates/docs/**`:
66
+ - `toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md`
67
+ - `toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md`
68
+ - `toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md`
@@ -4,8 +4,7 @@ This file is kept only for backward compatibility.
4
4
 
5
5
  Do not use this file as the primary source of truth anymore.
6
6
  The active rule source for API design detail and API flowchart behavior is now:
7
- - `API_DESIGN_FLOWCHART_CREATION_RULES_FINAL.md` (root)
8
- - `templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md` (toolkit)
7
+ - `toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md`
9
8
 
10
9
  Even in compatibility mode, generated API design detail docs must still include:
11
10
  - a top-level `## Assumptions` section