@zigrivers/scaffold 2.1.2 → 2.28.1

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 (97) hide show
  1. package/README.md +272 -59
  2. package/knowledge/core/adr-craft.md +53 -0
  3. package/knowledge/core/ai-memory-management.md +246 -0
  4. package/knowledge/core/api-design.md +4 -0
  5. package/knowledge/core/claude-md-patterns.md +254 -0
  6. package/knowledge/core/coding-conventions.md +246 -0
  7. package/knowledge/core/database-design.md +4 -0
  8. package/knowledge/core/design-system-tokens.md +465 -0
  9. package/knowledge/core/dev-environment.md +223 -0
  10. package/knowledge/core/domain-modeling.md +4 -0
  11. package/knowledge/core/eval-craft.md +1008 -0
  12. package/knowledge/core/multi-model-review-dispatch.md +250 -0
  13. package/knowledge/core/operations-runbook.md +37 -226
  14. package/knowledge/core/project-structure-patterns.md +231 -0
  15. package/knowledge/core/review-step-template.md +247 -0
  16. package/knowledge/core/{security-review.md → security-best-practices.md} +5 -1
  17. package/knowledge/core/task-decomposition.md +57 -34
  18. package/knowledge/core/task-tracking.md +225 -0
  19. package/knowledge/core/tech-stack-selection.md +214 -0
  20. package/knowledge/core/testing-strategy.md +63 -70
  21. package/knowledge/core/user-stories.md +69 -60
  22. package/knowledge/core/user-story-innovation.md +57 -0
  23. package/knowledge/core/ux-specification.md +5 -148
  24. package/knowledge/finalization/apply-fixes-and-freeze.md +165 -14
  25. package/knowledge/product/prd-craft.md +55 -34
  26. package/knowledge/review/review-adr.md +32 -0
  27. package/knowledge/review/{review-api-contracts.md → review-api-design.md} +34 -1
  28. package/knowledge/review/{review-database-schema.md → review-database-design.md} +27 -1
  29. package/knowledge/review/review-domain-modeling.md +33 -0
  30. package/knowledge/review/review-implementation-tasks.md +50 -0
  31. package/knowledge/review/review-operations.md +55 -0
  32. package/knowledge/review/review-prd.md +33 -0
  33. package/knowledge/review/review-security.md +53 -0
  34. package/knowledge/review/review-system-architecture.md +28 -0
  35. package/knowledge/review/review-testing-strategy.md +51 -0
  36. package/knowledge/review/review-user-stories.md +54 -0
  37. package/knowledge/review/{review-ux-spec.md → review-ux-specification.md} +37 -1
  38. package/methodology/custom-defaults.yml +32 -3
  39. package/methodology/deep.yml +32 -3
  40. package/methodology/mvp.yml +32 -3
  41. package/package.json +2 -1
  42. package/pipeline/architecture/review-architecture.md +18 -6
  43. package/pipeline/architecture/system-architecture.md +14 -2
  44. package/pipeline/consolidation/claude-md-optimization.md +73 -0
  45. package/pipeline/consolidation/workflow-audit.md +73 -0
  46. package/pipeline/decisions/adrs.md +14 -2
  47. package/pipeline/decisions/review-adrs.md +18 -5
  48. package/pipeline/environment/ai-memory-setup.md +70 -0
  49. package/pipeline/environment/automated-pr-review.md +70 -0
  50. package/pipeline/environment/design-system.md +73 -0
  51. package/pipeline/environment/dev-env-setup.md +65 -0
  52. package/pipeline/environment/git-workflow.md +71 -0
  53. package/pipeline/finalization/apply-fixes-and-freeze.md +1 -1
  54. package/pipeline/finalization/developer-onboarding-guide.md +1 -1
  55. package/pipeline/finalization/implementation-playbook.md +3 -3
  56. package/pipeline/foundation/beads.md +68 -0
  57. package/pipeline/foundation/coding-standards.md +68 -0
  58. package/pipeline/foundation/project-structure.md +69 -0
  59. package/pipeline/foundation/tdd.md +60 -0
  60. package/pipeline/foundation/tech-stack.md +74 -0
  61. package/pipeline/integration/add-e2e-testing.md +65 -0
  62. package/pipeline/modeling/domain-modeling.md +14 -2
  63. package/pipeline/modeling/review-domain-modeling.md +18 -5
  64. package/pipeline/parity/platform-parity-review.md +70 -0
  65. package/pipeline/planning/implementation-plan-review.md +56 -0
  66. package/pipeline/planning/{implementation-tasks.md → implementation-plan.md} +29 -9
  67. package/pipeline/pre/create-prd.md +13 -4
  68. package/pipeline/pre/innovate-prd.md +37 -8
  69. package/pipeline/pre/innovate-user-stories.md +38 -7
  70. package/pipeline/pre/review-prd.md +18 -6
  71. package/pipeline/pre/review-user-stories.md +23 -6
  72. package/pipeline/pre/user-stories.md +12 -2
  73. package/pipeline/quality/create-evals.md +102 -0
  74. package/pipeline/quality/operations.md +38 -13
  75. package/pipeline/quality/review-operations.md +17 -5
  76. package/pipeline/quality/review-security.md +17 -5
  77. package/pipeline/quality/review-testing.md +20 -8
  78. package/pipeline/quality/security.md +25 -3
  79. package/pipeline/quality/story-tests.md +73 -0
  80. package/pipeline/specification/api-contracts.md +17 -2
  81. package/pipeline/specification/database-schema.md +17 -2
  82. package/pipeline/specification/review-api.md +18 -6
  83. package/pipeline/specification/review-database.md +18 -6
  84. package/pipeline/specification/review-ux.md +19 -7
  85. package/pipeline/specification/ux-spec.md +29 -10
  86. package/pipeline/validation/critical-path-walkthrough.md +34 -7
  87. package/pipeline/validation/cross-phase-consistency.md +34 -7
  88. package/pipeline/validation/decision-completeness.md +34 -7
  89. package/pipeline/validation/dependency-graph-validation.md +34 -7
  90. package/pipeline/validation/implementability-dry-run.md +34 -7
  91. package/pipeline/validation/scope-creep-check.md +34 -7
  92. package/pipeline/validation/traceability-matrix.md +34 -7
  93. package/skills/multi-model-dispatch/SKILL.md +326 -0
  94. package/skills/scaffold-pipeline/SKILL.md +195 -0
  95. package/skills/scaffold-runner/SKILL.md +465 -0
  96. package/pipeline/planning/review-tasks.md +0 -38
  97. package/pipeline/quality/testing-strategy.md +0 -42
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ux-specification
3
- description: UX documentation patterns, design systems, accessibility, and component architecture
4
- topics: [ux, design-system, accessibility, wireframes, user-flows, responsive-design, components]
3
+ description: UX documentation patterns — user flows, interaction states, component architecture, accessibility, and responsive behavior
4
+ topics: [ux, accessibility, wireframes, user-flows, responsive-design, components, interaction-states]
5
5
  ---
