chati-dev 1.3.3 → 2.0.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 (215) hide show
  1. package/README.md +7 -6
  2. package/framework/agents/build/dev.md +343 -0
  3. package/framework/agents/clarity/architect.md +113 -0
  4. package/framework/agents/clarity/brief.md +183 -0
  5. package/framework/agents/clarity/brownfield-wu.md +182 -0
  6. package/framework/agents/clarity/detail.md +111 -0
  7. package/framework/agents/clarity/greenfield-wu.md +154 -0
  8. package/framework/agents/clarity/phases.md +1 -0
  9. package/framework/agents/clarity/tasks.md +1 -0
  10. package/framework/agents/clarity/ux.md +113 -0
  11. package/framework/agents/deploy/devops.md +1 -0
  12. package/framework/agents/quality/qa-implementation.md +1 -0
  13. package/framework/agents/quality/qa-planning.md +1 -0
  14. package/framework/config.yaml +3 -3
  15. package/framework/constitution.md +58 -1
  16. package/framework/context/governance.md +37 -0
  17. package/framework/context/protocols.md +34 -0
  18. package/framework/context/quality.md +27 -0
  19. package/framework/context/root.md +24 -0
  20. package/framework/data/entity-registry.yaml +1 -1
  21. package/framework/domains/agents/architect.yaml +51 -0
  22. package/framework/domains/agents/brief.yaml +47 -0
  23. package/framework/domains/agents/brownfield-wu.yaml +49 -0
  24. package/framework/domains/agents/detail.yaml +47 -0
  25. package/framework/domains/agents/dev.yaml +49 -0
  26. package/framework/domains/agents/devops.yaml +43 -0
  27. package/framework/domains/agents/greenfield-wu.yaml +47 -0
  28. package/framework/domains/agents/orchestrator.yaml +49 -0
  29. package/framework/domains/agents/phases.yaml +47 -0
  30. package/framework/domains/agents/qa-implementation.yaml +43 -0
  31. package/framework/domains/agents/qa-planning.yaml +44 -0
  32. package/framework/domains/agents/tasks.yaml +48 -0
  33. package/framework/domains/agents/ux.yaml +50 -0
  34. package/framework/domains/constitution.yaml +77 -0
  35. package/framework/domains/global.yaml +64 -0
  36. package/framework/domains/workflows/brownfield-discovery.yaml +16 -0
  37. package/framework/domains/workflows/brownfield-fullstack.yaml +26 -0
  38. package/framework/domains/workflows/brownfield-service.yaml +22 -0
  39. package/framework/domains/workflows/brownfield-ui.yaml +22 -0
  40. package/framework/domains/workflows/greenfield-fullstack.yaml +26 -0
  41. package/framework/hooks/constitution-guard.js +101 -0
  42. package/framework/hooks/mode-governance.js +92 -0
  43. package/framework/hooks/model-governance.js +76 -0
  44. package/framework/hooks/prism-engine.js +89 -0
  45. package/framework/hooks/session-digest.js +60 -0
  46. package/framework/hooks/settings.json +44 -0
  47. package/framework/i18n/en.yaml +3 -3
  48. package/framework/i18n/es.yaml +3 -3
  49. package/framework/i18n/fr.yaml +3 -3
  50. package/framework/i18n/pt.yaml +3 -3
  51. package/framework/intelligence/context-engine.md +2 -2
  52. package/framework/intelligence/decision-engine.md +1 -1
  53. package/framework/migrations/v1.4-to-v2.0.yaml +167 -0
  54. package/framework/migrations/v2.0-to-v2.0.1.yaml +132 -0
  55. package/framework/orchestrator/chati.md +350 -7
  56. package/framework/schemas/session.schema.json +15 -0
  57. package/framework/tasks/architect-api-design.md +63 -0
  58. package/framework/tasks/architect-consolidate.md +47 -0
  59. package/framework/tasks/architect-db-design.md +73 -0
  60. package/framework/tasks/architect-design.md +95 -0
  61. package/framework/tasks/architect-security-review.md +62 -0
  62. package/framework/tasks/architect-stack-selection.md +53 -0
  63. package/framework/tasks/brief-consolidate.md +249 -0
  64. package/framework/tasks/brief-constraint-identify.md +277 -0
  65. package/framework/tasks/brief-extract-requirements.md +339 -0
  66. package/framework/tasks/brief-stakeholder-map.md +176 -0
  67. package/framework/tasks/brief-validate-completeness.md +121 -0
  68. package/framework/tasks/brownfield-wu-architecture-map.md +394 -0
  69. package/framework/tasks/brownfield-wu-deep-discovery.md +312 -0
  70. package/framework/tasks/brownfield-wu-dependency-scan.md +359 -0
  71. package/framework/tasks/brownfield-wu-migration-plan.md +483 -0
  72. package/framework/tasks/brownfield-wu-report.md +325 -0
  73. package/framework/tasks/brownfield-wu-risk-assess.md +424 -0
  74. package/framework/tasks/detail-acceptance-criteria.md +372 -0
  75. package/framework/tasks/detail-consolidate.md +138 -0
  76. package/framework/tasks/detail-edge-case-analysis.md +300 -0
  77. package/framework/tasks/detail-expand-prd.md +389 -0
  78. package/framework/tasks/detail-nfr-extraction.md +223 -0
  79. package/framework/tasks/dev-code-review.md +404 -0
  80. package/framework/tasks/dev-consolidate.md +543 -0
  81. package/framework/tasks/dev-debug.md +322 -0
  82. package/framework/tasks/dev-implement.md +252 -0
  83. package/framework/tasks/dev-iterate.md +411 -0
  84. package/framework/tasks/dev-pr-prepare.md +497 -0
  85. package/framework/tasks/dev-refactor.md +342 -0
  86. package/framework/tasks/dev-test-write.md +306 -0
  87. package/framework/tasks/devops-ci-setup.md +412 -0
  88. package/framework/tasks/devops-consolidate.md +712 -0
  89. package/framework/tasks/devops-deploy-config.md +598 -0
  90. package/framework/tasks/devops-monitoring-setup.md +658 -0
  91. package/framework/tasks/devops-release-prepare.md +673 -0
  92. package/framework/tasks/greenfield-wu-analyze-empty.md +169 -0
  93. package/framework/tasks/greenfield-wu-report.md +266 -0
  94. package/framework/tasks/greenfield-wu-scaffold-detection.md +203 -0
  95. package/framework/tasks/greenfield-wu-tech-stack-assess.md +255 -0
  96. package/framework/tasks/orchestrator-deviation.md +260 -0
  97. package/framework/tasks/orchestrator-escalate.md +276 -0
  98. package/framework/tasks/orchestrator-handoff.md +243 -0
  99. package/framework/tasks/orchestrator-health.md +372 -0
  100. package/framework/tasks/orchestrator-mode-switch.md +262 -0
  101. package/framework/tasks/orchestrator-resume.md +189 -0
  102. package/framework/tasks/orchestrator-route.md +169 -0
  103. package/framework/tasks/orchestrator-spawn-terminal.md +358 -0
  104. package/framework/tasks/orchestrator-status.md +260 -0
  105. package/framework/tasks/orchestrator-suggest-mode.md +372 -0
  106. package/framework/tasks/phases-breakdown.md +91 -0
  107. package/framework/tasks/phases-dependency-mapping.md +67 -0
  108. package/framework/tasks/phases-mvp-scoping.md +94 -0
  109. package/framework/tasks/qa-impl-consolidate.md +522 -0
  110. package/framework/tasks/qa-impl-performance-test.md +487 -0
  111. package/framework/tasks/qa-impl-regression-check.md +413 -0
  112. package/framework/tasks/qa-impl-sast-scan.md +402 -0
  113. package/framework/tasks/qa-impl-test-execute.md +344 -0
  114. package/framework/tasks/qa-impl-verdict.md +339 -0
  115. package/framework/tasks/qa-planning-consolidate.md +309 -0
  116. package/framework/tasks/qa-planning-coverage-plan.md +338 -0
  117. package/framework/tasks/qa-planning-gate-define.md +339 -0
  118. package/framework/tasks/qa-planning-risk-matrix.md +631 -0
  119. package/framework/tasks/qa-planning-test-strategy.md +217 -0
  120. package/framework/tasks/tasks-acceptance-write.md +75 -0
  121. package/framework/tasks/tasks-consolidate.md +57 -0
  122. package/framework/tasks/tasks-decompose.md +80 -0
  123. package/framework/tasks/tasks-estimate.md +66 -0
  124. package/framework/tasks/ux-a11y-check.md +49 -0
  125. package/framework/tasks/ux-component-map.md +55 -0
  126. package/framework/tasks/ux-consolidate.md +46 -0
  127. package/framework/tasks/ux-user-flow.md +46 -0
  128. package/framework/tasks/ux-wireframe.md +76 -0
  129. package/package.json +1 -1
  130. package/scripts/bundle-framework.js +2 -0
  131. package/scripts/changelog-generator.js +222 -0
  132. package/scripts/codebase-mapper.js +728 -0
  133. package/scripts/commit-message-generator.js +167 -0
  134. package/scripts/coverage-analyzer.js +260 -0
  135. package/scripts/dependency-analyzer.js +280 -0
  136. package/scripts/framework-analyzer.js +308 -0
  137. package/scripts/generate-constitution-domain.js +253 -0
  138. package/scripts/health-check.js +481 -0
  139. package/scripts/ide-sync.js +327 -0
  140. package/scripts/performance-analyzer.js +325 -0
  141. package/scripts/plan-tracker.js +278 -0
  142. package/scripts/populate-entity-registry.js +481 -0
  143. package/scripts/pr-review.js +317 -0
  144. package/scripts/rollback-manager.js +310 -0
  145. package/scripts/stuck-detector.js +343 -0
  146. package/scripts/test-quality-assessment.js +257 -0
  147. package/scripts/validate-agents.js +367 -0
  148. package/scripts/validate-tasks.js +465 -0
  149. package/src/autonomy/autonomous-gate.js +293 -0
  150. package/src/autonomy/index.js +51 -0
  151. package/src/autonomy/mode-manager.js +225 -0
  152. package/src/autonomy/mode-suggester.js +283 -0
  153. package/src/autonomy/progress-reporter.js +268 -0
  154. package/src/autonomy/safety-net.js +320 -0
  155. package/src/context/bracket-tracker.js +79 -0
  156. package/src/context/domain-loader.js +107 -0
  157. package/src/context/engine.js +144 -0
  158. package/src/context/formatter.js +184 -0
  159. package/src/context/index.js +4 -0
  160. package/src/context/layers/l0-constitution.js +28 -0
  161. package/src/context/layers/l1-global.js +37 -0
  162. package/src/context/layers/l2-agent.js +39 -0
  163. package/src/context/layers/l3-workflow.js +42 -0
  164. package/src/context/layers/l4-task.js +24 -0
  165. package/src/decision/analyzer.js +167 -0
  166. package/src/decision/engine.js +270 -0
  167. package/src/decision/index.js +38 -0
  168. package/src/decision/registry-healer.js +450 -0
  169. package/src/decision/registry-updater.js +330 -0
  170. package/src/gates/circuit-breaker.js +119 -0
  171. package/src/gates/g1-planning-complete.js +153 -0
  172. package/src/gates/g2-qa-planning.js +153 -0
  173. package/src/gates/g3-implementation.js +188 -0
  174. package/src/gates/g4-qa-implementation.js +207 -0
  175. package/src/gates/g5-deploy-ready.js +180 -0
  176. package/src/gates/gate-base.js +144 -0
  177. package/src/gates/index.js +46 -0
  178. package/src/installer/brownfield-upgrader.js +249 -0
  179. package/src/installer/core.js +55 -3
  180. package/src/installer/file-hasher.js +51 -0
  181. package/src/installer/manifest.js +117 -0
  182. package/src/installer/templates.js +17 -15
  183. package/src/installer/transaction.js +229 -0
  184. package/src/installer/validator.js +18 -1
  185. package/src/intelligence/registry-manager.js +2 -2
  186. package/src/memory/agent-memory.js +255 -0
  187. package/src/memory/gotchas-injector.js +72 -0
  188. package/src/memory/gotchas.js +361 -0
  189. package/src/memory/index.js +35 -0
  190. package/src/memory/search.js +233 -0
  191. package/src/memory/session-digest.js +239 -0
  192. package/src/merger/env-merger.js +112 -0
  193. package/src/merger/index.js +56 -0
  194. package/src/merger/replace-merger.js +51 -0
  195. package/src/merger/yaml-merger.js +127 -0
  196. package/src/orchestrator/agent-selector.js +285 -0
  197. package/src/orchestrator/deviation-handler.js +350 -0
  198. package/src/orchestrator/handoff-engine.js +271 -0
  199. package/src/orchestrator/index.js +67 -0
  200. package/src/orchestrator/intent-classifier.js +264 -0
  201. package/src/orchestrator/pipeline-manager.js +492 -0
  202. package/src/orchestrator/pipeline-state.js +223 -0
  203. package/src/orchestrator/session-manager.js +409 -0
  204. package/src/tasks/executor.js +195 -0
  205. package/src/tasks/handoff.js +226 -0
  206. package/src/tasks/index.js +4 -0
  207. package/src/tasks/loader.js +210 -0
  208. package/src/tasks/router.js +182 -0
  209. package/src/terminal/collector.js +216 -0
  210. package/src/terminal/index.js +30 -0
  211. package/src/terminal/isolation.js +129 -0
  212. package/src/terminal/monitor.js +277 -0
  213. package/src/terminal/spawner.js +269 -0
  214. package/src/upgrade/checker.js +1 -1
  215. package/src/wizard/i18n.js +3 -3
