sdtk-spec-kit 0.3.12 → 0.3.14

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 (30) hide show
  1. package/assets/manifest/toolkit-bundle.manifest.json +82 -37
  2. package/assets/manifest/toolkit-bundle.sha256.txt +27 -18
  3. package/assets/toolkit/toolkit/AGENTS.md +1 -1
  4. package/assets/toolkit/toolkit/README.md +4 -3
  5. package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +9 -3
  6. package/assets/toolkit/toolkit/scripts/agents/run-claude-task.ps1 +111 -0
  7. package/assets/toolkit/toolkit/scripts/agents/run-codex-task.ps1 +103 -0
  8. package/assets/toolkit/toolkit/scripts/agents/validate-mailbox-formal-artifact.py +87 -0
  9. package/assets/toolkit/toolkit/scripts/generate-code-handoff.ps1 +317 -246
  10. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +1 -1
  11. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +1 -1
  12. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +17 -0
  13. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +29 -4
  14. package/assets/toolkit/toolkit/skills/sdtk-mailbox-dispatch/SKILL.md +71 -0
  15. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +8 -0
  16. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +37 -0
  17. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +25 -0
  18. package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +17 -0
  19. package/assets/toolkit/toolkit/skills-claude/dev/SKILL.md +59 -57
  20. package/assets/toolkit/toolkit/skills-claude/mailbox-dispatch/SKILL.md +71 -0
  21. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +7 -0
  22. package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +38 -2
  23. package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +13 -2
  24. package/assets/toolkit/toolkit/templates/docs/dev/OPS_HANDOFF_CREATION_RULES.md +369 -0
  25. package/assets/toolkit/toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md +276 -0
  26. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_SDTK_CODE.md +60 -29
  27. package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +5 -1
  28. package/assets/toolkit/toolkit/templates/mailbox/AGENT_REPORT_TEMPLATE.md +50 -0
  29. package/assets/toolkit/toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md +63 -0
  30. package/package.json +46 -46
@@ -155,7 +155,7 @@ if ($missingRefs.Count -gt 0) {
155
155
  }
156
156
 
157
157
  # Strict count assertions
158
- $expectedSkills = 13
158
+ $expectedSkills = 14
159
159
  $expectedRefs = 9
