@aslomon/effectum 0.1.0

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 (39) hide show
  1. package/README.md +633 -0
  2. package/bin/install.js +652 -0
  3. package/package.json +29 -0
  4. package/system/README.md +118 -0
  5. package/system/commands/build-fix.md +89 -0
  6. package/system/commands/cancel-ralph.md +90 -0
  7. package/system/commands/checkpoint.md +63 -0
  8. package/system/commands/code-review.md +120 -0
  9. package/system/commands/e2e.md +92 -0
  10. package/system/commands/plan.md +111 -0
  11. package/system/commands/ralph-loop.md +163 -0
  12. package/system/commands/refactor-clean.md +104 -0
  13. package/system/commands/tdd.md +84 -0
  14. package/system/commands/verify.md +71 -0
  15. package/system/stacks/generic.md +96 -0
  16. package/system/stacks/nextjs-supabase.md +114 -0
  17. package/system/stacks/python-fastapi.md +140 -0
  18. package/system/stacks/swift-ios.md +136 -0
  19. package/system/templates/AUTONOMOUS-WORKFLOW.md +1368 -0
  20. package/system/templates/CLAUDE.md.tmpl +141 -0
  21. package/system/templates/guardrails.md.tmpl +39 -0
  22. package/system/templates/settings.json.tmpl +201 -0
  23. package/workshop/knowledge/01-prd-template.md +275 -0
  24. package/workshop/knowledge/02-questioning-framework.md +209 -0
  25. package/workshop/knowledge/03-decomposition-guide.md +234 -0
  26. package/workshop/knowledge/04-examples.md +435 -0
  27. package/workshop/knowledge/05-quality-checklist.md +166 -0
  28. package/workshop/knowledge/06-network-map-guide.md +413 -0
  29. package/workshop/knowledge/07-prompt-templates.md +315 -0
  30. package/workshop/knowledge/08-workflow-modes.md +198 -0
  31. package/workshop/projects/_example-project/PROJECT.md +33 -0
  32. package/workshop/projects/_example-project/notes/decisions.md +15 -0
  33. package/workshop/projects/_example-project/notes/discovery-log.md +9 -0
  34. package/workshop/templates/PROJECT.md +25 -0
  35. package/workshop/templates/network-map.mmd +13 -0
  36. package/workshop/templates/prd.md +133 -0
  37. package/workshop/templates/requirements-map.md +48 -0
  38. package/workshop/templates/shared-contracts.md +89 -0
  39. package/workshop/templates/vision.md +66 -0
