sdtk-spec-kit 0.3.9

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 (113) hide show
  1. package/README.md +190 -0
  2. package/assets/manifest/toolkit-bundle.manifest.json +483 -0
  3. package/assets/manifest/toolkit-bundle.sha256.txt +95 -0
  4. package/assets/toolkit/toolkit/AGENTS.md +137 -0
  5. package/assets/toolkit/toolkit/install.ps1 +310 -0
  6. package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +54 -0
  7. package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +32 -0
  8. package/assets/toolkit/toolkit/scripts/generate-code-handoff.ps1 +246 -0
  9. package/assets/toolkit/toolkit/scripts/init-feature.ps1 +261 -0
  10. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +169 -0
  11. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +189 -0
  12. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +139 -0
  13. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +116 -0
  14. package/assets/toolkit/toolkit/sdtk-spec.config.json +28 -0
  15. package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +50 -0
  16. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +84 -0
  17. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +22 -0
  18. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -0
  19. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/FLOWCHART_CREATION_RULES.md +20 -0
  20. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +732 -0
  21. package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +43 -0
  22. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -0
  23. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/FLOWCHART_CREATION_RULES.md +20 -0
  24. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/YAML_CREATION_RULES.md +128 -0
  25. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +83 -0
  26. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +22 -0
  27. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -0
  28. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOWCHART_CREATION_RULES.md +20 -0
  29. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +220 -0
  30. package/assets/toolkit/toolkit/skills/sdtk-arch/references/YAML_CREATION_RULES.md +128 -0
  31. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +29 -0
  32. package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +52 -0
  33. package/assets/toolkit/toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py +246 -0
  34. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +98 -0
  35. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/code-quality-reviewer.md +35 -0
  36. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/implementer.md +61 -0
  37. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/spec-reviewer.md +42 -0
  38. package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +21 -0
  39. package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +19 -0
  40. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +81 -0
  41. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +30 -0
  42. package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +52 -0
  43. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +86 -0
  44. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +220 -0
  45. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md +51 -0
  46. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md +54 -0
  47. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +28 -0
  48. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py +136 -0
  49. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +414 -0
  50. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +74 -0
  51. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md +129 -0
  52. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py +97 -0
  53. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +303 -0
  54. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +90 -0
  55. package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +47 -0
  56. package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +59 -0
  57. package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +50 -0
  58. package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +57 -0
  59. package/assets/toolkit/toolkit/skills-claude/dev/SKILL.md +54 -0
  60. package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +20 -0
  61. package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +18 -0
  62. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +63 -0
  63. package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +52 -0
  64. package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +50 -0
  65. package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +90 -0
  66. package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +61 -0
  67. package/assets/toolkit/toolkit/templates/QUALITY_CHECKLIST.md +121 -0
  68. package/assets/toolkit/toolkit/templates/README.md +63 -0
  69. package/assets/toolkit/toolkit/templates/SHARED_PLANNING.md +81 -0
  70. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +22 -0
  71. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +67 -0
  72. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -0
  73. package/assets/toolkit/toolkit/templates/docs/api/API_ENDPOINTS_TEMPLATE.md +229 -0
  74. package/assets/toolkit/toolkit/templates/docs/api/FEATURE_API_TEMPLATE.yaml +20 -0
  75. package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +20 -0
  76. package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +128 -0
  77. package/assets/toolkit/toolkit/templates/docs/api/feature_api_flow_list_TEMPLATE.txt +12 -0
  78. package/assets/toolkit/toolkit/templates/docs/architecture/ARCH_DESIGN_TEMPLATE.md +109 -0
  79. package/assets/toolkit/toolkit/templates/docs/database/DATABASE_SPEC_TEMPLATE.md +175 -0
  80. package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +60 -0
  81. package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +93 -0
  82. package/assets/toolkit/toolkit/templates/docs/product/BACKLOG_TEMPLATE.md +50 -0
  83. package/assets/toolkit/toolkit/templates/docs/product/PRD_TEMPLATE.md +66 -0
  84. package/assets/toolkit/toolkit/templates/docs/product/PROJECT_INITIATION_TEMPLATE.md +98 -0
  85. package/assets/toolkit/toolkit/templates/docs/qa/QA_RELEASE_REPORT_TEMPLATE.md +61 -0
  86. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md +129 -0
  87. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_TEMPLATE.md +104 -0
  88. package/assets/toolkit/toolkit/templates/docs/specs/BA_SPEC_TEMPLATE.md +139 -0
  89. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +220 -0
  90. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +197 -0
  91. package/assets/toolkit/toolkit/templates/handoffs/ARCH_TO_DEV.md +31 -0
  92. package/assets/toolkit/toolkit/templates/handoffs/BA_TO_ARCH.md +28 -0
  93. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE1_SPEC_REVIEW.md +26 -0
  94. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE2_CODE_QUALITY_REVIEW.md +20 -0
  95. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_QA.md +29 -0
  96. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_SDTK_CODE.md +29 -0
  97. package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +26 -0
  98. package/assets/toolkit/toolkit/templates/handoffs/QA_RELEASE_DECISION.md +21 -0
  99. package/bin/sdtk.js +15 -0
  100. package/package.json +48 -0
  101. package/src/commands/auth.js +85 -0
  102. package/src/commands/generate.js +177 -0
  103. package/src/commands/help.js +101 -0
  104. package/src/commands/init.js +97 -0
  105. package/src/commands/runtime.js +217 -0
  106. package/src/index.js +59 -0
  107. package/src/lib/args.js +116 -0
  108. package/src/lib/errors.js +41 -0
  109. package/src/lib/github-access.js +68 -0
  110. package/src/lib/powershell.js +85 -0
  111. package/src/lib/scope.js +68 -0
  112. package/src/lib/state.js +83 -0
  113. package/src/lib/toolkit-payload.js +99 -0