6
6
 
7
7
  ## User Flow Documentation
@@ -128,148 +128,11 @@ Define how data flows through the component tree:
128
128
 
129
129
  **Promotion rule:** A component starts as page-specific. When a second feature needs the same component, promote it to shared. Don't pre-optimize by making everything shared from the start.
130
130
 
131
- ## Design System
131
+ ## Design System Reference
132
132
 
133
- A design system is the set of constraints and building blocks that ensure visual consistency across the entire application. It includes design tokens, base components, and usage patterns.
133
+ Design tokens (colors, typography, spacing, borders, shadows), base component visual specs, dark mode patterns, and the pattern library are defined in `docs/design-system.md`. The UX specification consumes these tokens it does not redefine them.
134
134
 
135
- ### Design Tokens
136
-
137
- Design tokens are the atomic values that define the visual language. They are variables, not hard-coded values. Every visual property in the application references a token.
138
-
139
- **Color tokens:**
140
-
141
- ```
142
- --color-primary: #2563EB // Main brand/action color
143
- --color-primary-hover: #1D4ED8 // Interactive state
144
- --color-primary-light: #DBEAFE // Backgrounds, subtle highlights
145
-
146
- --color-secondary: #7C3AED // Supporting brand color
147
-
148
- --color-neutral-50: #FAFAFA // Lightest background
149
- --color-neutral-100: #F5F5F5 // Card backgrounds
150
- --color-neutral-200: #E5E5E5 // Borders
151
- --color-neutral-400: #A3A3A3 // Muted text, placeholders
152
- --color-neutral-700: #404040 // Secondary text
153
- --color-neutral-900: #171717 // Primary text
154
-
155
- --color-success: #16A34A // Success states, positive actions
156
- --color-warning: #CA8A04 // Warning states, caution
157
- --color-error: #DC2626 // Error states, destructive actions
158
- --color-info: #2563EB // Informational states
159
- ```
160
-
161
- **Typography tokens:**
162
-
163
- ```
164
- --font-family: 'Inter', system-ui, sans-serif
165
-
166
- --text-xs: 0.75rem // 12px — fine print, labels
167
- --text-sm: 0.875rem // 14px — secondary text, table cells
168
- --text-base: 1rem // 16px — body text
169
- --text-lg: 1.125rem // 18px — subheadings
170
- --text-xl: 1.25rem // 20px — section titles
171
- --text-2xl: 1.5rem // 24px — page titles
172
- --text-3xl: 1.875rem // 30px — hero text
173
-
174
- --font-weight-normal: 400
175
- --font-weight-medium: 500
176
- --font-weight-semibold: 600
177
- --font-weight-bold: 700
178
-
179
- --line-height-tight: 1.25
180
- --line-height-normal: 1.5
181
- --line-height-relaxed: 1.75
182
- ```
183
-
184
- **Spacing tokens:**
185
-
186
- ```
187
- --space-1: 0.25rem // 4px — tight gaps (icon to label)
188
- --space-2: 0.5rem // 8px — compact spacing (list items)
189
- --space-3: 0.75rem // 12px — default padding (buttons, inputs)
190
- --space-4: 1rem // 16px — standard spacing (form fields)
191
- --space-6: 1.5rem // 24px — section padding
192
- --space-8: 2rem // 32px — large gaps
193
- --space-12: 3rem // 48px — section separators
194
- --space-16: 4rem // 64px — page-level spacing
195
- ```
196
-
197
- **Border and shadow tokens:**
198
-
199
- ```
200
- --radius-sm: 0.25rem // 4px — subtle rounding (tags, badges)
201
- --radius-md: 0.5rem // 8px — standard rounding (cards, inputs, buttons)
202
- --radius-lg: 0.75rem // 12px — prominent rounding (modals, panels)
203
- --radius-full: 9999px // Pill shapes, avatars
204
-
205
- --shadow-sm: 0 1px 2px rgba(0,0,0,0.05)
206
- --shadow-md: 0 4px 6px rgba(0,0,0,0.07)
207
- --shadow-lg: 0 10px 15px rgba(0,0,0,0.1)
208
- --shadow-xl: 0 20px 25px rgba(0,0,0,0.1)
209
- ```
210
-
211
- ### Dark Mode
212
-
213
- When dark mode is required, define a parallel set of semantic tokens that switch based on the color scheme:
214
-
215
- ```css
216
- :root {
217
- --bg-primary: var(--color-neutral-50);
218
- --bg-card: white;
219
- --text-primary: var(--color-neutral-900);
220
- --text-secondary: var(--color-neutral-700);
221
- --border-default: var(--color-neutral-200);
222
- }
223
-
224
- @media (prefers-color-scheme: dark) {
225
- :root {
226
- --bg-primary: var(--color-neutral-900);
227
- --bg-card: var(--color-neutral-800);
228
- --text-primary: var(--color-neutral-50);
229
- --text-secondary: var(--color-neutral-400);
230
- --border-default: var(--color-neutral-700);
231
- }
232
- }
233
- ```
234
-
235
- Use semantic tokens (`--bg-primary`, `--text-primary`) in components, not raw color tokens. This makes dark mode automatic.
236
-
237
- ### Base Components
238
-
239
- Define the standard appearance and behavior for every common component:
240
-
241
- **Buttons:**
242
- - Variants: Primary (solid fill), Secondary (subtle fill), Outline (border only), Ghost (no border), Destructive (red/danger)
243
- - Sizes: sm (28px height), md (36px height), lg (44px height)
244
- - States: default, hover, active, focused, disabled, loading
245
- - Loading state replaces label with spinner, disables interaction
246
-
247
- **Form elements:**
248
- - All inputs: border, focus ring, error state (red border + error message below), disabled state (reduced opacity)
249
- - Labels: always visible (never placeholder-only), required indicator (asterisk or "(required)")
250
- - Help text: below input, muted color, explains what the field expects
251
- - Error messages: below input, error color, describes what went wrong and how to fix it
252
-
253
- **Cards:**
254
- - Default: white/card background, subtle shadow or border, rounded corners
255
- - Interactive: hover state (shadow increase or border color change), cursor pointer
256
- - Header/footer sections: visually separated, structured content areas
257
-
258
- **Feedback:**
259
- - Toast notifications: temporary, non-blocking, auto-dismiss (with manual dismiss option)
260
- - Alert banners: persistent until dismissed, full-width or contained within a section
261
- - Empty states: illustration or icon, explanatory text, call-to-action button
262
- - Loading: skeleton loaders (preferred over spinners for content areas), spinner for actions
263
-
264
- ### Pattern Library
265
-
266
- Document recurring UI patterns with implementation guidance:
267
-
268
- - **Search with autocomplete:** Debounced input, dropdown results, keyboard navigation, "no results" state
269
- - **Confirmation dialogs:** Before destructive actions, clearly state what will happen, "Cancel" as primary action (preventing accidents)
270
- - **Inline editing:** Click to edit, Enter to save, Escape to cancel, loading indicator during save
271
- - **Bulk actions:** Select all, individual select, action toolbar appears when items selected
272
- - **Wizard/stepper:** Progress indicator, back/next navigation, save progress between steps
135
+ When specifying component behavior in user flows and interaction states, reference design system tokens by name (e.g., `--color-error`, `--space-4`) rather than hard-coding values. If `docs/design-system.md` does not exist yet, note which tokens are needed and defer visual decisions to the design-system step.
273
136
 