160
160
  if ($skillCount -ne $expectedSkills) {
161
161
  throw "Claude install failed. Expected $expectedSkills skills but installed $skillCount."
@@ -28,7 +28,7 @@ HTTP_METHODS = {"get", "post", "put", "patch", "delete", "options", "head"}
28
28
 
29
29
  def parse_args() -> argparse.Namespace:
30
30
  parser = argparse.ArgumentParser(description="Generate API design detail markdown from YAML + flow list.")
31
- parser.add_argument("--feature-key", required=True, help="Feature key, e.g. SCHEDULE_WHITEBOARD")
31
+ parser.add_argument("--feature-key", required=True, help="Feature key, e.g. WORK_PLANNING_BOARD")
32
32
  parser.add_argument("--yaml", required=True, help="Path to OpenAPI YAML")
33
33
  parser.add_argument("--flow-list", required=True, help="Path to API flow list txt containing PlantUML blocks")
34
34
  parser.add_argument("--output", required=True, help="Output markdown path, e.g. docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md")
@@ -12,6 +12,23 @@ description: Business Analyst workflow for SDTK-SPEC. Use when you need to turn
12
12
  ## Output
13
13
  - `docs/specs/BA_SPEC_[FEATURE_KEY].md`
14
14
 
15
+ ## Optional: Condensed Upstream Input
16
+
17
+ If a condensed upstream input package was produced before PM initiation, read it
18
+ alongside `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md`. The package is at:
19
+ `docs/product/CONDENSED_UPSTREAM_INPUT_[FEATURE_KEY].md`
20
+
21
+ The condensed package is a DRAFT accelerator only. All derived actors, entities,
22
+ rules, and acceptance criteria require human review before adoption. Do not treat
23
+ draft content as authoritative without explicit PM or maintainer confirmation.
24
+
25
+ For approval/workflow domain packages, the condensed package also includes a
26
+ Role Matrix, State Set, State Transitions, and Policy And Approval Rules
27
+ sections. When producing BR-xx and UC-xx items in BA_SPEC, read these sections
28
+ alongside the Actors and Workflow Entities sections. Any unresolved open
29
+ questions from the Open Questions For Human Review section must be carried
30
+ forward as explicit OQ-xx items in BA_SPEC rather than silently resolved.
31
+
15
32
  ## Process
16
33
  1. Read `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md` and any source requirements.
17
34
  2. Produce:
@@ -12,6 +12,7 @@ description: Developer planning workflow for SDTK-SPEC. Use when you need to con
12
12
  ## Outputs
13
13
  - `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md`
14
14
  - `docs/dev/CODE_HANDOFF_[FEATURE_KEY].json`
15
+ - `docs/dev/OPS_HANDOFF_[FEATURE_KEY].json` after CODE phase completion and human-approved readiness review
15
16
 
16
17
  ## Legacy Prompt Templates
17
18
  - `./prompts/implementer.md`
@@ -28,10 +29,10 @@ Use them only when the user explicitly requests a manual legacy review or delega
28
29
  3. Write or refine `FEATURE_IMPL_PLAN_*`:
29
30
  - issue summary and scope
30
31
  - explicit non-goals
31
- - implementation slices
32
+ - implementation slices in the recommended downstream build order
32
33
  - required refs
33
34
  - optional refs
34
- - issue-specific test obligations using real executable commands
35
+ - issue-specific test obligations using implementation-ready acceptance mapping statements and real executable commands
35
36
  - blockers and open questions
36
37
  4. If anything is unclear: record OQ-xx in `FEATURE_IMPL_PLAN` and escalate to `@pm` for a decision.
37
38
  5. Decide readiness:
@@ -41,10 +42,34 @@ Use them only when the user explicitly requests a manual legacy review or delega
41
42
  - Canonical writer rule: the machine-readable JSON is generator-owned; do not hand-author or patch the JSON shape manually.
42
43
  - If an existing `CODE_HANDOFF_*` file is non-canonical, regenerate it with the script and `-Force` instead of editing keys by hand.
43
44
  - Use the script-owned snake_case contract only. Do not emit legacy camelCase keys such as `featureKey`, `requiredRefs`, `optionalRefs`, `openBlockers`, `implementationSlices`, `testObligations`, or `suggestedNextCommand`.
45
+ - Current canonical emission is schema `0.2`; the generator auto-derives `impact_map` from the current handoff refs and may include optional `recovery_notes`.
46
+ - For approval/workflow features, follow `toolkit/templates/handoffs/DEV_TO_SDTK_CODE.md` as the authoritative domain note. Keep state-machine-first slice ordering, populate workflow `impact_map` refs explicitly, cover all four workflow test-obligation categories, and carry unresolved workflow `OQ-xx` items as `open_blockers` instead of hiding them.
44
47
  7. Mirror the same readiness decision in the final `SDTK-CODE Handoff` section of `FEATURE_IMPL_PLAN`.
45
48
  - Do not copy placeholder `UPDATE_ME` commands from `sdtk-spec.config.json` into the handoff plan as if they were executable proof.
46
- 8. Update `SHARED_PLANNING.md` + `QUALITY_CHECKLIST.md` Phase 4 to show planning/handoff completion status.
47
- 9. Handoff:
49
+ 8. After CODE_HANDOFF is generated and the feature has been implemented and verified by SDTK-CODE,
50
+ author `docs/dev/OPS_HANDOFF_[FEATURE_KEY].json` for operational readiness handoff.
51
+ - Creation rules: `toolkit/templates/docs/dev/OPS_HANDOFF_CREATION_RULES.md`
52
+ - Schema version must be `"0.1"`. Required top-level fields: `schema_version`, `feature_key`,
53
+ `ops_handoff_status`, `source_handoff_ref`, `non_claims`, `deploy_starter`,
54
+ `env_expectations`, `health_check_baseline`, `monitoring_baseline`, `rollback_starter`,
55
+ `human_gates`. Optional: `open_questions`.
56
+ - The `non_claims` array must include the six minimum entries defined in the creation rules.
57
+ The handoff does not automate deployment, does not configure CI/CD pipelines, does not
58
+ configure a production monitoring platform, and does not provide automated rollback.
59
+ - Gate H5 must be present in `human_gates`. A human controller must review and approve the
60
+ OPS_HANDOFF artifact before any deployment action proceeds. This gate is not optional and
61
+ cannot be satisfied by automated review alone.
62
+ - Set `ops_handoff_status` to `"READY_FOR_OPS_REVIEW"` only after all required fields are
63
+ complete, the authoring checklist in the creation rules passes, and all blocking
64
+ open_questions are resolved. Use `"BLOCKED_FOR_OPS_REVIEW"` when any blocking question
65
+ remains unresolved.
66
+ - Do not hand-author fields derived from CODE_HANDOFF without verifying the source artifact.
67
+ Read `source_handoff_ref` before completing `deploy_starter` and `env_expectations`.
68
+ - This is starter-level guidance for a bounded small-app internal deployment only.
69
+ Do not claim production automation, cloud-platform management, or CI/CD pipeline
70
+ configuration in any field of the OPS_HANDOFF artifact.
71
+ 9. Update `SHARED_PLANNING.md` + `QUALITY_CHECKLIST.md` Phase 4 to show planning/handoff completion status.
72
+ 10. Handoff:
48
73
  - if ready: suggest the exact `sdtk-code start --feature-key <KEY> --lane <feature|bugfix> --project-path .` command
49
74
  - if blocked: list blockers and keep the work in `/dev`
50
75
 
@@ -0,0 +1,71 @@
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`
@@ -52,6 +52,13 @@ description: Orchestrate a full 6-phase SDLC multi-agent workflow (PM/BA/ARCH/DE
52
52
  - `on`: always run `sdtk-test-case-spec` for QA phase (fail fast if required inputs are missing).
53
53
  - `off`: skip test-case spec generation unless user explicitly requests it.
54
54
 
55
+ ## Optional: Mailbox Dispatch
56
+ - Use `sdtk-mailbox-dispatch` when one bounded controller-owned phase should be delegated to Claude or Codex.
57
+ - Keep planning local when the controller already has enough repo context.
58
+ - Lock exact include/exclude boundaries, fallback triggers, and verification commands before dispatch.
59
+ - Keep mailbox runtime files transient under `governance/ai/agent-mailbox/runtime/`.
60
+ - Run the default post-issue mailbox retrospective after repo truth is closed and before the next mailbox-driven issue.
61
+
55
62
  ## Flow Overview
56
63
 
57
64
  ```dot
@@ -93,5 +100,6 @@ If the evidence is incomplete, keep the phase open or mark it blocked instead of
93
100
  | Hand off a phase based on planned checks instead of executed evidence | Creates false PASS status and weakens downstream gates | Require fresh evidence before marking the phase complete |
94
101
  | Mix generation, review, and release decisions in one uncontrolled turn | Makes status tracking ambiguous | Complete one phase handoff at a time and update shared state before moving on |
95
102
  | Claim helper-dispatch or skill exposure is universal across every runtime surface | Overstates runtime guarantees and breaks truthful fallback behavior | State the verified surface only and keep the repo-local fallback explicit |
103
+ | Use mailbox dispatch as a generic worker platform or reopen broad planning through it | Wastes controller time and weakens boundary discipline | Keep mailbox delegation bounded, preserve exact boundaries, and prefer local planning when context is already strong |
96
104
  | Let a bounded audit issue the final verdict or replace QA/controller review | Breaks authority boundaries and creates ambiguous approval ownership | Keep audits narrow and evidence-cited, then return the findings to QA/controller |
97
105
  | Let a rejected batch jump straight to ship or PM closure | Breaks the targeted-fix refresh order and hides unresolved findings | Route rejected batches through the bounded loop `verify -> QA -> controller` before any later phase |
@@ -24,6 +24,43 @@ description: Product Manager + meta-orchestrator workflow for SDTK-SPEC. Use whe
24
24
  - After Project Initiation -> `@ba please analyze ...`
25
25
  - After PRD/Backlog -> `@arch please design ...`
26
26
 
27
+ ## Optional: Condensed Upstream Input
28
+
29
+ If a basic product brief is provided before PM initiation, a condensed upstream
30
+ input package may be produced first using:
31
+ `toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md`
32
+
33
+ The condensed output must carry the REQUIRES_HUMAN_REVIEW label (Gate H2) and
34
+ must be reviewed before the PM phase proceeds. Do not auto-advance to PM or BA
35
+ without explicit human confirmation. If the brief is outside the bounded domain,
36
+ stop and surface a boundary flag (Gate H1) rather than proceeding.
37
+
38
+ The condensed package is a DRAFT accelerator only. It seeds PM initiation; it
39
+ does not replace PM or BA judgment. Deliver the condensed output as:
40
+ `docs/product/CONDENSED_UPSTREAM_INPUT_[FEATURE_KEY].md`
41
+
42
+ For approval/workflow domain briefs, apply the Approval/Workflow Domain
43
+ Extension defined in the template. The extended condensed package must include
44
+ the Role Matrix, State Set, State Transitions, and Policy And Approval Rules
45
+ sections, plus an Open Questions For Human Review section in place of the
46
+ standard Gaps section. Gate H3 (Policy Open Questions Review) applies to all
47
+ approval/workflow condensed outputs and requires explicit PM or maintainer review
48
+ of all open policy questions before the SPEC phase proceeds. Open questions must
49
+ not be silently dropped.
50
+
51
+ ## Optional: Mailbox Delegation
52
+
53
+ Use `sdtk-mailbox-dispatch` when PM needs bounded external-agent help without
54
+ opening a full orchestration platform loop.
55
+
56
+ Rules:
57
+ - keep PM planning local when the controller already has enough context
58
+ - delegate only one bounded phase at a time with exact include/exclude truth
59
+ - prefer Claude for controller-spec, wording-heavy review, and SDTK-SPEC shaping
60
+ - prefer Codex for code, tests, harness, or verification-heavy implementation
61
+ - review the formal artifact on disk before trusting raw console output
62
+ - keep governance/ai/agent-mailbox/runtime/ transient and out of feature commits
63
+ - run the post-issue mailbox retrospective before the next mailbox-driven issue
27
64
  ## Phase 6 Closure Truth
28
65
  - Review the final QA and controller decisions before closing the issue.
29
66
  - Treat `SHARED_PLANNING.md`, `QUALITY_CHECKLIST.md`, and `governance/ai/core/IMPROVEMENT_BACKLOG.md` as closure-state surfaces that must stay synchronized.
@@ -143,6 +143,31 @@ skills:
143
143
  dependencies: []
144
144
  pack: core
145
145
 
146
+ - name: sdtk-mailbox-dispatch
147
+ phase: orchestration
148
+ role_tag: /mailbox-dispatch
149
+ use_when: Delegate one bounded controller-owned phase to Claude or Codex while preserving exact include/exclude boundaries, formal artifact review, and a default post-issue retrospective.
150
+ primary_inputs:
151
+ - issue spec or plan artifacts
152
+ - toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md
153
+ - toolkit/templates/mailbox/AGENT_REPORT_TEMPLATE.md
154
+ - current git truth
155
+ primary_outputs:
156
+ - governance/ai/agent-mailbox/runtime/<ISSUE_KEY>/<RUN_ID>/*
157
+ - governance/ai/reviews/shared/*
158
+ hard_gates:
159
+ - Do not use mailbox dispatch for broad exploratory planning when controller context is already strong.
160
+ - Do not mix transient mailbox runtime files into feature commit boundaries.
161
+ - Do not widen boundaries, fallback rules, or verification commands without an explicit controller decision.
162
+ references: []
163
+ prompts: []
164
+ scripts:
165
+ - toolkit/scripts/agents/run-claude-task.ps1
166
+ - toolkit/scripts/agents/run-codex-task.ps1
167
+ runtime_support: [claude, codex]
168
+ dependencies: []
169
+ pack: core
170
+
146
171
  - name: sdtk-dev-backend
147
172
  phase: dev
148
173
  role_tag: /dev-backend
@@ -33,6 +33,23 @@ If no arguments are provided, read current feature context from SHARED_PLANNING.
33
33
  ## Output
34
34
  - `docs/specs/BA_SPEC_[FEATURE_KEY].md`
35
35
 
36
+ ## Optional: Condensed Upstream Input
37
+
38
+ If a condensed upstream input package was produced before PM initiation, read it
39
+ alongside `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md`. The package is at:
40
+ `docs/product/CONDENSED_UPSTREAM_INPUT_[FEATURE_KEY].md`
41
+
42
+ The condensed package is a DRAFT accelerator only. All derived actors, entities,
43
+ rules, and acceptance criteria require human review before adoption. Do not treat
44
+ draft content as authoritative without explicit PM or maintainer confirmation.
45
+
46
+ For approval/workflow domain packages, the condensed package also includes a
47
+ Role Matrix, State Set, State Transitions, and Policy And Approval Rules
48
+ sections. When producing BR-xx and UC-xx items in BA_SPEC, read these sections
49
+ alongside the Actors and Workflow Entities sections. Any unresolved open
50
+ questions from the Open Questions For Human Review section must be carried
51
+ forward as explicit OQ-xx items in BA_SPEC rather than silently resolved.
52
+
36
53
  ## Process
37
54
  1. Read `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md` and any source requirements.
38
55
  2. Produce:
@@ -1,57 +1,59 @@
1
- ---
2
- name: dev
3
- description: Developer planning workflow for SDTK-SPEC. Use when you need to convert ARCH_DESIGN plus BACKLOG into a scoped implementation plan, readiness decision, and formal SDTK-CODE handoff.
4
- ---
5
-
6
- ## SDTK-SPEC Pipeline Rules (always apply)
7
- 1. Pipeline: PM Initiation -> BA Analysis -> PM Planning -> Architecture Design -> Development Planning + SDTK-CODE Handoff -> QA Validation
8
- 2. After completing phase work: update SHARED_PLANNING.md + QUALITY_CHECKLIST.md
9
- 3. If unclear: log OQ-xx in artifact, escalate to PM (PM asks user if needed)
10
- 4. Traceability: REQ -> BR/UC/AC -> design -> backlog -> FEATURE_IMPL_PLAN -> CODE_HANDOFF -> downstream implementation evidence -> QA
11
- 5. `/dev` stops at planning plus handoff; downstream code execution belongs to SDTK-CODE by default
12
- 6. Do not skip phases. If inputs missing, ask focused questions.
13
-
14
- ## Prerequisites (verify before proceeding)
15
- Read QUALITY_CHECKLIST.md and verify:
16
- - Phase 3 ARCH Design gate must show all items [x] Done.
17
-
18
- If prerequisites are not met: report which gate is missing, suggest user run `/arch` first.
19
-
20
- ## Current Context
21
- - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk-spec.config.json','utf8'))}catch{process.stdout.write('{}')}"`
22
- - Pipeline: !`node -e "try{process.stdout.write(require('fs').readFileSync('SHARED_PLANNING.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
23
- - Gates: !`node -e "try{process.stdout.write(require('fs').readFileSync('QUALITY_CHECKLIST.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
24
- - State: !`node -e "try{process.stdout.write(require('fs').readFileSync('.sdtk/orchestration-state.json','utf8'))}catch{process.stdout.write('{}')}"`
25
-
26
- ## Input
27
- $ARGUMENTS
28
-
29
- If no arguments provided, read current feature context from SHARED_PLANNING.md.
30
-
31
- # SDTK-SPEC DEV (Planning + SDTK-CODE Handoff)
32
-
33
- ## Outputs
34
- - `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md`
35
- - `docs/dev/CODE_HANDOFF_[FEATURE_KEY].json`
36
-
37
- ## Process
38
- 1. Read `ARCH_DESIGN_*` + backlog.
39
- 2. Read `sdtk-spec.config.json` for project stack + test/lint commands.
40
- 3. Write or refine `FEATURE_IMPL_PLAN_*`:
41
- - implementation slices
42
- - required refs
43
- - optional refs
44
- - test obligations
45
- - blockers and OQ items
46
- 4. If anything is unclear: record OQ-xx in `FEATURE_IMPL_PLAN` and escalate to PM (suggest user run `/pm` for a decision if still missing info).
47
- 5. Decide readiness:
48
- - `READY_FOR_SDTK_CODE`, or
49
- - `BLOCKED_FOR_SDTK_CODE`
50
- 6. Generate `CODE_HANDOFF_*` with `toolkit/scripts/generate-code-handoff.ps1`.
51
- - Canonical writer rule: the machine-readable JSON is generator-owned; do not hand-author or patch the JSON shape manually.
52
- - If an existing `CODE_HANDOFF_*` file is non-canonical, regenerate it with the script and `-Force` instead of editing keys by hand.
53
- - Use the script-owned snake_case contract only. Do not emit legacy camelCase keys such as `featureKey`, `requiredRefs`, `optionalRefs`, `openBlockers`, `implementationSlices`, `testObligations`, or `suggestedNextCommand`.
54
- 7. Update `SHARED_PLANNING.md` + `QUALITY_CHECKLIST.md` Phase 4.
55
- 8. If ready, suggest:
56
- - `sdtk-code start --feature-key <KEY> --lane <feature|bugfix> --project-path .`
57
- 9. Do not claim that `/dev` executed downstream code, build, verify, ship, or QA handoff.
1
+ ---
2
+ name: dev
3
+ description: Developer planning workflow for SDTK-SPEC. Use when you need to convert ARCH_DESIGN plus BACKLOG into a scoped implementation plan, readiness decision, and formal SDTK-CODE handoff.
4
+ ---
5
+
6
+ ## SDTK-SPEC Pipeline Rules (always apply)
7
+ 1. Pipeline: PM Initiation -> BA Analysis -> PM Planning -> Architecture Design -> Development Planning + SDTK-CODE Handoff -> QA Validation
8
+ 2. After completing phase work: update SHARED_PLANNING.md + QUALITY_CHECKLIST.md
9
+ 3. If unclear: log OQ-xx in artifact, escalate to PM (PM asks user if needed)
10
+ 4. Traceability: REQ -> BR/UC/AC -> design -> backlog -> FEATURE_IMPL_PLAN -> CODE_HANDOFF -> downstream implementation evidence -> QA
11
+ 5. `/dev` stops at planning plus handoff; downstream code execution belongs to SDTK-CODE by default
12
+ 6. Do not skip phases. If inputs missing, ask focused questions.
13
+
14
+ ## Prerequisites (verify before proceeding)
15
+ Read QUALITY_CHECKLIST.md and verify:
16
+ - Phase 3 ARCH Design gate must show all items [x] Done.
17
+
18
+ If prerequisites are not met: report which gate is missing, suggest user run `/arch` first.
19
+
20
+ ## Current Context
21
+ - Config: !`node -e "try{process.stdout.write(require('fs').readFileSync('sdtk-spec.config.json','utf8'))}catch{process.stdout.write('{}')}"`
22
+ - Pipeline: !`node -e "try{process.stdout.write(require('fs').readFileSync('SHARED_PLANNING.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
23
+ - Gates: !`node -e "try{process.stdout.write(require('fs').readFileSync('QUALITY_CHECKLIST.md','utf8'))}catch{process.stdout.write('Not initialized')}"`
24
+ - State: !`node -e "try{process.stdout.write(require('fs').readFileSync('.sdtk/orchestration-state.json','utf8'))}catch{process.stdout.write('{}')}"`
25
+
26
+ ## Input
27
+ $ARGUMENTS
28
+
29
+ If no arguments provided, read current feature context from SHARED_PLANNING.md.
30
+
31
+ # SDTK-SPEC DEV (Planning + SDTK-CODE Handoff)
32
+
33
+ ## Outputs
34
+ - `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md`
35
+ - `docs/dev/CODE_HANDOFF_[FEATURE_KEY].json`
36
+
37
+ ## Process
38
+ 1. Read `ARCH_DESIGN_*` + backlog.
39
+ 2. Read `sdtk-spec.config.json` for project stack + test/lint commands.
40
+ 3. Write or refine `FEATURE_IMPL_PLAN_*`:
41
+ - implementation slices in the recommended downstream build order
42
+ - required refs
43
+ - optional refs
44
+ - test obligations written as implementation-ready acceptance mapping statements
45
+ - blockers and OQ items
46
+ 4. If anything is unclear: record OQ-xx in `FEATURE_IMPL_PLAN` and escalate to PM (suggest user run `/pm` for a decision if still missing info).
47
+ 5. Decide readiness:
48
+ - `READY_FOR_SDTK_CODE`, or
49
+ - `BLOCKED_FOR_SDTK_CODE`
50
+ 6. Generate `CODE_HANDOFF_*` with `toolkit/scripts/generate-code-handoff.ps1`.
51
+ - Canonical writer rule: the machine-readable JSON is generator-owned; do not hand-author or patch the JSON shape manually.
52
+ - If an existing `CODE_HANDOFF_*` file is non-canonical, regenerate it with the script and `-Force` instead of editing keys by hand.
53
+ - Use the script-owned snake_case contract only. Do not emit legacy camelCase keys such as `featureKey`, `requiredRefs`, `optionalRefs`, `openBlockers`, `implementationSlices`, `testObligations`, or `suggestedNextCommand`.
54
+ - Current canonical emission is schema `0.2`; the generator auto-derives `impact_map` from the current handoff refs and may include optional `recovery_notes`.
55
+ - For approval/workflow features, follow `toolkit/templates/handoffs/DEV_TO_SDTK_CODE.md` as the authoritative domain note. Keep state-machine-first slice ordering, populate workflow `impact_map` refs explicitly, cover all four workflow test-obligation categories, and carry unresolved workflow `OQ-xx` items as `open_blockers` instead of hiding them.
56
+ 7. Update `SHARED_PLANNING.md` + `QUALITY_CHECKLIST.md` Phase 4.
57
+ 8. If ready, suggest:
58
+ - `sdtk-code start --feature-key <KEY> --lane <feature|bugfix> --project-path .`
59
+ 9. Do not claim that `/dev` executed downstream code, build, verify, ship, or QA handoff.
@@ -0,0 +1,71 @@
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`
@@ -28,6 +28,13 @@ description: Orchestrate the SDTK-SPEC 6-phase workflow in Claude Code using SHA
28
28
  - Update `SHARED_PLANNING.md` and `QUALITY_CHECKLIST.md`.
29
29
  - Hand off only after the current phase has fresh evidence.
30
30
 
31
+ ## Optional: Mailbox Dispatch
32
+ - Use `mailbox-dispatch` when one bounded controller-owned phase should be delegated to Claude or Codex.
33
+ - Keep planning local when the controller already has enough repo context.
34
+ - Lock exact include/exclude boundaries, fallback triggers, and verification commands before dispatch.
35
+ - Keep mailbox runtime files transient under `governance/ai/agent-mailbox/runtime/`.
36
+ - Run the default post-issue mailbox retrospective after repo truth is closed and before the next mailbox-driven issue.
37
+
31
38
  ## Guardrails
32
39
  - Keep traceability: `REQ -> BR/UC/AC -> design -> backlog -> FEATURE_IMPL_PLAN -> CODE_HANDOFF -> downstream implementation evidence -> QA report`.
33
40
  - Preserve the repo-local orchestrator contract as the exact fallback when direct built-in exposure or invocation is absent or unvalidated.
@@ -4,10 +4,10 @@ description: Product Manager + meta-orchestrator workflow for SDTK-SPEC. Use whe
4
4
  ---
5
5
 
6
6
  ## SDTK-SPEC Pipeline Rules (always apply)
7
- 1. Pipeline: PM Initiation → BA Analysis → PM Planning → Architecture Design → Development + Review → QA Validation
7
+ 1. Pipeline: PM Initiation 竊・BA Analysis 竊・PM Planning 竊・Architecture Design 竊・Development + Review 竊・QA Validation
8
8
  2. After completing phase work: update SHARED_PLANNING.md + QUALITY_CHECKLIST.md
9
9
  3. If unclear: log OQ-xx in artifact, escalate to PM (PM asks user if needed)
10
- 4. Traceability: REQ → BR/UC/AC → design → backlog → code/tests → QA
10
+ 4. Traceability: REQ 竊・BR/UC/AC 竊・design 竊・backlog 竊・code/tests 竊・QA
11
11
  5. Code review must be COMPLETE before QA phase can start
12
12
  6. Do not skip phases. If inputs missing, ask focused questions.
13
13
 
@@ -45,6 +45,42 @@ If no arguments provided, read current feature context from SHARED_PLANNING.md.
45
45
  - After Project Initiation -> suggest user run `/ba` to analyze requirements
46
46
  - After PRD/Backlog -> suggest user run `/arch` to design architecture
47
47
 
48
+ ## Optional: Condensed Upstream Input
49
+
50
+ If a basic product brief is provided before PM initiation, a condensed upstream
51
+ input package may be produced first using:
52
+ `toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md`
53
+
54
+ The condensed output must carry the REQUIRES_HUMAN_REVIEW label (Gate H2) and
55
+ must be reviewed before the PM phase proceeds. Do not auto-advance to PM or BA
56
+ without explicit human confirmation. If the brief is outside the bounded domain,
57
+ stop and surface a boundary flag (Gate H1) rather than proceeding.
58
+
59
+ Deliver the condensed output as:
60
+ `docs/product/CONDENSED_UPSTREAM_INPUT_[FEATURE_KEY].md`
61
+
62
+ For approval/workflow domain briefs, apply the Approval/Workflow Domain
63
+ Extension defined in the template. The extended condensed package must include
64
+ the Role Matrix, State Set, State Transitions, and Policy And Approval Rules
65
+ sections, plus an Open Questions For Human Review section in place of the
66
+ standard Gaps section. Gate H3 (Policy Open Questions Review) applies to all
67
+ approval/workflow condensed outputs and requires explicit PM or maintainer review
68
+ of all open policy questions before the SPEC phase proceeds. Open questions must
69
+ not be silently dropped.
70
+
71
+ ## Optional: Mailbox Delegation
72
+
73
+ Use `mailbox-dispatch` when PM needs bounded external-agent help without
74
+ opening a full orchestration platform loop.
75
+
76
+ Rules:
77
+ - keep PM planning local when the controller already has enough context
78
+ - delegate only one bounded phase at a time with exact include/exclude truth
79
+ - prefer Claude for controller-spec, wording-heavy review, and SDTK-SPEC shaping
80
+ - prefer Codex for code, tests, harness, or verification-heavy implementation
81
+ - review the formal artifact on disk before trusting raw console output
82
+ - keep governance/ai/agent-mailbox/runtime/ transient and out of feature commits
83
+ - run the post-issue mailbox retrospective before the next mailbox-driven issue
48
84
  ## Clarification And Decisions (PM responsibility)
49
85
  - Collect OQ-xx items raised by BA/ARCH/DEV/QA in their respective artifacts.
50
86
  - Try to resolve OQ-xx using existing docs and reasonable product/tech decisions.
@@ -75,6 +75,7 @@
75
75
  - Generator-owned artifact: write or refresh it with `toolkit/scripts/generate-code-handoff.ps1`
76
76
  - Do not hand-author the JSON shape or copy planning tables directly into the JSON
77
77
  - Use canonical snake_case keys only; do not use legacy camelCase keys such as `featureKey`, `requiredRefs`, or `suggestedNextCommand`
78
+ - Current canonical generator emission is schema `0.2`; `SDTK-CODE` still accepts `0.1` for bounded compatibility
78
79
 
79
80
  ### 4.1 Handoff Status
80
81
  - `READY_FOR_SDTK_CODE` or `BLOCKED_FOR_SDTK_CODE`
@@ -94,12 +95,22 @@
94
95
  - TBD
95
96
 
96
97
  ### 4.6 Implementation Slices
98
+ - Keep the list in the recommended downstream build order.
97
99
  - TBD
98
100
 
99
- ### 4.7 Test Obligations
101
+ ### 4.7 Impact Map
102
+ - Auto-derived from the handoff refs when the canonical generator runs.
103
+ - Expected keys: `api_refs`, `database_refs`, `ui_refs`, `flow_refs`
104
+
105
+ ### 4.8 Test Obligations
106
+ - Write implementation-ready acceptance mapping statements, not vague labels.
107
+ - TBD
108
+
109
+ ### 4.9 Recovery Notes (Optional)
110
+ - Add only when `/dev` already knows a recovery-sensitive constraint or a do-not-guess reminder.
100
111
  - TBD
101
112
 
102
- ### 4.8 Suggested Next Command
113
+ ### 4.10 Suggested Next Command
103
114
  - If ready:
104
115
  - `sdtk-code start --feature-key {{FEATURE_KEY}} --lane feature --project-path .`
105
116
  - If blocked: