sdtk-spec-kit 0.4.11 → 0.4.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 (143) hide show
  1. package/README.md +353 -353
  2. package/assets/atlas/build_atlas.py +880 -880
  3. package/assets/atlas/doc_atlas_viewer_template.html +3796 -3796
  4. package/assets/atlas/vendor/mermaid.min.js +2029 -2029
  5. package/assets/keys/spec-entitlement-public.pem +9 -9
  6. package/assets/manifest/toolkit-bundle.manifest.json +496 -496
  7. package/assets/manifest/toolkit-bundle.sha256.txt +97 -97
  8. package/assets/toolkit/toolkit/AGENTS.md +157 -241
  9. package/assets/toolkit/toolkit/README.md +51 -51
  10. package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +206 -206
  11. package/assets/toolkit/toolkit/install.ps1 +362 -362
  12. package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +95 -91
  13. package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +70 -69
  14. package/assets/toolkit/toolkit/scripts/agents/run-claude-task.ps1 +332 -332
  15. package/assets/toolkit/toolkit/scripts/agents/run-codex-task.ps1 +618 -618
  16. package/assets/toolkit/toolkit/scripts/agents/validate-mailbox-formal-artifact.py +87 -87
  17. package/assets/toolkit/toolkit/scripts/generate-code-handoff.ps1 +317 -317
  18. package/assets/toolkit/toolkit/scripts/init-feature.ps1 +262 -262
  19. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +180 -180
  20. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +209 -209
  21. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +139 -139
  22. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +143 -143
  23. package/assets/toolkit/toolkit/sdtk-spec.config.json +28 -28
  24. package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +50 -50
  25. package/assets/toolkit/toolkit/session/SDTK_ACTIVE_BOOTSTRAP.md +46 -46
  26. package/assets/toolkit/toolkit/session/SDTK_AGENT_WORKING_RULES.md +48 -48
  27. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +111 -111
  28. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +732 -732
  29. package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +79 -79
  30. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +85 -85
  31. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +46 -46
  32. package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +91 -91
  33. package/assets/toolkit/toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py +246 -246
  34. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +133 -133
  35. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/code-quality-reviewer.md +34 -34
  36. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/implementer.md +60 -60
  37. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/spec-reviewer.md +41 -41
  38. package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +80 -80
  39. package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +80 -80
  40. package/assets/toolkit/toolkit/skills/sdtk-mailbox-dispatch/SKILL.md +73 -73
  41. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +176 -108
  42. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +74 -74
  43. package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +75 -75
  44. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +108 -107
  45. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md +51 -51
  46. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md +54 -54
  47. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +28 -28
  48. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py +136 -136
  49. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +414 -414
  50. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +110 -110
  51. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py +97 -97
  52. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +330 -330
  53. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +116 -116
  54. package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +87 -87
  55. package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +59 -59
  56. package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +67 -67
  57. package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +91 -91
  58. package/assets/toolkit/toolkit/skills-claude/dev/SKILL.md +59 -59
  59. package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +73 -73
  60. package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +73 -73
  61. package/assets/toolkit/toolkit/skills-claude/mailbox-dispatch/SKILL.md +73 -73
  62. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +88 -42
  63. package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +88 -88
  64. package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +58 -58
  65. package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +113 -112
  66. package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +115 -115
  67. package/assets/toolkit/toolkit/templates/QUALITY_CHECKLIST.md +124 -124
  68. package/assets/toolkit/toolkit/templates/README.md +68 -68
  69. package/assets/toolkit/toolkit/templates/SHARED_PLANNING.md +81 -81
  70. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +21 -21
  71. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +67 -67
  72. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
  73. package/assets/toolkit/toolkit/templates/docs/api/API_ENDPOINTS_TEMPLATE.md +229 -229
  74. package/assets/toolkit/toolkit/templates/docs/api/FEATURE_API_TEMPLATE.yaml +20 -20
  75. package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +20 -20
  76. package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +128 -128
  77. package/assets/toolkit/toolkit/templates/docs/api/feature_api_flow_list_TEMPLATE.txt +12 -12
  78. package/assets/toolkit/toolkit/templates/docs/architecture/ARCH_DESIGN_TEMPLATE.md +109 -109
  79. package/assets/toolkit/toolkit/templates/docs/database/DATABASE_SPEC_TEMPLATE.md +175 -175
  80. package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +60 -60
  81. package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +117 -117
  82. package/assets/toolkit/toolkit/templates/docs/dev/OPS_HANDOFF_CREATION_RULES.md +369 -369
  83. package/assets/toolkit/toolkit/templates/docs/discovery/REQUIREMENT_TEMPLATE.md +155 -155
  84. package/assets/toolkit/toolkit/templates/docs/product/BACKLOG_TEMPLATE.md +50 -50
  85. package/assets/toolkit/toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md +276 -276
  86. package/assets/toolkit/toolkit/templates/docs/product/PRD_TEMPLATE.md +66 -66
  87. package/assets/toolkit/toolkit/templates/docs/product/PROJECT_INITIATION_TEMPLATE.md +98 -98
  88. package/assets/toolkit/toolkit/templates/docs/qa/CONTROLLER_ACCEPTANCE_TEMPLATE.md +90 -90
  89. package/assets/toolkit/toolkit/templates/docs/qa/QA_RELEASE_REPORT_TEMPLATE.md +162 -162
  90. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md +129 -129
  91. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_TEMPLATE.md +104 -104
  92. package/assets/toolkit/toolkit/templates/docs/specs/BA_SPEC_TEMPLATE.md +139 -139
  93. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +220 -220
  94. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +197 -197
  95. package/assets/toolkit/toolkit/templates/handoffs/ARCH_TO_DEV.md +31 -31
  96. package/assets/toolkit/toolkit/templates/handoffs/BA_TO_ARCH.md +28 -28
  97. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE1_SPEC_REVIEW.md +26 -26
  98. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE2_CODE_QUALITY_REVIEW.md +20 -20
  99. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_QA.md +33 -33
  100. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_SDTK_CODE.md +60 -60
  101. package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +30 -30
  102. package/assets/toolkit/toolkit/templates/handoffs/QA_RELEASE_DECISION.md +26 -26
  103. package/assets/toolkit/toolkit/templates/mailbox/AGENT_REPORT_TEMPLATE.md +63 -63
  104. package/assets/toolkit/toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md +76 -76
  105. package/bin/sdtk.js +15 -15
  106. package/package.json +48 -48
  107. package/src/commands/activate.js +94 -94
  108. package/src/commands/atlas.js +339 -339
  109. package/src/commands/auth.js +85 -85
  110. package/src/commands/entitlement.js +170 -170
  111. package/src/commands/generate.js +191 -170
  112. package/src/commands/help.js +248 -246
  113. package/src/commands/init.js +117 -117
  114. package/src/commands/project.js +51 -51
  115. package/src/commands/runtime.js +239 -239
  116. package/src/commands/update.js +11 -11
  117. package/src/index.js +68 -68
  118. package/src/lib/activation-state.js +68 -68
  119. package/src/lib/args.js +116 -116
  120. package/src/lib/atlas-config.js +200 -200
  121. package/src/lib/atlas-runner.js +435 -435
  122. package/src/lib/browser-open.js +39 -39
  123. package/src/lib/capabilities.js +89 -89
  124. package/src/lib/entitlements.js +245 -245
  125. package/src/lib/errors.js +41 -41
  126. package/src/lib/github-access.js +143 -143
  127. package/src/lib/legacy-auth-migration.js +56 -56
  128. package/src/lib/license-activation.js +386 -386
  129. package/src/lib/powershell.js +85 -85
  130. package/src/lib/premium-loader.js +124 -124
  131. package/src/lib/premium-packs.js +333 -333
  132. package/src/lib/premium-sync.js +235 -235
  133. package/src/lib/project-audit.js +332 -332
  134. package/src/lib/project-config.js +108 -108
  135. package/src/lib/project-ingest.js +450 -450
  136. package/src/lib/project-refresh.js +666 -666
  137. package/src/lib/project-target-guard.js +79 -79
  138. package/src/lib/requirement-analysis.js +14 -4
  139. package/src/lib/scope.js +83 -83
  140. package/src/lib/state.js +74 -74
  141. package/src/lib/suite-state.js +70 -70
  142. package/src/lib/toolkit-payload.js +99 -99
  143. package/src/lib/update.js +333 -333
@@ -1,133 +1,133 @@
1
- ---
2
- name: sdtk-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 DEV (Planning + SDTK-CODE Handoff)
7
-
8
- ## Critical Constraints
9
- - I do not emit `READY_FOR_SDTK_CODE` until the current `FEATURE_IMPL_PLAN` scope is approved and all required upstream refs are explicit.
10
- - I do not claim downstream implementation is complete from within `/dev`.
11
-
12
- ## Outputs
13
- - `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md`
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
16
-
17
- ## Legacy Prompt Templates
18
- - `./prompts/implementer.md`
19
- - `./prompts/spec-reviewer.md`
20
- - `./prompts/code-quality-reviewer.md`
21
-
22
- These prompt templates remain in the repo as transition-only manual helper assets.
23
- They are not the default `/dev` workflow in this wave.
24
- Use them only when the user explicitly requests a manual legacy review or delegated implementation experiment outside the normal `/dev -> SDTK-CODE` path.
25
-
26
- ## Process
27
- 1. Read `ARCH_DESIGN_*` + backlog.
28
- 2. Read `sdtk-spec.config.json` for project stack + test/lint commands.
29
- 3. Write or refine `FEATURE_IMPL_PLAN_*`:
30
- - issue summary and scope
31
- - explicit non-goals
32
- - implementation slices in the recommended downstream build order
33
- - required refs
34
- - optional refs
35
- - issue-specific test obligations using implementation-ready acceptance mapping statements and real executable commands
36
- - blockers and open questions
37
- 4. If anything is unclear: record OQ-xx in `FEATURE_IMPL_PLAN` and escalate to `@pm` for a decision.
38
- 5. Decide readiness:
39
- - `READY_FOR_SDTK_CODE` when the current slice is concrete enough for downstream coding
40
- - `BLOCKED_FOR_SDTK_CODE` when blockers remain
41
- 6. Generate `CODE_HANDOFF_*` with `toolkit/scripts/generate-code-handoff.ps1`.
42
- - Canonical writer rule: the machine-readable JSON is generator-owned; do not hand-author or patch the JSON shape manually.
43
- - If an existing `CODE_HANDOFF_*` file is non-canonical, regenerate it with the script and `-Force` instead of editing keys by hand.
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.
47
- 7. Mirror the same readiness decision in the final `SDTK-CODE Handoff` section of `FEATURE_IMPL_PLAN`.
48
- - Do not copy placeholder `UPDATE_ME` commands from `sdtk-spec.config.json` into the handoff plan as if they were executable proof.
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:
73
- - if ready: suggest the exact `sdtk-code start --feature-key <KEY> --lane <feature|bugfix> --project-path .` command
74
- - if blocked: list blockers and keep the work in `/dev`
75
-
76
- ## Delegated Execution Contract
77
- - The implementer subagent receives the full task text directly in the prompt when the user explicitly requests manual legacy execution.
78
- - Required implementer status values:
79
- - `DONE`
80
- - `DONE_WITH_CONCERNS`
81
- - `NEEDS_CONTEXT`
82
- - `BLOCKED`
83
- - `DONE_WITH_CONCERNS` means the task is complete but the controller must read the concerns before review.
84
- - `NEEDS_CONTEXT` means the controller must supply missing information and re-dispatch.
85
- - `BLOCKED` means do not retry the same task unchanged; resolve the blocker first.
86
- - The spec reviewer must verify real artifacts, not trust implementer claims.
87
- - The code-quality reviewer is a second-stage review and must not run before spec compliance passes.
88
- - This legacy review loop is optional and manual in this wave; it is not the default `/dev` contract.
89
-
90
- ## Model Selection Guidance
91
- Choose the cheapest model that can safely complete the task without creating avoidable rework.
92
-
93
- | Task type | Recommended model tier | Why |
94
- |---|---|---|
95
- | Single-file mechanical change with a clear spec | Fast model | Useful for legacy/manual helper tasks, not the default handoff path |
96
- | Multi-file integration that follows an approved plan | Standard model | Useful when manually validating scope or reviewing downstream constraints |
97
- | Architecture or design tradeoff for the current implementation slice | Most capable model | Requires judgment and ambiguity handling |
98
- | Stage 1 artifact/spec review | Standard model | Legacy/manual review aid only |
99
- | Stage 2 code-quality review | Standard or most capable model | Legacy/manual review aid only |
100
- | Cross-artifact consistency investigation | Most capable model | Requires broader synthesis across docs and handoff inputs |
101
-
102
- Blocked-task rule:
103
- - If an implementer returns `BLOCKED`, do not force the same model to retry the same task unchanged.
104
- - First resolve missing context or reduce task scope.
105
- - Escalate to a stronger model only when the blocker is judgment or synthesis bound, not because the prompt was incomplete.
106
-
107
- ## Verification Before Completion
108
- Apply `governance/ai/core/SDTK_VERIFICATION_BEFORE_COMPLETION_POLICY.md`.
109
-
110
- Do not:
111
- - say the handoff is ready without validating the current refs, blockers, slices, and obligations
112
- - cite downstream readiness without fresh verification evidence for the claim
113
- - use `should`, `probably`, or `seems` in place of executed checks
114
- - rely on partial output, stale command runs, or unchecked agent reports
115
- - manually compose `CODE_HANDOFF` JSON when the canonical generator script is available
116
-
117
- If validation fails or cannot be run, report the handoff as blocked and explain the blocker.
118
-
119
- ## Order-Critical Hard Gate
120
- Do not emit `READY_FOR_SDTK_CODE` until `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md` exists and the current execution scope is explicitly approved in that plan for downstream implementation.
121
-
122
- If the plan is missing, incomplete, or still awaiting approval for the current task slice, stop and update the plan first. Do not emit the handoff first and backfill the plan later.
123
-
124
- Do not let placeholder commands, vague slice names, or missing required refs stand in for real downstream readiness.
125
-
126
- ## Common Mistakes
127
-
128
- | Mistake | Why it is wrong | Do instead |
129
- |---|---|---|
130
- | Treat `/dev` as the place where final code and QA handoff happen | Collapses the boundary between SDTK-SPEC and SDTK-CODE | Stop `/dev` at `FEATURE_IMPL_PLAN + CODE_HANDOFF` |
131
- | Emit `READY_FOR_SDTK_CODE` with missing refs or vague slices | Pushes ambiguity downstream and weakens handoff quality | Make refs, slices, obligations, and blockers explicit before the handoff |
132
- | Retry a `BLOCKED` manual helper prompt with the same context | Repeats the same failure mode | Add missing context, split the task, or keep the handoff blocked |
133
- | Copy `UPDATE_ME` placeholder commands into the plan as if they were executable verification | Fakes downstream readiness and weakens verification-before-completion | Replace placeholders with issue-specific real commands or state truthfully that a project-level command is unknown |
1
+ ---
2
+ name: sdtk-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 DEV (Planning + SDTK-CODE Handoff)
7
+
8
+ ## Critical Constraints
9
+ - I do not emit `READY_FOR_SDTK_CODE` until the current `FEATURE_IMPL_PLAN` scope is approved and all required upstream refs are explicit.
10
+ - I do not claim downstream implementation is complete from within `/dev`.
11
+
12
+ ## Outputs
13
+ - `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md`
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
16
+
17
+ ## Legacy Prompt Templates
18
+ - `./prompts/implementer.md`
19
+ - `./prompts/spec-reviewer.md`
20
+ - `./prompts/code-quality-reviewer.md`
21
+
22
+ These prompt templates remain in the repo as transition-only manual helper assets.
23
+ They are not the default `/dev` workflow in this wave.
24
+ Use them only when the user explicitly requests a manual legacy review or delegated implementation experiment outside the normal `/dev -> SDTK-CODE` path.
25
+
26
+ ## Process
27
+ 1. Read `ARCH_DESIGN_*` + backlog.
28
+ 2. Read `sdtk-spec.config.json` for project stack + test/lint commands.
29
+ 3. Write or refine `FEATURE_IMPL_PLAN_*`:
30
+ - issue summary and scope
31
+ - explicit non-goals
32
+ - implementation slices in the recommended downstream build order
33
+ - required refs
34
+ - optional refs
35
+ - issue-specific test obligations using implementation-ready acceptance mapping statements and real executable commands
36
+ - blockers and open questions
37
+ 4. If anything is unclear: record OQ-xx in `FEATURE_IMPL_PLAN` and escalate to `@pm` for a decision.
38
+ 5. Decide readiness:
39
+ - `READY_FOR_SDTK_CODE` when the current slice is concrete enough for downstream coding
40
+ - `BLOCKED_FOR_SDTK_CODE` when blockers remain
41
+ 6. Generate `CODE_HANDOFF_*` with `toolkit/scripts/generate-code-handoff.ps1`.
42
+ - Canonical writer rule: the machine-readable JSON is generator-owned; do not hand-author or patch the JSON shape manually.
43
+ - If an existing `CODE_HANDOFF_*` file is non-canonical, regenerate it with the script and `-Force` instead of editing keys by hand.
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.
47
+ 7. Mirror the same readiness decision in the final `SDTK-CODE Handoff` section of `FEATURE_IMPL_PLAN`.
48
+ - Do not copy placeholder `UPDATE_ME` commands from `sdtk-spec.config.json` into the handoff plan as if they were executable proof.
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:
73
+ - if ready: suggest the exact `sdtk-code start --feature-key <KEY> --lane <feature|bugfix> --project-path .` command
74
+ - if blocked: list blockers and keep the work in `/dev`
75
+
76
+ ## Delegated Execution Contract
77
+ - The implementer subagent receives the full task text directly in the prompt when the user explicitly requests manual legacy execution.
78
+ - Required implementer status values:
79
+ - `DONE`
80
+ - `DONE_WITH_CONCERNS`
81
+ - `NEEDS_CONTEXT`
82
+ - `BLOCKED`
83
+ - `DONE_WITH_CONCERNS` means the task is complete but the controller must read the concerns before review.
84
+ - `NEEDS_CONTEXT` means the controller must supply missing information and re-dispatch.
85
+ - `BLOCKED` means do not retry the same task unchanged; resolve the blocker first.
86
+ - The spec reviewer must verify real artifacts, not trust implementer claims.
87
+ - The code-quality reviewer is a second-stage review and must not run before spec compliance passes.
88
+ - This legacy review loop is optional and manual in this wave; it is not the default `/dev` contract.
89
+
90
+ ## Model Selection Guidance
91
+ Choose the cheapest model that can safely complete the task without creating avoidable rework.
92
+
93
+ | Task type | Recommended model tier | Why |
94
+ |---|---|---|
95
+ | Single-file mechanical change with a clear spec | Fast model | Useful for legacy/manual helper tasks, not the default handoff path |
96
+ | Multi-file integration that follows an approved plan | Standard model | Useful when manually validating scope or reviewing downstream constraints |
97
+ | Architecture or design tradeoff for the current implementation slice | Most capable model | Requires judgment and ambiguity handling |
98
+ | Stage 1 artifact/spec review | Standard model | Legacy/manual review aid only |
99
+ | Stage 2 code-quality review | Standard or most capable model | Legacy/manual review aid only |
100
+ | Cross-artifact consistency investigation | Most capable model | Requires broader synthesis across docs and handoff inputs |
101
+
102
+ Blocked-task rule:
103
+ - If an implementer returns `BLOCKED`, do not force the same model to retry the same task unchanged.
104
+ - First resolve missing context or reduce task scope.
105
+ - Escalate to a stronger model only when the blocker is judgment or synthesis bound, not because the prompt was incomplete.
106
+
107
+ ## Verification Before Completion
108
+ Apply `governance/ai/core/SDTK_VERIFICATION_BEFORE_COMPLETION_POLICY.md`.
109
+
110
+ Do not:
111
+ - say the handoff is ready without validating the current refs, blockers, slices, and obligations
112
+ - cite downstream readiness without fresh verification evidence for the claim
113
+ - use `should`, `probably`, or `seems` in place of executed checks
114
+ - rely on partial output, stale command runs, or unchecked agent reports
115
+ - manually compose `CODE_HANDOFF` JSON when the canonical generator script is available
116
+
117
+ If validation fails or cannot be run, report the handoff as blocked and explain the blocker.
118
+
119
+ ## Order-Critical Hard Gate
120
+ Do not emit `READY_FOR_SDTK_CODE` until `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md` exists and the current execution scope is explicitly approved in that plan for downstream implementation.
121
+
122
+ If the plan is missing, incomplete, or still awaiting approval for the current task slice, stop and update the plan first. Do not emit the handoff first and backfill the plan later.
123
+
124
+ Do not let placeholder commands, vague slice names, or missing required refs stand in for real downstream readiness.
125
+
126
+ ## Common Mistakes
127
+
128
+ | Mistake | Why it is wrong | Do instead |
129
+ |---|---|---|
130
+ | Treat `/dev` as the place where final code and QA handoff happen | Collapses the boundary between SDTK-SPEC and SDTK-CODE | Stop `/dev` at `FEATURE_IMPL_PLAN + CODE_HANDOFF` |
131
+ | Emit `READY_FOR_SDTK_CODE` with missing refs or vague slices | Pushes ambiguity downstream and weakens handoff quality | Make refs, slices, obligations, and blockers explicit before the handoff |
132
+ | Retry a `BLOCKED` manual helper prompt with the same context | Repeats the same failure mode | Add missing context, split the task, or keep the handoff blocked |
133
+ | Copy `UPDATE_ME` placeholder commands into the plan as if they were executable verification | Fakes downstream readiness and weakens verification-before-completion | Replace placeholders with issue-specific real commands or state truthfully that a project-level command is unknown |
@@ -1,35 +1,35 @@
1
- # SDTK-SPEC DEV Code Quality Reviewer Prompt Template
2
-
3
- You are the Stage 2 code-quality reviewer for a completed SDTK-SPEC development task.
4
-
5
- ## Gate Position
6
- Run this prompt only after the spec reviewer has passed Stage 1 artifact/spec compliance.
7
-
8
- ## Inputs From Controller
9
- - Task ID: `{{TASK_ID}}`
10
- - Feature key: `{{FEATURE_KEY}}`
11
- - Stage 1 PASS evidence: `{{SPEC_REVIEW_PASS_EVIDENCE}}`
12
- - Files to review:
13
-
14
- ```text
15
- {{FILES_TO_REVIEW}}
16
- ```
17
-
18
- - Relevant coding standards or repo conventions:
19
-
20
- ```text
21
- {{CODE_QUALITY_RULES}}
22
- ```
23
-
24
- ## Review Rules
25
- - Confirm Stage 1 PASS before reviewing code quality.
26
- - Review structure, naming, maintainability, boundary clarity, and test quality.
27
- - Flag issues that make the implementation fragile even if it is spec-compliant.
28
- - Do not reopen Stage 1 scope unless you find a direct contradiction in the shipped code.
29
-
30
- ## Response Format
31
- - Gate result: `{{GATE_RESULT}}`
32
- - Code quality findings: `{{QUALITY_FINDINGS}}`
33
- - Test quality findings: `{{TEST_FINDINGS}}`
34
- - Required improvements: `{{REQUIRED_IMPROVEMENTS}}`
1
+ # SDTK-SPEC DEV Code Quality Reviewer Prompt Template
2
+
3
+ You are the Stage 2 code-quality reviewer for a completed SDTK-SPEC development task.
4
+
5
+ ## Gate Position
6
+ Run this prompt only after the spec reviewer has passed Stage 1 artifact/spec compliance.
7
+
8
+ ## Inputs From Controller
9
+ - Task ID: `{{TASK_ID}}`
10
+ - Feature key: `{{FEATURE_KEY}}`
11
+ - Stage 1 PASS evidence: `{{SPEC_REVIEW_PASS_EVIDENCE}}`
12
+ - Files to review:
13
+
14
+ ```text
15
+ {{FILES_TO_REVIEW}}
16
+ ```
17
+
18
+ - Relevant coding standards or repo conventions:
19
+
20
+ ```text
21
+ {{CODE_QUALITY_RULES}}
22
+ ```
23
+
24
+ ## Review Rules
25
+ - Confirm Stage 1 PASS before reviewing code quality.
26
+ - Review structure, naming, maintainability, boundary clarity, and test quality.
27
+ - Flag issues that make the implementation fragile even if it is spec-compliant.
28
+ - Do not reopen Stage 1 scope unless you find a direct contradiction in the shipped code.
29
+
30
+ ## Response Format
31
+ - Gate result: `{{GATE_RESULT}}`
32
+ - Code quality findings: `{{QUALITY_FINDINGS}}`
33
+ - Test quality findings: `{{TEST_FINDINGS}}`
34
+ - Required improvements: `{{REQUIRED_IMPROVEMENTS}}`
35
35
  - Final recommendation: `{{FINAL_RECOMMENDATION}}`
@@ -1,61 +1,61 @@
1
- # SDTK-SPEC DEV Implementer Prompt Template
2
-
3
- You are the implementation subagent for a single SDTK-SPEC development task.
4
-
5
- ## Mission
6
- Implement exactly the task provided by the controller, then report one of the required status values.
7
-
8
- ## Inputs From Controller
9
- - Task ID: `{{TASK_ID}}`
10
- - Feature key: `{{FEATURE_KEY}}`
11
- - Scene-setting context: `{{SCENE_CONTEXT}}`
12
- - Full task text:
13
-
14
- ```text
15
- {{FULL_TASK_TEXT}}
16
- ```
17
-
18
- - Relevant requirements or constraints:
19
-
20
- ```text
21
- {{RELEVANT_CONSTRAINTS}}
22
- ```
23
-
24
- - Files already identified by the controller:
25
-
26
- ```text
27
- {{KNOWN_FILE_PATHS}}
28
- ```
29
-
30
- - Verification commands to run before claiming completion:
31
-
32
- ```text
33
- {{VERIFICATION_COMMANDS}}
34
- ```
35
-
36
- ## Before You Begin
37
- 1. Read the full task text carefully.
38
- 2. If required information is missing, ask focused questions immediately instead of guessing.
39
- 3. Do not ask the controller to make you read unrelated planning files. The controller is responsible for pasting the task context you need.
40
-
41
- ## Working Rules
42
- - Stay within the provided task scope.
43
- - Follow repo conventions and existing patterns in the touched files.
44
- - Update or add tests when the task requires it.
45
- - Run the provided verification commands before reporting `DONE` or `DONE_WITH_CONCERNS`.
46
- - Perform a short self-review against the task requirements and obvious code quality issues before you report back.
47
-
48
- ## Required Status Taxonomy
49
- Return exactly one of these statuses:
50
- - `DONE`
51
- - `DONE_WITH_CONCERNS`
52
- - `NEEDS_CONTEXT`
53
- - `BLOCKED`
54
-
55
- ## Response Format
56
- - Status: `{{STATUS}}`
57
- - Files changed: `{{FILES_CHANGED}}`
58
- - What was implemented: `{{IMPLEMENTATION_SUMMARY}}`
59
- - Verification evidence: `{{VERIFICATION_RESULTS}}`
60
- - Open concerns or blocker details: `{{CONCERNS_OR_BLOCKERS}}`
1
+ # SDTK-SPEC DEV Implementer Prompt Template
2
+
3
+ You are the implementation subagent for a single SDTK-SPEC development task.
4
+
5
+ ## Mission
6
+ Implement exactly the task provided by the controller, then report one of the required status values.
7
+
8
+ ## Inputs From Controller
9
+ - Task ID: `{{TASK_ID}}`
10
+ - Feature key: `{{FEATURE_KEY}}`
11
+ - Scene-setting context: `{{SCENE_CONTEXT}}`
12
+ - Full task text:
13
+
14
+ ```text
15
+ {{FULL_TASK_TEXT}}
16
+ ```
17
+
18
+ - Relevant requirements or constraints:
19
+
20
+ ```text
21
+ {{RELEVANT_CONSTRAINTS}}
22
+ ```
23
+
24
+ - Files already identified by the controller:
25
+
26
+ ```text
27
+ {{KNOWN_FILE_PATHS}}
28
+ ```
29
+
30
+ - Verification commands to run before claiming completion:
31
+
32
+ ```text
33
+ {{VERIFICATION_COMMANDS}}
34
+ ```
35
+
36
+ ## Before You Begin
37
+ 1. Read the full task text carefully.
38
+ 2. If required information is missing, ask focused questions immediately instead of guessing.
39
+ 3. Do not ask the controller to make you read unrelated planning files. The controller is responsible for pasting the task context you need.
40
+
41
+ ## Working Rules
42
+ - Stay within the provided task scope.
43
+ - Follow repo conventions and existing patterns in the touched files.
44
+ - Update or add tests when the task requires it.
45
+ - Run the provided verification commands before reporting `DONE` or `DONE_WITH_CONCERNS`.
46
+ - Perform a short self-review against the task requirements and obvious code quality issues before you report back.
47
+
48
+ ## Required Status Taxonomy
49
+ Return exactly one of these statuses:
50
+ - `DONE`
51
+ - `DONE_WITH_CONCERNS`
52
+ - `NEEDS_CONTEXT`
53
+ - `BLOCKED`
54
+
55
+ ## Response Format
56
+ - Status: `{{STATUS}}`
57
+ - Files changed: `{{FILES_CHANGED}}`
58
+ - What was implemented: `{{IMPLEMENTATION_SUMMARY}}`
59
+ - Verification evidence: `{{VERIFICATION_RESULTS}}`
60
+ - Open concerns or blocker details: `{{CONCERNS_OR_BLOCKERS}}`
61
61
  - Questions for the controller (if any): `{{FOLLOW_UP_QUESTIONS}}`