274
137
  ## Accessibility
275
138
 
@@ -367,14 +230,8 @@ Mobile touch targets must be at least 44x44px (Apple) or 48x48px (Material). Ens
367
230
 
368
231
  **Accessibility as afterthought.** Building the entire UI first, then trying to add accessibility. Results in ARIA hacks layered on top of inaccessible markup. Fix: use semantic HTML from the start. Test keyboard navigation during development, not after.
369
232
 
370
- **Inconsistent spacing and typography.** Five different font sizes that are all "kind of like body text." Spacing that varies randomly between 12px and 17px with no system. Fix: define a spacing scale and type scale in the design system. Only use values from the scale.
371
-
372
- **Placeholder text as labels.** Using placeholder text instead of labels for form fields. Placeholders disappear when the user starts typing, leaving them with no indication of what the field expects. Fix: always use visible labels. Placeholders are supplementary hints, not replacements for labels.
373
-
374
233
  **Missing loading states.** The page shows nothing (white screen) while data loads, then content pops in. Users think the app is broken. Fix: use skeleton loaders that match the shape of the content being loaded.
375
234
 
376
- **Ignoring touch targets on mobile.** Tiny links and buttons that require precise finger tapping. Fix: ensure all interactive elements meet minimum 44x44px touch target size on mobile.
377
-
378
235
  **Breaking text on resize.** Content that looks fine at the design width but overflows, truncates, or overlaps at other widths. Fix: test with variable-length content and multiple viewport widths. Use CSS that handles overflow gracefully (truncation with ellipsis, wrapping, or scrolling).
379
236
 
380
237
  **Modal abuse.** Using modals for content that should be a page (long forms, complex workflows, multi-step processes). Modals are for brief, focused interactions. Fix: if the modal content would benefit from a back button or URL, it should be a page.
@@ -30,44 +30,148 @@ Minor polish, documentation gaps that don't affect implementation correctness, a
30
30
 
31
31
  **Examples**: Missing UX specs for secondary flows, incomplete examples in knowledge base entries, editorial inconsistencies in prose.
32
32
 
33
+ ### Categorization Methodology
34
+
35
+ When collecting findings from multiple validation reports, assign each finding to exactly one category using these decision rules:
36
+
37
+ 1. **Would an agent produce incorrect code if this is not fixed?** -> P0
38
+ 2. **Would an agent have to guess or make assumptions?** -> P1
39
+ 3. **Is the issue real but unlikely to affect implementation correctness?** -> P2
40
+
41
+ When a finding spans multiple categories (e.g., a stale count that is also ambiguous), assign it to the highest applicable priority. Do not duplicate findings across priority levels.
42
+
33
43
  ## Fix Application Process
34
44
 
35
45
  ### Step 1: Build the Fix Plan
36
46
 
37
47
  1. Collect all findings from validation phase outputs (cross-phase-consistency, traceability-matrix, decision-completeness, critical-path-walkthrough, implementability-dry-run, dependency-graph-validation, scope-creep-check).
38
- 2. Deduplicate — the same root cause often appears in multiple validation reports.
48
+ 2. Deduplicate — the same root cause often appears in multiple validation reports. When a single root cause appears in 3+ reports, mark it as a **systemic issue** and track it separately.
39
49
  3. Group by affected document — batch fixes to minimize file churn.
40
50
  4. Order by priority (P0 first), then by document (reduce context switching).
51
+ 5. Estimate impact radius for each fix — how many other documents does this fix touch?
52
+
53
+ #### Fix Plan Output Format
54
+
55
+ The fix plan is a working document that guides fix execution. Structure it as follows:
56
+
57
+ ```markdown
58
+ ## Fix Plan
59
+
60
+ ### Systemic Issues (multi-document root causes)
61
+ | ID | Root Cause | Affected Documents | Priority | Est. Impact |
62
+ |----|------------|-------------------|----------|-------------|
63
+ | SYS-1 | Pipeline expanded from 32→36 steps, counts not propagated | architecture, state-schema, cli-contract, 12 others | P0 | 15 files |
64
+
65
+ ### Individual Fixes
66
+ | ID | Finding Source | Finding | Priority | Target Document | Dependencies |
67
+ |----|--------------|---------|----------|-----------------|--------------|
68
+ | FIX-1 | CPC-007 | Terminology drift: "prompts" vs "steps" | P0 | state-json-schema.md | FIX-2 |
69
+ | FIX-2 | CPC-007 | Terminology drift: "prompts" vs "steps" | P0 | cli-contract.md | — |
70
+ ```
41
71
 
42
72
  ### Step 2: Apply Fixes
43
73
 
44
74
  For each fix:
45
75
  1. Read the finding and the affected document section.
46
- 2. Make the minimal change that resolves the finding.
47
- 3. Check whether the fix affects other documents (e.g., changing a field name in the schema requires updating API contracts and state documentation).
76
+ 2. Make the minimal change that resolves the finding. Do not refactor, improve prose, or add features — fix only what the finding identifies.
77
+ 3. Check whether the fix affects other documents (e.g., changing a field name in the schema requires updating API contracts and state documentation). Use project-wide search to find all references before changing any term.
48
78
  4. Log the fix in `docs/validation/fix-log.md` with: finding ID, affected files, what changed, why.
79
+ 5. For systemic issues, fix the source of truth first, then sweep all downstream references in a single pass.
80
+
81
+ #### Fix Execution Rules
82
+
83
+ - **One finding per commit** (or one systemic issue per commit). This makes rollback possible if a fix introduces a regression.
84
+ - **Fix forward, not around.** If a finding reveals a design mistake, fix the design — do not patch the symptom.
85
+ - **Preserve document structure.** Fixes should not reorganize sections, add new headings, or change formatting conventions. Content changes only.
86
+ - **Cross-document fixes must be atomic.** If a terminology change spans 5 files, update all 5 in the same commit. A half-applied rename is worse than the original inconsistency.
87
+
88
+ ### Step 3: Re-validation
49
89
 
50
- ### Step 3: Verify No Regressions
90
+ After all fixes are applied, re-validate to confirm fixes resolved the findings without introducing new issues:
51
91
 
52
- After all fixes are applied:
53
- 1. Re-run cross-phase consistency checks on modified documents.
54
- 2. Verify traceability links still resolve (no broken references introduced by renames).
55
- 3. Spot-check that counts, terminology, and cross-references are internally consistent.
56
- 4. If a fix introduced a new issue, treat it as a P0 and resolve before proceeding.
92
+ 1. **Re-run affected validation checks.** For each fix, identify which validation pass originally flagged it and re-run that specific check against the modified document(s). At minimum, re-run:
93
+ - Cross-phase consistency checks on all modified documents
94
+ - Traceability link resolution (no broken references introduced by renames)
95
+ - Scope-creep check (fixes did not add new requirements)
96
+ 2. **Spot-check adjacent sections.** When a fix modifies a section, read the surrounding sections in the same document to verify internal consistency was not broken.
97
+ 3. **Verify counts and cross-references.** Any fix that changes a quantity (step count, story count, task count) requires verifying every other document that cites that quantity.
98
+ 4. **Regression test systemic fixes.** For systemic issues that touched many files, grep for the old term/value across the entire docs directory to confirm no instances were missed.
99
+ 5. **If re-validation finds new issues**, treat them as P0 findings and loop back to Step 2. The fix→revalidate cycle continues until re-validation produces zero new findings.
100
+
101
+ #### Re-validation Output
102
+
103
+ Record re-validation results alongside the fix log:
104
+
105
+ ```markdown
106
+ ## Re-validation Results
107
+
108
+ | Fix ID | Re-validation Check | Result | Notes |
109
+ |--------|-------------------|--------|-------|
110
+ | FIX-1 | CPC re-run | PASS | All "step" references consistent |
111
+ | FIX-3 | Traceability links | FAIL | New broken ref in tasks.md line 47 |
112
+ ```
57
113
 
