siesa-agents 2.1.1 → 2.1.3-dev.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 (147) hide show
  1. package/README.md +83 -83
  2. package/bin/install.js +400 -399
  3. package/bin/prepare-publish.js +26 -26
  4. package/bin/restore-folders.js +26 -26
  5. package/bmad-core/agent-teams/team-all.yaml +15 -15
  6. package/bmad-core/agent-teams/team-fullstack.yaml +19 -19
  7. package/bmad-core/agent-teams/team-ide-minimal.yaml +11 -11
  8. package/bmad-core/agent-teams/team-no-ui.yaml +14 -14
  9. package/bmad-core/agents/analyst.md +84 -84
  10. package/bmad-core/agents/architect.md +94 -94
  11. package/bmad-core/agents/backend-agent.md +189 -189
  12. package/bmad-core/agents/bmad-master.md +110 -110
  13. package/bmad-core/agents/bmad-orchestrator.md +147 -147
  14. package/bmad-core/agents/dev.md +81 -81
  15. package/bmad-core/agents/frontend-agent.md +168 -168
  16. package/bmad-core/agents/pm.md +84 -84
  17. package/bmad-core/agents/po.md +79 -79
  18. package/bmad-core/agents/qa.md +91 -91
  19. package/bmad-core/agents/sm.md +65 -65
  20. package/bmad-core/agents/ux-expert.md +69 -69
  21. package/bmad-core/checklists/architect-checklist.md +440 -440
  22. package/bmad-core/checklists/backend-checklist.md +142 -142
  23. package/bmad-core/checklists/change-checklist.md +184 -184
  24. package/bmad-core/checklists/frontend-checklist.md +105 -105
  25. package/bmad-core/checklists/pm-checklist.md +372 -372
  26. package/bmad-core/checklists/po-master-checklist.md +434 -434
  27. package/bmad-core/checklists/story-dod-checklist.md +96 -96
  28. package/bmad-core/checklists/story-draft-checklist.md +155 -155
  29. package/bmad-core/core-config.yaml +22 -22
  30. package/bmad-core/data/backend-standards.md +439 -439
  31. package/bmad-core/data/bmad-kb.md +809 -809
  32. package/bmad-core/data/brainstorming-techniques.md +38 -38
  33. package/bmad-core/data/elicitation-methods.md +156 -156
  34. package/bmad-core/data/frontend-standards.md +323 -323
  35. package/bmad-core/data/technical-preferences.md +5 -5
  36. package/bmad-core/data/test-levels-framework.md +148 -148
  37. package/bmad-core/data/test-priorities-matrix.md +174 -174
  38. package/bmad-core/enhanced-ide-development-workflow.md +248 -248
  39. package/bmad-core/install-manifest.yaml +230 -230
  40. package/bmad-core/tasks/advanced-elicitation.md +119 -119
  41. package/bmad-core/tasks/apply-qa-fixes.md +150 -150
  42. package/bmad-core/tasks/brownfield-create-epic.md +162 -162
  43. package/bmad-core/tasks/brownfield-create-story.md +149 -149
  44. package/bmad-core/tasks/correct-course.md +72 -72
  45. package/bmad-core/tasks/create-brownfield-story.md +314 -314
  46. package/bmad-core/tasks/create-component.md +102 -102
  47. package/bmad-core/tasks/create-deep-research-prompt.md +280 -280
  48. package/bmad-core/tasks/create-doc.md +103 -103
  49. package/bmad-core/tasks/create-entity.md +132 -132
  50. package/bmad-core/tasks/create-feature.md +90 -90
  51. package/bmad-core/tasks/create-next-story.md +114 -114
  52. package/bmad-core/tasks/create-service.md +117 -117
  53. package/bmad-core/tasks/create-use-case.md +140 -140
  54. package/bmad-core/tasks/document-project.md +345 -345
  55. package/bmad-core/tasks/execute-checklist.md +88 -88
  56. package/bmad-core/tasks/facilitate-brainstorming-session.md +138 -138
  57. package/bmad-core/tasks/generate-ai-frontend-prompt.md +53 -53
  58. package/bmad-core/tasks/index-docs.md +175 -175
  59. package/bmad-core/tasks/kb-mode-interaction.md +77 -77
  60. package/bmad-core/tasks/nfr-assess.md +345 -345
  61. package/bmad-core/tasks/qa-gate.md +163 -163
  62. package/bmad-core/tasks/review-story.md +316 -316
  63. package/bmad-core/tasks/risk-profile.md +355 -355
  64. package/bmad-core/tasks/scaffold-backend.md +110 -110
  65. package/bmad-core/tasks/scaffold-frontend.md +78 -78
  66. package/bmad-core/tasks/shard-doc.md +187 -187
  67. package/bmad-core/tasks/test-design.md +176 -176
  68. package/bmad-core/tasks/trace-requirements.md +266 -266
  69. package/bmad-core/tasks/validate-next-story.md +136 -136
  70. package/bmad-core/templates/architecture-tmpl.yaml +662 -662
  71. package/bmad-core/templates/brainstorming-output-tmpl.yaml +156 -156
  72. package/bmad-core/templates/brownfield-architecture-tmpl.yaml +477 -477
  73. package/bmad-core/templates/brownfield-prd-tmpl.yaml +281 -281
  74. package/bmad-core/templates/competitor-analysis-tmpl.yaml +307 -307
  75. package/bmad-core/templates/front-end-architecture-tmpl.yaml +258 -258
  76. package/bmad-core/templates/front-end-spec-tmpl.yaml +350 -350
  77. package/bmad-core/templates/fullstack-architecture-tmpl.yaml +824 -824
  78. package/bmad-core/templates/market-research-tmpl.yaml +253 -253
  79. package/bmad-core/templates/prd-tmpl.yaml +203 -203
  80. package/bmad-core/templates/project-brief-tmpl.yaml +222 -222
  81. package/bmad-core/templates/qa-gate-tmpl.yaml +103 -103
  82. package/bmad-core/templates/story-tmpl.yaml +138 -138
  83. package/bmad-core/user-guide.md +530 -530
  84. package/bmad-core/utils/bmad-doc-template.md +327 -327
  85. package/bmad-core/utils/workflow-management.md +71 -71
  86. package/bmad-core/workflows/brownfield-fullstack.yaml +298 -298
  87. package/bmad-core/workflows/brownfield-service.yaml +188 -188
  88. package/bmad-core/workflows/brownfield-ui.yaml +198 -198
  89. package/bmad-core/workflows/greenfield-fullstack.yaml +241 -241
  90. package/bmad-core/workflows/greenfield-service.yaml +207 -207
  91. package/bmad-core/workflows/greenfield-ui.yaml +236 -236
  92. package/bmad-core/working-in-the-brownfield.md +606 -606
  93. package/claude/commands/BMad/agents/analyst.md +88 -0
  94. package/claude/commands/BMad/agents/architect.md +89 -0
  95. package/claude/commands/BMad/agents/backend.md +188 -0
  96. package/claude/commands/BMad/agents/bmad-master.md +114 -0
  97. package/claude/commands/BMad/agents/bmad-orchestrator.md +151 -0
  98. package/claude/commands/BMad/agents/dev.md +85 -0
  99. package/claude/commands/BMad/agents/frontend.md +151 -0
  100. package/claude/commands/BMad/agents/pm.md +88 -0
  101. package/claude/commands/BMad/agents/po.md +83 -0
  102. package/claude/commands/BMad/agents/qa.md +95 -0
  103. package/claude/commands/BMad/agents/sm.md +69 -0
  104. package/claude/commands/BMad/agents/ux-expert.md +73 -0
  105. package/claude/commands/BMad/tasks/advanced-elicitation.md +123 -0
  106. package/claude/commands/BMad/tasks/apply-qa-fixes.md +154 -0
  107. package/claude/commands/BMad/tasks/brownfield-create-epic.md +166 -0
  108. package/claude/commands/BMad/tasks/brownfield-create-story.md +153 -0
  109. package/claude/commands/BMad/tasks/correct-course.md +76 -0
  110. package/claude/commands/BMad/tasks/create-brownfield-story.md +318 -0
  111. package/claude/commands/BMad/tasks/create-deep-research-prompt.md +284 -0
  112. package/claude/commands/BMad/tasks/create-doc.md +107 -0
  113. package/claude/commands/BMad/tasks/create-next-story.md +118 -0
  114. package/claude/commands/BMad/tasks/document-project.md +349 -0
  115. package/claude/commands/BMad/tasks/execute-checklist.md +92 -0
  116. package/claude/commands/BMad/tasks/facilitate-brainstorming-session.md +142 -0
  117. package/claude/commands/BMad/tasks/generate-ai-frontend-prompt.md +57 -0
  118. package/claude/commands/BMad/tasks/index-docs.md +179 -0
  119. package/claude/commands/BMad/tasks/kb-mode-interaction.md +81 -0
  120. package/claude/commands/BMad/tasks/nfr-assess.md +349 -0
  121. package/claude/commands/BMad/tasks/qa-gate.md +167 -0
  122. package/claude/commands/BMad/tasks/review-story.md +320 -0
  123. package/claude/commands/BMad/tasks/risk-profile.md +359 -0
  124. package/claude/commands/BMad/tasks/shard-doc.md +191 -0
  125. package/claude/commands/BMad/tasks/test-design.md +180 -0
  126. package/claude/commands/BMad/tasks/trace-requirements.md +270 -0
  127. package/claude/commands/BMad/tasks/validate-next-story.md +140 -0
  128. package/claude/hooks/file-restriction-hook.py +51 -0
  129. package/claude/hooks/track-agent.py +67 -0
  130. package/claude/settings.local.json +56 -0
  131. package/github/b-mad-expert.md +742 -742
  132. package/github/chatmodes/analyst.chatmode.md +89 -89
  133. package/github/chatmodes/architect.chatmode.md +97 -97
  134. package/github/chatmodes/backend.chatmode.md +194 -194
  135. package/github/chatmodes/bmad-master.chatmode.md +115 -115
  136. package/github/chatmodes/bmad-orchestrator.chatmode.md +152 -152
  137. package/github/chatmodes/dev.chatmode.md +86 -86
  138. package/github/chatmodes/frontend.chatmode.md +157 -157
  139. package/github/chatmodes/pm.chatmode.md +89 -89
  140. package/github/chatmodes/po.chatmode.md +84 -84
  141. package/github/chatmodes/qa.chatmode.md +96 -96
  142. package/github/chatmodes/sm.chatmode.md +70 -70
  143. package/github/chatmodes/ux-expert.chatmode.md +74 -74
  144. package/index.js +9 -9
  145. package/package.json +37 -36
  146. package/vscode/mcp.json +11 -11
  147. package/vscode/settings.json +12 -12