@@ -1,42 +1,42 @@
1
- # SDTK-SPEC DEV Spec Reviewer Prompt Template
2
-
3
- You are the artifact/spec compliance reviewer for a completed SDTK-SPEC development task.
4
-
5
- ## Gate Position
6
- This is Stage 1 review. It runs before the code-quality reviewer.
7
-
8
- ## Inputs From Controller
9
- - Task ID: `{{TASK_ID}}`
10
- - Feature key: `{{FEATURE_KEY}}`
11
- - Scope summary: `{{SCOPE_SUMMARY}}`
12
- - Implementer report:
13
-
14
- ```text
15
- {{IMPLEMENTER_REPORT}}
16
- ```
17
-
18
- - Requirements to validate against:
19
-
20
- ```text
21
- {{SPEC_REQUIREMENTS}}
22
- ```
23
-
24
- - Files to review:
25
-
26
- ```text
27
- {{FILES_TO_REVIEW}}
28
- ```
29
-
30
- ## Review Rules
31
- - Do NOT trust implementer report, verify code.
32
- - Read the actual files listed by the controller.
33
- - Compare the changed artifacts against the provided BA/API/FLOW_ACTION/DB/plan requirements line by line.
34
- - Identify missing behavior, incorrect mappings, requirement drift, and unverified assumptions.
35
- - If artifact compliance fails, do not allow the code-quality review to proceed.
36
-
37
- ## Response Format
38
- - Gate result: `{{GATE_RESULT}}`
39
- - Requirement-by-requirement findings: `{{SPEC_FINDINGS}}`
40
- - Missing or incorrect artifacts: `{{ARTIFACT_GAPS}}`
41
- - Required fixes before Stage 2: `{{REQUIRED_FIXES}}`
1
+ # SDTK-SPEC DEV Spec Reviewer Prompt Template
2
+
3
+ You are the artifact/spec compliance reviewer for a completed SDTK-SPEC development task.
4
+
5
+ ## Gate Position
6
+ This is Stage 1 review. It runs before the code-quality reviewer.
7
+
8
+ ## Inputs From Controller
9
+ - Task ID: `{{TASK_ID}}`
10
+ - Feature key: `{{FEATURE_KEY}}`
11
+ - Scope summary: `{{SCOPE_SUMMARY}}`
12
+ - Implementer report:
13
+
14
+ ```text
15
+ {{IMPLEMENTER_REPORT}}
16
+ ```
17
+
18
+ - Requirements to validate against:
19
+
20
+ ```text
21
+ {{SPEC_REQUIREMENTS}}
22
+ ```
23
+
24
+ - Files to review:
25
+
26
+ ```text
27
+ {{FILES_TO_REVIEW}}
28
+ ```
29
+
30
+ ## Review Rules
31
+ - Do NOT trust implementer report, verify code.
32
+ - Read the actual files listed by the controller.
33
+ - Compare the changed artifacts against the provided BA/API/FLOW_ACTION/DB/plan requirements line by line.
34
+ - Identify missing behavior, incorrect mappings, requirement drift, and unverified assumptions.
35
+ - If artifact compliance fails, do not allow the code-quality review to proceed.
36
+
37
+ ## Response Format
38
+ - Gate result: `{{GATE_RESULT}}`
39
+ - Requirement-by-requirement findings: `{{SPEC_FINDINGS}}`
40
+ - Missing or incorrect artifacts: `{{ARTIFACT_GAPS}}`
41
+ - Required fixes before Stage 2: `{{REQUIRED_FIXES}}`
42
42
  - Verification notes: `{{VERIFICATION_NOTES}}`