58
114
  ## Documentation Freeze
59
115
 
60
- Once all P0 and P1 findings are resolved:
116
+ Once all P0 and P1 findings are resolved and re-validation produces zero new findings:
61
117
 
62
118
  1. Add a freeze marker (tracking comment) to each phase artifact indicating the document is implementation-ready.
63
119
  2. Record the freeze timestamp and the validation findings that were addressed.
64
120
  3. P2 deferrals are logged in the fix log with rationale — these become backlog items for post-implementation polish.
65
121
 
122
+ ### Freeze Criteria Checklist
123
+
124
+ Before declaring freeze, verify all of the following:
125
+
126
+ - [ ] All P0 findings resolved and re-validated
127
+ - [ ] All P1 findings resolved (or explicitly risk-accepted with documented rationale)
128
+ - [ ] Re-validation produced zero new findings on the final pass
129
+ - [ ] Fix log is complete with all changes documented
130
+ - [ ] P2 deferrals are logged with rationale
131
+ - [ ] Cross-document counts are internally consistent (final count sweep)
132
+ - [ ] All traceability links resolve (no dangling references)
133
+ - [ ] Terminology is consistent across all documents (final terminology sweep)
134
+
66
135
  ### What Freeze Means
67
136
 
68
137
  - **No further content changes** unless implementation reveals a genuine gap (not a preference).
69
138
  - **Formatting and typo fixes** are allowed — they don't affect implementation.
70
139
  - **If a gap is found during implementation**, the fix goes through the same prioritization process: update the document, log the change, re-verify consistency.
140
+ - **Freeze does NOT mean the documents are perfect.** P2 deferrals exist. The standard is implementation readiness — an implementing agent can produce correct code from these documents without guessing.
141
+
142
+ ### What Is Allowed After Freeze
143
+
144
+ | Change Type | Allowed? | Process |
145
+ |------------|----------|---------|
146
+ | Typo fixes, formatting | Yes | Direct edit, no re-validation needed |
147
+ | Gap discovered during implementation | Yes | Prioritize as P0/P1, apply fix, re-validate affected section, log in fix log |
148
+ | "Nice to have" improvements | No | Log as P2 deferral for post-implementation |
149
+ | Scope additions | No | Out of scope — must go through PRD amendment process |
150
+ | Terminology alignment (missed in freeze) | Yes | Treat as P0 fix, apply and re-validate |
151
+
152
+ ### Freeze Marker Format
153
+
154
+ Add the following marker to the top of each frozen document, immediately after the frontmatter:
155
+
156
+ ```markdown
157
+ <!-- FROZEN: Implementation-ready as of YYYY-MM-DD. Changes require fix-log entry. -->
158
+ ```
159
+
160
+ ### Frozen Artifact Set
161
+
162
+ The complete set of frozen artifacts should be documented in the fix log as a manifest:
163
+
164
+ ```markdown
165
+ ## Frozen Artifact Manifest
166
+
167
+ | Document | Freeze Date | P0 Fixes | P1 Fixes | P2 Deferred |
168
+ |----------|------------|----------|----------|-------------|
169
+ | docs/plan.md | 2025-01-15 | 0 | 2 | 1 |
170
+ | docs/system-architecture.md | 2025-01-15 | 3 | 4 | 2 |
171
+ | docs/api-contracts.md | 2025-01-15 | 1 | 1 | 0 |
172
+ | docs/database-schema.md | 2025-01-15 | 2 | 3 | 1 |
173
+ | ... | ... | ... | ... | ... |
174
+ ```
71
175
 
72
176
  ## Fix Log Format
73
177
 
@@ -85,9 +189,56 @@ Once all P0 and P1 findings are resolved:
85
189
  | 1 | IR-012: Missing adopt-flow UX spec | Low implementation impact; adopt is secondary flow |
