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,347 @@
1
+ # Phase: 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 use `get_fraim_file` to read 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 `registry/rules/git-safe-commands.md` via `get_fraim_file` to avoid interactive commands that hang agents.
39
+
40
+ ## PRINCIPLES
41
+ - **Real Testing**: Test actual functionality, not mocks
42
+ - **Appropriate Tools**: Use browser for UI, curl for APIs, CLI for commands
43
+ - **Complete Coverage**: Test all acceptance criteria
44
+ - **Edge Cases**: Test boundary conditions and error scenarios
45
+ - **Evidence**: Document validation results
46
+
47
+ ## 📋 MANDATORY VALIDATION STEPS
48
+
49
+ ### Step 1: Build and Compilation Check ✅
50
+
51
+ **Requirements**:
52
+ - TypeScript compiles without errors
53
+ - Build process completes successfully
54
+ - No type errors or warnings
55
+
56
+ **Commands to Run**:
57
+ ```bash
58
+ # Check TypeScript compilation
59
+ npx tsc --noEmit --skipLibCheck
60
+
61
+ # Run full build (includes validation)
62
+ npm run build
63
+
64
+ # Check for any 'as any' type bypassing
65
+ grep -r "as any" src/ || echo "✅ No type bypassing found"
66
+ ```
67
+
68
+ **What to Look For**:
69
+ - Exit code 0 (success) for all commands
70
+ - No error messages in output
71
+ - Clean compilation without warnings
72
+
73
+ ### Step 2: Test Suite Validation 📊
74
+
75
+ **Requirements**:
76
+ - All tests pass (100% success rate)
77
+ - No timeouts or hanging tests
78
+ - Meaningful test coverage
79
+
80
+ **Commands to Run**:
81
+ ```bash
82
+ # Run all tests
83
+ npm test
84
+
85
+ # Run smoke tests specifically
86
+ npm run test-smoke-ci
87
+
88
+ # Run all tests in CI mode
89
+ npm run test-all-ci
90
+ ```
91
+
92
+ **What to Look For**:
93
+ - "All tests passed" or similar success message
94
+ - No "FAILED" or "ERROR" in output
95
+ - Reasonable test count (not just 1-2 tests)
96
+ - No timeout messages
97
+
98
+ ### Step 3: Manual Functionality Testing 🧪
99
+
100
+ **Requirements**:
101
+ - Test actual user workflows end-to-end
102
+ - Verify all acceptance criteria manually
103
+ - Test both happy path and error scenarios
104
+
105
+ **For UI Changes**:
106
+ ```bash
107
+ # Start development server
108
+ npm run dev
109
+ # Then manually test in browser at http://localhost:3000
110
+ ```
111
+
112
+ **For API Changes**:
113
+ ```bash
114
+ # Test API endpoints
115
+ curl -X GET http://localhost:3000/health
116
+ curl -X POST http://localhost:3000/api/test -H "Content-Type: application/json" -d '{"test":"data"}'
117
+ ```
118
+
119
+ **For CLI Changes**:
120
+ ```bash
121
+ # Test CLI commands
122
+ node bin/fraim.js --help
123
+ node bin/fraim.js sync --dry-run
124
+ ```
125
+
126
+ **What to Document**:
127
+ - Specific steps you performed
128
+ - What you clicked/typed/tested
129
+ - Results you observed
130
+ - Any errors encountered and how they were handled
131
+
132
+ ### Step 4: Git and Code Quality Check 🔍
133
+
134
+ **Requirements**:
135
+ - Git status is clean
136
+ - No debugging code remains
137
+ - Code follows quality standards
138
+
139
+ **Commands to Run**:
140
+ ```bash
141
+ # Check git status
142
+ git status
143
+
144
+ # Look for debugging code
145
+ grep -r "console.log" src/ | grep -v "logger" | grep -v "// OK" || echo "✅ No debug logs found"
146
+
147
+ # Check for TODO comments in core functionality
148
+ grep -r "TODO" src/ || echo "✅ No TODOs found"
149
+
150
+ # Validate registry paths (if applicable)
151
+ npm run validate:registry
152
+ ```
153
+
154
+ **What to Look For**:
155
+ - Only intended files are modified
156
+ - No console.log statements (except intentional logging)
157
+ - No TODO comments in critical code
158
+ - Clean working directory
159
+
160
+ ### Step 5: Bug-Specific Validation (For Bug Fixes) 🐛
161
+
162
+ **Requirements**:
163
+ - Original reproduction test now passes
164
+ - Bug symptoms are gone
165
+ - No regressions introduced
166
+
167
+ **Commands to Run**:
168
+ ```bash
169
+ # Run the specific repro test
170
+ npm test -- path/to/repro/test.test.ts
171
+
172
+ # Test the original bug scenario manually
173
+ # (Follow the original reproduction steps)
174
+ ```
175
+
176
+ **What to Verify**:
177
+ - Repro test that was failing now passes
178
+ - Original bug behavior is fixed
179
+ - Related functionality still works
180
+
181
+ ### Step 6: Feature-Specific Validation (For Features) ✨
182
+
183
+ **Requirements**:
184
+ - New functionality works as specified
185
+ - Integration with existing features works
186
+ - All acceptance criteria met
187
+
188
+ **What to Test**:
189
+ - Main user scenarios from the spec
190
+ - Edge cases and error conditions
191
+ - Integration points with existing code
192
+ - Performance (if applicable)
193
+
194
+ ## 🛠️ VALIDATION COMMANDS REFERENCE
195
+
196
+ ### Quick Health Check
197
+ ```bash
198
+ # One-liner to check basic health
199
+ npx tsc --noEmit --skipLibCheck && npm test && git status
200
+ ```
201
+
202
+ ### Comprehensive Validation
203
+ ```bash
204
+ # Full validation suite
205
+ npm run build && npm run test-all-ci && npm run validate:registry
206
+ ```
207
+
208
+ ### API Testing
209
+ ```bash
210
+ # Test API health and basic functionality
211
+ curl -f http://localhost:3000/health && echo "✅ API healthy"
212
+ ```
213
+
214
+ ### Build Verification
215
+ ```bash
216
+ # Verify build artifacts are created correctly
217
+ npm run build && ls -la dist/ && echo "✅ Build artifacts present"
218
+ ```
219
+
220
+ ## WORKFLOW
221
+
222
+ ### Step 1: Identify Validation Method
223
+
224
+ **For UI Changes:**
225
+ - Use browser to navigate and test
226
+ - Verify visual correctness
227
+ - Test user interactions
228
+ - Check responsive behavior
229
+
230
+ **For API Changes:**
231
+ - Use curl or similar tools
232
+ - Test all endpoints
233
+ - Verify request/response formats
234
+ - Test error handling
235
+
236
+ **For Backend/CLI Changes:**
237
+ - Run relevant commands
238
+ - Test with various inputs
239
+ - Verify output correctness
240
+ - Test error conditions
241
+
242
+ ### Step 2: Test All Acceptance Criteria
243
+ - Review acceptance criteria from scoping phase
244
+ - Test each criterion systematically
245
+ - Document results for each
246
+ - Verify all are met
247
+
248
+ ### Step 3: Test Edge Cases
249
+ **Common edge cases:**
250
+ - Empty inputs
251
+ - Invalid inputs
252
+ - Boundary values
253
+ - Error conditions
254
+ - Concurrent operations (if applicable)
255
+
256
+ ### Step 4: Document Results
257
+ In evidence, include:
258
+ - What was tested
259
+ - How it was tested
260
+ - Results of each test
261
+ - Any issues found and fixed
262
+ - Screenshots/output (if applicable)
263
+
264
+ ## VALIDATION
265
+
266
+ ### Phase Complete When:
267
+ - ✅ All acceptance criteria tested and passing
268
+ - ✅ Edge cases handled correctly
269
+ - ✅ For bugs: repro test now passes
270
+ - ✅ For features: new functionality works
271
+ - ✅ No obvious bugs or issues
272
+ - ✅ Validation results documented with evidence
273
+ - ✅ All servers running without errors
274
+ - ✅ 100% test success rate
275
+ - ✅ Error scenarios tested and handled
276
+
277
+ ### Phase Incomplete If:
278
+ - ❌ Acceptance criteria not met
279
+ - ❌ For bugs: repro test still fails
280
+ - ❌ For features: functionality doesn't work
281
+ - ❌ Edge cases not handled
282
+ - ❌ Obvious bugs found
283
+ - ❌ Missing evidence for claims
284
+ - ❌ Server errors present
285
+ - ❌ Any tests failing
286
+
287
+ ### Report Back:
288
+ When you complete this phase, call:
289
+
290
+ ```javascript
291
+ seekCoachingOnNextStep({
292
+ workflowType: "implement",
293
+ issueNumber: "{issue_number}",
294
+ currentPhase: "validate",
295
+ status: "complete",
296
+ evidence: {
297
+ buildPassed: "YES", // Did `npm run build` succeed?
298
+ testsPassed: "YES", // Did `npm test` show 100% pass rate?
299
+ manualValidationDone: "YES", // Did you manually test the functionality?
300
+ serversStarted: "YES", // Did servers start without errors?
301
+ reproTestPassed: "YES", // (For bugs) Does the repro test now pass?
302
+ featureWorking: "YES", // (For features) Does the new functionality work?
303
+ commandsRun: "npm run build && npm test", // What validation commands did you run?
304
+ summary: "All validation steps completed successfully. Build passes, all 15 tests pass, manual testing confirmed functionality works as expected."
305
+ }
306
+ })
307
+ ```
308
+
309
+ If validation reveals issues, report back with status "incomplete":
310
+ ```javascript
311
+ seekCoachingOnNextStep({
312
+ workflowType: "implement",
313
+ issueNumber: "{issue_number}",
314
+ currentPhase: "validate",
315
+ status: "incomplete",
316
+ evidence: {
317
+ buildPassed: "NO", // Specify what failed
318
+ testsPassed: "NO", // Be specific about failures
319
+ issues: ["Build failed with TypeScript errors", "3 tests failing", "Manual testing revealed login button not working"],
320
+ commandsRun: "npm run build && npm test",
321
+ nextAction: "Need to return to implement phase to fix these issues"
322
+ }
323
+ })
324
+ ```
325
+
326
+ ## SCRIPTS
327
+
328
+ **Browser testing:**
329
+ ```bash
330
+ npm run dev # Start dev server
331
+ # Then manually test in browser
332
+ ```
333
+
334
+ **API testing:**
335
+ ```bash
336
+ curl -X POST http://localhost:3000/api/endpoint -d '{"data": "value"}'
337
+ ```
338
+
339
+ **CLI testing:**
340
+ ```bash
341
+ npm run cli -- command --flag value
342
+ ```
343
+
344
+ **Run all tests:**
345
+ ```bash
346
+ npm test
347
+ ```
@@ -0,0 +1,169 @@
1
+ # Phase: Finalize
2
+
3
+ ## INTENT
4
+ To prepare completed work for human review by setting proper labels, creating/updating PR, and documenting evidence.
5
+
6
+ ## OUTCOME
7
+ Work is ready for human review with:
8
+ - Proper issue labels applied
9
+ - PR created/updated with work
10
+ - Evidence documented
11
+ - Clean handoff to next phase or review
12
+
13
+ ## PRINCIPLES
14
+ - **Complete Documentation**: Evidence shows all work done
15
+ - **Proper Labels**: Issue status reflects readiness
16
+ - **Clear Communication**: PR and evidence are clear
17
+ - **Ready for Review**: No blockers for human reviewer
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 documentation of all work completed)
24
+ - **Completeness** (all finalization steps completed)
25
+
26
+ ### Simplicity Principles
27
+ Read `registry/rules/simplicity.md` via `get_fraim_file` for complete guidelines. Key for finalization:
28
+ - **Focus on the assigned issue only** - document only relevant work
29
+ - **Clear communication** - evidence should be easy to understand
30
+
31
+ ### Git Operations (if needed)
32
+ 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.
33
+
34
+ ## WORKFLOW
35
+
36
+ ### Step 1: Update Issue Labels
37
+
38
+ **Remove:**
39
+ - `status:wip`
40
+ - Any phase-specific labels (e.g., `phase:spec`, `phase:design`, `phase:impl`)
41
+
42
+ **Add:**
43
+ - `status:needs-review`
44
+
45
+ **GitHub Repository Context:**
46
+ Read `.fraim/config.json` for:
47
+ - `git.repoOwner` - GitHub repository owner
48
+ - `git.repoName` - GitHub repository name
49
+
50
+ Use GitHub MCP tools to update labels.
51
+
52
+ ### Step 2: Create Evidence Document
53
+
54
+ **File location:**
55
+ ```
56
+ docs/evidence/{issue_number}-{workflow_type}-evidence.md
57
+ ```
58
+
59
+ **Evidence document should include:**
60
+
61
+ #### Summary
62
+ - Issue number and title
63
+ - Workflow type (spec, design, implement, test)
64
+ - Brief description of work completed
65
+
66
+ #### Work Completed
67
+ **For Spec Workflow:**
68
+ - Specification document created
69
+ - High-fidelity HTML mocks (if UI changes)
70
+ - Requirements coverage
71
+
72
+ **For Design Workflow:**
73
+ - Technical design document
74
+ - Architecture decisions
75
+ - API specifications
76
+ - Database schema (if applicable)
77
+
78
+ **For Implement Workflow:**
79
+ - Implementation details
80
+ - Key files changed
81
+ - Approach taken
82
+ - Testing completed
83
+
84
+ **For Test Workflow:**
85
+ - Test suite created/enhanced
86
+ - Coverage metrics
87
+ - Test results
88
+
89
+ #### Validation
90
+ - How work was validated
91
+ - Validation results
92
+ - Screenshots/output (if applicable)
93
+
94
+ #### Quality Checks
95
+ - All deliverables complete
96
+ - Documentation clear and professional
97
+ - Work ready for next phase or review
98
+
99
+ #### Phase Completion
100
+ - All phases completed for this workflow
101
+ - Evidence from each phase
102
+ - Any iterations or challenges
103
+
104
+ ### Step 3: Verify PR Exists
105
+
106
+ **Verify PR:**
107
+ - PR exists for the feature branch
108
+ - PR title reflects the issue and workflow
109
+ - PR description includes context and links to deliverables
110
+
111
+ **If PR doesn't exist:**
112
+ - Create PR manually
113
+ - Link to issue
114
+ - Add evidence document link
115
+
116
+ ### Step 4: Add PR Comment
117
+
118
+ Add comment to PR with link to evidence:
119
+ ```
120
+ {Workflow_type} workflow complete. Evidence document: docs/evidence/{issue_number}-{workflow_type}-evidence.md
121
+
122
+ All phases completed:
123
+ {workflow_specific_phases_checklist}
124
+
125
+ Ready for human review.
126
+ ```
127
+
128
+ ### Step 5: Final Verification
129
+
130
+ **Checklist:**
131
+ - ✅ Issue labels updated
132
+ - ✅ Evidence document created and complete
133
+ - ✅ PR exists and is ready
134
+ - ✅ PR comment added with evidence link
135
+ - ✅ All deliverables complete
136
+ - ✅ Git status clean
137
+
138
+ ## VALIDATION
139
+
140
+ ### Phase Complete When:
141
+ - ✅ Issue has `status:needs-review` label
142
+ - ✅ Issue does not have workflow phase labels
143
+ - ✅ Evidence document exists and is complete
144
+ - ✅ PR exists and is ready for review
145
+ - ✅ PR has comment linking to evidence
146
+ - ✅ All previous phases complete
147
+
148
+ ### Phase Incomplete If:
149
+ - ❌ Labels not updated
150
+ - ❌ Evidence document missing or incomplete
151
+ - ❌ PR not ready
152
+ - ❌ Previous phases not complete
153
+
154
+ ### Report Back:
155
+ ```javascript
156
+ seekCoachingOnNextStep({
157
+ workflowType: "{workflow_type}",
158
+ issueNumber: "{issue_number}",
159
+ currentPhase: "finalize",
160
+ status: "complete",
161
+ evidence: {
162
+ labelsUpdated: "Issue has status:needs-review label",
163
+ evidenceDocument: "docs/evidence/{issue_number}-{workflow_type}-evidence.md created",
164
+ prStatus: "PR ready for review",
165
+ prComment: "PR comment added with evidence link",
166
+ allPhasesComplete: "All {workflow_type} phases completed successfully"
167
+ }
168
+ })
169
+ ```
@@ -0,0 +1,202 @@
1
+ # Phase: submit-pr
2
+
3
+ ## INTENT
4
+ To submit completed work for review by creating/updating PR, setting proper labels, and documenting evidence.
5
+
6
+ ## OUTCOME
7
+ Work is submitted for review with:
8
+ - PR created/updated with work
9
+ - Proper issue labels applied
10
+ - Evidence documented
11
+ - Ready to enter PR review phase
12
+
13
+ ## PRINCIPLES
14
+ - **Complete Documentation**: Evidence shows all work done
15
+ - **Proper Labels**: Issue status reflects PR submission
16
+ - **Clear Communication**: PR and evidence are clear
17
+ - **Ready for Review**: No blockers for PR review process
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 documentation of all work completed)
24
+ - **Completeness** (all finalization steps completed)
25
+
26
+ ### Simplicity Principles
27
+ Read `registry/rules/simplicity.md` via `get_fraim_file` for complete guidelines. Key for finalization:
28
+ - **Focus on the assigned issue only** - document only relevant work
29
+ - **Clear communication** - evidence should be easy to understand
30
+
31
+ ### Git Operations (if needed)
32
+ 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.
33
+
34
+ ## WORKFLOW
35
+
36
+ ### Step 1: Create Evidence Document
37
+
38
+ **File location:**
39
+ ```
40
+ docs/evidence/{issue_number}-{workflow_type}-evidence.md
41
+ ```
42
+
43
+ **Evidence document should include:**
44
+
45
+ #### Summary
46
+ - Issue number and title
47
+ - Workflow type (spec, design, implement, test)
48
+ - Brief description of work completed
49
+
50
+ #### Work Completed
51
+ **For Spec Workflow:**
52
+ - Specification document created
53
+ - High-fidelity HTML mocks (if UI changes)
54
+ - Requirements coverage
55
+
56
+ **For Design Workflow:**
57
+ - Technical design document
58
+ - Architecture decisions
59
+ - API specifications
60
+ - Database schema (if applicable)
61
+
62
+ **For Implement Workflow:**
63
+ - Implementation details
64
+ - Key files changed
65
+ - Approach taken
66
+ - Testing completed
67
+
68
+ **For Test Workflow:**
69
+ - Test suite created/enhanced
70
+ - Coverage metrics
71
+ - Test results
72
+
73
+ #### PR Feedback History (if applicable)
74
+ **CRITICAL**: If PR feedback file exists (`docs/evidence/{issue_number}-{workflow_type}-feedback.md`), include its complete contents in the evidence document under this section.
75
+
76
+ This shows reviewers:
77
+ - All previous feedback received
78
+ - How each item was addressed
79
+ - Complete audit trail of review iterations
80
+
81
+ #### Validation
82
+ - How work was validated
83
+ - Validation results
84
+ - Screenshots/output (if applicable)
85
+
86
+ #### Quality Checks
87
+ - All deliverables complete
88
+ - Documentation clear and professional
89
+ - Work ready for next phase or review
90
+
91
+ #### Phase Completion
92
+ - All phases completed for this workflow
93
+ - Evidence from each phase
94
+ - Any iterations or challenges
95
+
96
+ ### Step 2: Commit and Sync Work
97
+
98
+ **Commit all changes:**
99
+ - Stage all modified files
100
+ - Create commit with descriptive message
101
+ - Push to feature branch
102
+
103
+ **Commit message format:**
104
+ ```
105
+ {workflow_type}({issue_number}): complete {phase_name} phase
106
+
107
+ - Evidence document created
108
+ - All deliverables complete
109
+ - Ready for review
110
+ ```
111
+
112
+ ### Step 3: Verify PR Exists
113
+
114
+ **Verify PR:**
115
+ - PR exists for the feature branch
116
+ - PR title reflects the issue and workflow
117
+ - PR description includes context and links to deliverables
118
+
119
+ **If PR doesn't exist:**
120
+ - Create PR manually
121
+ - Link to issue
122
+ - Add evidence document link
123
+
124
+ ### Step 4: Add PR Comment
125
+
126
+ Add comment to PR with link to evidence:
127
+ ```
128
+ {Workflow_type} workflow complete. Evidence document: docs/evidence/{issue_number}-{workflow_type}-evidence.md
129
+
130
+ All phases completed:
131
+ {workflow_specific_phases_checklist}
132
+
133
+ **PR Feedback History**:
134
+ {If feedback file exists, include: "This submission addresses all feedback from previous review rounds. See evidence document for complete feedback history and resolutions."}
135
+
136
+ Ready for human review.
137
+ ```
138
+
139
+ ### Step 5: Update Issue Labels
140
+
141
+ **Remove:**
142
+ - `status:wip`
143
+
144
+ **Add:**
145
+ - `status:needs-review`
146
+
147
+ **Keep:**
148
+ - Current phase label (e.g., `phase:spec`, `phase:design`, `phase:impl`) to indicate which phase is in PR
149
+
150
+ **GitHub Repository Context:**
151
+ Read `.fraim/config.json` for:
152
+ - `git.repoOwner` - GitHub repository owner
153
+ - `git.repoName` - GitHub repository name
154
+
155
+ Use GitHub MCP tools to update labels.
156
+
157
+ ### Step 6: Final Verification
158
+
159
+ **Checklist:**
160
+ - ✅ Issue labels updated (kept phase label, added needs-review)
161
+ - ✅ Evidence document created and complete
162
+ - ✅ All work committed and pushed to feature branch
163
+ - ✅ PR exists and is ready
164
+ - ✅ PR comment added with evidence link
165
+ - ✅ All deliverables complete
166
+ - ✅ Git status clean
167
+
168
+ ## VALIDATION
169
+
170
+ ### Phase Complete When:
171
+ - ✅ Issue has `status:needs-review` label
172
+ - ✅ Issue keeps current phase label to indicate what needs review
173
+ - ✅ Evidence document exists and is complete
174
+ - ✅ All work committed and synced to remote
175
+ - ✅ PR exists and is ready for review
176
+ - ✅ PR has comment linking to evidence
177
+ - ✅ All previous phases complete
178
+
179
+ ### Phase Incomplete If:
180
+ - ❌ Labels not updated correctly
181
+ - ❌ Evidence document missing or incomplete
182
+ - ❌ Work not committed and synced
183
+ - ❌ PR not ready
184
+ - ❌ Previous phases not complete
185
+
186
+ ### Report Back:
187
+ ```javascript
188
+ seekCoachingOnNextStep({
189
+ workflowType: "{workflow_type}",
190
+ issueNumber: "{issue_number}",
191
+ currentPhase: "submit-pr",
192
+ status: "complete",
193
+ evidence: {
194
+ labelsUpdated: "Issue has status:needs-review and keeps phase label",
195
+ evidenceDocument: "docs/evidence/{issue_number}-{workflow_type}-evidence.md created",
196
+ workCommitted: "All changes committed and pushed to feature branch",
197
+ prStatus: "PR ready for review",
198
+ prComment: "PR comment added with evidence link",
199
+ allPhasesComplete: "All {workflow_type} phases completed successfully"
200
+ }
201
+ })
202
+ ```