@@ -0,0 +1,372 @@
1
+ ---
2
+ id: detail-acceptance-criteria
3
+ agent: detail
4
+ trigger: detail-edge-case-analysis
5
+ phase: clarity
6
+ requires_input: false
7
+ parallelizable: false
8
+ outputs: [acceptance-criteria.yaml]
9
+ handoff_to: detail-consolidate
10
+ autonomous_gate: true
11
+ criteria:
12
+ - All functional requirements have Given-When-Then criteria
13
+ - Edge cases incorporated into criteria
14
+ - Testable acceptance scenarios defined
15
+ ---
16
+ # Write Acceptance Criteria for All Requirements
17
+
18
+ ## Purpose
19
+ Create comprehensive, testable Given-When-Then acceptance criteria for every functional requirement and edge case.
20
+
21
+ ## Prerequisites
22
+ - `prd-draft.yaml` with FRs
23
+ - `edge-cases.yaml` with scenarios
24
+
25
+ ## Steps
26
+
27
+ ### 1. Load FRs and Edge Cases
28
+ Combine functional requirements with identified edge cases.
29
+
30
+ ### 2. For Each Functional Requirement, Write Main Scenarios
31
+ Use Given-When-Then format:
32
+ - **Given**: Initial state/context
33
+ - **When**: User action or system event
34
+ - **Then**: Expected outcome
35
+
36
+ ### 3. Add Happy Path Scenarios
37
+ Normal, expected user flow without errors.
38
+
39
+ ### 4. Add Error Path Scenarios
40
+ From edge-cases.yaml, include failure scenarios.
41
+
42
+ ### 5. Add Boundary Condition Scenarios
43
+ Test at min, max, below-min, above-max values.
44
+
45
+ ### 6. Ensure Testability
46
+ Each criterion must be:
47
+ - Unambiguous (one clear interpretation)
48
+ - Testable (can verify pass/fail)
49
+ - Specific (not vague)
50
+ - Independent (not dependent on order)
51
+
52
+ ### 7. Add Non-Functional Acceptance Criteria
53
+ Performance, security, usability criteria in testable format.
54
+
55
+ ### 8. Link to UI Mockups
56
+ Reference screen names and elements.
57
+
58
+ ### 9. Priority Tag Each Criterion
59
+ P0 (must-have), P1 (should-have), P2 (nice-to-have).
60
+
61
+ ### 10. Generate Complete Acceptance Criteria Document
62
+ Comprehensive, ready for development and QA.
63
+
64
+ ## Decision Points
65
+ None - systematic translation of requirements.
66
+
67
+ ## Error Handling
68
+ - **Ambiguous FR**: Note ambiguity and provide best interpretation
69
+
70
+ ## Output Format
71
+ ```yaml
72
+ # acceptance-criteria.yaml
73
+ timestamp: 2026-02-13T15:30:00Z
74
+
75
+ FR-001-user-registration:
76
+ happy_path:
77
+ - scenario: Successful registration with valid inputs
78
+ priority: P0
79
+ given: |
80
+ - User is on /register page
81
+ - User is not authenticated
82
+ - Email "newuser@example.com" does not exist in database
83
+ when: |
84
+ User fills in:
85
+ - Email: newuser@example.com
86
+ - Password: ValidPass123
87
+ And clicks "Register" button
88
+ then: |
89
+ - HTTP 201 Created response received
90
+ - User account created in database with hashed password
91
+ - JWT token returned in response
92
+ - Token stored in localStorage
93
+ - User redirected to /dashboard
94
+ - Success message displayed: "Welcome! Your account has been created."
95
+ test_type: [integration, e2e]
96
+
97
+ error_paths:
98
+ - scenario: Registration with existing email
99
+ priority: P0
100
+ given: |
101
+ - User is on /register page
102
+ - Email "existing@example.com" already exists in database
103
+ when: |
104
+ User submits form with:
105
+ - Email: existing@example.com
106
+ - Password: ValidPass123
107
+ then: |
108
+ - HTTP 409 Conflict response
109
+ - Error message displayed: "Email already registered"
110
+ - Form remains filled (password cleared for security)
111
+ - User remains on /register page
112
+ - No account created
113
+ test_type: [integration, e2e]
114
+
115
+ - scenario: Registration with weak password
116
+ priority: P0
117
+ given: User is on /register page
118
+ when: |
119
+ User submits form with:
120
+ - Email: newuser@example.com
121
+ - Password: weak (no uppercase, no number)
122
+ then: |
123
+ - HTTP 400 Bad Request response
124
+ - Error message: "Password must contain at least 1 uppercase letter and 1 number"
125
+ - Password requirements shown
126
+ - Form not submitted
127
+ test_type: [unit, integration]
128
+
129
+ - scenario: Registration with invalid email format
130
+ priority: P0
131
+ given: User is on /register page
132
+ when: |
133
+ User submits form with:
134
+ - Email: not-an-email
135
+ - Password: ValidPass123
136
+ then: |
137
+ - HTTP 400 Bad Request response
138
+ - Error message: "Invalid email format"
139
+ - Form not submitted
140
+ test_type: [unit, integration]
141
+
142
+ boundary_conditions:
143
+ - scenario: Registration with minimum valid password (8 chars)
144
+ priority: P1
145
+ given: User is on /register page
146
+ when: |
147
+ User submits:
148
+ - Email: test@example.com
149
+ - Password: Abcd123! (exactly 8 chars)
150
+ then: |
151
+ - Registration succeeds
152
+ - Account created
153
+ test_type: [unit]
154
+
155
+ - scenario: Registration with password below minimum (7 chars)
156
+ priority: P1
157
+ given: User is on /register page
158
+ when: |
159
+ User submits password with 7 characters
160
+ then: |
161
+ - HTTP 400 error
162
+ - Error: "Password must be at least 8 characters"
163
+ test_type: [unit]
164
+
165
+ - scenario: Registration with maximum password length (256 chars)
166
+ priority: P2
167
+ given: User is on /register page
168
+ when: User submits 256-character password
169
+ then: Registration succeeds
170
+ test_type: [unit]
171
+
172
+ - scenario: Registration with excessive password length (300 chars)
173
+ priority: P2
174
+ given: User is on /register page
175
+ when: User submits 300-character password
176
+ then: |
177
+ - HTTP 400 error
178
+ - Error: "Password exceeds maximum length (256 characters)"
179
+ test_type: [unit]
180
+
181
+ security:
182
+ - scenario: SQL injection attempt in email field
183
+ priority: P0
184
+ given: User is on /register page
185
+ when: |
186
+ User submits:
187
+ - Email: admin'--
188
+ - Password: ValidPass123
189
+ then: |
190
+ - Parameterized query prevents injection
191
+ - Email validation rejects format
192
+ - HTTP 400 error
193
+ - No database compromise
194
+ test_type: [security]
195
+
196
+ - scenario: Password is hashed before storage
197
+ priority: P0
198
+ given: User registers successfully
199
+ when: Account created in database
200
+ then: |
201
+ - Password stored as bcrypt hash
202
+ - Original password not in database
203
+ - Hash starts with "$2b$12$" (bcrypt signature)
204
+ test_type: [integration]
205
+
206
+ ui_behavior:
207
+ - scenario: Real-time password strength indicator
208
+ priority: P1
209
+ given: User is on /register page
210
+ when: User types password in password field
211
+ then: |
212
+ - Password strength indicator updates in real-time
213
+ - Shows "Weak", "Medium", or "Strong"
214
+ - Displays which requirements are met/unmet
215
+ test_type: [e2e]
216
+
217
+ - scenario: Form validation on blur
218
+ priority: P1
219
+ given: User is on /register page
220
+ when: User enters invalid email and moves to password field (blur)
221
+ then: |
222
+ - Email validation error shown immediately
223
+ - Error visible before form submission
224
+ test_type: [e2e]
225
+
226
+ FR-003-create-post:
227
+ happy_path:
228
+ - scenario: Create post with title, content, and tags
229
+ priority: P0
230
+ given: |
231
+ - User is authenticated
232
+ - User is on /posts/new page
233
+ when: |
234
+ User fills in:
235
+ - Title: "My First Post"
236
+ - Content: "This is the content..."
237
+ - Tags: ["technology", "tutorial"]
238
+ And clicks "Publish"
239
+ then: |
240
+ - HTTP 201 Created
241
+ - Post created in database with:
242
+ - user_id = current user
243
+ - published_at = current timestamp
244
+ - User redirected to /posts/:new_post_id
245
+ - Success message: "Post published successfully"
246
+ test_type: [integration, e2e]
247
+
248
+ error_paths:
249
+ - scenario: Create post without title
250
+ priority: P0
251
+ given: User is on /posts/new
252
+ when: |
253
+ User submits:
254
+ - Title: "" (empty)
255
+ - Content: "Content here"
256
+ then: |
257
+ - HTTP 400 error
258
+ - Error: "Title is required"
259
+ - Post not created
260
+ test_type: [integration]
261
+
262
+ - scenario: Unauthenticated user tries to create post
263
+ priority: P0
264
+ given: User is not authenticated
265
+ when: User sends POST /api/posts
266
+ then: |
267
+ - HTTP 401 Unauthorized
268
+ - Error: "Authentication required"
269
+ - Post not created
270
+ test_type: [integration]
271
+
272
+ - scenario: Upload image exceeding 5MB
273
+ priority: P0
274
+ given: User is creating post
275
+ when: User uploads 6MB image
276
+ then: |
277
+ - HTTP 413 Payload Too Large
278
+ - Error: "Image must be smaller than 5MB"
279
+ - Image not uploaded
280
+ test_type: [integration]
281
+
282
+ boundary_conditions:
283
+ - scenario: Title at maximum length (200 chars)
284
+ priority: P1
285
+ given: User is creating post
286
+ when: User submits 200-character title
287
+ then: Post created successfully
288
+ test_type: [integration]
289
+
290
+ - scenario: Title exceeding maximum (201 chars)
291
+ priority: P1
292
+ given: User is creating post
293
+ when: User submits 201-character title
294
+ then: |
295
+ - HTTP 400 error
296
+ - Error: "Title must be 200 characters or less"
297
+ test_type: [integration]
298
+
299
+ NFR-PERF-001-api-response-time:
300
+ acceptance_criteria:
301
+ - scenario: API response time under normal load
302
+ priority: P0
303
+ given: System under normal load (<1000 concurrent users)
304
+ when: API endpoint is called (GET /api/posts)
305
+ then: |
306
+ - p50 response time < 200ms
307
+ - p95 response time < 500ms
308
+ - p99 response time < 1000ms
309
+ test_type: [performance]
310
+ measurement: Load testing with k6 or JMeter
311
+
312
+ - scenario: API response time under high load
313
+ priority: P1
314
+ given: System under high load (5000-10000 concurrent users)
315
+ when: API endpoint is called
316
+ then: |
317
+ - p50 response time < 300ms
318
+ - p95 response time < 1000ms
319
+ - No 5xx errors
320
+ test_type: [performance]
321
+
322
+ NFR-SEC-001-https:
323
+ acceptance_criteria:
324
+ - scenario: All HTTP requests redirected to HTTPS
325
+ priority: P0
326
+ given: Server is running
327
+ when: Client makes HTTP request to http://example.com/any-path
328
+ then: |
329
+ - HTTP 301 Moved Permanently response
330
+ - Location header points to https://example.com/any-path
331
+ - Client automatically redirected
332
+ test_type: [integration]
333
+
334
+ - scenario: HSTS header present
335
+ priority: P1
336
+ given: Server is running
337
+ when: Client makes HTTPS request
338
+ then: |
339
+ - Strict-Transport-Security header present
340
+ - max-age=31536000 (1 year)
341
+ test_type: [integration]
342
+
343
+ test_coverage_requirements:
344
+ unit_tests:
345
+ - All validation functions (email, password, title, etc.)
346
+ - Business logic (post creation, user registration)
347
+ - Utility functions (password hashing, JWT generation)
348
+ target_coverage: 90%
349
+ integration_tests:
350
+ - All API endpoints (success and error paths)
351
+ - Database operations (CRUD, constraints)
352
+ - Authentication middleware
353
+ target_coverage: 80%
354
+ e2e_tests:
355
+ - Critical user flows (register → login → create post → view post)
356
+ - Search functionality
357
+ - Error handling (network errors, validation)
358
+ target_coverage: Key user journeys
359
+
360
+ definition_of_done:
361
+ - All P0 acceptance criteria passing
362
+ - All P1 acceptance criteria passing or explicitly deferred
363
+ - Code reviewed and approved
364
+ - Unit test coverage >90%
365
+ - Integration tests passing
366
+ - E2E tests for critical paths passing
367
+ - Security tests passing (no SQL injection, XSS)
368
+ - Performance tests meeting NFRs
369
+ - Documentation updated (API docs, README)
370
+ - Deployed to staging and validated
371
+ - Product Owner sign-off
372
+ ```
@@ -0,0 +1,138 @@
1
+ ---
2
+ id: detail-consolidate
3
+ agent: detail
4
+ trigger: detail-acceptance-criteria
5
+ phase: clarity
6
+ requires_input: false
7
+ parallelizable: false
8
+ outputs: [prd.yaml]
9
+ handoff_to: architect
10
+ autonomous_gate: true
11
+ criteria:
12
+ - All detail artifacts consolidated into single PRD
13
+ - PRD is comprehensive and ready for architecture phase
14
+ - Completeness score >= 98%
15
+ ---
16
+ # Consolidate Final PRD
17
+
18
+ ## Purpose
19
+ Merge all detailed analysis into a comprehensive, production-ready Product Requirements Document.
20
+
21
+ ## Prerequisites
22
+ - `brief.yaml`
23
+ - `prd-draft.yaml`
24
+ - `nfr.yaml`
25
+ - `edge-cases.yaml`
26
+ - `acceptance-criteria.yaml`
27
+
28
+ ## Steps
29
+
30
+ ### 1. Load All Artifacts
31
+ Read and verify all prerequisite documents.
32
+
33
+ ### 2. Create PRD Structure
34
+ Standard sections:
35
+ - Executive Summary
36
+ - Project Vision and Goals
37
+ - Functional Requirements (detailed)
38
+ - Non-Functional Requirements
39
+ - Data Models
40
+ - API Specifications
41
+ - UI Specifications
42
+ - Acceptance Criteria
43
+ - Edge Cases and Error Handling
44
+ - Assumptions and Dependencies
45
+ - Success Metrics
46
+ - Glossary
47
+
48
+ ### 3. Merge Functional Requirements
49
+ Combine FR details from prd-draft.yaml with acceptance criteria from acceptance-criteria.yaml.
50
+
51
+ ### 4. Consolidate NFRs
52
+ Include detailed NFRs with implementation approaches.
53
+
54
+ ### 5. Document Complete Data Models
55
+ Include relationships, constraints, indexes.
56
+
57
+ ### 6. Specify API Contracts
58
+ Complete endpoint specifications with request/response examples.
59
+
60
+ ### 7. Include All Acceptance Criteria
61
+ Link each FR to its testable criteria.
62
+
63
+ ### 8. Document Edge Cases
64
+ Comprehensive error handling documentation.
65
+
66
+ ### 9. Add Visual Documentation
67
+ ASCII diagrams for:
68
+ - Data model ERD
69
+ - System architecture (high-level)
70
+ - User flow diagrams
71
+
72
+ ### 10. Calculate Completeness Score
73
+ Verify all required sections present and detailed.
74
+
75
+ ## Decision Points
76
+ None - consolidation is mechanical.
77
+
78
+ ## Error Handling
79
+ - **Missing Sections**: Flag and request completion of prerequisite tasks
80
+
81
+ ## Output Format
82
+ ```yaml
83
+ # prd.yaml
84
+ document_type: Product Requirements Document
85
+ version: 1.0
86
+ timestamp: 2026-02-13T16:00:00Z
87
+ status: complete
88
+ completeness_score: 98
89
+
90
+ executive_summary: |
91
+ [Full summary from brief, enhanced with technical details]
92
+
93
+ project_vision: |
94
+ [Vision statement]
95
+
96
+ goals:
97
+ business: [List of business goals]
98
+ technical: [List of technical goals]
99
+ user: [List of user goals]
100
+
101
+ functional_requirements:
102
+ [Complete FR list with all details, acceptance criteria, edge cases]
103
+
104
+ non_functional_requirements:
105
+ [Complete NFR list with metrics and implementation]
106
+
107
+ data_models:
108
+ [Complete data model specifications]
109
+
110
+ api_specifications:
111
+ [Complete API endpoint documentation]
112
+
113
+ ui_specifications:
114
+ [Complete UI screen definitions]
115
+
116
+ acceptance_criteria:
117
+ [All Given-When-Then scenarios]
118
+
119
+ edge_cases:
120
+ [All edge case handling]
121
+
122
+ assumptions:
123
+ [List of all assumptions]
124
+
125
+ dependencies:
126
+ [External dependencies and integrations]
127
+
128
+ success_metrics:
129
+ [Measurable success criteria]
130
+
131
+ glossary:
132
+ [Terms and definitions]
133
+
134
+ next_phase: architecture
135
+ handoff_note: |
136
+ PRD complete with comprehensive functional and non-functional requirements,
137
+ acceptance criteria, and edge case handling. Ready for architecture design.
138
+ ```