86
190
  ```
87
191
 
192
+ ## The Fix-Revalidate-Freeze Cycle
193
+
194
+ The full process follows a strict cycle:
195
+
196
+ ```
197
+ Collect findings
198
+
199
+
200
+ Build fix plan (categorize, prioritize, estimate impact)
201
+
202
+
203
+ ┌─> Apply fixes (one finding or systemic issue per commit)
204
+ │ │
205
+ │ ▼
206
+ │ Re-validate (re-run affected checks, spot-check adjacent sections)
207
+ │ │
208
+ │ ▼
209
+ │ New findings? ──Yes──┐
210
+ │ │ │
211
+ │ No │
212
+ │ │ │
213
+ │ ▼ │
214
+ │ Freeze criteria met? │
215
+ │ │ │
216
+ │ No │
217
+ │ │ │
218
+ └───────┘ ◄──────────────┘
219
+
220
+ Yes
221
+
222
+
223
+ Declare freeze (add markers, create manifest, log deferrals)
224
+ ```
225
+
226
+ Each iteration through the cycle should produce strictly fewer findings than the previous iteration. If the count of findings is not decreasing, stop and investigate — you may be fixing symptoms while the root cause persists.
227
+
88
228
  ## Common Pitfalls
89
229
 
90
- 1. **Fixing symptoms instead of root causes.** If the same stale count appears in 15 files, the root cause is a single pipeline change that wasn't propagated. Fix the source and sweep all references.
91
- 2. **Introducing new inconsistencies.** Renaming a field in one document but missing it in another. Always search for all references before changing a term.
92
- 3. **Over-fixing.** The goal is implementation readiness, not perfection. If a P2 finding doesn't affect an implementing agent's ability to produce correct code, defer it.
93
- 4. **Skipping verification.** A fix that breaks a cross-reference is worse than the original finding. Always re-verify after applying fixes.
230
+ 1. **Fixing symptoms instead of root causes.** If the same stale count appears in 15 files, the root cause is a single pipeline change that wasn't propagated. Fix the source and sweep all references. A good diagnostic: if your fix plan has 10+ individual fixes that all trace to the same upstream change, consolidate them into one systemic fix.
231
+
232
+ 2. **Introducing new inconsistencies.** Renaming a field in one document but missing it in another. Always search for all references before changing a term. Run a project-wide grep for the old term after every rename.
233
+
234
+ 3. **Over-fixing.** The goal is implementation readiness, not perfection. If a P2 finding doesn't affect an implementing agent's ability to produce correct code, defer it. A common trap: improving prose clarity during the fix phase. This is not fixing — it is editing, and it risks introducing new inconsistencies.
235
+
236
+ 4. **Skipping re-validation.** A fix that breaks a cross-reference is worse than the original finding. Always re-validate after applying fixes. The most dangerous fixes are the ones that "obviously" don't need re-validation — those are the ones that introduce silent regressions.
237
+
238
+ 5. **Premature freeze.** Declaring freeze before all P0 and P1 findings are resolved because of time pressure. A premature freeze sends agents into implementation with known issues, guaranteeing rework. If time is short, reduce scope (defer entire features) rather than freezing with known P0 issues.
239
+
240
+ 6. **Scope creep during the fix phase.** A finding says "the error format is unspecified" and the fix adds a complete error taxonomy, error codes, error localization strategy, and retry semantics. The fix should specify the minimum error format needed for implementation. Everything else is new scope.
241
+
242
+ 7. **Infinite fix loops.** Each fix introduces a new finding, which requires another fix, which introduces another finding. This happens when fixes are too broad (changing things beyond what the finding requires) or when the underlying documents have systemic structural problems. Break the loop by: (a) making smaller, more targeted fixes, or (b) stepping back to identify the structural issue and fixing that instead.
243
+
244
+ 8. **Incomplete fix log.** Applying fixes without logging them. The fix log is not bureaucracy — it is the audit trail that proves the freeze is valid. If an implementation agent later questions a design choice, the fix log explains why the document says what it says.
@@ -8,13 +8,36 @@ topics: [prd, requirements, product, scoping]
8
8
 
9
9
  A Product Requirements Document is the single source of truth for what is being built and why. It defines the problem, the users, the scope, and the success criteria. Everything in the pipeline flows from the PRD — domain models, architecture, implementation tasks. A weak PRD propagates weakness through every downstream artifact.
10
10
 
11
- This document covers what makes a good PRD, what makes a bad one, and how to tell the difference.
11
+ ## Summary
12
12
 
13
- ## Problem Statement
13
+ ### PRD Structure
14
+
15
+ A complete PRD includes these sections:
16
+ 1. **Problem Statement** — Specific, testable, grounded in observable reality. Names a user group, describes a pain point, includes quantitative evidence.
17
+ 2. **Target Users** — Personas with roles, needs, current behavior, constraints, and success criteria. Typically 2-4 meaningful personas.
18
+ 3. **Feature Scoping** — Three explicit lists: In Scope (v1), Out of Scope, and Deferred (future). Each in-scope feature detailed enough to estimate.
19
+ 4. **Success Criteria** — Measurable outcomes tied to the problem statement with target values and measurement methods.
20
+ 5. **Constraints** — Technical, timeline, budget, team, and regulatory constraints traceable to architectural decisions.
21
+ 6. **Non-Functional Requirements** — Quantified performance, scalability, availability, security, accessibility, data, i18n, browser/device support, and monitoring requirements.
22
+ 7. **Competitive Context** — What exists, how this differs, why users would switch.
23
+
24
+ ### Quality Criteria
25
+
26
+ - Problem statement is specific and testable
27
+ - Features are prioritized with MoSCoW (Must/Should/Could/Won't)
28
+ - Success criteria have target values and measurement methods
29
+ - NFRs are quantified (not "fast" but "p95 under 200ms")
30
+ - Error scenarios and edge cases are addressed
31
+ - The PRD says WHAT, not HOW
32
+ - Every feature is detailed enough for estimation without prescribing implementation
33
+
34
+ ## Deep Guidance
35
+
36
+ ### Problem Statement
14
37
 
15
38
  The problem statement is the foundation. If it is wrong, everything built on top of it is wrong.
16
39
 
17
- ### What Makes a Good Problem Statement
40
+ #### What Makes a Good Problem Statement
18
41
 
19
42
  A good problem statement is **specific**, **testable**, and **grounded in observable reality**.
20
43
 
@@ -29,7 +52,7 @@ A good problem statement is **specific**, **testable**, and **grounded in observ
29
52
  - "Users want a better dashboard." (Aspirational, not grounded. What is wrong with the current one? What does "better" mean?)
30
53
  - "We need to modernize our technology stack." (Technology is not a problem — what user-facing or business issue does the old stack cause?)
31
54
 
32
- ### Problem Statement Checklist
55
+ #### Problem Statement Checklist
33
56
 
34
57
  - [ ] Names a specific user group (not "users" or "everyone")
35
58
  - [ ] Describes an observable behavior or pain point (not a desired state)
@@ -37,9 +60,9 @@ A good problem statement is **specific**, **testable**, and **grounded in observ
37
60
  - [ ] Does not prescribe a solution (the problem is not "we need feature X")
38
61
  - [ ] Can be validated — you can measure whether the problem is solved
39
62
 
40
- ## Target Users
63
+ ### Target Users — Detailed Persona Methodology
41
64
 
42
- ### Personas with Needs
65
+ #### Personas with Needs
43
66
 
44
67
  Each persona should have:
45
68
  - **Role or description** — Who they are in relation to the product.
@@ -69,17 +92,17 @@ Each persona should have:
69
92
 
70
93
  The bad persona tells the implementation team nothing actionable. It does not constrain design decisions.
71
94
 
72
- ### How Many Personas
95
+ #### How Many Personas
73
96
 
74
97
  Most products have 2-4 meaningful personas. If a PRD lists more than 6, the product scope is likely too broad. If it lists only 1, secondary users (admins, support staff, integration partners) may be missing.
75
98
 
76
- ### Anti-pattern: The Everything User
99
+ #### Anti-pattern: The Everything User
77
100
 
78
101
  A persona that represents all users is no persona at all. "Power users who want advanced features AND casual users who want simplicity" describes a contradiction, not a persona. Different personas may have conflicting needs — that is fine, but the PRD must state which takes priority.
79
102
 
80
- ## Feature Scoping
103
+ ### Feature Scoping — Depth
81
104
 
82
- ### What Is In, What Is Out, What Is Deferred
105
+ #### What Is In, What Is Out, What Is Deferred
83
106
 
84
107
  Every PRD should have three explicit lists:
85
108
 
@@ -126,7 +149,7 @@ Every PRD should have three explicit lists:
126
149
 
127
150
  This tells you nothing about boundaries. Is "user management" basic registration or full RBAC with teams and permissions? Is "analytics" a page view counter or a business intelligence suite?
128
151
 
129
- ### MoSCoW Prioritization
152
+ #### MoSCoW Prioritization — In Depth
130
153
 
131
154
  When the in-scope list is large, use MoSCoW to further prioritize:
132
155
 
@@ -160,7 +183,7 @@ Won't Have:
160
183
  - Social login
161
184
  ```
