@onuraslan/sdd 1.0.5

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 (70) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +184 -0
  3. package/bin/sdd.js +9 -0
  4. package/cli/index.js +74 -0
  5. package/cli/install.js +156 -0
  6. package/cli/prompts.js +98 -0
  7. package/cli/skills.js +56 -0
  8. package/cli/targets.js +69 -0
  9. package/package.json +23 -0
  10. package/sdd/plugin.json +10 -0
  11. package/sdd/skills/chicago-tdd/SKILL.md +26 -0
  12. package/sdd/skills/deep-spec/SKILL.md +69 -0
  13. package/sdd/skills/deep-spec/spec-format.md +32 -0
  14. package/sdd/skills/feature-implementer/SKILL.md +48 -0
  15. package/sdd/skills/feature-implementer/reference/task-implementer.md +5 -0
  16. package/sdd/skills/implementer/SKILL.md +11 -0
  17. package/sdd/skills/prd-test-writer/SKILL.md +86 -0
  18. package/sdd/skills/prd-test-writer/references/user-story-test-writer-prompt.md +12 -0
  19. package/sdd/skills/prd-to-task/SKILL.md +51 -0
  20. package/sdd/skills/prd-to-task/reference/ascii-mock-format.md +67 -0
  21. package/sdd/skills/prd-to-task/reference/feature-template.md +20 -0
  22. package/sdd/skills/prd-to-task/reference/task-template.md +63 -0
  23. package/sdd/skills/spec-to-prd/SKILL.md +76 -0
  24. package/sdd/skills/spec-to-prd/references/mapping-guide.md +95 -0
  25. package/sdd/skills/spec-to-prd/references/prd-format.md +122 -0
  26. package/sdd/skills/workflow-generator/SKILL.md +60 -0
  27. package/sdd/skills/workflow-generator/reference/workflow-bug-fix-backend.md +35 -0
  28. package/sdd/skills/workflow-generator/reference/workflow-bug-fix-frontend.md +34 -0
  29. package/sdd/skills/workflow-generator/reference/workflow-enhancement-backend.md +35 -0
  30. package/sdd/skills/workflow-generator/reference/workflow-enhancement-frontend.md +34 -0
  31. package/sdd/skills/workflow-generator/reference/workflow-feature-development-backend.md +105 -0
  32. package/sdd/skills/workflow-generator/reference/workflow-feature-frontend-development.md +78 -0
  33. package/sdd-backend/plugin.json +10 -0
  34. package/sdd-backend/skills/backend-enhancement/SKILL.md +54 -0
  35. package/sdd-backend/skills/bug-fix-backend/SKILL.md +21 -0
  36. package/sdd-backend/skills/verify-with-curl/SKILL.md +8 -0
  37. package/sdd-frontend/.mcp.json +8 -0
  38. package/sdd-frontend/plugin.json +10 -0
  39. package/sdd-frontend/skills/bug-fix-frontend/SKILL.md +15 -0
  40. package/sdd-frontend/skills/feature-e2e-verifier/SKILL.md +64 -0
  41. package/sdd-frontend/skills/feature-e2e-verifier/reference/e2e-verifier.md +17 -0
  42. package/sdd-frontend/skills/frontend-enhancement/SKILL.md +44 -0
  43. package/sdd-frontend/skills/git-cleanup-playwright-artifacts/SKILL.md +7 -0
  44. package/sdd-frontend/skills/ui-heuristic-click-audit/SKILL.md +168 -0
  45. package/sdd-frontend/skills/ui-heuristic-click-audit/references/checklist.md +72 -0
  46. package/sdd-frontend/skills/using-playwright-mcp/SKILL.md +7 -0
  47. package/sdd-frontend/skills/verify-with-playwright-mcp/SKILL.md +14 -0
  48. package/sdd-utility/plugin.json +10 -0
  49. package/sdd-utility/skills/ask-first/SKILL.md +30 -0
  50. package/sdd-utility/skills/buy-before-build/SKILL.md +11 -0
  51. package/sdd-utility/skills/code-slop-review/SKILL.md +134 -0
  52. package/sdd-utility/skills/code-slop-review/references/agent-prompt.md +110 -0
  53. package/sdd-utility/skills/code-slop-review/references/aggregate-and-report.md +62 -0
  54. package/sdd-utility/skills/code-slop-review/references/architecture-slop.md +126 -0
  55. package/sdd-utility/skills/code-slop-review/references/dead-code-slop.md +107 -0
  56. package/sdd-utility/skills/code-slop-review/references/error-handling-slop.md +101 -0
  57. package/sdd-utility/skills/code-slop-review/references/final-report-template.md +55 -0
  58. package/sdd-utility/skills/code-slop-review/references/fix-mode.md +68 -0
  59. package/sdd-utility/skills/code-slop-review/references/structural-slop.md +150 -0
  60. package/sdd-utility/skills/code-slop-review/references/test-slop.md +88 -0
  61. package/sdd-utility/skills/gap-analysis/SKILL.md +7 -0
  62. package/sdd-utility/skills/glossary-builder/SKILL.md +28 -0
  63. package/sdd-utility/skills/grounded-mode/SKILL.md +13 -0
  64. package/sdd-utility/skills/handoff/SKILL.md +67 -0
  65. package/sdd-utility/skills/handoff-resume/SKILL.md +15 -0
  66. package/sdd-utility/skills/init-feature/SKILL.md +63 -0
  67. package/sdd-utility/skills/init-feature/references/explorer-prompt.md +58 -0
  68. package/sdd-utility/skills/init-feature/references/prd-format.md +122 -0
  69. package/sdd-utility/skills/init-feature/references/prd-writer-prompt.md +23 -0
  70. package/sdd-utility/skills/using-glossary/SKILL.md +11 -0
