fraim-framework 2.0.44 → 2.0.45

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 (72) hide show
  1. package/bin/fraim.js +1 -1
  2. package/dist/registry/ai-manager-rules/design-phases/design-completeness-review.md +73 -0
  3. package/dist/registry/ai-manager-rules/design-phases/design-design.md +145 -0
  4. package/dist/registry/ai-manager-rules/design-phases/design.md +108 -0
  5. package/dist/registry/ai-manager-rules/design-phases/finalize.md +60 -0
  6. package/dist/registry/ai-manager-rules/design-phases/validate.md +125 -0
  7. package/dist/registry/ai-manager-rules/implement-phases/code.md +323 -0
  8. package/dist/registry/ai-manager-rules/implement-phases/completeness-review.md +94 -0
  9. package/dist/registry/ai-manager-rules/implement-phases/finalize.md +177 -0
  10. package/dist/registry/ai-manager-rules/implement-phases/implement-code.md +286 -0
  11. package/dist/registry/ai-manager-rules/implement-phases/implement-completeness-review.md +120 -0
  12. package/dist/registry/ai-manager-rules/implement-phases/implement-regression.md +173 -0
  13. package/dist/registry/ai-manager-rules/implement-phases/implement-repro.md +104 -0
  14. package/dist/registry/ai-manager-rules/implement-phases/implement-scoping.md +100 -0
  15. package/dist/registry/ai-manager-rules/implement-phases/implement-smoke.md +230 -0
  16. package/dist/registry/ai-manager-rules/implement-phases/implement-spike.md +121 -0
  17. package/dist/registry/ai-manager-rules/implement-phases/implement-validate.md +371 -0
  18. package/dist/registry/ai-manager-rules/implement-phases/quality-review.md +304 -0
  19. package/dist/registry/ai-manager-rules/implement-phases/regression.md +159 -0
  20. package/dist/registry/ai-manager-rules/implement-phases/repro.md +101 -0
  21. package/dist/registry/ai-manager-rules/implement-phases/scoping.md +93 -0
  22. package/dist/registry/ai-manager-rules/implement-phases/smoke.md +225 -0
  23. package/dist/registry/ai-manager-rules/implement-phases/spike.md +118 -0
  24. package/dist/registry/ai-manager-rules/implement-phases/validate.md +347 -0
  25. package/dist/registry/ai-manager-rules/shared-phases/finalize.md +169 -0
  26. package/dist/registry/ai-manager-rules/shared-phases/submit-pr.md +202 -0
  27. package/dist/registry/ai-manager-rules/shared-phases/wait-for-pr-review.md +170 -0
  28. package/dist/registry/ai-manager-rules/spec-phases/finalize.md +60 -0
  29. package/dist/registry/ai-manager-rules/spec-phases/spec-completeness-review.md +66 -0
  30. package/dist/registry/ai-manager-rules/spec-phases/spec-spec.md +139 -0
  31. package/dist/registry/ai-manager-rules/spec-phases/spec.md +102 -0
  32. package/dist/registry/ai-manager-rules/spec-phases/validate.md +118 -0
  33. package/dist/src/ai-manager/ai-manager.js +380 -119
  34. package/dist/src/ai-manager/evidence-validator.js +309 -0
  35. package/dist/src/ai-manager/phase-flow.js +244 -0
  36. package/dist/src/ai-manager/types.js +5 -0
  37. package/dist/src/fraim-mcp-server.js +45 -153
  38. package/dist/src/static-website-middleware.js +75 -0
  39. package/dist/tests/test-ai-coach-edge-cases.js +415 -0
  40. package/dist/tests/test-ai-coach-mcp-integration.js +432 -0
  41. package/dist/tests/test-ai-coach-performance.js +328 -0
  42. package/dist/tests/test-ai-coach-phase-content.js +264 -0
  43. package/dist/tests/test-ai-coach-workflows.js +487 -0
  44. package/dist/tests/test-ai-manager-phase-protocol.js +147 -0
  45. package/dist/tests/test-ai-manager.js +60 -71
  46. package/dist/tests/test-evidence-validation.js +221 -0
  47. package/dist/tests/test-mcp-lifecycle-methods.js +18 -23
  48. package/dist/tests/test-pr-review-integration.js +1 -0
  49. package/dist/tests/test-pr-review-workflow.js +299 -0
  50. package/dist/website/.nojekyll +0 -0
  51. package/dist/website/404.html +101 -0
  52. package/dist/website/CNAME +1 -0
  53. package/dist/website/README.md +22 -0
  54. package/dist/website/demo.html +604 -0
  55. package/dist/website/images/.gitkeep +1 -0
  56. package/dist/website/images/fraim-logo.png +0 -0
  57. package/dist/website/index.html +290 -0
  58. package/dist/website/pricing.html +414 -0
  59. package/dist/website/script.js +55 -0
  60. package/dist/website/styles.css +2647 -0
  61. package/package.json +2 -1
  62. package/registry/agent-guardrails.md +1 -1
  63. package/registry/stubs/workflows/brainstorming/blue-sky-brainstorming.md +11 -0
  64. package/registry/stubs/workflows/brainstorming/codebase-brainstorming.md +11 -0
  65. package/registry/stubs/workflows/compliance/detect-compliance-requirements.md +11 -0
  66. package/registry/stubs/workflows/compliance/generate-audit-evidence.md +11 -0
  67. package/registry/stubs/workflows/learning/synthesize-learnings.md +11 -0
  68. package/registry/stubs/workflows/legal/nda.md +11 -0
  69. package/registry/stubs/workflows/legal/patent-filing.md +11 -0
  70. package/registry/stubs/workflows/legal/trademark-filing.md +11 -0
  71. package/registry/stubs/workflows/product-building/design.md +1 -1
  72. package/registry/stubs/workflows/product-building/implement.md +1 -2