162
185
 
163
- ### Feature Detail Level
186
+ #### Feature Detail Level
164
187
 
165
188
  Each in-scope feature needs enough detail to be estimable:
166
189
 
@@ -175,9 +198,9 @@ Each in-scope feature needs enough detail to be estimable:
175
198
 
176
199
  The PRD says WHAT, not HOW.
177
200
 
178
- ## Success Criteria
201
+ ### Success Criteria — Depth
179
202
 
180
- ### Measurable Outcomes
203
+ #### Measurable Outcomes
181
204
 
182
205
  Success criteria define how you will know the product works. They must be measurable, specific, and tied to the problem statement.
183
206
 
@@ -193,7 +216,7 @@ Success criteria define how you will know the product works. They must be measur
193
216
  - "Revenue increases." (Not tied to the problem. Revenue can increase for many reasons.)
194
217
  - "We ship on time." (Success criteria for the project, not the product)
195
218
 
196
- ### Types of Success Criteria
219
+ #### Types of Success Criteria
197
220
 
198
221
  1. **User behavior metrics** — Conversion rates, completion rates, time-on-task, error rates.
199
222
  2. **Business metrics** — Revenue impact, cost reduction, customer acquisition.
@@ -202,9 +225,9 @@ Success criteria define how you will know the product works. They must be measur
202
225
 
203
226
  Every success criterion should have a **target value** and a **measurement method**. "Checkout abandonment under 40% as measured by analytics funnel tracking" is complete. "Checkout abandonment decreases" is not.
204
227
 
205
- ## Constraints
228
+ ### Constraints — Detailed Categories
206
229
 
207
- ### Categories of Constraints
230
+ #### Categories of Constraints
208
231
 
209
232
  **Technical constraints:**
210
233
  - Existing systems that must be integrated with.
@@ -233,7 +256,7 @@ Every success criterion should have a **target value** and a **measurement metho
233
256
  - Accessibility mandates (ADA, WCAG requirements).
234
257
  - Industry-specific regulations.
235
258
 
236
- ### How Constraints Affect Downstream Artifacts
259
+ #### How Constraints Affect Downstream Artifacts
237
260
 
238
261
  Each constraint should be traceable to architectural decisions:
239
262
  - "Must use PostgreSQL" → ADR for database choice.
@@ -241,11 +264,9 @@ Each constraint should be traceable to architectural decisions:
241
264
  - "Team of 3 developers" → Implementation tasks sized for 3 parallel workers.
242
265
  - "Launch by March 1" → Feature scope fits within timeline.
243
266
 
244
- ## Non-Functional Requirements
245
-
246
- NFRs define HOW the system should behave, not WHAT it should do. They are frequently under-specified in PRDs, which leads to expensive rework.
267
+ ### NFR Quantification Patterns
247
268
 
248
- ### Quantified NFRs
269
+ #### Quantified NFRs
249
270
 
250
271
  **Good:**
251
272
  - "Page load time: p95 under 2 seconds on 4G mobile connection."
@@ -260,7 +281,7 @@ NFRs define HOW the system should behave, not WHAT it should do. They are freque
260
281
  - "Scalable." (To what? 100 users? 1 million users? What is the growth curve?)