@@ -0,0 +1,98 @@
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
+
16
+ ## Legacy Prompt Templates
17
+ - `./prompts/implementer.md`
18
+ - `./prompts/spec-reviewer.md`
19
+ - `./prompts/code-quality-reviewer.md`
20
+
21
+ These prompt templates remain in the repo as transition-only manual helper assets.
22
+ They are not the default `/dev` workflow in this wave.
23
+ Use them only when the user explicitly requests a manual legacy review or delegated implementation experiment outside the normal `/dev -> SDTK-CODE` path.
24
+
25
+ ## Process
26
+ 1. Read `ARCH_DESIGN_*` + backlog.
27
+ 2. Read `sdtk-spec.config.json` for project stack + test/lint commands.
28
+ 3. Write or refine `FEATURE_IMPL_PLAN_*`:
29
+ - implementation slices
30
+ - required refs
31
+ - optional refs
32
+ - test obligations
33
+ - blockers and open questions
34
+ 4. If anything is unclear: record OQ-xx in `FEATURE_IMPL_PLAN` and escalate to `@pm` for a decision.
35
+ 5. Decide readiness:
36
+ - `READY_FOR_SDTK_CODE` when the current slice is concrete enough for downstream coding
37
+ - `BLOCKED_FOR_SDTK_CODE` when blockers remain
38
+ 6. Generate `CODE_HANDOFF_*` with `toolkit/scripts/generate-code-handoff.ps1`.
39
+ 7. Mirror the same readiness decision in the final `SDTK-CODE Handoff` section of `FEATURE_IMPL_PLAN`.
40
+ 8. Update `SHARED_PLANNING.md` + `QUALITY_CHECKLIST.md` Phase 4 to show planning/handoff completion status.
41
+ 9. Handoff:
42
+ - if ready: suggest the exact `sdtk-code start --feature-key <KEY> --lane <feature|bugfix> --project-path .` command
43
+ - if blocked: list blockers and keep the work in `/dev`
44
+
45
+ ## Delegated Execution Contract
46
+ - The implementer subagent receives the full task text directly in the prompt when the user explicitly requests manual legacy execution.
47
+ - Required implementer status values:
48
+ - `DONE`
49
+ - `DONE_WITH_CONCERNS`
50
+ - `NEEDS_CONTEXT`
51
+ - `BLOCKED`
52
+ - `DONE_WITH_CONCERNS` means the task is complete but the controller must read the concerns before review.
53
+ - `NEEDS_CONTEXT` means the controller must supply missing information and re-dispatch.
54
+ - `BLOCKED` means do not retry the same task unchanged; resolve the blocker first.
55
+ - The spec reviewer must verify real artifacts, not trust implementer claims.
56
+ - The code-quality reviewer is a second-stage review and must not run before spec compliance passes.
57
+ - This legacy review loop is optional and manual in this wave; it is not the default `/dev` contract.
58
+
59
+ ## Model Selection Guidance
60
+ Choose the cheapest model that can safely complete the task without creating avoidable rework.
61
+
62
+ | Task type | Recommended model tier | Why |
63
+ |---|---|---|
64
+ | Single-file mechanical change with a clear spec | Fast model | Useful for legacy/manual helper tasks, not the default handoff path |
65
+ | Multi-file integration that follows an approved plan | Standard model | Useful when manually validating scope or reviewing downstream constraints |
66
+ | Architecture or design tradeoff for the current implementation slice | Most capable model | Requires judgment and ambiguity handling |
67
+ | Stage 1 artifact/spec review | Standard model | Legacy/manual review aid only |
68
+ | Stage 2 code-quality review | Standard or most capable model | Legacy/manual review aid only |
69
+ | Cross-artifact consistency investigation | Most capable model | Requires broader synthesis across docs and handoff inputs |
70
+
71
+ Blocked-task rule:
72
+ - If an implementer returns `BLOCKED`, do not force the same model to retry the same task unchanged.
73
+ - First resolve missing context or reduce task scope.
74
+ - Escalate to a stronger model only when the blocker is judgment or synthesis bound, not because the prompt was incomplete.
75
+
76
+ ## Verification Before Completion
77
+ Apply `governance/ai/core/SDTK_VERIFICATION_BEFORE_COMPLETION_POLICY.md`.
78
+
79
+ Do not:
80
+ - say the handoff is ready without validating the current refs, blockers, slices, and obligations
81
+ - cite downstream readiness without fresh verification evidence for the claim
82
+ - use `should`, `probably`, or `seems` in place of executed checks
83
+ - rely on partial output, stale command runs, or unchecked agent reports
84
+
85
+ If validation fails or cannot be run, report the handoff as blocked and explain the blocker.
86
+
87
+ ## Order-Critical Hard Gate
88
+ 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.
89
+
90
+ 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.
91
+
92
+ ## Common Mistakes
93
+
94
+ | Mistake | Why it is wrong | Do instead |
95
+ |---|---|---|
96
+ | 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` |
97
+ | 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 |
98
+ | 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 |
@@ -0,0 +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}}`
35
+ - Final recommendation: `{{FINAL_RECOMMENDATION}}`
@@ -0,0 +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}}`
61
+ - Questions for the controller (if any): `{{FOLLOW_UP_QUESTIONS}}`
@@ -0,0 +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}}`
42
+ - Verification notes: `{{VERIFICATION_NOTES}}`
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: sdtk-dev-backend
3
+ description: Generate/modify Python Django REST Framework backend code following the toolkit conventions (models/views/services/serializers/validation/urls/enums). Use when implementing backend features in that project style.
4
+ ---
5
+
6
+ # SDTK-SPEC Backend (Toolkit conventions)
7
+
8
+ ## Critical Constraints
9
+ - I do not generate backend code without approved API and data-contract sources.
10
+ - I do not ignore established repository patterns when adding backend modules.
11
+
12
+ ## Process
13
+ 1. Check whether this repository already has a backend reference module and follow its patterns.
14
+ 2. Follow module structure: `src/backend/<module>/{models,view,service,serializers,validation,enum,urls.py}`.
15
+ 3. Apply conventions:
16
+ - Soft delete via `del_flg`
17
+ - Audit fields (creator/updater/del timestamps)
18
+ - Permission checks before operations
19
+ - `transaction.atomic()` for writes
20
+ - Logging decorator on public endpoints
21
+ 4. Add tests for critical business rules and state transitions.
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: sdtk-dev-frontend
3
+ description: Generate/modify React frontend code following the toolkit conventions (list/register/edit/detail pages, components, services, React Query hooks, permission checks). Use when implementing frontend features in that project style.
4
+ ---
5
+
6
+ # SDTK-SPEC Frontend (Toolkit conventions)
7
+
8
+ ## Critical Constraints
9
+ - I do not implement screens without current layout and flow-action sources.
10
+ - I do not bypass existing frontend patterns for loading, permissions, or labels.
11
+
12
+ ## Process
13
+ 1. Check whether this repository already has a frontend reference module and follow its patterns.
14
+ 2. Follow structure:
15
+ - `src/frontend/features/{feature}/...`
16
+ - `src/frontend/services/{feature}/{feature}Service.js`
17
+ - `src/frontend/services/apiHook/{feature}.js`
18
+ 3. Implement screens based on `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`.
19
+ 4. Preserve patterns: React Query hooks, loading states, permission checks, consistent labels.
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: sdtk-orchestrator
3
+ description: Orchestrate a full 6-phase SDLC multi-agent workflow (PM/BA/ARCH/DEV/QA) using this repo's conventions: SHARED_PLANNING.md + QUALITY_CHECKLIST.md + docs/* artifacts + explicit /dev -> SDTK-CODE -> /qa handoffs.
4
+ ---
5
+
6
+ # SDTK-SPEC Orchestrator (multi-agent workflow)
7
+
8
+ ## Critical Constraints
9
+ - I do not skip mandatory phases or hand off without current-phase evidence.
10
+ - I do not treat planned commands as equivalent to completed work.
11
+
12
+ ## Initialize
13
+ - Ensure feature key + feature name exist (ask if missing).
14
+ - Read `sdtk-spec.config.json` (project stack + commands) if present.
15
+ - If `toolkit/scripts/init-feature.ps1` exists: run it to create skeleton artifacts; otherwise create the same files from `toolkit/templates/`.
16
+
17
+ ## Execute pipeline (one phase per turn)
18
+ - Default role: PM (entry point) if user did not specify.
19
+ - Respect role tags: `/pm`, `/ba`, `/arch`, `/dev`, `/qa`.
20
+ - For each phase:
21
+ - Create/update the phase artifact(s) in `docs/`.
22
+ - If phase is ARCH and API contract/flow is in scope, invoke `sdtk-api-doc` to produce/update `docs/api/[FeaturePascal]_API.yaml`, `docs/api/[FEATURE_KEY]_ENDPOINTS.md`, and `docs/api/[feature_snake]_api_flow_list.txt`.
23
+ - If phase is ARCH and API detail spec is in scope, invoke `sdtk-api-design-spec` to produce/update `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`.
24
+ - If phase is ARCH and UI flow behavior is in scope, invoke `sdtk-screen-design-spec` to produce/update `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`.
25
+ - If phase is DEV, stop at `FEATURE_IMPL_PLAN + CODE_HANDOFF`; do not claim the orchestrator completed downstream code execution.
26
+ - If phase is QA and test-case specification is in scope, invoke `sdtk-test-case-spec` to produce/update `docs/qa/[FEATURE_KEY]_TEST_CASE.md`.
27
+ - Update `SHARED_PLANNING.md` (phase row + activity log).
28
+ - Update `QUALITY_CHECKLIST.md` (mark items PASS/Pending).
29
+ - Produce one clear handoff message to the next role only after the current phase evidence supports that handoff.
30
+
31
+ ## API design detail mode (Hybrid)
32
+ - Read `sdtk-spec.config.json` key: `orchestration.apiDesignDetailMode`.
33
+ - Supported values:
34
+ - `auto` (default): run `sdtk-api-design-spec` when ARCH has API scope and YAML + flow list are available.
35
+ - `on`: always run `sdtk-api-design-spec` for API scope (fail fast if required inputs are missing).
36
+ - `off`: skip API design detail generation unless user explicitly requests it.
37
+
38
+ ## Test-case spec mode (Hybrid)
39
+ - Read `sdtk-spec.config.json` key: `orchestration.testCaseSpecMode`.
40
+ - Supported values:
41
+ - `auto` (default): run `sdtk-test-case-spec` when QA phase requires reusable test-case artifact.
42
+ - `on`: always run `sdtk-test-case-spec` for QA phase (fail fast if required inputs are missing).
43
+ - `off`: skip test-case spec generation unless user explicitly requests it.
44
+
45
+ ## Flow Overview
46
+
47
+ ```dot
48
+ digraph sdtk_orchestrator_flow {
49
+ rankdir=LR;
50
+ PM -> BA;
51
+ BA -> ARCH;
52
+ ARCH -> DEV;
53
+ DEV -> SDTK_CODE [label="CODE_HANDOFF"];
54
+ SDTK_CODE -> QA [label="implementation evidence"];
55
+ QA -> PM;
56
+ }
57
+ ```
58
+
59
+ ## Verification Before Completion
60
+ Apply `governance/ai/core/SDTK_VERIFICATION_BEFORE_COMPLETION_POLICY.md` whenever you mark a phase complete, mark a gate PASS, or hand off to the next role. Require fresh verification evidence before you state that the phase is done.
61
+
62
+ Do not:
63
+ - say a phase is done or PASS without citing the evidence that proves it
64
+ - treat a planned command as equivalent to an executed command
65
+ - hand off DEV or QA work with overstated verification status
66
+
67
+ If the evidence is incomplete, keep the phase open or mark it blocked instead of overstating completion.
68
+
69
+ ## Guardrails
70
+ - Do not skip phases; if prerequisites are missing, ask focused questions.
71
+ - Keep traceability: REQ -> BR/UC/AC -> design -> backlog -> FEATURE_IMPL_PLAN -> CODE_HANDOFF -> downstream implementation evidence -> QA report.
72
+ - Default bridge is `/dev -> SDTK-CODE -> /qa`.
73
+ - If input requirements are VI/JP: preserve original text + add EN translation in appendix for traceability (at least in Project Initiation and BA spec).
74
+
75
+ ## Common Mistakes
76
+
77
+ | Mistake | Why it is wrong | Do instead |
78
+ |---|---|---|
79
+ | Skip directly from PM to DEV because the request seems small | Breaks traceability and removes BA and ARCH controls | Keep phase order unless the user explicitly narrows scope with acceptable evidence |
80
+ | 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 |
81
+ | 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 |
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: sdtk-pm
3
+ description: Product Manager + meta-orchestrator workflow for SDTK-SPEC. Use when you need to start a new feature (Phase 1) or produce PM planning artifacts (PRD + BACKLOG) and update SHARED_PLANNING.md / QUALITY_CHECKLIST.md with correct phase handoffs.
4
+ ---
5
+
6
+ # SDTK-SPEC PM (Entry Point + Planning)
7
+
8
+ ## Critical Constraints
9
+ - I do not hand off PM work until `SHARED_PLANNING.md` and `QUALITY_CHECKLIST.md` reflect the current phase.
10
+ - I do not hide unresolved scope or decision gaps; I record them as `OQ-xx` items for downstream roles.
11
+
12
+ ## Outputs
13
+ - Phase 1: `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md`
14
+ - Phase 2+ (after BA spec): `docs/product/PRD_[FEATURE_KEY].md` + `docs/product/BACKLOG_[FEATURE_KEY].md`
15
+
16
+ ## Process
17
+ 1. Confirm `FEATURE_KEY` + `FEATURE_NAME` + Phase-1 scope in/out.
18
+ 2. Create/update PM artifact(s) using `toolkit/templates/docs/product/*` as structure.
19
+ 3. Ensure REQ-xx list is clear and testable.
20
+ 4. If requirements are provided in VI/JP: keep the original text in an appendix and add an EN translation (literal) for traceability.
21
+ 5. Update `SHARED_PLANNING.md` + `QUALITY_CHECKLIST.md`.
22
+ 6. Handoff:
23
+ - After Project Initiation -> `@ba please analyze ...`
24
+ - After PRD/Backlog -> `@arch please design ...`
25
+
26
+ ## Clarification And Decisions (PM responsibility)
27
+ - Collect OQ-xx items raised by BA/ARCH/DEV/QA in their respective artifacts.
28
+ - Try to resolve OQ-xx using existing docs and reasonable product/tech decisions.
29
+ - If still missing information from the original input: ask the user (final stakeholder) and record the answer as the resolution.
30
+ - Record decisions in PRD `Decision Log` and update OQ-xx `Resolution` fields in the originating docs.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: sdtk-qa
3
+ description: QA workflow for SDTK-SPEC. Use when you need to validate downstream implementation evidence against BA/PRD/Backlog, run quality gates, document defects, and produce a QA_RELEASE_REPORT with a release decision.
4
+ ---
5
+
6
+ # SDTK-SPEC QA (Testing + Release Decision)
7
+
8
+ ## Critical Constraints
9
+ - I do not start QA handoff or release decision work until downstream implementation evidence exists, normally from SDTK-CODE.
10
+ - I do not approve without exact specification quotes and fresh verification evidence.
11
+
12
+ ## Output
13
+ - `docs/qa/QA_RELEASE_REPORT_[FEATURE_KEY].md`
14
+ - Optional (when detailed test design spec is requested):
15
+ - `docs/qa/[FEATURE_KEY]_TEST_CASE.md` via `sdtk-test-case-spec`
16
+
17
+ ## Process
18
+ 1. Validate prerequisites: `FEATURE_IMPL_PLAN`, `CODE_HANDOFF`, and downstream implementation evidence are available and reference the same feature scope.
19
+ 2. Treat SDTK-CODE workflow evidence as the normal bridge into QA, but allow equivalent downstream coding-review evidence when SDTK-CODE is not the implementation owner.
20
+ 3. Create test strategy mapped to UC/AC.
21
+ 4. If test-case specification artifact is required, invoke `sdtk-test-case-spec` and align counts/coverage with release testing scope. Keep the structured TEST_CASE total consistent with the release-report baseline; track E2E separately if needed.
22
+ 5. Apply `governance/ai/core/SDTK_BENCHMARK_QA_MODE_POLICY.md` for benchmark-mode verdict rules when no executable build exists.
23
+ 6. If acceptance criteria / expected behavior is unclear, record OQ-xx in QA report and preserve benchmark-expected ambiguity per `governance/ai/core/SDTK_BENCHMARK_OQ_POLICY.md`; escalate to `@pm` if still missing info.
24
+ 7. Execute the required checks, record the commands used, and capture the actual results (unit/integration/e2e or document review evidence as applicable).
25
+ 8. When validating requirement behavior, quote the exact specification text before recording a match or mismatch.
26
+ 9. Record defects with severity and status.
27
+ 10. Decide: APPROVED vs REJECTED only after fresh verification evidence supports the verdict.
28
+ 11. Update shared state + Phase 5 checklist.
29
+ 12. Handoff: `@pm please finalize release status ...` if approved.
30
+
31
+ ## Verification Before Completion
32
+ Apply `governance/ai/core/SDTK_VERIFICATION_BEFORE_COMPLETION_POLICY.md` and require fresh verification evidence before any QA verdict or handoff.
33
+
34
+ Do not:
35
+ - issue an APPROVED verdict without fresh verification evidence
36
+ - infer PASS from expected behavior, partial logs, or missing runtime access
37
+ - overstate benchmark-mode results as if they were live execution results
38
+
39
+ If the environment cannot run the proving checks, follow the benchmark QA mode policy explicitly and state that the result is not fully verified at runtime.
40
+
41
+ ## Specification Quoting
42
+ When validating a requirement, quote the exact source text before judging the evidence.
43
+
44
+ Use this format:
45
+ - `Spec says: "[exact quote]" -> Evidence: [match/mismatch + file reference]`
46
+
47
+ Apply it to BA, PRD or BACKLOG, ARCH, API, DB, and flow-action sources whenever they define the expected behavior.
48
+
49
+ ## Order-Critical Hard Gate
50
+ Do not start QA handoff, release testing, or release decision work until downstream implementation evidence is documented for the current feature, normally from SDTK-CODE `verify`/`ship` outputs or equivalent coding-review evidence.
51
+
52
+ If downstream implementation evidence is missing or stale, keep the work blocked and request a refreshed downstream handoff before QA starts.
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: sdtk-screen-design-spec
3
+ description: Create/update screen flow-action specifications from requirement sources (Excel/Figma/spec docs), including screen flow PlantUML, UI item/action tables, API mapping tables, and screen-to-API traceability.
4
+ ---
5
+
6
+ # SDTK-SPEC Screen Flow Action Spec
7
+
8
+ ## Critical Constraints
9
+ - I do not finalize UI-scope screens without a valid design source type and reference.
10
+ - I do not leave broken image paths or incomplete API mappings in the flow-action spec.
11
+ - I use new-style PlantUML activity diagram syntax only for the screen flow diagram.
12
+ - I do not mix legacy and new-style PlantUML activity syntax in the screen flow diagram.
13
+ - Do not mix legacy activity syntax such as `(*)`, `-->`, or `[edge label]` with new-style activity actions like `:Activity;`.
14
+ - I keep action-table numbering global across the document even when wireframe markers reset per screen.
15
+
16
+ ## Outputs
17
+ - `docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md`
18
+ - Optional supporting docs:
19
+ - `docs/specs/[FEATURE_KEY]_FIGMA_LAYOUT.md`
20
+ - `docs/specs/[FEATURE_KEY]_DESIGN_SPEC_FROM_EXCEL.md`
21
+ - `docs/specs/assets/[feature_snake]/screens/*`
22
+
23
+ ## Required Inputs
24
+ - Feature key/name
25
+ - Primary requirement sources (BA spec, architecture, customer design docs)
26
+ - Screen source references, using one of these design source modes:
27
+ - `source-backed`: Figma URLs and/or requirement screenshots
28
+ - `generated-draft`: generated layout from `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md` (used when no Figma/screenshot is available for a UI-scope feature)
29
+ - API endpoint source (`docs/api/[FEATURE_KEY]_ENDPOINTS.md`) when available
30
+
31
+ ## Process
32
+ 1. Read requirement sources and identify in-scope screens, dialogs, and transitions.
33
+ 2. Read and apply rules from `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`.
34
+ 3. Determine design source mode per screen:
35
+ - If Figma URL or screenshot exists: use `source-backed`.
36
+ - If no Figma/screenshot but feature has UI scope: use `generated-draft` and reference the corresponding section in `docs/design/DESIGN_LAYOUT_[FEATURE_KEY].md`. That file must exist before finalizing the flow-action spec.
37
+ - If screen has no UI scope: use `none`.
38
+ 4. Build/update section `Feature overview` and `Screen flow action` (PlantUML).
39
+ 5. For each screen/dialog:
40
+ - Add metadata (screen ID, Design Source Type, Design Source Reference)
41
+ - Add screen image reference (from Figma, screenshot, or rendered `.svg` from generated layout)
42
+ - For generated-draft wireframes, add a wireframe-marker mapping table from the screen-local wireframe markers to the global action-table `No`
43
+ - Add UI item/action table with `No` column
44
+ - Add API mapping table (trigger -> API -> data usage)
45
+ 6. Build/update `System processing flow` from use-case and process sources.
46
+ 7. Build/update `Open questions` for unresolved behavior/API/data points.
47
+ 8. Build/update `Screen - API Mapping` summary section.
48
+ 9. Validate:
49
+ - global numbering consistency (no screen-level reset)
50
+ - no broken image paths (for `generated-draft` screens, verify `.svg` exists or use render-skipped note)
51
+ - PlantUML renderability and new-style activity syntax consistency (no `(*)`, `-->`, or `[edge label]` mixing)
52
+ - consistency with API endpoints spec
53
+ - EN artifact hygiene (no VI leftovers, no mojibake, no merged heading lines)
54
+ - for legacy specs with per-screen reset numbering: run renumber migration first
55
+ - every UI-scope screen declares a Design Source Type (`source-backed` or `generated-draft`)
56
+ - every generated-draft screen with an embedded wireframe image includes a wireframe-marker mapping table to the global action-table `No`
57
+ 10. For `generated-draft` screens, set `Screen image:` to the rendered `.svg` path if the file exists:
58
+ - Expected path (filesystem): `docs/specs/assets/<feature_snake>/screens/<screen_id>.svg`
59
+ - Markdown image path (file-relative): `assets/<feature_snake>/screens/<screen_id>.svg`
60
+ - If the `.svg` does not exist (render unavailable), replace the image reference with: `> Screen image not rendered in this environment. See Design Source Reference for layout.`
61
+ 11. For generated-draft screens, treat wireframe markers as screen-local visual references:
62
+ - the local marker sequence may reset per screen
63
+ - do not renumber the wireframe to fake equality with the global action-table `No`
64
+ - publish the mapping table directly under the screen image so reviewers can cross-reference local markers to global action-table numbers
65
+ 12. Update document history and handoff to ARCH/DEV.
66
+
67
+ ## Rule References
68
+ - Core rules: `./references/FLOW_ACTION_SPEC_CREATION_RULES.md`
69
+ - Numbering reference: `./references/numbering-rules.md`
70
+ - Figma reference: `./references/figma-mcp.md`
71
+ - Excel image export reference: `./references/excel-image-export.md`
72
+
73
+ ## Validation Script
74
+ - `scripts/validate_flow_action_spec_numbering.py`
75
+ - Checks duplicate/resetted numbering in action tables.
76
+ - Checks encoding/markdown hygiene.
77
+ - Checks screen-image markdown path convention.
78
+ - Checks mixed legacy/new-style PlantUML activity syntax in screen-flow diagrams.
79
+ - For EN artifacts, run with `--en-check`:
80
+ - `python "toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --en-check`
81
+ - `scripts/renumber_flow_action_spec_global.py`
82
+ - Auto-migrates action table `No` fields to global numbering.
83
+ - Dry-run:
84
+ - `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md"`
85
+ - Apply:
86
+ - `python "toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py" --spec "docs/specs/[FEATURE_KEY]_FLOW_ACTION_SPEC.md" --write`