@@ -0,0 +1,371 @@
1
+ # Phase: Implement-Validate
2
+
3
+ ## INTENT
4
+ To verify that the implementation works correctly by testing it in appropriate ways: browser testing for UI changes, API testing for backend changes, and command-line testing for CLI changes.
5
+
6
+ ## OUTCOME
7
+ Confirmation that:
8
+ - Implementation works as expected
9
+ - All acceptance criteria are met
10
+ - Edge cases are handled
11
+ - No obvious bugs or issues
12
+
13
+ ## 🎯 VALIDATION MINDSET
14
+
15
+ This is THE critical phase where you prove your implementation actually works. No shortcuts, no assumptions.
16
+
17
+ **Your Mission**: Prove beyond doubt that a real user can successfully use this feature.
18
+
19
+ ## RULES FOR THIS PHASE
20
+
21
+ ### Success Criteria
22
+ Read `registry/rules/agent-success-criteria.md` via `get_fraim_file` for the complete framework. Focus on:
23
+ - **Integrity** (honest reporting of validation results - never claim something works if you didn't test it)
24
+ - **Correctness** (implementation actually works as expected)
25
+ - **Completeness** (all acceptance criteria validated, edge cases tested)
26
+
27
+ ### Simplicity Principles
28
+ Read `registry/rules/simplicity.md` via `get_fraim_file` for complete guidelines. Critical for validation:
29
+ - **Manual Validation Required** - This is THE manual validation phase
30
+ - **Prototype-First** - Validate the working solution before engineering tests
31
+ - **Resource Waste Prevention** - Efficient testing approach
32
+
33
+ ### Architecture Compliance
34
+ Read `.fraim/config.json` for the architecture document path (`customizations.architectureDoc`), then read the local architecture document to understand the full architecture guidelines. Ensure implementation follows architectural patterns.
35
+
36
+ ### Debugging and Git Operations
37
+ - Use Successful Debugging Patterns from `rules/successful-debugging-patterns.md` via `get_fraim_file`
38
+ - When using git commands directly (if MCP tools unavailable), read `rules/git-safe-commands.md` via `get_fraim_file` to avoid interactive commands that hang agents.
39
+
40
+ ### Failure Handling
41
+ - **If validation fails**: Return to implement-code phase
42
+ - **Do not proceed to smoke tests** if validation fails
43
+ - Fix the implementation first, then re-validate
44
+
45
+ ## PRINCIPLES
46
+ - **Real Testing**: Test actual functionality, not mocks
47
+ - **Appropriate Tools**: Use browser for UI, curl for APIs, CLI for commands
48
+ - **Complete Coverage**: Test all acceptance criteria
49
+ - **Edge Cases**: Test boundary conditions and error scenarios
50
+ - **Evidence**: Document validation results
51
+
52
+ ## 📋 MANDATORY VALIDATION STEPS
53
+
54
+ ### Step 1: Build and Compilation Check ✅
55
+
56
+ **Requirements**:
57
+ - TypeScript compiles without errors
58
+ - Build process completes successfully
59
+ - No type errors or warnings
60
+
61
+ **Commands to Run**:
62
+ ```bash
63
+ # Check TypeScript compilation
64
+ npx tsc --noEmit --skipLibCheck
65
+
66
+ # Run full build (includes validation)
67
+ npm run build
68
+
69
+ # Check for any 'as any' type bypassing
70
+ grep -r "as any" src/ || echo "✅ No type bypassing found"
71
+ ```
72
+
73
+ **What to Look For**:
74
+ - Exit code 0 (success) for all commands
75
+ - No error messages in output
76
+ - Clean compilation without warnings
77
+
78
+ ### Step 2: Test Suite Validation 📊
79
+
80
+ **Requirements**:
81
+ - ALL existing tests pass (100% success rate) - not just tests you created
82
+ - No timeouts or hanging tests
83
+ - Comprehensive test coverage validation
84
+
85
+ **CRITICAL**: You must run the COMPLETE test suite, including all existing tests, smoke tests, and any tests you created. Do not run only the tests you wrote.
86
+
87
+ **Commands to Run** (check .fraim/config.json for project-specific commands first):
88
+ ```bash
89
+ # 1. FIRST: Read your project's validation commands from .fraim/config.json
90
+ cat .fraim/config.json | grep -A 10 "validation"
91
+
92
+ # 2. Run the comprehensive test suite (this runs ALL tests)
93
+ npm test
94
+
95
+ # 3. Also run smoke tests specifically to verify core functionality
96
+ npm run test-smoke-ci
97
+
98
+ # 4. Run all tests in CI mode for complete coverage
99
+ npm run test-all-ci
100
+ ```
101
+
102
+ **What to Look For**:
103
+ - "All tests passed" or similar success message for ALL commands
104
+ - No "FAILED" or "ERROR" in output from any test run
105
+ - Test count should include existing tests + any new tests you added
106
+ - No timeout messages
107
+ - Verify that existing functionality tests are included in the run
108
+
109
+ **Example Expected Output**:
110
+ ```
111
+ ✅ Running 45 tests (including existing + new tests)
112
+ ✅ All tests passed
113
+ ✅ Test suite completed successfully
114
+ ```
115
+
116
+ ### Step 3: Manual Functionality Testing 🧪
117
+
118
+ **Requirements**:
119
+ - Test actual user workflows end-to-end
120
+ - Verify all acceptance criteria manually
121
+ - Test both happy path and error scenarios
122
+
123
+ **For UI Changes**:
124
+ ```bash
125
+ # Start development server
126
+ npm run dev
127
+ # Then manually test in browser at http://localhost:3000
128
+ ```
129
+
130
+ **For API Changes**:
131
+ ```bash
132
+ # Test API endpoints
133
+ curl -X GET http://localhost:3000/health
134
+ curl -X POST http://localhost:3000/api/test -H "Content-Type: application/json" -d '{"test":"data"}'
135
+ ```
136
+
137
+ **For CLI Changes**:
138
+ ```bash
139
+ # Test CLI commands
140
+ node bin/fraim.js --help
141
+ node bin/fraim.js sync --dry-run
142
+ ```
143
+
144
+ **What to Document**:
145
+ - Specific steps you performed
146
+ - What you clicked/typed/tested
147
+ - Results you observed
148
+ - Any errors encountered and how they were handled
149
+
150
+ ### Step 4: Git and Code Quality Check 🔍
151
+
152
+ **Requirements**:
153
+ - Git status is clean
154
+ - No debugging code remains
155
+ - Code follows quality standards
156
+
157
+ **Commands to Run**:
158
+ ```bash
159
+ # Check git status
160
+ git status
161
+
162
+ # Look for debugging code
163
+ grep -r "console.log" src/ | grep -v "logger" | grep -v "// OK" || echo "✅ No debug logs found"
164
+
165
+ # Check for task placeholder comments in core functionality
166
+ grep -r "task-placeholder" src/ || echo "✅ No task placeholders found"
167
+
168
+ # Validate registry paths (if applicable)
169
+ npm run validate:registry
170
+ ```
171
+
172
+ **What to Look For**:
173
+ - Only intended files are modified
174
+ - No console.log statements (except intentional logging)
175
+ - No task placeholder comments in critical code
176
+ - Clean working directory
177
+
178
+ ### Step 5: Bug-Specific Validation (For Bug Fixes) 🐛
179
+
180
+ **Requirements**:
181
+ - Original reproduction test now passes
182
+ - Bug symptoms are gone
183
+ - No regressions introduced
184
+
185
+ **Commands to Run**:
186
+ ```bash
187
+ # Run the specific repro test
188
+ npm test -- path/to/repro/test.test.ts
189
+
190
+ # Test the original bug scenario manually
191
+ # (Follow the original reproduction steps)
192
+ ```
193
+
194
+ **What to Verify**:
195
+ - Repro test that was failing now passes
196
+ - Original bug behavior is fixed
197
+ - Related functionality still works
198
+
199
+ ### Step 6: Feature-Specific Validation (For Features) ✨
200
+
201
+ **Requirements**:
202
+ - New functionality works as specified
203
+ - Integration with existing features works
204
+ - All acceptance criteria met
205
+
206
+ **What to Test**:
207
+ - Main user scenarios from the spec
208
+ - Edge cases and error conditions
209
+ - Integration points with existing code
210
+ - Performance (if applicable)
211
+
212
+ ## 🛠️ VALIDATION COMMANDS REFERENCE
213
+
214
+ ### Quick Health Check
215
+ ```bash
216
+ # One-liner to check basic health
217
+ npx tsc --noEmit --skipLibCheck && npm test && git status
218
+ ```
219
+
220
+ ### Comprehensive Validation
221
+ ```bash
222
+ # Full validation suite
223
+ npm run build && npm run test-all-ci && npm run validate:registry
224
+ ```
225
+
226
+ ### API Testing
227
+ ```bash
228
+ # Test API health and basic functionality
229
+ curl -f http://localhost:3000/health && echo "✅ API healthy"
230
+ ```
231
+
232
+ ### Build Verification
233
+ ```bash
234
+ # Verify build artifacts are created correctly
235
+ npm run build && ls -la dist/ && echo "✅ Build artifacts present"
236
+ ```
237
+
238
+ ## WORKFLOW
239
+
240
+ ### Step 1: Identify Validation Method
241
+
242
+ **For UI Changes:**
243
+ - Use browser to navigate and test
244
+ - Verify visual correctness
245
+ - Test user interactions
246
+ - Check responsive behavior
247
+
248
+ **For API Changes:**
249
+ - Use curl or similar tools
250
+ - Test all endpoints
251
+ - Verify request/response formats
252
+ - Test error handling
253
+
254
+ **For Backend/CLI Changes:**
255
+ - Run relevant commands
256
+ - Test with various inputs
257
+ - Verify output correctness
258
+ - Test error conditions
259
+
260
+ ### Step 2: Test All Acceptance Criteria
261
+ - Review acceptance criteria from implement-scoping phase
262
+ - Test each criterion systematically
263
+ - Document results for each
264
+ - Verify all are met
265
+
266
+ ### Step 3: Test Edge Cases
267
+ **Common edge cases:**
268
+ - Empty inputs
269
+ - Invalid inputs
270
+ - Boundary values
271
+ - Error conditions
272
+ - Concurrent operations (if applicable)
273
+
274
+ ### Step 4: Document Results
275
+ In evidence, include:
276
+ - What was tested
277
+ - How it was tested
278
+ - Results of each test
279
+ - Any issues found and fixed
280
+ - Screenshots/output (if applicable)
281
+
282
+ ## VALIDATION
283
+
284
+ ### Phase Complete When:
285
+ - ✅ All acceptance criteria tested and passing
286
+ - ✅ Edge cases handled correctly
287
+ - ✅ For bugs: repro test now passes
288
+ - ✅ For features: new functionality works
289
+ - ✅ No obvious bugs or issues
290
+ - ✅ Validation results documented with evidence
291
+ - ✅ All servers running without errors
292
+ - ✅ 100% test success rate
293
+ - ✅ Error scenarios tested and handled
294
+
295
+ ### Phase Incomplete If:
296
+ - ❌ Acceptance criteria not met
297
+ - ❌ For bugs: repro test still fails
298
+ - ❌ For features: functionality doesn't work
299
+ - ❌ Edge cases not handled
300
+ - ❌ Obvious bugs found
301
+ - ❌ Missing evidence for claims
302
+ - ❌ Server errors present
303
+ - ❌ Any tests failing
304
+
305
+ ### Report Back:
306
+ When you complete this phase, call:
307
+
308
+ ```javascript
309
+ seekCoachingOnNextStep({
310
+ workflowType: "implement",
311
+ issueNumber: "{issue_number}",
312
+ currentPhase: "implement-validate",
313
+ status: "complete",
314
+ findings: {
315
+ issueType: "bug" // or "feature" - Required for phase validation
316
+ },
317
+ evidence: {
318
+ buildPassed: "YES", // Did `npm run build` succeed?
319
+ testsPassed: "YES", // Did `npm test` show 100% pass rate?
320
+ manualValidationDone: "YES", // Did you manually test the functionality?
321
+ serversStarted: "YES", // Did servers start without errors?
322
+ reproTestPassed: "YES", // (For bugs) Does the repro test now pass?
323
+ featureWorking: "YES", // (For features) Does the new functionality work?
324
+ commandsRun: "npm run build && npm test", // What validation commands did you run?
325
+ summary: "All validation steps completed successfully. Build passes, all 15 tests pass, manual testing confirmed functionality works as expected."
326
+ }
327
+ })
328
+ ```
329
+
330
+ If validation reveals issues, report back with status "incomplete":
331
+ ```javascript
332
+ seekCoachingOnNextStep({
333
+ workflowType: "implement",
334
+ issueNumber: "{issue_number}",
335
+ currentPhase: "implement-validate",
336
+ status: "incomplete",
337
+ findings: {
338
+ issueType: "bug" // or "feature" - Required for phase validation
339
+ },
340
+ evidence: {
341
+ buildPassed: "NO", // Specify what failed
342
+ testsPassed: "NO", // Be specific about failures
343
+ issues: ["Build failed with TypeScript errors", "3 tests failing", "Manual testing revealed login button not working"],
344
+ commandsRun: "npm run build && npm test",
345
+ nextAction: "Need to return to implement phase to fix these issues"
346
+ }
347
+ })
348
+ ```
349
+
350
+ ## SCRIPTS
351
+
352
+ **Browser testing:**
353
+ ```bash
354
+ npm run dev # Start dev server
355
+ # Then manually test in browser
356
+ ```
357
+
358
+ **API testing:**
359
+ ```bash
360
+ curl -X POST http://localhost:3000/api/endpoint -d '{"data": "value"}'
361
+ ```
362
+
363
+ **CLI testing:**
364
+ ```bash
365
+ npm run cli -- command --flag value
366
+ ```
367
+
368
+ **Run all tests:**
369
+ ```bash
370
+ npm test
371
+ ```
@@ -0,0 +1,304 @@
1
+ # Phase: Quality Review
2
+
3
+ ## INTENT
4
+ To perform final quality checks ensuring all design aspects are implemented, code quality standards are met, and the work is production-ready.
5
+
6
+ ## OUTCOME
7
+ Confirmation that:
8
+ - All design aspects implemented
9
+ - Code compiles without errors
10
+ - All tests pass
11
+ - Code quality standards met
12
+ - No debugging code remains
13
+ - Git status is clean
14
+
15
+ ## RULES FOR THIS PHASE
16
+
17
+ ### Success Criteria
18
+ Read `registry/rules/agent-success-criteria.md` via `get_fraim_file` for the complete framework. This phase tests ALL criteria:
19
+ - **Integrity** (truthful reporting of all validation results)
20
+ - **Correctness** (code compiles, tests pass, follows architecture)
21
+ - **Completeness** (all requirements implemented, all validation steps completed)
22
+ - **Independence** (thorough self-validation without asking user)
23
+ - **Speed** (efficient validation process)
24
+
25
+ ### Simplicity Principles
26
+ Read `registry/rules/simplicity.md` via `get_fraim_file` for complete guidelines. Key for quality review:
27
+ - **Focus on the assigned issue only** - ensure no unrelated changes
28
+ - **Manual Validation Required** - verify implementation works as expected
29
+ - **Resource Waste Prevention** - efficient validation process
30
+
31
+ ### Architecture Compliance
32
+ Read `.fraim/config.json` for the architecture document path (`customizations.architectureDoc`), then use `get_fraim_file` to read the full architecture guidelines. Verify all architectural standards are met.
33
+
34
+ ### Git Operations (if needed)
35
+ When using git commands directly (if MCP tools unavailable), read `registry/rules/git-safe-commands.md` via `get_fraim_file` to avoid interactive commands that hang agents.
36
+
37
+ ## PRINCIPLES
38
+ - **Comprehensive**: Check all quality dimensions
39
+ - **Standards Compliance**: Follow all coding standards
40
+ - **Production Ready**: Code is ready for deployment
41
+ - **Clean State**: No temporary code or artifacts
42
+
43
+ ## WORKFLOW
44
+
45
+ ### Step 1: TypeScript Compilation Check
46
+ ```bash
47
+ npx tsc --noEmit --skipLibCheck
48
+ ```
49
+
50
+ **Must exit with code 0** (no errors)
51
+
52
+ If compilation fails:
53
+ - Review errors carefully
54
+ - Fix type issues
55
+ - Re-compile to verify
56
+ - Return to implement phase if major issues found
57
+
58
+ ### Step 2: Build Verification
59
+ ```bash
60
+ npm run build
61
+ ```
62
+
63
+ **Must complete successfully:**
64
+ - No build errors
65
+ - All validation steps pass
66
+ - Build artifacts created
67
+
68
+ If build fails:
69
+ - Check build output for specific errors
70
+ - Fix issues found
71
+ - Re-run build to verify
72
+
73
+ ### Step 3: Complete Test Suite
74
+ ```bash
75
+ npm test
76
+ ```
77
+
78
+ **All tests must pass:**
79
+ - No failures (0 failed tests)
80
+ - No timeouts
81
+ - No skipped tests (unless intentional)
82
+
83
+ **Additional test commands:**
84
+ ```bash
85
+ # Run smoke tests
86
+ npm run test-smoke-ci
87
+
88
+ # Run all tests in CI mode
89
+ npm run test-all-ci
90
+ ```
91
+
92
+ If tests fail:
93
+ - Review failure output
94
+ - Fix failing tests
95
+ - Return to appropriate phase if needed
96
+
97
+ ### Step 4: Code Quality Verification
98
+
99
+ **Check for type bypassing:**
100
+ ```bash
101
+ grep -r "as any" src/ || echo "✅ No type bypassing found"
102
+ ```
103
+ **Must find zero instances** (or only justified ones with comments)
104
+
105
+ **Check for debugging code:**
106
+ ```bash
107
+ grep -r "console.log" src/ | grep -v "// OK" | grep -v "logger" || echo "✅ No debug logs found"
108
+ ```
109
+ **Should find zero or only intentional logging**
110
+
111
+ **Check for TODO comments:**
112
+ ```bash
113
+ grep -r "TODO" src/ || echo "✅ No TODOs found"
114
+ ```
115
+ **Core functionality should have no TODOs**
116
+
117
+ **Validate registry paths:**
118
+ ```bash
119
+ npm run validate:registry
120
+ ```
121
+ **Must pass without errors**
122
+
123
+ ### Step 5: Git Status Verification
124
+ ```bash
125
+ git status
126
+ ```
127
+
128
+ **Should show:**
129
+ - Only intended changes
130
+ - No untracked files (except evidence docs)
131
+ - No accidentally modified files
132
+ - Clean working directory
133
+
134
+ **Check recent commits:**
135
+ ```bash
136
+ git log --oneline -5
137
+ ```
138
+ **Verify commits are meaningful and related to the issue**
139
+
140
+ ### Step 6: Design Completeness Check (Features)
141
+
142
+ For features, verify all design aspects implemented:
143
+
144
+ **API Contracts:**
145
+ ```bash
146
+ # Test all API endpoints mentioned in spec
147
+ curl -X GET http://localhost:3000/api/endpoint1
148
+ curl -X POST http://localhost:3000/api/endpoint2 -d '{"test":"data"}'
149
+ ```
150
+
151
+ **Data Models:**
152
+ - Check database schemas match design
153
+ - Verify data validation rules
154
+ - Test data persistence
155
+
156
+ **User Interfaces:**
157
+ - All UI components from design implemented
158
+ - Responsive behavior works
159
+ - Error states handled
160
+
161
+ **Integration Points:**
162
+ - External API integrations work
163
+ - Internal service communication works
164
+ - Authentication/authorization implemented
165
+
166
+ ### Step 7: Bug Fix Verification (Bugs)
167
+
168
+ For bugs, verify:
169
+
170
+ **Minimal Changes:**
171
+ ```bash
172
+ git diff HEAD~1 --stat
173
+ ```
174
+ **Should show focused, minimal changes**
175
+
176
+ **Root Cause Addressed:**
177
+ - Review the fix against original bug report
178
+ - Ensure fix addresses cause, not just symptoms
179
+ - Verify no new issues introduced
180
+
181
+ **Regression Testing:**
182
+ ```bash
183
+ # Run tests related to the bug area
184
+ npm test -- --grep "related-functionality"
185
+ ```
186
+
187
+ ### Step 8: Comprehensive Health Check
188
+
189
+ **One-liner health check:**
190
+ ```bash
191
+ npx tsc --noEmit --skipLibCheck && npm test && git status
192
+ ```
193
+
194
+ **Full validation suite:**
195
+ ```bash
196
+ npm run build && npm run test-all-ci && npm run validate:registry
197
+ ```
198
+
199
+ **API health check (if applicable):**
200
+ ```bash
201
+ curl -f http://localhost:3000/health && echo "✅ API healthy"
202
+ ```
203
+
204
+ ### Step 9: Mandatory Pre-Completion Reflection
205
+
206
+ **🚨 CRITICAL - Minimum 10 minutes required**
207
+
208
+ Read and complete reflection from `rules/mandatory-pre-completion-reflection.md` via `get_fraim_file`:
209
+
210
+ **Phase 1: Claim Verification (3 min)**
211
+ - What am I claiming works?
212
+ - What evidence do I have?
213
+ - Have I actually tested these claims?
214
+ - Are ALL tests passing (100%)?
215
+ - Have I investigated every error in the logs?
216
+
217
+ **Phase 2: Risk Analysis (3 min)**
218
+ - What could go wrong?
219
+ - What didn't I test?
220
+ - What edge cases might exist?
221
+ - What would a user experience if they tried this?
222
+
223
+ **Phase 3: Validation Plan Check (2 min)**
224
+ - Do I cover all spec scenarios?
225
+ - Are there gaps in my testing?
226
+ - Did I validate manually?
227
+ - Would I ship this to customers right now?
228
+ - Would I bet money this works end-to-end?
229
+
230
+ **Phase 4: Self-Audit (2 min)**
231
+ - Did I follow all rules?
232
+ - Would I bet money this works?
233
+ - Am I being honest about status?
234
+ - Am I rushing to claim completion?
235
+
236
+ **Document reflection analysis and address any blockers identified.**
237
+
238
+ ## VALIDATION
239
+
240
+ ### Phase Complete When:
241
+ - ✅ TypeScript compiles (exit code 0)
242
+ - ✅ All tests pass
243
+ - ✅ No "as any" type bypassing
244
+ - ✅ No debugging code remains
245
+ - ✅ Git status clean
246
+ - ✅ (Features) All design aspects implemented
247
+ - ✅ (Bugs) Changes minimal and focused
248
+ - ✅ (If applicable) Design feedback addressed
249
+ - ✅ Test integrity verified (no modified test criteria)
250
+ - ✅ Mandatory reflection completed
251
+ - ✅ All reflection blockers addressed
252
+
253
+ ### Phase Incomplete If:
254
+ - ❌ TypeScript compilation errors
255
+ - ❌ Any tests fail
256
+ - ❌ Code quality issues found
257
+ - ❌ Design aspects incomplete
258
+ - ❌ Unintended changes in git
259
+ - ❌ Design feedback not addressed
260
+ - ❌ Test criteria were modified without approval
261
+ - ❌ Reflection not completed
262
+ - ❌ Reflection identified unaddressed blockers
263
+
264
+ **Full quality check:**
265
+ ```bash
266
+ npx tsc --noEmit --skipLibCheck && npm test && grep -r "as any" src/ && git status
267
+ ```
268
+
269
+ ### Report Back:
270
+ When you complete this phase, call:
271
+
272
+ ```javascript
273
+ seekCoachingOnNextStep({
274
+ workflowType: "implement",
275
+ issueNumber: "{issue_number}",
276
+ currentPhase: "quality-review",
277
+ status: "complete",
278
+ evidence: {
279
+ typescriptCompiles: "YES", // Did `npx tsc --noEmit --skipLibCheck` succeed?
280
+ buildSucceeds: "YES", // Did `npm run build` succeed?
281
+ allTestsPass: "YES", // Did `npm test` show 100% pass rate?
282
+ noTypeBypass: "YES", // Did `grep -r "as any" src/` find zero instances?
283
+ noDebugCode: "YES", // Did you remove console.log statements?
284
+ gitStatusClean: "YES", // Does `git status` show only intended changes?
285
+ designComplete: "YES", // (Features) All design aspects implemented?
286
+ changesMinimal: "YES", // (Bugs) Changes are focused and minimal?
287
+ reflectionDone: "YES", // Did you complete the mandatory reflection?
288
+ commandsRun: "npx tsc --noEmit --skipLibCheck && npm run build && npm test && git status",
289
+ summary: "All quality checks passed. TypeScript compiles clean, all tests pass, git status clean, reflection completed."
290
+ },
291
+ iterationCount: 1
292
+ })
293
+ ```
294
+
295
+ ## QUALITY STANDARDS
296
+ Read `.fraim/config.json` for the architecture document path (`customizations.architectureDoc`), then use `get_fraim_file` to read the full quality standards. Key requirements include:
297
+ - No 'as any' type bypassing
298
+ - Proper error handling
299
+ - Consistent code style
300
+ - Meaningful variable names
301
+ - Appropriate code comments
302
+ - Tests follow architecture standards
303
+ - Tests validate real functionality
304
+ - No tests that default to passing