agentic-code 0.5.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.
@@ -0,0 +1,461 @@
1
+ # Acceptance Test Generation
2
+
3
+ ## Required Rules [MANDATORY - MUST BE ACTIVE]
4
+
5
+ **RULE AVAILABILITY VERIFICATION:**
6
+ 1. [LOAD IF NOT ACTIVE] `.agents/rules/language/testing.md`
7
+ 2. [LOAD IF NOT ACTIVE] `.agents/rules/core/documentation-criteria.md`
8
+ 3. [LOAD IF NOT ACTIVE] `.agents/rules/core/testing-strategy.md`
9
+ 4. [LOAD IF NOT ACTIVE] `.agents/rules/core/integration-e2e-testing.md`
10
+
11
+ **LOADING PROTOCOL:**
12
+ - STEP 1: CHECK if language/testing.md is active in working memory
13
+ - STEP 2: If language/testing.md NOT active → Execute BLOCKING READ
14
+ - STEP 3: CHECK if documentation-criteria.md is active in working memory
15
+ - STEP 4: If documentation-criteria.md NOT active → Execute BLOCKING READ
16
+ - STEP 5: CHECK if testing-strategy.md is active in working memory
17
+ - STEP 6: If testing-strategy.md NOT active → Execute BLOCKING READ
18
+ - STEP 7: CHECK if integration-e2e-testing.md is active in working memory
19
+ - STEP 8: If integration-e2e-testing.md NOT active → Execute BLOCKING READ
20
+ - STEP 9: CONFIRM all required rules active before proceeding
21
+
22
+ ## Plan Injection Requirement [MANDATORY]
23
+
24
+ **Upon reading this file, IMMEDIATELY inject to work plan:**
25
+ 1. All BLOCKING READs identified in Loading Protocol above:
26
+ - `.agents/rules/language/testing.md` (if not active)
27
+ - `.agents/rules/core/documentation-criteria.md` (if not active)
28
+ - `.agents/rules/core/testing-strategy.md` (if not active)
29
+ - `.agents/rules/core/integration-e2e-testing.md` (if not active)
30
+ 2. Mark each with "[From acceptance-test-generation.md]" source tag
31
+ 3. Show evidence of injection:
32
+ ```
33
+ [PLAN INJECTION FROM acceptance-test-generation.md]
34
+ Injected to work plan:
35
+ ✓ BLOCKING READ: language/testing.md - testing standards
36
+ ✓ BLOCKING READ: documentation-criteria.md - document analysis
37
+ ✓ BLOCKING READ: testing-strategy.md - ROI-based test selection
38
+ ✓ BLOCKING READ: integration-e2e-testing.md - integration/E2E test design
39
+ Status: VERIFIED
40
+ ```
41
+
42
+ **ENFORCEMENT:** Cannot proceed without Plan Injection evidence
43
+
44
+ **EVIDENCE REQUIRED:**
45
+ ```
46
+ Rule Status Verification:
47
+ ✓ language/testing.md - ACTIVE
48
+ ✓ documentation-criteria.md - ACTIVE
49
+ ✓ testing-strategy.md - ACTIVE
50
+ ✓ integration-e2e-testing.md - ACTIVE
51
+ ```
52
+
53
+ ## Phase Entry Gate [BLOCKING - SYSTEM HALT IF VIOLATED]
54
+
55
+ **CHECKPOINT: System CANNOT proceed until ALL boxes checked:**
56
+ ☐ [VERIFIED] Plan Injection completed (from acceptance-test-generation.md)
57
+ ☐ [VERIFIED] Work plan contains ALL BLOCKING READs from this file
58
+ ☐ [VERIFIED] Design document exists and contains Acceptance Criteria section
59
+ ☐ [VERIFIED] Project testing structure investigated (existing test patterns)
60
+ ☐ [VERIFIED] Test framework configuration confirmed
61
+ ☐ [VERIFIED] Required rules LOADED with file paths listed above
62
+ ☐ [VERIFIED] SESSION_BASELINE_DATE established and active
63
+
64
+ **GATE ENFORCEMENT:**
65
+ IF any box unchecked → HALT → Return to uncompleted step
66
+ IF attempting to skip → CRITICAL ERROR
67
+
68
+ ## Purpose
69
+
70
+ Transform Design Document Acceptance Criteria (ACs) into structured integration and end-to-end test skeletons. Convert multi-dimensional requirements into measurable, prioritized test cases with comprehensive traceability.
71
+
72
+ ## When to Use
73
+
74
+ - After technical design document completion
75
+ - When Acceptance Criteria are defined and need verification
76
+ - Before implementation phase starts
77
+ - When test-driven development approach is required
78
+ - For complex features requiring systematic test coverage
79
+
80
+ ## Completion Conditions
81
+
82
+ □ Design document Acceptance Criteria analyzed and decomposed
83
+ □ Multi-dimensional requirements mapped (functional, UX, technical, integration, quality)
84
+ □ Test priorities assigned using risk-based analysis
85
+ □ Integration test skeletons generated with pending/placeholder markers
86
+ □ E2E test skeletons generated with pending/placeholder markers
87
+ □ Verification points clearly documented for each test case
88
+ □ Traceability matrix created linking tests to original ACs
89
+ □ Edge cases systematically identified and included
90
+ □ Test execution order optimized
91
+ □ Metadata annotations added for downstream processes
92
+
93
+ ## Mandatory Process [STRICT COMPLIANCE]
94
+
95
+ ### Stage 1: Document Analysis [REQUIRED - CANNOT SKIP]
96
+
97
+ **1.1 Design Document Investigation**
98
+ 1. **Locate Design Document**
99
+ - Search `docs/design/` directory for relevant design document
100
+ - Verify document contains Acceptance Criteria section
101
+ - Extract all ACs with their identifiers
102
+
103
+ 2. **Acceptance Criteria Extraction**
104
+ - Parse functional requirements ACs
105
+ - Parse non-functional requirements ACs
106
+ - Parse UX/UI requirements ACs
107
+ - Parse integration requirements ACs
108
+ - Parse quality/performance requirements ACs
109
+
110
+ 3. **Requirement Layer Separation**
111
+ - **Functional Layer**: Core business logic and features
112
+ - **UX Layer**: User experience and interface requirements
113
+ - **Technical Layer**: Performance, security, reliability constraints
114
+ - **Integration Layer**: External system interactions and data flows
115
+ - **Quality Layer**: Testing, monitoring, and maintenance standards
116
+
117
+ **1.2 Dependency and Constraint Mapping**
118
+ 1. **Identify Dependencies**
119
+ - AC-to-AC dependencies (prerequisite relationships)
120
+ - External system dependencies
121
+ - Data dependencies and flows
122
+ - User state dependencies
123
+
124
+ 2. **Constraint Analysis**
125
+ - Technical constraints (performance limits, browser support)
126
+ - Business constraints (regulatory, policy requirements)
127
+ - Resource constraints (time, infrastructure limits)
128
+
129
+ **1.3 Measurability Assessment**
130
+ - Evaluate each AC for testability
131
+ - Identify ambiguous or non-measurable criteria
132
+ - Flag ACs requiring clarification
133
+ - Document assumption points
134
+
135
+ **1.4 Behavior-First Filtering [CRITICAL - PREVENTS LOW-ROI TEST GENERATION]**
136
+
137
+ Apply 3-check process to each AC before proceeding to test generation:
138
+
139
+ **Check 1: User-Observable**
140
+ - Question: "Can a user (or system operator) observe this behavior?"
141
+ - If NO → Skip AC with reason: `[IMPLEMENTATION_DETAIL]`
142
+ - If YES → Continue to Check 2
143
+
144
+ **Check 2: System Context**
145
+ - Question: "Requires full system integration to verify?"
146
+ - If NO → Skip AC with reason: `[UNIT_LEVEL]`
147
+ - If YES → Continue to Check 3
148
+
149
+ **Check 3: CI Verifiable**
150
+ - Question: "Is this verifiable deterministically in CI environment?"
151
+ - If NO → Skip AC with reason: `[NON_DETERMINISTIC]` or `[EXTERNAL_SERVICE]`
152
+ - If YES → Valid AC for test generation
153
+
154
+ **Skip Reason Tracking**:
155
+ ```
156
+ AC-001: "Password hashed with bcrypt" → SKIP [IMPLEMENTATION_DETAIL]
157
+ AC-002: "Tax calculation returns correct value" → SKIP [UNIT_LEVEL]
158
+ AC-003: "API response time < 200ms" → SKIP [NON_DETERMINISTIC]
159
+ AC-004: "Email delivered to inbox" → SKIP [EXTERNAL_SERVICE]
160
+ AC-005: "User can view order history" → PASS (all checks)
161
+ ```
162
+
163
+ **Expected Impact**: 40% of ACs filtered at this stage, preventing low-ROI test generation
164
+
165
+ ### Stage 2: Strategic Interpretation [REQUIRED]
166
+
167
+ **2.1 Context-Dependent Analysis**
168
+ 1. **Nuance Identification**
169
+ - Implicit requirements (security, accessibility)
170
+ - Cross-cutting concerns (logging, error handling)
171
+ - Edge case scenarios (empty states, error conditions)
172
+ - Integration failure scenarios
173
+
174
+ 2. **Risk Impact Evaluation**
175
+ ```
176
+ critical-path: core-user-journeys
177
+ business: high-value/risk
178
+ technical: high-complexity
179
+ integration: external-deps
180
+ ```
181
+
182
+ **2.2 Interpretation Criteria Application**
183
+ 1. **Consistency Standards**
184
+ - Apply uniform interpretation across similar ACs
185
+ - Maintain consistent granularity levels
186
+ - Ensure compatible verification approaches
187
+
188
+ 2. **Coverage Standards**
189
+ - Ensure comprehensive requirement coverage
190
+ - Identify testing gaps
191
+ - Document coverage rationale
192
+
193
+ ### Stage 3: Test Case Structuring [REQUIRED]
194
+
195
+ **3.1 Priority Determination**
196
+ ```
197
+ P0: critical - core/security/data
198
+ P1: high - key features/performance
199
+ P2: medium - secondary/UX
200
+ P3: low - edge/nice-to-have
201
+ ```
202
+
203
+ **3.2 Edge Case Selection**
204
+ ```
205
+ boundary: min/max/empty
206
+ error: network/invalid-input
207
+ state: complex-combinations
208
+ concurrency: multi-user/race
209
+ ```
210
+
211
+ **3.3 Verification Point Design**
212
+ ```
213
+ setup: initial-state
214
+ action: user/system-operation
215
+ expect: measurable-outcome
216
+ cleanup: post-test-state
217
+ ```
218
+
219
+ **3.4 Test Execution Optimization**
220
+ ```
221
+ order: minimize-setup/teardown
222
+ data: shared|isolated
223
+ parallel: safe|sequential
224
+ env: dev|staging|prod
225
+ ```
226
+
227
+ ### Stage 4: ROI-Based Selection and Budget Enforcement [REQUIRED]
228
+
229
+ **Purpose**: Select highest-value tests within budget constraints to prevent over-generation
230
+
231
+ **4.1 ROI Calculation**
232
+
233
+ For each test candidate from Stage 3, calculate ROI score:
234
+
235
+ ```
236
+ ROI Score = (Business Value × User Frequency + Legal Requirement × 10 + Defect Detection)
237
+ / Test Level Cost
238
+
239
+ Where:
240
+ - Business Value: 0-10 (revenue impact)
241
+ - User Frequency: 0-10 (% of users affected)
242
+ - Legal Requirement: 0 or 1 (boolean)
243
+ - Defect Detection: 0-10 (likelihood of catching bugs)
244
+ - Test Level Cost: Unit=3, Integration=11, E2E=38
245
+ ```
246
+
247
+ **See**: `.agents/rules/core/testing-strategy.md` for detailed ROI framework
248
+
249
+ **4.2 Deduplication Check**
250
+
251
+ Before adding to selection pool:
252
+ 1. Search existing test suite for similar scenarios
253
+ 2. Check for overlapping coverage at different test levels
254
+ 3. Decision:
255
+ - Full coverage exists → Skip candidate
256
+ - Partial coverage → Consider extending existing test
257
+ - No coverage → Add to selection pool
258
+
259
+ **4.3 Push-Down Analysis**
260
+
261
+ For each integration/E2E candidate:
262
+ ```
263
+ Can this be verified with unit test?
264
+ YES → Remove from integration/E2E pool, recommend unit test
265
+ NO → Continue
266
+
267
+ Already covered by integration test?
268
+ YES → Don't create E2E version
269
+ NO → Keep as E2E candidate
270
+ ```
271
+
272
+ **4.4 Budget Enforcement**
273
+
274
+ **Hard Limits per Feature**:
275
+ - Integration Tests: MAX 3 tests
276
+ - E2E Tests: MAX 1-2 tests (only if ROI > 1.5)
277
+
278
+ **Selection Algorithm**:
279
+ 1. Sort candidates by ROI score (descending)
280
+ 2. Select top N within budget limits
281
+ 3. Document selection rationale
282
+
283
+ **Critical User Journey Exception**:
284
+ Budget limits may be relaxed for:
285
+ - Revenue-impacting flows (payment, checkout)
286
+ - Legally required flows (GDPR, data protection)
287
+ - High-frequency core functionality (>80% users)
288
+
289
+ **Exception requires**: Explicit justification in generation report
290
+
291
+ **4.5 Selection Documentation**
292
+
293
+ For each selected test, document:
294
+ ```
295
+ Test ID: INT-001
296
+ AC Mapping: AC-FUNC-001, AC-FUNC-003
297
+ ROI Score: 8.9
298
+ Selection Reason: Revenue-critical payment flow
299
+ Budget Slot: 1/3 (integration)
300
+ ```
301
+
302
+ For each skipped candidate, document:
303
+ ```
304
+ Candidate: "User profile image upload E2E"
305
+ ROI Score: 0.7
306
+ Skip Reason: Below E2E threshold (1.5), covered by integration test
307
+ Alternative: Existing integration test INT-005
308
+ ```
309
+
310
+ ## Test Generation Guidelines
311
+
312
+ **Note:** The following structures use language-agnostic pseudocode. Implement using your project's test framework conventions.
313
+
314
+ ### Integration Test Structure
315
+
316
+ ```
317
+ SUITE: [Feature] Integration
318
+ GROUP: [AC-ID] [Description]
319
+ CASE [PENDING]: P[0-3] [verification] when [condition]
320
+ @ac: [ID]
321
+ @setup: [initial state]
322
+ @action: [operation]
323
+ @verify: [expected outcome]
324
+ ```
325
+
326
+ ### E2E Test Structure
327
+
328
+ ```
329
+ SUITE: [Feature] E2E
330
+ GROUP: [Journey] [Description]
331
+ CASE [PENDING]: P[0-3] complete [goal] via [path]
332
+ @ac: [ID1,ID2]
333
+ @path: [step1 > step2 > step3]
334
+ @verify: [end state]
335
+ ```
336
+
337
+ ### Test Metadata
338
+
339
+ ```
340
+ @ac: [IDs]
341
+ @risk: high|medium|low
342
+ @impact: critical|high|medium|low
343
+ @data: isolated|shared|external
344
+ @time: fast|medium|slow
345
+ @env: dev|staging|prod
346
+ @deps: [dependencies]
347
+ ```
348
+
349
+ ## Test Framework Investigation [MANDATORY BEFORE GENERATION]
350
+
351
+ **Before generating tests, MUST investigate:**
352
+
353
+ 1. **Existing Test Structure**
354
+ - Analyze current test file organization
355
+ - Identify existing test patterns and conventions
356
+ - Document test framework configuration and available testing tools
357
+
358
+ 2. **Test Categories Present**
359
+ - Unit test patterns and location
360
+ - Integration test setup and structure
361
+ - E2E test configuration and helpers
362
+ - Test utility functions and mocks
363
+
364
+ 3. **Framework-Specific Requirements**
365
+ - Test file naming conventions
366
+ - Setup/teardown patterns
367
+ - Assertion libraries used
368
+ - Mock/stub patterns
369
+
370
+ **Investigation Results:**
371
+ ```
372
+ framework: [name]
373
+ integration_path: [path]
374
+ e2e_path: [path]
375
+ patterns: [existing]
376
+ naming: [convention]
377
+ utilities: [available]
378
+ ```
379
+
380
+ ## Traceability Matrix
381
+
382
+ ```
383
+ INT-001: Auth validation | AC-FUNC-001,AC-SEC-002 | P0 | High
384
+ E2E-001: Registration flow | AC-FUNC-001,AC-UX-003,AC-FUNC-005 | P0 | Critical
385
+ ```
386
+
387
+ ## Quality Gates
388
+
389
+ **Before test generation completion:**
390
+ □ All ACs mapped to at least one test case
391
+ □ Critical path scenarios covered by P0 tests
392
+ □ Edge cases systematically included
393
+ □ Test priorities assigned using risk analysis
394
+ □ Verification points clearly documented
395
+ □ Framework conventions followed
396
+ □ Traceability matrix complete
397
+
398
+ ## Out of Scope
399
+
400
+ **PRINCIPLE**: Generate only tests verifiable in isolated CI/CD environment with high automation ROI.
401
+
402
+ **External Dependencies** (Test contracts/interfaces instead):
403
+ - Real API calls to third-party services
404
+ - External authentication providers
405
+ - Payment/email/SMS delivery verification
406
+ - Real database connections → Use test DB or mocks
407
+
408
+ **Non-Deterministic in CI Environment**:
409
+ - Performance metrics, response time measurements
410
+ - Load/stress testing
411
+ - LLM output reproducibility (outputs vary by nature)
412
+ - Long-term operations (infrastructure/deployment scope)
413
+
414
+ **Implementation Details** (Not user-observable behavior):
415
+ - Internal function calls, code structure, internal operations
416
+ - Specific rendering/styling details → Test information presence, not layout
417
+ - Code organization or architectural patterns
418
+
419
+ **ACTION when AC contains out-of-scope items**:
420
+ 1. Transform to verifiable behavior (e.g., external API → mock/contract test)
421
+ 2. If transformation impossible → Generate test.skip() with manual test reference
422
+ 3. Document rationale in test comment
423
+
424
+ ## Anti-Patterns to Avoid
425
+
426
+ **Document Analysis Anti-Patterns:**
427
+ - Skipping requirement layer separation
428
+ - Ignoring implicit requirements
429
+ - Missing dependency analysis
430
+ - Accepting non-measurable ACs without clarification
431
+
432
+ **Test Generation Anti-Patterns:**
433
+ - Creating tests without clear verification points
434
+ - Ignoring existing test patterns and conventions
435
+ - Missing traceability to source ACs
436
+ - Failing to prioritize tests by risk
437
+ - Generating tests that can't be executed
438
+ - Skipping edge case analysis
439
+ - Creating overly broad test descriptions
440
+
441
+ **Coverage Anti-Patterns:**
442
+ - Testing only happy path scenarios
443
+ - Ignoring integration failure cases
444
+ - Missing cross-cutting concerns
445
+ - Focusing only on functional requirements
446
+
447
+ ## Post-Generation Validation [MANDATORY]
448
+
449
+ **AFTER completing test generation:**
450
+ ☐ Execute "After Completion" metacognition checklist
451
+ ☐ Verify all ACs have corresponding test coverage
452
+ ☐ Confirm test framework conventions followed
453
+ ☐ Validate test priorities align with business risk
454
+ ☐ Review traceability matrix completeness
455
+ ☐ Ensure tests are executable (no syntax errors in skeletons)
456
+
457
+ **CANNOT proceed to implementation without:**
458
+ - Test generation validation complete
459
+ - Traceability matrix approved
460
+ - Test framework compliance verified
461
+ - User approval on test coverage approach
@@ -0,0 +1,207 @@
1
+ # Code Review
2
+
3
+ ## Required Rules [MANDATORY - MUST BE ACTIVE]
4
+
5
+ **RULE AVAILABILITY VERIFICATION:**
6
+ 1. [LOAD IF NOT ACTIVE] `.agents/rules/language/rules.md`
7
+ 2. [LOAD IF NOT ACTIVE] `.agents/rules/core/ai-development-guide.md`
8
+
9
+ **LOADING PROTOCOL:**
10
+ - STEP 1: CHECK if `.agents/rules/language/rules.md` is active in working memory
11
+ - STEP 2: If NOT active → Execute BLOCKING READ
12
+ - STEP 3: CHECK if `.agents/rules/core/ai-development-guide.md` is active in working memory
13
+ - STEP 4: If NOT active → Execute BLOCKING READ
14
+ - STEP 5: CONFIRM all required rules active before proceeding
15
+
16
+ ## Purpose
17
+
18
+ Validate Design Doc compliance and evaluate implementation completeness from a third-party perspective. Detect missing implementations, validate acceptance criteria, and provide quality reports.
19
+
20
+ ## When to Use
21
+
22
+ - After implementation is complete
23
+ - When reviewing code changes (PR review, post-implementation review)
24
+ - When validating Design Doc compliance
25
+
26
+ ## Required Information
27
+
28
+ - **implementationFiles**: List of files to review (required)
29
+ - **designDocPath**: Path to Design Document for validation baseline (optional - if provided, enables compliance validation)
30
+ - **workPlanPath**: Path to work plan for completed task verification (optional)
31
+ - **reviewMode**:
32
+ - `full`: Complete validation (default)
33
+ - `acceptance`: Acceptance criteria only (requires designDocPath)
34
+ - `architecture`: Architecture compliance only (requires designDocPath)
35
+ - `quality`: Code quality check only (no designDocPath needed)
36
+
37
+ ## Completion Conditions
38
+
39
+ □ All implementation files reviewed
40
+ □ Quality issues documented with severity
41
+ □ Compliance rate calculated (if designDocPath provided)
42
+ □ Verdict determined with rationale
43
+ □ Prioritized actions provided
44
+
45
+ ## Review Process
46
+
47
+ ### Stage 1: Load Baseline Documents (if designDocPath provided)
48
+
49
+ Extract from Design Doc:
50
+ - Functional requirements and acceptance criteria
51
+ - Architecture design
52
+ - Data flow
53
+ - Error handling policy
54
+
55
+ If designDocPath not provided, skip to Stage 3 (Code Quality Check).
56
+
57
+ ### Stage 2: Implementation Validation (if designDocPath provided)
58
+
59
+ For each implementation file, verify:
60
+
61
+ | Check Item | Verification Content |
62
+ |------------|---------------------|
63
+ | AC Implementation | Acceptance criteria has corresponding code |
64
+ | Interface Compliance | Implementation matches Design Doc interfaces |
65
+ | Error Handling | Error scenarios properly handled |
66
+ | Test Existence | Test cases exist for functionality |
67
+
68
+ ### Stage 3: Code Quality Check (always executed)
69
+
70
+ | Metric | Ideal | Maximum | Failure Condition |
71
+ |--------|-------|---------|-------------------|
72
+ | Function length | <50 lines | 200 lines | Exceeds maximum |
73
+ | Nesting depth | ≤3 levels | 4 levels | Exceeds maximum |
74
+ | Single responsibility | 1 function = 1 purpose | - | Multiple responsibilities |
75
+ | Error handling | All error paths covered | - | Missing error handling |
76
+
77
+ ### Stage 4: Architecture Compliance (if designDocPath provided)
78
+
79
+ | Check Item | Verification Content |
80
+ |------------|---------------------|
81
+ | Design Match | Implementation matches Design Doc architecture |
82
+ | Data Flow | Data flow follows design |
83
+ | Dependencies | Component dependencies correct |
84
+ | Separation | Responsibilities properly separated |
85
+ | Duplicate Check | No unnecessary duplicate implementations (Pattern 5 from ai-development-guide.md) |
86
+
87
+ ## Validation Checklist
88
+
89
+ ### Functional Requirements (if designDocPath provided)
90
+ - [ ] All acceptance criteria have corresponding implementations
91
+ - [ ] Happy path scenarios implemented
92
+ - [ ] Error scenarios handled
93
+ - [ ] Edge cases considered
94
+ - [ ] Implementation matches Design Doc architecture
95
+ - [ ] Data flow follows design
96
+
97
+ ### Quality Validation (always executed)
98
+ - [ ] Comprehensive error handling
99
+ - [ ] Appropriate logging
100
+ - [ ] Tests exist for functionality
101
+ - [ ] No unnecessary duplicate implementations
102
+ - [ ] Responsibilities properly separated
103
+
104
+ ## Output Format
105
+
106
+ ### Status Determination
107
+
108
+ **pass** (90%+ compliance):
109
+ - All critical acceptance criteria implemented
110
+ - No high severity quality issues
111
+ - Architecture compliance verified
112
+
113
+ **needs_improvement** (70-89% compliance):
114
+ - Some acceptance criteria gaps
115
+ - Medium severity quality issues exist
116
+ - Minor architecture deviations
117
+
118
+ **needs_redesign** (<70% compliance):
119
+ - Major acceptance criteria missing
120
+ - High severity quality issues
121
+ - Significant architecture violations
122
+
123
+ ### Report Structure
124
+
125
+ ```
126
+ [REVIEW RESULT]
127
+ complianceRate: [X]%
128
+ verdict: pass | needs_improvement | needs_redesign
129
+ designDoc: [path]
130
+ filesReviewed: [count]
131
+
132
+ [ACCEPTANCE CRITERIA]
133
+ totalACs: [count]
134
+ fulfilledACs: [count]
135
+ unfulfilledItems:
136
+ - item: [AC name]
137
+ priority: high | medium | low
138
+ solution: [specific implementation approach]
139
+
140
+ [QUALITY ISSUES]
141
+ - severity: high | medium | low
142
+ type: long_function | deep_nesting | multiple_responsibilities | missing_error_handling
143
+ location: [file:line or file:function]
144
+ description: [problem description]
145
+ suggestion: [specific improvement]
146
+
147
+ [ARCHITECTURE COMPLIANCE]
148
+ designMatch: yes | partial | no
149
+ issues:
150
+ - [architecture issue if any]
151
+
152
+ [VERDICT]
153
+ decision: pass | needs_improvement | needs_redesign
154
+ reason: [decision rationale]
155
+ nextAction: [highest priority action needed]
156
+ prioritizedActions:
157
+ 1. [highest priority fix]
158
+ 2. [next fix]
159
+ ```
160
+
161
+ ## Review Principles
162
+
163
+ 1. **Maintain Objectivity**
164
+ - Evaluate independent of implementation context
165
+ - Use Design Doc as single source of truth
166
+
167
+ 2. **Constructive Feedback**
168
+ - Provide solutions, not just problems
169
+ - Clarify priorities
170
+
171
+ 3. **Quantitative Assessment**
172
+ - Quantify wherever possible
173
+ - Eliminate subjective judgment
174
+
175
+ 4. **Respect Implementation**
176
+ - Acknowledge good implementations
177
+ - Present improvements as actionable items
178
+
179
+ ## Escalation Criteria
180
+
181
+ Recommend escalation when:
182
+ - Design Doc itself has deficiencies
183
+ - Security concerns discovered
184
+ - Critical performance issues found
185
+ - Implementation significantly deviates from design
186
+
187
+ ## Special Considerations
188
+
189
+ ### For Prototypes/MVPs
190
+ - Prioritize functionality over completeness
191
+ - Consider future extensibility
192
+
193
+ ### For Refactoring
194
+ - Maintain existing functionality as top priority
195
+ - Quantify improvement degree
196
+
197
+ ### For Emergency Fixes
198
+ - Verify minimal implementation solves problem
199
+ - Check technical debt documentation
200
+
201
+ ## Anti-Patterns to Avoid
202
+
203
+ - Approving code that doesn't meet acceptance criteria
204
+ - Ignoring architecture violations
205
+ - Overlooking missing error handling
206
+ - Accepting code without corresponding tests
207
+ - Providing vague feedback without specific solutions