261
282
  - "Secure." (Against what threats? To what standard?)
262
283
 
263
- ### NFR Categories Checklist
284
+ #### NFR Categories Checklist
264
285
 
265
286
  - [ ] **Performance** — Response times (p50, p95, p99), throughput, page load times
266
287
  - [ ] **Scalability** — Concurrent users, data volume, growth rate
@@ -272,42 +293,42 @@ NFRs define HOW the system should behave, not WHAT it should do. They are freque
272
293
  - [ ] **Browser/device support** — Minimum browser versions, mobile support, responsive breakpoints
273
294
  - [ ] **Monitoring** — What needs to be observable? Alerting thresholds?
274
295
 
275
- ## Competitive Context
296
+ ### Competitive Context Analysis
276
297
 
277
- ### What to Include
298
+ #### What to Include
278
299
 
279
300
  - **What exists** — Name competing products and what they do well.
280
301
  - **How this is different** — Specific differentiators, not "we're better."
281
302
  - **Why users would switch** — What pain does this product solve that competitors do not?
282
303
  - **What to learn from** — Features or patterns from competitors worth adopting.
283
304
 
284
- ### What NOT to Include
305
+ #### What NOT to Include
285
306
 
286
307
  - Exhaustive competitor feature matrices (belongs in market research, not PRD).
287
308
  - Competitive strategy or positioning (belongs in business plan, not PRD).
288
309
  - Pricing comparisons (unless pricing is a product feature).
289
310
 
290
- ## Common PRD Failures
311
+ ### Common PRD Failures
291
312
 
292
- ### The "Requirements as Solutions" Failure
313
+ #### The "Requirements as Solutions" Failure
293
314
  PRD prescribes technical solutions instead of stating requirements. "Use Redis for caching" belongs in architecture, not the PRD. The PRD should say "response time under 200ms" — how to achieve that is an architectural decision.
294
315
 
295
- ### The "Missing Sad Path" Failure
316
+ #### The "Missing Sad Path" Failure
296
317
  PRD describes only happy paths. What happens when payment fails? When the user's session expires during checkout? When the network drops? When the form has invalid data? Every user action that can fail should have at least a sentence about what happens.
297
318
 
298
- ### The "Everyone Is a User" Failure
319
+ #### The "Everyone Is a User" Failure
299
320
  PRD addresses "users" as a monolith instead of identifying distinct personas with distinct needs. Admins, end users, API consumers, and support staff have different requirements.
300
321
 
301
- ### The "Implied API" Failure
322
+ #### The "Implied API" Failure
302
323
  PRD describes a UI but implies an API without stating it. "Users can view their order history" implies GET /orders, data model for orders, pagination, filtering, sorting. These implications should be explicit in the PRD.
303
324
 
304
- ### The "No Boundaries" Failure
325
+ #### The "No Boundaries" Failure
305
326
  PRD states what is in scope but never states what is out. Every documentation phase becomes a scope negotiation.
306
327
 
307
- ### The "Success Is Shipping" Failure
328
+ #### The "Success Is Shipping" Failure
308
329
  PRD has no success criteria beyond "launch the product." Without measurable outcomes, there is no way to know if the product solved the problem.
309
330
 
310
- ## PRD Quality Checklist
331
+ ### PRD Quality Checklist
311
332
 
312
333
  Before considering a PRD complete:
313
334
 
@@ -201,3 +201,35 @@ For each category, verify at least one accepted ADR covers it. If a category is
201
201
  - P0: "The monolith-vs-services question has two proposed ADRs (ADR-003, ADR-004) but neither is accepted. The system architecture step cannot define component boundaries."
202
202
  - P1: "Authentication approach is not covered by any ADR. The system architecture step needs to know the auth pattern to design the auth component."
203
203
  - P2: "Monitoring strategy has no ADR. This could be deferred to the operations step but should be noted."
204
+
205
+ ### Example Review Finding
206
+
207
+ ```markdown
208
+ ### Finding: Straw-man alternatives mask the real decision rationale
209
+
210
+ **Pass:** 2 — Rationale Quality
211
+ **Priority:** P0
212
+ **Location:** ADR-003 "Use React for Frontend Framework"
213
+
214
+ **Issue:** ADR-003 lists two alternatives: "Use jQuery" and "Build from scratch
215
+ with vanilla JS." Neither is a genuinely viable alternative for a 2024 SPA with
216
+ the complexity described in the PRD. The real alternatives — Vue, Svelte, Angular
217
+ — are not mentioned.
218
+
219
+ The consequences section lists four benefits and zero costs. React has well-known
220
+ trade-offs (large bundle size, JSX learning curve, frequent ecosystem churn) that
221
+ are absent.
222
+
223
+ **Impact:** When conditions change (e.g., bundle size becomes a priority, or the
224
+ team grows to include Vue-experienced developers), there is no documented rationale
225
+ for why React was chosen over comparable frameworks. The ADR cannot be meaningfully
226
+ re-evaluated because the real decision criteria were never recorded.
227
+
228
+ **Recommendation:** Replace alternatives with genuinely considered options (Vue 3,
229
+ Svelte/SvelteKit, Angular). For each, document honest pros and cons. Add negative
230
+ consequences to the React decision: bundle size overhead, ecosystem churn rate,
231
+ and dependency on the React team's architectural direction (Server Components,
232
+ compiler changes).
233
+
234
+ **Trace:** ADR-003 → blocks Architecture Phase component structure decisions
235
+ ```