@@ -1,316 +1,316 @@
1
- <!-- Powered by BMAD™ Core -->
2
-
3
- # review-story
4
-
5
- Perform a comprehensive test architecture review with quality gate decision. This adaptive, risk-aware review creates both a story update and a detailed gate file.
6
-
7
- ## Inputs
8
-
9
- ```yaml
10
- required:
11
- - story_id: '{epic}.{story}' # e.g., "1.3"
12
- - story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml
13
- - story_title: '{title}' # If missing, derive from story file H1
14
- - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated)
15
- ```
16
-
17
- ## Prerequisites
18
-
19
- - Story status must be "Review"
20
- - Developer has completed all tasks and updated the File List
21
- - All automated tests are passing
22
-
23
- ## Review Process - Adaptive Test Architecture
24
-
25
- ### 1. Risk Assessment (Determines Review Depth)
26
-
27
- **Auto-escalate to deep review when:**
28
-
29
- - Auth/payment/security files touched
30
- - No tests added to story
31
- - Diff > 500 lines
32
- - Previous gate was FAIL/CONCERNS
33
- - Story has > 5 acceptance criteria
34
-
35
- ### 2. Comprehensive Analysis
36
-
37
- **A. Requirements Traceability**
38
-
39
- - Map each acceptance criteria to its validating tests (document mapping with Given-When-Then, not test code)
40
- - Identify coverage gaps
41
- - Verify all requirements have corresponding test cases
42
-
43
- **B. Code Quality Review**
44
-
45
- - Architecture and design patterns
46
- - Refactoring opportunities (and perform them)
47
- - Code duplication or inefficiencies
48
- - Performance optimizations
49
- - Security vulnerabilities
50
- - Best practices adherence
51
-
52
- **C. Test Architecture Assessment**
53
-
54
- - Test coverage adequacy at appropriate levels
55
- - Test level appropriateness (what should be unit vs integration vs e2e)
56
- - Test design quality and maintainability
57
- - Test data management strategy
58
- - Mock/stub usage appropriateness
59
- - Edge case and error scenario coverage
60
- - Test execution time and reliability
61
-
62
- **D. Non-Functional Requirements (NFRs)**
63
-
64
- - Security: Authentication, authorization, data protection
65
- - Performance: Response times, resource usage
66
- - Reliability: Error handling, recovery mechanisms
67
- - Maintainability: Code clarity, documentation
68
-
69
- **E. Testability Evaluation**
70
-
71
- - Controllability: Can we control the inputs?
72
- - Observability: Can we observe the outputs?
73
- - Debuggability: Can we debug failures easily?
74
-
75
- **F. Technical Debt Identification**
76
-
77
- - Accumulated shortcuts
78
- - Missing tests
79
- - Outdated dependencies
80
- - Architecture violations
81
-
82
- ### 3. Active Refactoring
83
-
84
- - Refactor code where safe and appropriate
85
- - Run tests to ensure changes don't break functionality
86
- - Document all changes in QA Results section with clear WHY and HOW
87
- - Do NOT alter story content beyond QA Results section
88
- - Do NOT change story Status or File List; recommend next status only
89
-
90
- ### 4. Standards Compliance Check
91
-
92
- - Verify adherence to `docs/coding-standards.md`
93
- - Check compliance with `docs/unified-project-structure.md`
94
- - Validate testing approach against `docs/testing-strategy.md`
95
- - Ensure all guidelines mentioned in the story are followed
96
-
97
- ### 5. Acceptance Criteria Validation
98
-
99
- - Verify each AC is fully implemented
100
- - Check for any missing functionality
101
- - Validate edge cases are handled
102
-
103
- ### 6. Documentation and Comments
104
-
105
- - Verify code is self-documenting where possible
106
- - Add comments for complex logic if missing
107
- - Ensure any API changes are documented
108
-
109
- ## Output 1: Update Story File - QA Results Section ONLY
110
-
111
- **CRITICAL**: You are ONLY authorized to update the "QA Results" section of the story file. DO NOT modify any other sections.
112
-
113
- **QA Results Anchor Rule:**
114
-
115
- - If `## QA Results` doesn't exist, append it at end of file
116
- - If it exists, append a new dated entry below existing entries
117
- - Never edit other sections
118
-
119
- After review and any refactoring, append your results to the story file in the QA Results section:
120
-
121
- ```markdown
122
- ## QA Results
123
-
124
- ### Review Date: [Date]
125
-
126
- ### Reviewed By: Quinn (Test Architect)
127
-
128
- ### Code Quality Assessment
129
-
130
- [Overall assessment of implementation quality]
131
-
132
- ### Refactoring Performed
133
-
134
- [List any refactoring you performed with explanations]
135
-
136
- - **File**: [filename]
137
- - **Change**: [what was changed]
138
- - **Why**: [reason for change]
139
- - **How**: [how it improves the code]
140
-
141
- ### Compliance Check
142
-
143
- - Coding Standards: [✓/✗] [notes if any]
144
- - Project Structure: [✓/✗] [notes if any]
145
- - Testing Strategy: [✓/✗] [notes if any]
146
- - All ACs Met: [✓/✗] [notes if any]
147
-
148
- ### Improvements Checklist
149
-
150
- [Check off items you handled yourself, leave unchecked for dev to address]
151
-
152
- - [x] Refactored user service for better error handling (services/user.service.ts)
153
- - [x] Added missing edge case tests (services/user.service.test.ts)
154
- - [ ] Consider extracting validation logic to separate validator class
155
- - [ ] Add integration test for error scenarios
156
- - [ ] Update API documentation for new error codes
157
-
158
- ### Security Review
159
-
160
- [Any security concerns found and whether addressed]
161
-
162
- ### Performance Considerations
163
-
164
- [Any performance issues found and whether addressed]
165
-
166
- ### Files Modified During Review
167
-
168
- [If you modified files, list them here - ask Dev to update File List]
169
-
170
- ### Gate Status
171
-
172
- Gate: {STATUS} → qa.qaLocation/gates/{epic}.{story}-{slug}.yml
173
- Risk profile: qa.qaLocation/assessments/{epic}.{story}-risk-{YYYYMMDD}.md
174
- NFR assessment: qa.qaLocation/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md
175
-
176
- # Note: Paths should reference core-config.yaml for custom configurations
177
-
178
- ### Recommended Status
179
-
180
- [✓ Ready for Done] / [✗ Changes Required - See unchecked items above]
181
- (Story owner decides final status)
182
- ```
183
-
184
- ## Output 2: Create Quality Gate File
185
-
186
- **Template and Directory:**
187
-
188
- - Render from `../templates/qa-gate-tmpl.yaml`
189
- - Create directory defined in `qa.qaLocation/gates` (see `bmad-core/core-config.yaml`) if missing
190
- - Save to: `qa.qaLocation/gates/{epic}.{story}-{slug}.yml`
191
-
192
- Gate file structure:
193
-
194
- ```yaml
195
- schema: 1
196
- story: '{epic}.{story}'
197
- story_title: '{story title}'
198
- gate: PASS|CONCERNS|FAIL|WAIVED
199
- status_reason: '1-2 sentence explanation of gate decision'
200
- reviewer: 'Quinn (Test Architect)'
201
- updated: '{ISO-8601 timestamp}'
202
-
203
- top_issues: [] # Empty if no issues
204
- waiver: { active: false } # Set active: true only if WAIVED
205
-
206
- # Extended fields (optional but recommended):
207
- quality_score: 0-100 # 100 - (20*FAILs) - (10*CONCERNS) or use technical-preferences.md weights
208
- expires: '{ISO-8601 timestamp}' # Typically 2 weeks from review
209
-
210
- evidence:
211
- tests_reviewed: { count }
212
- risks_identified: { count }
213
- trace:
214
- ac_covered: [1, 2, 3] # AC numbers with test coverage
215
- ac_gaps: [4] # AC numbers lacking coverage
216
-
217
- nfr_validation:
218
- security:
219
- status: PASS|CONCERNS|FAIL
220
- notes: 'Specific findings'
221
- performance:
222
- status: PASS|CONCERNS|FAIL
223
- notes: 'Specific findings'
224
- reliability:
225
- status: PASS|CONCERNS|FAIL
226
- notes: 'Specific findings'
227
- maintainability:
228
- status: PASS|CONCERNS|FAIL
229
- notes: 'Specific findings'
230
-
231
- recommendations:
232
- immediate: # Must fix before production
233
- - action: 'Add rate limiting'
234
- refs: ['api/auth/login.ts']
235
- future: # Can be addressed later
236
- - action: 'Consider caching'
237
- refs: ['services/data.ts']
238
- ```
239
-
240
- ### Gate Decision Criteria
241
-
242
- **Deterministic rule (apply in order):**
243
-
244
- If risk_summary exists, apply its thresholds first (≥9 → FAIL, ≥6 → CONCERNS), then NFR statuses, then top_issues severity.
245
-
246
- 1. **Risk thresholds (if risk_summary present):**
247
- - If any risk score ≥ 9 → Gate = FAIL (unless waived)
248
- - Else if any score ≥ 6 → Gate = CONCERNS
249
-
250
- 2. **Test coverage gaps (if trace available):**
251
- - If any P0 test from test-design is missing → Gate = CONCERNS
252
- - If security/data-loss P0 test missing → Gate = FAIL
253
-
254
- 3. **Issue severity:**
255
- - If any `top_issues.severity == high` → Gate = FAIL (unless waived)
256
- - Else if any `severity == medium` → Gate = CONCERNS
257
-
258
- 4. **NFR statuses:**
259
- - If any NFR status is FAIL → Gate = FAIL
260
- - Else if any NFR status is CONCERNS → Gate = CONCERNS
261
- - Else → Gate = PASS
262
-
263
- - WAIVED only when waiver.active: true with reason/approver
264
-
265
- Detailed criteria:
266
-
267
- - **PASS**: All critical requirements met, no blocking issues
268
- - **CONCERNS**: Non-critical issues found, team should review
269
- - **FAIL**: Critical issues that should be addressed
270
- - **WAIVED**: Issues acknowledged but explicitly waived by team
271
-
272
- ### Quality Score Calculation
273
-
274
- ```text
275
- quality_score = 100 - (20 × number of FAILs) - (10 × number of CONCERNS)
276
- Bounded between 0 and 100
277
- ```
278
-
279
- If `technical-preferences.md` defines custom weights, use those instead.
280
-
281
- ### Suggested Owner Convention
282
-
283
- For each issue in `top_issues`, include a `suggested_owner`:
284
-
285
- - `dev`: Code changes needed
286
- - `sm`: Requirements clarification needed
287
- - `po`: Business decision needed
288
-
289
- ## Key Principles
290
-
291
- - You are a Test Architect providing comprehensive quality assessment
292
- - You have the authority to improve code directly when appropriate
293
- - Always explain your changes for learning purposes
294
- - Balance between perfection and pragmatism
295
- - Focus on risk-based prioritization
296
- - Provide actionable recommendations with clear ownership
297
-
298
- ## Blocking Conditions
299
-
300
- Stop the review and request clarification if:
301
-
302
- - Story file is incomplete or missing critical sections
303
- - File List is empty or clearly incomplete
304
- - No tests exist when they were required
305
- - Code changes don't align with story requirements
306
- - Critical architectural issues that require discussion
307
-
308
- ## Completion
309
-
310
- After review:
311
-
312
- 1. Update the QA Results section in the story file
313
- 2. Create the gate file in directory from `qa.qaLocation/gates`
314
- 3. Recommend status: "Ready for Done" or "Changes Required" (owner decides)
315
- 4. If files were modified, list them in QA Results and ask Dev to update File List
316
- 5. Always provide constructive feedback and actionable recommendations
1
+ <!-- Powered by BMAD™ Core -->
2
+
3
+ # review-story
4
+
5
+ Perform a comprehensive test architecture review with quality gate decision. This adaptive, risk-aware review creates both a story update and a detailed gate file.
6
+
7
+ ## Inputs
8
+
9
+ ```yaml
10
+ required:
11
+ - story_id: '{epic}.{story}' # e.g., "1.3"
12
+ - story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml
13
+ - story_title: '{title}' # If missing, derive from story file H1
14
+ - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated)
15
+ ```
16
+
17
+ ## Prerequisites
18
+
19
+ - Story status must be "Review"
20
+ - Developer has completed all tasks and updated the File List
21
+ - All automated tests are passing
22
+
23
+ ## Review Process - Adaptive Test Architecture
24
+
25
+ ### 1. Risk Assessment (Determines Review Depth)
26
+
27
+ **Auto-escalate to deep review when:**
28
+
29
+ - Auth/payment/security files touched
30
+ - No tests added to story
31
+ - Diff > 500 lines
32
+ - Previous gate was FAIL/CONCERNS
33
+ - Story has > 5 acceptance criteria
34
+
35
+ ### 2. Comprehensive Analysis
36
+
37
+ **A. Requirements Traceability**
38
+
39
+ - Map each acceptance criteria to its validating tests (document mapping with Given-When-Then, not test code)
40
+ - Identify coverage gaps
41
+ - Verify all requirements have corresponding test cases
42
+
43
+ **B. Code Quality Review**
44
+
45
+ - Architecture and design patterns
46
+ - Refactoring opportunities (and perform them)
47
+ - Code duplication or inefficiencies
48
+ - Performance optimizations
49
+ - Security vulnerabilities
50
+ - Best practices adherence
51
+
52
+ **C. Test Architecture Assessment**
53
+
54
+ - Test coverage adequacy at appropriate levels
55
+ - Test level appropriateness (what should be unit vs integration vs e2e)
56
+ - Test design quality and maintainability
57
+ - Test data management strategy
58
+ - Mock/stub usage appropriateness
59
+ - Edge case and error scenario coverage
60
+ - Test execution time and reliability
61
+
62
+ **D. Non-Functional Requirements (NFRs)**
63
+
64
+ - Security: Authentication, authorization, data protection
65
+ - Performance: Response times, resource usage
66
+ - Reliability: Error handling, recovery mechanisms
67
+ - Maintainability: Code clarity, documentation
68
+
69
+ **E. Testability Evaluation**
70
+
71
+ - Controllability: Can we control the inputs?
72
+ - Observability: Can we observe the outputs?
73
+ - Debuggability: Can we debug failures easily?
74
+
75
+ **F. Technical Debt Identification**
76
+
77
+ - Accumulated shortcuts
78
+ - Missing tests
79
+ - Outdated dependencies
80
+ - Architecture violations
81
+
82
+ ### 3. Active Refactoring
83
+
84
+ - Refactor code where safe and appropriate
85
+ - Run tests to ensure changes don't break functionality
86
+ - Document all changes in QA Results section with clear WHY and HOW
87
+ - Do NOT alter story content beyond QA Results section
88
+ - Do NOT change story Status or File List; recommend next status only
89
+
90
+ ### 4. Standards Compliance Check
91
+
92
+ - Verify adherence to `docs/coding-standards.md`
93
+ - Check compliance with `docs/unified-project-structure.md`
94
+ - Validate testing approach against `docs/testing-strategy.md`
95
+ - Ensure all guidelines mentioned in the story are followed
96
+
97
+ ### 5. Acceptance Criteria Validation
98
+
99
+ - Verify each AC is fully implemented
100
+ - Check for any missing functionality
101
+ - Validate edge cases are handled
102
+
103
+ ### 6. Documentation and Comments
104
+
105
+ - Verify code is self-documenting where possible
106
+ - Add comments for complex logic if missing
107
+ - Ensure any API changes are documented
108
+
109
+ ## Output 1: Update Story File - QA Results Section ONLY
110
+
111
+ **CRITICAL**: You are ONLY authorized to update the "QA Results" section of the story file. DO NOT modify any other sections.
112
+
113
+ **QA Results Anchor Rule:**
114
+
115
+ - If `## QA Results` doesn't exist, append it at end of file
116
+ - If it exists, append a new dated entry below existing entries
117
+ - Never edit other sections
118
+
119
+ After review and any refactoring, append your results to the story file in the QA Results section:
120
+
121
+ ```markdown
122
+ ## QA Results
123
+
124
+ ### Review Date: [Date]
125
+
126
+ ### Reviewed By: Quinn (Test Architect)
127
+
128
+ ### Code Quality Assessment
129
+
130
+ [Overall assessment of implementation quality]
131
+
132
+ ### Refactoring Performed
133
+
134
+ [List any refactoring you performed with explanations]
135
+
136
+ - **File**: [filename]
137
+ - **Change**: [what was changed]
138
+ - **Why**: [reason for change]
139
+ - **How**: [how it improves the code]
140
+
141
+ ### Compliance Check
142
+
143
+ - Coding Standards: [✓/✗] [notes if any]
144
+ - Project Structure: [✓/✗] [notes if any]
145
+ - Testing Strategy: [✓/✗] [notes if any]
146
+ - All ACs Met: [✓/✗] [notes if any]
147
+
148
+ ### Improvements Checklist
149
+
150
+ [Check off items you handled yourself, leave unchecked for dev to address]
151
+
152
+ - [x] Refactored user service for better error handling (services/user.service.ts)
153
+ - [x] Added missing edge case tests (services/user.service.test.ts)
154
+ - [ ] Consider extracting validation logic to separate validator class
155
+ - [ ] Add integration test for error scenarios
156
+ - [ ] Update API documentation for new error codes
157
+
158
+ ### Security Review
159
+
160
+ [Any security concerns found and whether addressed]
161
+
162
+ ### Performance Considerations
163
+
164
+ [Any performance issues found and whether addressed]
165
+
166
+ ### Files Modified During Review
167
+
168
+ [If you modified files, list them here - ask Dev to update File List]
169
+
170
+ ### Gate Status
171
+
172
+ Gate: {STATUS} → qa.qaLocation/gates/{epic}.{story}-{slug}.yml
173
+ Risk profile: qa.qaLocation/assessments/{epic}.{story}-risk-{YYYYMMDD}.md
174
+ NFR assessment: qa.qaLocation/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md
175
+
176
+ # Note: Paths should reference core-config.yaml for custom configurations
177
+
178
+ ### Recommended Status
179
+
180
+ [✓ Ready for Done] / [✗ Changes Required - See unchecked items above]
181
+ (Story owner decides final status)
182
+ ```
183
+
184
+ ## Output 2: Create Quality Gate File
185
+
186
+ **Template and Directory:**
187
+
188
+ - Render from `../templates/qa-gate-tmpl.yaml`
189
+ - Create directory defined in `qa.qaLocation/gates` (see `bmad-core/core-config.yaml`) if missing
190
+ - Save to: `qa.qaLocation/gates/{epic}.{story}-{slug}.yml`
191
+
192
+ Gate file structure:
193
+
194
+ ```yaml
195
+ schema: 1
196
+ story: '{epic}.{story}'
197
+ story_title: '{story title}'
198
+ gate: PASS|CONCERNS|FAIL|WAIVED
199
+ status_reason: '1-2 sentence explanation of gate decision'
200
+ reviewer: 'Quinn (Test Architect)'
201
+ updated: '{ISO-8601 timestamp}'
202
+
203
+ top_issues: [] # Empty if no issues
204
+ waiver: { active: false } # Set active: true only if WAIVED
205
+
206
+ # Extended fields (optional but recommended):
207
+ quality_score: 0-100 # 100 - (20*FAILs) - (10*CONCERNS) or use technical-preferences.md weights
208
+ expires: '{ISO-8601 timestamp}' # Typically 2 weeks from review
209
+
210
+ evidence:
211
+ tests_reviewed: { count }
212
+ risks_identified: { count }
213
+ trace:
214
+ ac_covered: [1, 2, 3] # AC numbers with test coverage
215
+ ac_gaps: [4] # AC numbers lacking coverage
216
+
217
+ nfr_validation:
218
+ security:
219
+ status: PASS|CONCERNS|FAIL
220
+ notes: 'Specific findings'
221
+ performance:
222
+ status: PASS|CONCERNS|FAIL
223
+ notes: 'Specific findings'
224
+ reliability:
225
+ status: PASS|CONCERNS|FAIL
226
+ notes: 'Specific findings'
227
+ maintainability:
228
+ status: PASS|CONCERNS|FAIL
229
+ notes: 'Specific findings'
230
+
231
+ recommendations:
232
+ immediate: # Must fix before production
233
+ - action: 'Add rate limiting'
234
+ refs: ['api/auth/login.ts']
235
+ future: # Can be addressed later
236
+ - action: 'Consider caching'
237
+ refs: ['services/data.ts']
238
+ ```
239
+
240
+ ### Gate Decision Criteria
241
+
242
+ **Deterministic rule (apply in order):**
243
+
244
+ If risk_summary exists, apply its thresholds first (≥9 → FAIL, ≥6 → CONCERNS), then NFR statuses, then top_issues severity.
245
+
246
+ 1. **Risk thresholds (if risk_summary present):**
247
+ - If any risk score ≥ 9 → Gate = FAIL (unless waived)
248
+ - Else if any score ≥ 6 → Gate = CONCERNS
249
+
250
+ 2. **Test coverage gaps (if trace available):**
251
+ - If any P0 test from test-design is missing → Gate = CONCERNS
252
+ - If security/data-loss P0 test missing → Gate = FAIL
253
+
254
+ 3. **Issue severity:**
255
+ - If any `top_issues.severity == high` → Gate = FAIL (unless waived)
256
+ - Else if any `severity == medium` → Gate = CONCERNS
257
+
258
+ 4. **NFR statuses:**
259
+ - If any NFR status is FAIL → Gate = FAIL
260
+ - Else if any NFR status is CONCERNS → Gate = CONCERNS
261
+ - Else → Gate = PASS
262
+
263
+ - WAIVED only when waiver.active: true with reason/approver
264
+
265
+ Detailed criteria:
266
+
267
+ - **PASS**: All critical requirements met, no blocking issues
268
+ - **CONCERNS**: Non-critical issues found, team should review
269
+ - **FAIL**: Critical issues that should be addressed
270
+ - **WAIVED**: Issues acknowledged but explicitly waived by team
271
+
272
+ ### Quality Score Calculation
273
+
274
+ ```text
275
+ quality_score = 100 - (20 × number of FAILs) - (10 × number of CONCERNS)
276
+ Bounded between 0 and 100
277
+ ```
278
+
279
+ If `technical-preferences.md` defines custom weights, use those instead.
280
+
281
+ ### Suggested Owner Convention
282
+
283
+ For each issue in `top_issues`, include a `suggested_owner`:
284
+
285
+ - `dev`: Code changes needed
286
+ - `sm`: Requirements clarification needed
287
+ - `po`: Business decision needed
288
+
289
+ ## Key Principles
290
+
291
+ - You are a Test Architect providing comprehensive quality assessment
292
+ - You have the authority to improve code directly when appropriate
293
+ - Always explain your changes for learning purposes
294
+ - Balance between perfection and pragmatism
295
+ - Focus on risk-based prioritization
296
+ - Provide actionable recommendations with clear ownership
297
+
298
+ ## Blocking Conditions
299
+
300
+ Stop the review and request clarification if:
301
+
302
+ - Story file is incomplete or missing critical sections
303
+ - File List is empty or clearly incomplete
304
+ - No tests exist when they were required
305
+ - Code changes don't align with story requirements
306
+ - Critical architectural issues that require discussion
307
+
308
+ ## Completion
309
+
310
+ After review:
311
+
312
+ 1. Update the QA Results section in the story file
313
+ 2. Create the gate file in directory from `qa.qaLocation/gates`
314
+ 3. Recommend status: "Ready for Done" or "Changes Required" (owner decides)
315
+ 4. If files were modified, list them in QA Results and ask Dev to update File List
316
+ 5. Always provide constructive feedback and actionable recommendations