@@ -0,0 +1,435 @@
1
+ # PRD Examples
2
+
3
+ Three complete examples showing the progression from simple to complex, all agent-ready.
4
+
5
+ ---
6
+
7
+ ## Example A: Simple Feature (single PRD, ~20 iterations)
8
+
9
+ ````markdown
10
+ # PRD: User Profile Avatar Upload
11
+
12
+ ## Problem
13
+
14
+ Users cannot upload a profile picture. Profiles show a generic placeholder,
15
+ making it harder for team members to identify each other in a multi-user workspace.
16
+
17
+ ## Goal
18
+
19
+ Users can upload, preview, and change their profile picture. The avatar is displayed
20
+ across the application wherever the user's identity appears.
21
+
22
+ ## User Stories
23
+
24
+ - As a user, I want to upload a profile picture so that others can recognize me
25
+ - As a user, I want to preview my image before confirming the upload so that I can ensure it looks right
26
+ - As a user, I want to see a fallback avatar when no image is uploaded so that the UI remains consistent
27
+
28
+ ## Acceptance Criteria
29
+
30
+ - [ ] AC1: Upload accepts JPG, PNG, and WebP files up to 5MB
31
+ - [ ] AC2: Given a file larger than 5MB, When the user attempts upload, Then an error message is shown
32
+ - [ ] AC3: Image is stored in Supabase Storage bucket "avatars"
33
+ - [ ] AC4: Avatar URL is persisted in the user profile (profiles.avatar_url)
34
+ - [ ] AC5: Preview is shown immediately after file selection, before upload confirmation
35
+ - [ ] AC6: Fallback avatar displays user initials when no image is uploaded
36
+ - [ ] AC7: Avatar is displayed in the header, team member list, and comment threads
37
+
38
+ ## Scope
39
+
40
+ ### In Scope
41
+
42
+ - Upload component with drag-and-drop and file picker
43
+ - Image preview before upload
44
+ - Supabase Storage integration
45
+ - Profile update (avatar_url field)
46
+ - Fallback avatar component
47
+ - Display in header, team list, and comments
48
+
49
+ ### Out of Scope
50
+
51
+ - Image cropping or editing
52
+ - Image filters or effects
53
+ - Social media avatar import
54
+ - Avatar history or versioning
55
+ - Animated avatars (GIF support)
56
+
57
+ ## Data Model
58
+
59
+ ### profiles (existing table — add column)
60
+
61
+ | Column | Type | Constraints | Description |
62
+ | ---------- | ---- | ----------- | --------------------------------- |
63
+ | avatar_url | text | NULL | URL to avatar in Supabase Storage |
64
+
65
+ ### Supabase Storage
66
+
67
+ - Bucket: "avatars"
68
+ - Path: `{org_id}/{user_id}/avatar.{ext}`
69
+ - Max size: 5MB
70
+ - Allowed MIME types: image/jpeg, image/png, image/webp
71
+ - RLS: Users can only upload/delete their own avatar
72
+
73
+ ## API Design
74
+
75
+ ### POST /api/profile/avatar
76
+
77
+ **Purpose:** Upload or replace profile avatar
78
+
79
+ **Request:** multipart/form-data with "file" field
80
+
81
+ **Response (200):**
82
+
83
+ ```json
84
+ {
85
+ "data": {
86
+ "avatar_url": "https://[project].supabase.co/storage/v1/object/public/avatars/..."
87
+ }
88
+ }
89
+ ```
90
+ ````
91
+
92
+ **Errors:**
93
+
94
+ - 400: File too large or invalid MIME type
95
+ - 401: Not authenticated
96
+ - 500: Storage upload failed
97
+
98
+ ### DELETE /api/profile/avatar
99
+
100
+ **Purpose:** Remove profile avatar, revert to fallback
101
+
102
+ **Response (200):**
103
+
104
+ ```json
105
+ {
106
+ "data": { "avatar_url": null }
107
+ }
108
+ ```
109
+
110
+ ## Quality Gates
111
+
112
+ - Build: `pnpm build` — 0 errors
113
+ - Types: `tsc --noEmit` — 0 errors
114
+ - Tests: `pnpm vitest run` — all pass, 80%+ coverage on new code
115
+ - Lint: `pnpm lint` — 0 errors
116
+
117
+ ## Autonomy Rules
118
+
119
+ - Design: Follow DESIGN.md for avatar sizing, border radius, and colors
120
+ - Libraries: Use existing project dependencies only
121
+ - Architecture: Follow existing patterns in src/lib/ and src/components/
122
+ - On ambiguity: Decide autonomously
123
+
124
+ ## Completion Promise
125
+
126
+ "All acceptance criteria met, build passes, all tests pass, 0 lint errors, no console.log in production code"
127
+
128
+ ````
129
+
130
+ ---
131
+
132
+ ## Example B: Standard Feature (single PRD, ~30 iterations)
133
+
134
+ ```markdown
135
+ # PRD: Team Invitation System
136
+
137
+ ## Problem
138
+
139
+ New team members can only be added manually via direct database insertion.
140
+ This is error-prone, unauditable, and requires developer involvement for
141
+ every new hire or collaborator.
142
+
143
+ ## Goal
144
+
145
+ Admins can send email invitations from the settings page. Invited users receive
146
+ a magic link and are automatically assigned to the team with the correct role
147
+ upon acceptance. Pending invitations are visible and revocable.
148
+
149
+ ## User Stories
150
+
151
+ - As an admin, I want to invite team members via email so that onboarding is self-service
152
+ - As an invitee, I want to join via a link without manual registration so that joining is frictionless
153
+ - As an admin, I want to see pending invitations and their status so that I can track onboarding
154
+ - As an admin, I want to revoke pending invitations so that I can correct mistakes
155
+
156
+ ## Acceptance Criteria
157
+
158
+ - [ ] AC1: Admin can enter one or more email addresses and assign a role (member, admin)
159
+ - [ ] AC2: Each invitation generates a single-use token valid for 24 hours
160
+ - [ ] AC3: Given an expired token, When the invitee clicks the link, Then they see an expiration message
161
+ - [ ] AC4: Email is sent via Supabase Edge Function with invitation link
162
+ - [ ] AC5: Given a new user (no account), When they accept, Then they are redirected to onboarding
163
+ - [ ] AC6: Given an existing user, When they accept, Then they are directly assigned to the team
164
+ - [ ] AC7: Admin sees a list of pending invitations with email, role, status, and expiration
165
+ - [ ] AC8: Admin can revoke any pending invitation (immediate invalidation)
166
+ - [ ] AC9: Maximum 50 pending invitations per team
167
+ - [ ] AC10: Rate limit: 10 invitations per hour per admin
168
+ - [ ] AC11: Given a duplicate email (already invited or already a member), When the admin invites, Then an appropriate error message is shown
169
+
170
+ ## Scope
171
+
172
+ ### In Scope
173
+
174
+ - Invitation CRUD (create, list, revoke)
175
+ - Token generation and validation
176
+ - Email sending via Edge Function
177
+ - Invitation acceptance flow (new + existing users)
178
+ - Admin UI in settings page
179
+ - Rate limiting and invitation limits
180
+
181
+ ### Out of Scope
182
+
183
+ - Bulk CSV import
184
+ - Custom invitation email templates
185
+ - Invitation analytics or reporting
186
+ - Role management beyond member/admin
187
+ - SSO-based invitations
188
+ - Re-sending expired invitations (user must create new invitation)
189
+
190
+ ## Data Model
191
+
192
+ ### invitations
193
+
194
+ | Column | Type | Constraints | Description |
195
+ |--------|------|-------------|-------------|
196
+ | id | uuid | PK, default gen_random_uuid() | |
197
+ | org_id | uuid | FK → organizations.id, NOT NULL | Tenant isolation |
198
+ | email | text | NOT NULL | Invitee email address |
199
+ | role | text | NOT NULL, CHECK (role IN ('member', 'admin')) | Assigned role |
200
+ | token | text | NOT NULL, UNIQUE | Single-use invitation token |
201
+ | status | text | NOT NULL, default 'pending', CHECK (status IN ('pending', 'accepted', 'revoked', 'expired')) | |
202
+ | invited_by | uuid | FK → profiles.id, NOT NULL | Admin who created |
203
+ | expires_at | timestamptz | NOT NULL | Token expiration (created_at + 24h) |
204
+ | accepted_at | timestamptz | NULL | When invitation was accepted |
205
+ | created_at | timestamptz | NOT NULL, default now() | |
206
+
207
+ ### RLS Policies
208
+
209
+ - SELECT: Users can view invitations where org_id matches their org
210
+ - INSERT: Only admins of the same org can create invitations
211
+ - UPDATE: Only admins of the same org can update status (revoke)
212
+ - DELETE: Not allowed (use status = 'revoked' instead)
213
+
214
+ ### Indexes
215
+
216
+ - UNIQUE on (org_id, email) WHERE status = 'pending' (prevent duplicate pending invitations)
217
+ - INDEX on token (lookup during acceptance)
218
+ - INDEX on (org_id, status) (admin list view)
219
+
220
+ ## API Design
221
+
222
+ ### POST /api/invitations
223
+
224
+ Create one or more invitations.
225
+
226
+ Request:
227
+ ```json
228
+ {
229
+ "invitations": [
230
+ { "email": "user@example.com", "role": "member" },
231
+ { "email": "admin@example.com", "role": "admin" }
232
+ ]
233
+ }
234
+ ````
235
+
236
+ Response (201):
237
+
238
+ ```json
239
+ {
240
+ "data": {
241
+ "created": 2,
242
+ "failed": 0,
243
+ "invitations": [{ "id": "...", "email": "...", "status": "pending" }]
244
+ }
245
+ }
246
+ ```
247
+
248
+ Errors:
249
+
250
+ - 400: Invalid email format, invalid role, duplicate email
251
+ - 403: Not an admin
252
+ - 429: Rate limit exceeded (10/hour)
253
+
254
+ ### GET /api/invitations
255
+
256
+ List invitations for current org. Query params: ?status=pending
257
+
258
+ Response (200):
259
+
260
+ ```json
261
+ {
262
+ "data": [
263
+ {
264
+ "id": "...",
265
+ "email": "...",
266
+ "role": "member",
267
+ "status": "pending",
268
+ "expires_at": "...",
269
+ "invited_by": { "name": "..." }
270
+ }
271
+ ]
272
+ }
273
+ ```
274
+
275
+ ### DELETE /api/invitations/:id
276
+
277
+ Revoke invitation (sets status to 'revoked').
278
+
279
+ Response (200):
280
+
281
+ ```json
282
+ { "data": { "id": "...", "status": "revoked" } }
283
+ ```
284
+
285
+ ### POST /api/invitations/accept
286
+
287
+ Redeem invitation token.
288
+
289
+ Request:
290
+
291
+ ```json
292
+ { "token": "abc123..." }
293
+ ```
294
+
295
+ Response (200): Redirect URL to dashboard or onboarding
296
+
297
+ Errors:
298
+
299
+ - 400: Invalid or expired token
300
+ - 409: Already accepted
301
+
302
+ ## Constraints
303
+
304
+ - Use Supabase Auth for magic links (no external email providers)
305
+ - Edge Function for email sending (supabase/functions/send-invitation/)
306
+ - Token format: 32 random bytes, hex-encoded
307
+ - Rate limiting: Implemented via database count query, not in-memory
308
+
309
+ ## Quality Gates
310
+
311
+ - Build: `pnpm build` — 0 errors
312
+ - Types: `tsc --noEmit` — 0 errors
313
+ - Tests: `pnpm vitest run` — all pass, 80%+ coverage
314
+ - Lint: `pnpm lint` — 0 errors
315
+ - E2E: `npx playwright test tests/e2e/invitations.spec.ts` — all pass
316
+ - RLS: Supabase security advisor — no warnings
317
+
318
+ ## Autonomy Rules
319
+
320
+ - Design: Follow DESIGN.md
321
+ - Libraries: Use existing project dependencies
322
+ - Architecture: Follow patterns in src/lib/billing/ for service layer
323
+ - Edge Functions: Follow patterns in supabase/functions/
324
+ - On ambiguity: Decide autonomously, document decisions in code comments
325
+
326
+ ## Completion Promise
327
+
328
+ "All acceptance criteria met, migration applied, RLS policies active, all tests pass, build succeeds, 0 lint errors, types generated"
329
+
330
+ ````
331
+
332
+ ---
333
+
334
+ ## Example C: Large Project — Vision + Multiple PRDs
335
+
336
+ ### Project Vision Document
337
+
338
+ ```markdown
339
+ # Project Vision: TaskFlow — AI-Powered Project Management
340
+
341
+ ## Problem
342
+
343
+ Small teams (3-15 people) use spreadsheets and chat messages to manage projects.
344
+ They lack visibility into progress, miss deadlines, and waste time in status meetings.
345
+ Existing tools (Jira, Asana) are too complex and expensive for their needs.
346
+
347
+ ## Goal
348
+
349
+ A lightweight project management tool where teams can organize work, track progress,
350
+ and get AI-generated insights — without enterprise complexity. Launch MVP within 8 weeks.
351
+
352
+ ## Target Users
353
+
354
+ - **Team Lead (primary):** Manages 3-15 people, needs progress visibility, assigns work
355
+ - **Team Member:** Needs clear task list, updates status, logs time
356
+ - **Stakeholder (secondary):** Needs high-level progress reports, no daily interaction
357
+
358
+ ## Tech Stack
359
+
360
+ - Frontend: Next.js 16, App Router, TypeScript, Tailwind CSS v4, Shadcn UI
361
+ - Backend: Supabase (DB, Auth, Storage, Edge Functions, Realtime)
362
+ - AI: Claude API for insights and summaries
363
+ - Hosting: Vercel
364
+ - Auth: Supabase Auth (email + Google OAuth)
365
+
366
+ ## Constraints
367
+
368
+ - Multi-tenant from day one (org_id on every table)
369
+ - GDPR-compliant (EU data residency option in v2)
370
+ - Mobile-responsive (not native app)
371
+ - Budget: Supabase Pro plan, Vercel Pro plan
372
+
373
+ ## PRD Overview
374
+
375
+ | PRD | Name | Description | Dependencies |
376
+ |-----|------|-------------|--------------|
377
+ | 001 | Auth & Org Setup | Registration, login, org creation, member management | None |
378
+ | 002 | Projects & Tasks | Create projects, manage tasks, assign members, track status | 001 |
379
+ | 003 | AI Insights | AI-generated project summaries, risk detection, suggestions | 001, 002 |
380
+ | 004 | Notifications & Activity | Real-time notifications, activity feed, email digests | 001, 002 |
381
+
382
+ ## Dependency Graph
383
+
384
+ 001-Auth ──► 002-Projects & Tasks ──► 003-AI Insights
385
+ │ │
386
+ │ └──────────────► 004-Notifications
387
+ └──────────────────────────────►
388
+
389
+ ## Roadmap
390
+
391
+ | Phase | PRDs | Milestone | Effort |
392
+ |-------|------|-----------|--------|
393
+ | 1 | 001 | Users can register, create org, invite members | Small (20 iter) |
394
+ | 2 | 002 | Teams can create projects and manage tasks | Standard (30 iter) |
395
+ | 3 | 003, 004 (parallel) | AI insights + notifications functional | Large (40 iter each) |
396
+ ````
397
+
398
+ ### Requirements Map (excerpt)
399
+
400
+ ```markdown
401
+ ## v1 (Must-Have)
402
+
403
+ | ID | Requirement | PRD |
404
+ | ----- | ------------------------------ | --- |
405
+ | R-001 | Email registration + login | 001 |
406
+ | R-002 | Google OAuth login | 001 |
407
+ | R-003 | Organization creation | 001 |
408
+ | R-004 | Member invitation (email) | 001 |
409
+ | R-005 | Project CRUD | 002 |
410
+ | R-006 | Task CRUD with status workflow | 002 |
411
+ | R-007 | Task assignment to members | 002 |
412
+ | R-008 | Kanban board view | 002 |
413
+ | R-009 | AI project summary | 003 |
414
+ | R-010 | In-app notifications | 004 |
415
+
416
+ ## v2
417
+
418
+ | ID | Requirement | PRD |
419
+ | ----- | ---------------------- | --- |
420
+ | R-011 | Time tracking | 002 |
421
+ | R-012 | AI risk detection | 003 |
422
+ | R-013 | Email digest | 004 |
423
+ | R-014 | Gantt chart view | 002 |
424
+ | R-015 | Custom fields on tasks | 002 |
425
+
426
+ ## Out of Scope
427
+
428
+ - Native mobile apps
429
+ - Custom workflows / automation builder
430
+ - Integration marketplace (Slack, GitHub, etc.)
431
+ - White-label / custom branding
432
+ - On-premise deployment
433
+ ```
434
+
435
+ Each individual PRD (001, 002, 003, 004) would then follow the full template from Example B, with complete data models, API designs, and quality gates.
@@ -0,0 +1,166 @@
1
+ # PRD Quality Checklist
2
+
3
+ Verification checklist to ensure a PRD is complete, consistent, and agent-ready before handoff.
4
+
5
+ ---
6
+
7
+ ## Completeness Check
8
+
9
+ ### Problem & Goal
10
+
11
+ - [ ] Problem statement explains WHO is affected and WHY it matters
12
+ - [ ] Goal is measurable (you can verify it was achieved)
13
+ - [ ] Business context is provided (not just technical motivation)
14
+
15
+ ### User Stories
16
+
17
+ - [ ] Each story follows "As a [role], I want to [action], so that [benefit]"
18
+ - [ ] All identified user personas have at least one story
19
+ - [ ] Stories cover the happy path AND error/edge cases
20
+
21
+ ### Acceptance Criteria
22
+
23
+ - [ ] Each criterion is independently testable by an automated test
24
+ - [ ] Complex criteria use Given/When/Then format
25
+ - [ ] No vague terms ("user-friendly", "fast", "intuitive") — replaced with concrete metrics
26
+ - [ ] Edge cases are covered (empty state, max limits, invalid input, concurrent access)
27
+ - [ ] Error scenarios are specified (what happens when things go wrong)
28
+ - [ ] Each criterion maps to exactly one behavior (no compound "X and Y" criteria)
29
+
30
+ ### Scope
31
+
32
+ - [ ] In-scope list is exhaustive (everything being built is listed)
33
+ - [ ] Out-of-scope list includes items someone might reasonably expect
34
+ - [ ] No overlap between in-scope and out-of-scope
35
+ - [ ] Non-Goals are explicitly stated
36
+
37
+ ### Data Model
38
+
39
+ - [ ] All tables are defined with columns, types, and constraints
40
+ - [ ] Primary keys, foreign keys, and indexes are specified
41
+ - [ ] Multi-tenant isolation is addressed (org_id where needed)
42
+ - [ ] RLS policies are defined for every table
43
+ - [ ] Timestamps (created_at, updated_at) are included
44
+ - [ ] Soft delete vs. hard delete strategy is documented
45
+ - [ ] Relations between tables are documented
46
+
47
+ ### API Design
48
+
49
+ - [ ] Every CRUD operation has a defined endpoint
50
+ - [ ] Request and response shapes are specified with field types
51
+ - [ ] Error responses are documented (400, 401, 403, 404, 429, 500)
52
+ - [ ] Authentication requirements are stated per endpoint
53
+ - [ ] Rate limiting is specified where applicable
54
+ - [ ] Pagination strategy is defined for list endpoints
55
+
56
+ ---
57
+
58
+ ## Consistency Check
59
+
60
+ - [ ] Acceptance criteria align with user stories (every story has criteria)
61
+ - [ ] Data model supports all acceptance criteria (no missing fields/tables)
62
+ - [ ] API endpoints cover all acceptance criteria (no missing operations)
63
+ - [ ] Scope boundaries match acceptance criteria (nothing in AC that is out of scope)
64
+ - [ ] Constraints are reflected in the data model and API design
65
+
66
+ ---
67
+
68
+ ## Agent-Ready Check
69
+
70
+ ### Quality Gates
71
+
72
+ - [ ] Build command is specified (e.g., `pnpm build`)
73
+ - [ ] Type check command is specified (e.g., `tsc --noEmit`)
74
+ - [ ] Test command is specified (e.g., `pnpm vitest run`)
75
+ - [ ] Lint command is specified (e.g., `pnpm lint`)
76
+ - [ ] E2E test command is specified (if applicable)
77
+ - [ ] Coverage threshold is defined (e.g., 80%+)
78
+ - [ ] Project-specific checks are listed
79
+
80
+ ### Autonomy Rules
81
+
82
+ - [ ] Design decision authority is clear (follow DESIGN.md / free to decide / ask)
83
+ - [ ] Library choice authority is clear (existing only / free to add / predefined)
84
+ - [ ] Architecture pattern references are provided (e.g., "follow src/lib/billing/")
85
+ - [ ] Ambiguity handling is defined (decide autonomously / stop and ask)
86
+
87
+ ### Completion Promise
88
+
89
+ - [ ] Promise is a single, verifiable statement
90
+ - [ ] Promise covers ALL quality gates
91
+ - [ ] Promise is specific enough that it cannot be true if any AC fails
92
+ - [ ] Promise format works with the target system (Ralph Loop / GSD / manual)
93
+
94
+ ---
95
+
96
+ ## Architecture Compliance
97
+
98
+ These checks ensure the PRD aligns with the autonomous workflow's architecture principles.
99
+
100
+ - [ ] DB changes specify migration approach (`apply_migration`, not raw DDL)
101
+ - [ ] TypeScript types will be generated from schema (not hand-written)
102
+ - [ ] Type-safety chain is documented: DB schema → generated types → Zod schemas → API → frontend
103
+ - [ ] Multi-tenancy is addressed: `org_id` on relevant tables with RLS
104
+ - [ ] Service layer is separated from UI components (no business logic in components)
105
+ - [ ] Server Components are the default; Client Components are justified with reason
106
+ - [ ] All API inputs are validated with Zod
107
+ - [ ] Result pattern `{ data, error }` is used for operations that can fail
108
+ - [ ] API endpoints expose clean REST/RPC interfaces (agent-native principle)
109
+
110
+ ---
111
+
112
+ ## Red Flags — Issues That Will Cause Implementation Problems
113
+
114
+ | Red Flag | Problem | Fix |
115
+ | ---------------------------- | ---------------------------- | ---------------------------------------------- |
116
+ | "Should be fast" | Not testable | Define: "API response < 200ms at p95" |
117
+ | "Nice UI" | Subjective | Reference DESIGN.md or provide wireframes |
118
+ | "Handle errors gracefully" | Vague | Specify each error case with expected behavior |
119
+ | No data model | Agent must guess schema | Define tables, fields, types, relations |
120
+ | No out-of-scope | Scope creep guaranteed | List 3-5 explicit exclusions |
121
+ | Compound AC: "X and Y and Z" | Untestable as single unit | Split into separate criteria |
122
+ | "Similar to [product]" | Ambiguous without specifics | Describe exact behaviors to replicate |
123
+ | No API error responses | Agent invents error handling | Define status codes and messages |
124
+ | Missing auth requirements | Agent guesses access control | Specify per-endpoint authentication |
125
+ | No RLS policies | Security gap | Define row-level security for every table |
126
+
127
+ ---
128
+
129
+ ## Final Verification Questions
130
+
131
+ Ask these before declaring the PRD complete:
132
+
133
+ 1. **Can a developer implement this without asking a single question?**
134
+ If not, what is missing?
135
+
136
+ 2. **Can every acceptance criterion be verified by running a command?**
137
+ If not, rewrite the criterion to be testable.
138
+
139
+ 3. **Is it clear what is NOT being built?**
140
+ If not, add explicit out-of-scope items.
141
+
142
+ 4. **Could two developers read this PRD and build the same thing?**
143
+ If not, add specificity where interpretations diverge.
144
+
145
+ 5. **Does the data model support every acceptance criterion?**
146
+ Trace each AC to the fields and tables it requires.
147
+
148
+ 6. **Are all [ASSUMPTION] and [NEEDS CLARIFICATION] tags resolved?**
149
+ If not, resolve them before handoff.
150
+
151
+ ---
152
+
153
+ ## PRD Readiness Scoring
154
+
155
+ | Category | Weight | Score (0-3) | Notes |
156
+ | --------------------------- | ------ | ----------- | --------------------------------------------------------- |
157
+ | Problem clarity | 10% | | 0=missing, 1=vague, 2=clear, 3=compelling |
158
+ | Acceptance criteria quality | 20% | | 0=missing, 1=vague, 2=testable, 3=Given/When/Then |
159
+ | Scope definition | 10% | | 0=missing, 1=in-scope only, 2=+out-of-scope, 3=+non-goals |
160
+ | Data model completeness | 20% | | 0=missing, 1=tables only, 2=+relations, 3=+RLS+indexes |
161
+ | API design | 15% | | 0=missing, 1=endpoints only, 2=+shapes, 3=+errors+auth |
162
+ | Agent-ready extension | 15% | | 0=missing, 1=quality gates, 2=+autonomy, 3=+promise |
163
+ | Architecture compliance | 10% | | 0=missing, 1=partial, 2=most checks, 3=all checks pass |
164
+
165
+ **Minimum for handoff: Average score >= 2.0**
166
+ **Recommended for autonomous execution: Average score >= 2.5**