@@ -0,0 +1,150 @@
1
+ # Layer 1 — Structural Slop Reference
2
+
3
+ AI adds code; it does not refactor. It generates the pattern it saw most often
4
+ in training — not the pattern that fits your architecture.
5
+
6
+ ---
7
+
8
+ ## Pattern 1 — God X (Function / Class / Module / Service)
9
+
10
+ Any single unit that does more than one thing at one level of abstraction —
11
+ i.e., it has multiple responsibilities.
12
+
13
+ ### 1a — God Function
14
+
15
+ A function with multiple responsibilities.
16
+
17
+ **What to flag:**
18
+ - Comment-separated sections inside the function
19
+ - "and" in the function name (fetch_and_save, validate_and_send)
20
+ - Mixed abstraction levels (DB query + string formatting in one function)
21
+ - Deep nesting
22
+ - Too many parameters
23
+
24
+ ### 1b — God Class
25
+
26
+ A class with multiple unrelated responsibilities.
27
+
28
+ **What to flag:**
29
+ - Comment-separated sections
30
+ - Multiple unrelated responsibilities (e.g., DB ops + HTTP + file I/O in one class)
31
+ - Too many public methods
32
+ - Too many instance variables
33
+ - Generic responsibility names: "Manager", "Handler", "Processor", "Service"
34
+
35
+ ### 1c — God Module
36
+
37
+ A module that exports too many unrelated things.
38
+
39
+ **What to flag:**
40
+ - Too many exports
41
+ - Mixed concerns (e.g., date helpers + string helpers + math helpers)
42
+ - Comment-separated sections inside the module
43
+ - Generic file names: utils, helpers, common, shared, misc
44
+
45
+ ### 1d — God Service
46
+
47
+ A service that handles too many business capabilities.
48
+
49
+ **What to flag:**
50
+ - Service handles many distinct business capabilities
51
+ - Service has dependencies on many external services/repos
52
+ - Generic service names: UserService, OrderService, PaymentService
53
+ - Service imports from many other modules
54
+ - Service is imported by more than half the codebase
55
+
56
+ ---
57
+
58
+ ## Pattern 2 — Semantic Duplication
59
+
60
+ The same logic appearing in multiple places with different variable names or entity nouns.
61
+
62
+ **What to flag:**
63
+ - Parallel function shapes with identical structure, differing only by:
64
+ - Column name
65
+ - Role string
66
+ - Entity noun
67
+
68
+ ---
69
+
70
+ ## Pattern 3 — Wrong Abstraction
71
+
72
+ Abstractions introduced because they exist in training data, not because the code needs them.
73
+
74
+ **What to flag:**
75
+ - Interface or base class with exactly one non-test implementor
76
+ - Single-method wrapper class that only delegates
77
+ - Config object used in very few places
78
+
79
+ ---
80
+
81
+ ## Pattern 4 — Scaffolding Remnants
82
+
83
+ Placeholder implementations instead of real logic.
84
+
85
+ **What to flag:**
86
+ - pass statements in non-abstract functions
87
+ - return None / return null when return type is not nullable
88
+ - NotImplementedError / UnsupportedOperationException
89
+ - panic("not implemented") / unimplemented!() / todo!()
90
+ - TODO: implement / placeholder / stub comments
91
+
92
+ ---
93
+
94
+ ## Pattern 5 — Re-Inventing Existing Utilities
95
+
96
+ New helper function for logic that already exists elsewhere in the codebase.
97
+
98
+ **What to flag:**
99
+ - New utility function with a near-identical counterpart already existing
100
+ - New function with similar name/purpose to an existing utility
101
+
102
+ ---
103
+
104
+ ## Detection Checklist
105
+
106
+ ```
107
+ □ Any function with multiple responsibilities?
108
+ □ Any function with comment-separated sections?
109
+ □ Any function with "and" in its name?
110
+ □ Any function with deep nesting?
111
+ □ Any class with multiple unrelated responsibilities?
112
+ □ Any class with comment-separated sections?
113
+ □ Any class with too many public methods or instance variables?
114
+ □ Any class with generic responsibility name?
115
+ □ Any module with too many exports?
116
+ □ Any module with mixed concerns?
117
+ □ Any module with generic name (utils/helpers/common)?
118
+ □ Any service handling too many business capabilities?
119
+ □ Any service with too many external dependencies?
120
+ □ Any semantic duplication (same logic, different names)?
121
+ □ Any interface with exactly one non-test implementor?
122
+ □ Any single-method wrapper class?
123
+ □ Any config object used in very few places?
124
+ □ Any placeholder implementation (pass/null/not implemented)?
125
+ □ Any TODO: implement / placeholder / stub comments?
126
+ □ Any new utility that duplicates an existing one?
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Severity Guide
132
+
133
+ | Finding | Bucket |
134
+ |-------------------------------------|--------------|
135
+ | Function with multiple responsibilities | 🟡 Moderate |
136
+ | Function that is very long | 🟠 Important |
137
+ | Function that is extremely long | 🔴 Critical |
138
+ | Class with multiple responsibilities | 🟡 Moderate |
139
+ | Class that is very long | 🟠 Important |
140
+ | Class that is extremely long | 🔴 Critical |
141
+ | Module with mixed concerns | 🟡 Moderate |
142
+ | Module that is very long | 🟠 Important |
143
+ | Module that is extremely long | 🔴 Critical |
144
+ | Service with many capabilities | 🟠 Important |
145
+ | Semantic duplication (per instance) | 🟠 Important |
146
+ | Interface with single implementor | 🟠 Important |
147
+ | Single-method wrapper class | 🟡 Moderate |
148
+ | Mixed abstraction levels in a unit | 🟠 Important |
149
+ | Scaffolding remnant (placeholder) | 🔴 Critical |
150
+ | Re-invented existing utility | 🟠 Important |
@@ -0,0 +1,88 @@
1
+ # Layer 2 — Test Slop Reference
2
+
3
+ AI-generated tests mirror the implementation — they pass because they were
4
+ written alongside the code, not because they validate behavior.
5
+
6
+ ---
7
+
8
+ ## Pattern 1 — Implementation Mirror Test
9
+
10
+ The test asserts internal state or intermediate values rather than observable
11
+ behavior from the caller's perspective.
12
+
13
+ **What to flag:**
14
+ - Tests that break if you rename a private field or extract a private method
15
+ - Tests that describe how the function does it, not what it guarantees
16
+
17
+ ---
18
+
19
+ ## Pattern 2 — Meaningless Assertions
20
+
21
+ Assertions that always pass or verify nothing actionable.
22
+
23
+ **What to flag:**
24
+ - Checks for non-nullity without verifying content
25
+ - Checks for empty/non-empty without verifying correctness
26
+ - Type checks without behavioral assertions
27
+ - Status code checks without payload assertions
28
+
29
+ ---
30
+
31
+ ## Pattern 3 — Happy Path Only
32
+
33
+ Only the obvious success case is tested.
34
+
35
+ **What to flag (missing tests for):**
36
+ - Empty input
37
+ - Boundary values
38
+ - When dependencies raise exceptions
39
+ - None / null / nil inputs
40
+ - Duplicate values
41
+ - Idempotency (operation called twice)
42
+ - Negative tests (what the function guarantees it will NOT do)
43
+
44
+ ---
45
+
46
+ ## Pattern 4 — Mock Overuse
47
+
48
+ Everything is mocked to make tests pass in isolation, but mocks don't represent real behavior.
49
+
50
+ **What to flag:**
51
+ - Tests that only verify a mock method was called, without checking arguments
52
+ - Tests where mocking makes the assertion trivial
53
+
54
+ ---
55
+
56
+ ## Pattern 5 — No Test Files At All
57
+
58
+ The codebase or module being reviewed has no test files whatsoever.
59
+
60
+ **What to flag:**
61
+ - No test files found in the code scope → single Critical finding
62
+ - Do not run Patterns 1–4 if no tests exist
63
+
64
+ ---
65
+
66
+ ## Detecting Missing Tests
67
+
68
+ **What to check:**
69
+ - All public functions/methods should have corresponding tests
70
+
71
+ **Do NOT flag:**
72
+ - Private helpers
73
+ - Constructors
74
+ - Property getters
75
+ - Dunder/magic methods
76
+
77
+ ---
78
+
79
+ ## Severity Guide
80
+
81
+ | Finding | Bucket |
82
+ |----------------------------------------------|--------------|
83
+ | Implementation mirror assertion | 🟠 Important |
84
+ | Meaningless assertion | 🟡 Moderate |
85
+ | Happy path only (missing error cases) | 🟠 Important |
86
+ | Mock overuse (no meaningful assertion) | 🟡 Moderate |
87
+ | No tests at all for a public function | 🟠 Important |
88
+ | No test files exist in the codebase/module | 🔴 Critical |
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: gap-analysis
3
+ description: Compare implementation results against requirements to find missing or incorrect work.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ Ask the user for the **Requirement** (which file contains the requirements/specs). Then ask for the **Implementation** (what to analyze: git diff, specific commits, a branch, or a file/directory path). Read the requirement file to understand what should be implemented. Run the appropriate git diff command to gather the implementation changes. Analyze the diff against the requirements to identify: (1) **Missing** — required changes that weren't implemented, (2) **Extra** — unnecessary additions or changes not in the requirements, and (3) **Incorrect** — changes that don't match the requirements. Present findings to the user and ask if they want to apply fixes. If yes, fix the code and tests as needed.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: glossary-builder
3
+ description: Build and maintain a shared project glossary for consistent terminology.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ Auto-detect language and respond in the same language. One term at a time: ask which term, search the codebase for every plausible match, then show them as a numbered list plus an "I'll define it myself" option. If only one match exists, still confirm it rather than assuming; if zero matches exist, skip straight to the "define it myself" option. If the term already exists in the glossary, treat this as an update: re-search, show fresh candidates, replace the old entry in place — don't duplicate it. Once the user picks, save the file, ask "another term?", and repeat until done.
8
+
9
+ ---
10
+
11
+ ## Output Format
12
+
13
+ Save to `docs/sdd/domain-glossary.md` in the project root. One simple sentence per term: what it means → what it maps to.
14
+
15
+ ```markdown
16
+ # Domain Glossary
17
+ _Generated: [date] | [N] terms | [N] mapped | [N] unmapped_
18
+
19
+ ---
20
+
21
+ **Order** — A customer's request to purchase one or more products. Maps to `OrderAggregate`.
22
+
23
+ **Order Status** — The current stage of an order's lifecycle (pending, paid, shipped, etc). Maps to `OrderStatus` enum.
24
+
25
+ **Payment** — A transaction confirming funds received for an order. (No code match — defined by user.)
26
+
27
+ ---
28
+ ```
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: grounded-mode
3
+ description: Persistent grounded response mode that can be enabled or disabled by the user.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ When enabled: state confirmed facts as facts. Clearly label any inference and briefly explain the evidence or reasoning behind it. If evidence is insufficient, say so instead of guessing. Never fabricate information or present speculation as fact. Format responses using these sections when relevant:
8
+
9
+ ✓ Confirmed
10
+ → Inference
11
+ ? Uncertain
12
+
13
+ Omit any section that does not apply. Stay in this mode until explicitly disabled.
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: handoff
3
+ description: Capture session context and decisions for another agent or follow-up session.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Handoff
8
+
9
+ Goal: minimize context loss after `/clear`. `/compact` summarizes context but doesn't preserve things that never made it into the repo — why a certain approach was chosen, which paths were tried and abandoned, etc. This skill writes only the information that **cannot be recovered by reading the repo** (git log, git diff, file contents) to `docs/sdd/handoff.md`.
10
+
11
+ Use `handoff-resume` skill to read the handoff file in a new session.
12
+
13
+ 1. `mkdir -p docs/sdd` (create if missing).
14
+ 2. Review the entire session (conversation + tool calls made).
15
+ 3. Apply this filter to every candidate item:
16
+ - **"Could I recover this by reading `git log`, `git diff`, or the files themselves?"** → Yes → don't write it.
17
+ - **"Is this already documented in `CLAUDE.md` (project settings, user preferences, constraints)?"** → Yes → don't write it; those are already in the repo.
18
+ - No to both → write it into handoff.md.
19
+ - **Question asked to the user but never answered** → always include it in *Open questions*, transcribed **verbatim** (exact wording, no paraphrasing). This cannot be recovered from the repo, and the exact wording is needed so the next session can re-pose it and continue from the exact point of interruption.
20
+ 4. Generate `docs/sdd/handoff.md` **from scratch** (overwrite if exists) using the template below.
21
+ 5. Give the user a short confirmation: summarize what was written in 2-3 lines, then tell them it's safe to run `/clear`.
22
+
23
+ ### Template
24
+
25
+ ```markdown
26
+ # Handoff — <date, e.g. 2026-07-01>
27
+
28
+ ## Context
29
+ - Topic/epic being worked on: <short title>
30
+
31
+ ## Completed This Session
32
+ - <bullet points, referencing the relevant commit/file, one line each>
33
+
34
+ ## Context Not Recoverable From the Repo
35
+
36
+ ### Decisions and rationale
37
+ - <why this approach was chosen, what alternatives were considered and why they were rejected>
38
+
39
+ ### Tried and abandoned approaches
40
+ - <so they aren't retried — what was tried, why it didn't work or was dropped>
41
+
42
+ ### User preferences / constraints
43
+ - <preferences or constraints stated in conversation that never made it into code or comments>
44
+
45
+ ### Discovered gotchas / constraints
46
+ - <environment quirks, third-party library behavior, API quirks, performance findings — anything not written into the code>
47
+
48
+ ### Open questions
49
+ - <every question asked of the user in this session that still has no definitive answer — quoted verbatim, exactly as it was asked, in the order asked. Do not paraphrase or summarize. If there are none, remove this heading entirely.>
50
+
51
+ ## Next Steps
52
+ 1. <concrete, actionable, in order — if Open questions is non-empty, the first step must be to re-pose those questions verbatim to the user and wait for answers before starting other work>
53
+ 2. ...
54
+
55
+ ## Verification
56
+ - <if applicable: how to test/reproduce — only if not already documented in the repo>
57
+ ```
58
+
59
+ Don't leave empty sections in the template — if there are no abandoned approaches, remove that heading entirely rather than leaving it blank.
60
+
61
+ ---
62
+
63
+ ## Notes
64
+
65
+ - This skill doesn't replace `/compact` — it's a manual "context transfer" step around `/clear`.
66
+ - The "Context Not Recoverable From the Repo" section is the entire point of this skill — never put anything there that `git` could already surface (file listings, diff contents, commit messages).
67
+
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: handoff-resume
3
+ description: Resume work from a previous handoff document and recover session context.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Handoff Resume
8
+
9
+ Goal: quickly restore session context by reading `docs/sdd/handoff.md` at the start of a new session.
10
+
11
+ 1. Read `docs/sdd/handoff.md`.
12
+ 2. Absorb the content silently into context — don't dump the raw file back at the user.
13
+ 3. Give a short confirmation summary (3-5 lines): what the last state was, which decisions/constraints still apply, what the next step is.
14
+ 4. State that you're ready to continue from the first item in "Next Steps", then wait for the user's confirmation before doing anything else — never continue on your own.
15
+ 5. Delete `docs/sdd/handoff.md`.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: init-feature
3
+ description: Initialize a new feature with the required structure and starting artifacts.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ Scan the codebase to identify existing features and spawn subagents to write PRDs for each.
8
+
9
+ ---
10
+
11
+ ## Workflow
12
+
13
+ ### Step 1: External Interface Analysis
14
+
15
+ **Announce:** "Step 1: Analyzing external interfaces..."
16
+
17
+ Analyze the codebase to identify architectural layers and external interfaces. Show layers as ASCII diagram and list all bottom external interfaces.
18
+
19
+ Wait for user confirmation.
20
+
21
+ ---
22
+
23
+ ### Step 2: Discover Features (Explore Agent)
24
+
25
+ **Announce:** "Step 2: Discovering features..."
26
+
27
+ Spawn an Explore subagent with the prompt from [references/explorer-prompt.md](references/explorer-prompt.md).
28
+
29
+ Pass the layer structure and bottom external interfaces from Step 1 as input context.
30
+
31
+ Wait for the Explore agent to complete.
32
+
33
+ ---
34
+
35
+ ### Step 3: Present Findings to User
36
+
37
+ Show the user the list of identified features:
38
+
39
+ Which features should I generate PRDs for? (e.g., "1,3,4" or "all" or "none")
40
+
41
+ Wait for user to specify which features to process. Do not proceed without explicit confirmation.
42
+
43
+ ---
44
+
45
+ ### Step 4: Spawn PRD Writer Subagents
46
+
47
+ **Announce:** "Step 4: Spawning PRD writer subagents..."
48
+
49
+ For each confirmed feature:
50
+
51
+ 1. Spawn an Explore subagent with the prompt from [references/prd-writer-prompt.md](references/prd-writer-prompt.md)
52
+ 2. Replace `[feature name]`, `[feature key]`, and `[feature description]` placeholders with actual values from Step 3
53
+ 3. Run all subagents in parallel
54
+
55
+ Wait for all subagents to complete.
56
+
57
+ ---
58
+
59
+ ### Step 5: Report Results
60
+
61
+ **Announce:** "Step 5: PRD generation complete"
62
+
63
+ Report to the user.
@@ -0,0 +1,58 @@
1
+ Task tool (explore):
2
+ description: "Identify features by tracing vertical slices from top layer to bottom external interfaces"
3
+
4
+ prompt:
5
+ ```
6
+ Explore the codebase to identify features by tracing flows from top layer to bottom external interfaces.
7
+
8
+ ## Input Context
9
+
10
+ You will be given:
11
+ - **Layer structure:** [from External Interface Analysis]
12
+ - **Bottom external interfaces:** [from External Interface Analysis]
13
+
14
+ ## CRITICAL: Exploration Discipline
15
+
16
+ - **You are a photographer, not an interior designer.** Document what exists — full stop.
17
+ - Describe **ONLY** what exists — no improvements, alternatives, or prescriptive language
18
+ - Avoid: `should`, `could`, `would be better if`, `olmalı`, `daha iyi olur`
19
+
20
+ ## Trace Vertical Slices
21
+
22
+ A **vertical slice** is a complete flow from one top interface (entry point) to one bottom external interface.
23
+
24
+ For each vertical slice, identify:
25
+ 1. **Entry point:** Which route/page/component starts this flow?
26
+ 2. **Path:** What components/handlers/services does it traverse?
27
+ 3. **Exit point:** Which bottom external interface does it reach?
28
+
29
+ ## Group Vertical Slices into Features
30
+
31
+ **Key Rule:** Vertical slices that share the same **user capability** or **data boundary** belong to the same feature.
32
+
33
+ Group vertical slices by:
34
+ - **User Journey:** What complete user capability does this enable?
35
+ - **Data Boundary:** What records/entities does this operate on?
36
+ - **Entry Point Proximity:** Where does the user interact?
37
+
38
+ | ✅ Group Together | ❌ Don't Group By |
39
+ |-------------------|-------------------|
40
+ | "Create, view, edit, delete User" | Technical layers (UI/API/DB) |
41
+ | "All auth-related flows" | File types |
42
+ | Same entity/aggregate | Implementation steps |
43
+ | | Separate CRUD operations |
44
+
45
+ Assign a **feature key** to each group: lowercase, hyphen-separated (e.g., `auth`, `user-management`, `catalog`).
46
+
47
+ ## Report Format
48
+
49
+ For each **feature** (group of vertical slices):
50
+
51
+ - **Feature key:** `feature-key`
52
+ - **Feature name:** (generic, user-capability based)
53
+ - **Vertical slices included:** [list of top→bottom flows]
54
+ - **Entry points:** [routes, pages, components]
55
+ - **Bottom interfaces:** [DB tables, external APIs touched]
56
+ - **Current behavior:** [what the feature does, no commentary]
57
+ - **Data flow:** [how data moves through vertical slices]
58
+ ```
@@ -0,0 +1,122 @@
1
+ # PRD Template
2
+
3
+ Generate the following file at `docs/sdd/features/<feature-name>/prd.md`:
4
+
5
+ ```markdown
6
+ # PRD: [Feature Name]
7
+
8
+ | Metadata | Value |
9
+ |----------|-------|
10
+ | Status | Draft / In Review / Approved |
11
+ | Version | 1.0 |
12
+ | Created | YYYY-MM-DD |
13
+ | Owner | [Product Owner / Team] |
14
+
15
+ ---
16
+
17
+ ## 1. Executive Summary
18
+
19
+ [2-3 sentences summarizing what this feature does and why it matters. Written for executives/stakeholders who won't read the full document.]
20
+
21
+ ---
22
+
23
+ ## 2. Problem Statement
24
+
25
+ [What user problem or business need does this feature address? Include current pain points and impact.]
26
+
27
+ ### 2.1 Current State
28
+ [Describe the current situation without this feature]
29
+
30
+ ### 2.2 Desired State
31
+ [Describe the desired situation after this feature is delivered]
32
+
33
+ ---
34
+
35
+ ## 3. Goals & Objectives
36
+
37
+ ### 3.1 Primary Goals
38
+ - [Goal 1: Measurable outcome]
39
+ - [Goal 2: Measurable outcome]
40
+
41
+ ### 3.2 Non-Goals
42
+ [What this feature explicitly does NOT do - important for scope management]
43
+
44
+ ---
45
+
46
+ ## 4. Success Metrics
47
+
48
+ [How will you measure if this feature is successful? Include baseline, target, and time horizon.]
49
+
50
+ | Metric | Baseline | Target | Time Horizon | Measurement Method |
51
+ |--------|----------|--------|--------------|-------------------|
52
+ | [Metric name] | [Current value] | [Target value] | [Timeframe] | [How you'll measure] |
53
+
54
+ ---
55
+
56
+ ## 5. User Stories
57
+
58
+ | ID | User Story | Acceptance Criteria | Priority |
59
+ |----|------------|---------------------|----------|
60
+ | US-01 | As a [user], I want to [action], so that [benefit] | - [Criterion 1]<br>- [Criterion 2] | Must have / Should have / Could have |
61
+ | US-02 | As a [user], I want to [action], so that [benefit] | - [Criterion 1]<br>- [Criterion 2] | Must have / Should have / Could have |
62
+
63
+ ---
64
+
65
+ ## 6. Functional Requirements
66
+
67
+ | ID | Requirement | Description | Priority | Dependencies |
68
+ |----|-------------|-------------|----------|--------------|
69
+ | FR-01 | [Title] | [What the system must do] | P0 / P1 / P2 | [Related FR IDs or external deps] |
70
+ | FR-02 | [Title] | [What the system must do] | P0 / P1 / P2 | [Related FR IDs or external deps] |
71
+
72
+ ---
73
+
74
+ ## 7. Non-Functional Requirements
75
+
76
+ ### 7.1 Performance
77
+ - [Response time, throughput, latency requirements]
78
+
79
+ ### 7.2 Security
80
+ - [Authentication, authorization, data protection requirements]
81
+
82
+ ### 7.3 Reliability & Availability
83
+ - [Uptime, error rate, recovery requirements]
84
+
85
+ ### 7.4 Scalability
86
+ - [User load, data volume growth expectations]
87
+
88
+ ### 7.5 Accessibility
89
+ - [WCAG compliance level, assistive technology support]
90
+
91
+ ---
92
+
93
+ ## 8. User Experience & Design
94
+
95
+ ### 8.1 Wireframes / Mockups
96
+ [Link to or embed visual designs, or describe key UI states]
97
+
98
+ ### 8.2 Content & Messaging
99
+ [Key copy, tone, localization requirements]
100
+
101
+ ---
102
+
103
+ ## 9. Technical Considerations
104
+
105
+ [High-level technical approach translated from spec.md design decisions - written for technical stakeholders, not implementation detail]
106
+
107
+ ### 9.1 Integration Points
108
+ [External APIs, services, or systems this feature touches]
109
+
110
+ ### 9.2 Technical Constraints
111
+ [Hard constraints from the spec that affect product decisions]
112
+
113
+ ---
114
+
115
+ ## 10. Open Questions
116
+
117
+ | ID | Question | Context | Decision Needed By | Owner |
118
+ |----|----------|---------|-------------------|-------|
119
+ | Q-01 | [Unresolved question] | [Why it matters] | [Date/milestone] | [Role] |
120
+ ```
121
+
122
+ ---
@@ -0,0 +1,23 @@
1
+ Task tool (general-purpose):
2
+ description: "Writing PRD for `<feature>`..."
3
+
4
+ prompt:
5
+ ```
6
+ You are a PRD Writer. Your task is to write a Product Requirements Document (PRD) for a single feature.
7
+
8
+ ## Input Context
9
+
10
+ You will be given:
11
+ - **Feature Name:** [feature name from codebase scan]
12
+ - **Feature Key:** [feature key from codebase scan]
13
+ - **Feature Description:** [description from codebase scan - current behavior, entry point, data flow]
14
+ - **Current Codebase State:** [explore and understand the current state]
15
+
16
+ ## Your Task
17
+
18
+ Write a comprehensive PRD following the format at [prd-format.md](prd-format.md).
19
+
20
+ ## Output
21
+
22
+ Write the PRD to: `docs/sdd/features/[feature-key]/prd.md`
23
+ ```
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: using-glossary
3
+ description: Use the project glossary to keep terminology consistent during work.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ If `docs/sdd/domain-glossary.md` exists in the project, read it before starting work. Keep its term-to-code mappings in mind for the rest of the task: use the same names the glossary uses, recognize a domain term when the user mentions it, and point to the matching code instead of guessing. If the file doesn't exist, proceed normally — no need to mention it unless the user brings up domain terminology.
8
+
9
+ If the user describes a term in a way that conflicts with its glossary definition, flag the mismatch before proceeding — quote the glossary's definition, point out the difference, and ask which one should hold. Don't silently go with either version.
10
+
11
+ If a term comes up that isn't in the glossary, just do the work — don't suggest adding it unless asked.