fraim-framework 2.0.44 → 2.0.46

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 (73) 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/cli/commands/sync.js +81 -0
  38. package/dist/src/fraim-mcp-server.js +45 -153
  39. package/dist/src/static-website-middleware.js +75 -0
  40. package/dist/tests/test-ai-coach-edge-cases.js +415 -0
  41. package/dist/tests/test-ai-coach-mcp-integration.js +432 -0
  42. package/dist/tests/test-ai-coach-performance.js +328 -0
  43. package/dist/tests/test-ai-coach-phase-content.js +264 -0
  44. package/dist/tests/test-ai-coach-workflows.js +487 -0
  45. package/dist/tests/test-ai-manager-phase-protocol.js +147 -0
  46. package/dist/tests/test-ai-manager.js +60 -71
  47. package/dist/tests/test-evidence-validation.js +221 -0
  48. package/dist/tests/test-mcp-lifecycle-methods.js +18 -23
  49. package/dist/tests/test-pr-review-integration.js +1 -0
  50. package/dist/tests/test-pr-review-workflow.js +299 -0
  51. package/dist/website/.nojekyll +0 -0
  52. package/dist/website/404.html +101 -0
  53. package/dist/website/CNAME +1 -0
  54. package/dist/website/README.md +22 -0
  55. package/dist/website/demo.html +604 -0
  56. package/dist/website/images/.gitkeep +1 -0
  57. package/dist/website/images/fraim-logo.png +0 -0
  58. package/dist/website/index.html +290 -0
  59. package/dist/website/pricing.html +414 -0
  60. package/dist/website/script.js +55 -0
  61. package/dist/website/styles.css +2647 -0
  62. package/package.json +2 -2
  63. package/registry/agent-guardrails.md +1 -1
  64. package/registry/stubs/workflows/brainstorming/blue-sky-brainstorming.md +11 -0
  65. package/registry/stubs/workflows/brainstorming/codebase-brainstorming.md +11 -0
  66. package/registry/stubs/workflows/compliance/detect-compliance-requirements.md +11 -0
  67. package/registry/stubs/workflows/compliance/generate-audit-evidence.md +11 -0
  68. package/registry/stubs/workflows/learning/synthesize-learnings.md +11 -0
  69. package/registry/stubs/workflows/legal/nda.md +11 -0
  70. package/registry/stubs/workflows/legal/patent-filing.md +11 -0
  71. package/registry/stubs/workflows/legal/trademark-filing.md +11 -0
  72. package/registry/stubs/workflows/product-building/design.md +1 -1
  73. package/registry/stubs/workflows/product-building/implement.md +1 -2
@@ -0,0 +1,100 @@
1
+ # Phase: Implement-Scoping
2
+
3
+ ## INTENT
4
+ To understand the issue requirements and determine whether it's a bug fix or feature implementation.
5
+
6
+ ## OUTCOME
7
+ Clear understanding of:
8
+ - Issue type (bug or feature)
9
+ - All requirements and acceptance criteria
10
+ - Ready to proceed to next phase (repro for bugs, spike for features)
11
+
12
+ ## PRINCIPLES
13
+ - **Thorough Understanding**: Read all linked documents and context
14
+ - **Clear Classification**: Accurately determine bug vs feature
15
+ - **Question Early**: Escalate if requirements are unclear
16
+
17
+ ## RULES FOR THIS PHASE
18
+
19
+ ### Success Criteria
20
+ Read `registry/rules/agent-success-criteria.md` via `get_fraim_file` for the complete 5-criteria success framework. Focus especially on **Integrity** (truthfulness in reporting) and **Independence** (smart decision making).
21
+
22
+ ### Simplicity Principles
23
+ Read `registry/rules/simplicity.md` via `get_fraim_file` for complete guidelines. Key principles for scoping:
24
+ - **Focus on the assigned issue only** - don't scope other issues
25
+ - **Don't over-think it** - understand the specific need being addressed
26
+
27
+ ### Architecture Compliance
28
+ Read `.fraim/config.json` for the architecture document path (`customizations.architectureDoc`), then read the local architecture document to understand the full architecture guidelines. Understanding the architecture helps with proper scoping.
29
+
30
+ ## WORKFLOW
31
+
32
+ ### Step 1: Get Repository Context and Issue Details
33
+
34
+ **GitHub Repository Context**: Before using GitHub MCP tools, read the local `.fraim/config.json` file to get the repository context:
35
+ - Use `git.repoOwner` for the GitHub repository owner
36
+ - Use `git.repoName` for the GitHub repository name
37
+ - These values are required for GitHub MCP API calls (owner/repo parameters)
38
+
39
+ **Read Issue Details**: Use GitHub MCP tools to get the complete issue information:
40
+ - Read the full issue description in GitHub (use MCP where available)
41
+ - Note the issue title, labels, and any linked documents
42
+ - Identify if there's a spec, RFC, or design document
43
+
44
+ ### Step 2: Review Linked Documents
45
+ - If spec/RFC exists: Read it thoroughly
46
+ - If design document exists: Review the technical approach
47
+ - Note all acceptance criteria and requirements
48
+
49
+ ### Step 3: Determine Issue Type
50
+ **Bug indicators:**
51
+ - Issue describes broken/incorrect behavior
52
+ - References a regression or failure
53
+ - Has reproduction steps
54
+ - Reports unexpected behavior
55
+
56
+ **Feature indicators:**
57
+ - Issue describes new functionality
58
+ - Adds capabilities that don't exist
59
+ - Enhances existing features
60
+ - Has acceptance criteria for new behavior
61
+
62
+ ### Step 4: Understand Requirements
63
+ - List all acceptance criteria
64
+ - Identify edge cases mentioned
65
+ - Note any constraints or limitations
66
+ - Understand success criteria
67
+
68
+ ### Step 5: Identify Uncertainties
69
+ If anything is unclear:
70
+ - **DO NOT** make assumptions
71
+ - **DO NOT** hypothesize requirements
72
+ - **ESCALATE** to user with specific questions
73
+ - Wait for clarification before proceeding
74
+
75
+ ## VALIDATION
76
+
77
+ ### Phase Complete When:
78
+ - ✅ Issue type determined (bug or feature)
79
+ - ✅ All requirements understood
80
+ - ✅ No blocking uncertainties remain
81
+ - ✅ Ready to proceed to next phase
82
+
83
+ ### Report Back:
84
+ When you complete scoping, call:
85
+
86
+ ```javascript
87
+ seekCoachingOnNextStep({
88
+ workflowType: "implement",
89
+ issueNumber: "{issue_number}",
90
+ currentPhase: "implement-scoping",
91
+ status: "complete",
92
+ findings: {
93
+ issueType: "bug", // or "feature"
94
+ requirements: "Brief summary of what you understood",
95
+ uncertainties: [] // List any unclear aspects, or empty array if none
96
+ }
97
+ })
98
+ ```
99
+
100
+ The AI Coach will provide instructions for your next phase based on the issue type you determined.
@@ -0,0 +1,230 @@
1
+ # Phase: Implement-Smoke
2
+
3
+ ## INTENT
4
+ To run technical health checks ensuring the system is stable: build passes, all tests pass, git status is clean, and core functionality hasn't been broken by the implementation.
5
+
6
+ ## OUTCOME
7
+ All technical checks pass, confirming:
8
+ - Build compiles successfully
9
+ - All tests pass (100% success rate)
10
+ - Git status is clean
11
+ - Core system functionality intact
12
+ - No regressions in critical paths
13
+
14
+ **Note**: This phase focuses purely on technical health checks. Manual validation and functional testing are handled in the implement-validate phase.
15
+
16
+ ## PRINCIPLES
17
+ - **Zero Tolerance**: All checks must pass
18
+ - **Technical Focus**: Automated verification only
19
+ - **Fix Immediately**: If any check fails, return to implement phase
20
+ - **Fast Feedback**: Quick automated verification
21
+
22
+ ## 📋 MANDATORY TECHNICAL CHECKS
23
+
24
+ ### Step 0: Read Project Validation Commands 📖
25
+
26
+ **FIRST**: Read your project's validation commands from `.fraim/config.json`:
27
+
28
+ ```bash
29
+ # Read the config to get project-specific validation commands
30
+ cat .fraim/config.json
31
+ ```
32
+
33
+ Look for `customizations.validation.buildCommand` and `customizations.validation.smokeTestCommand`.
34
+
35
+ **Use these commands instead of the generic ones below if they exist.**
36
+
37
+ ### Step 1: Build Compilation Check ✅
38
+
39
+ **Requirements**:
40
+ - TypeScript compiles without errors
41
+ - Build process completes successfully
42
+ - No type errors or warnings
43
+
44
+ **Commands to Run** (use customizations.validation.buildCommand from config if available):
45
+ ```bash
46
+ # Run build (use customizations.validation.buildCommand if available, otherwise default)
47
+ npm run build
48
+ ```
49
+
50
+ **What to Look For**:
51
+ - Exit code 0 (success) for all commands
52
+ - No error messages in output
53
+ - Clean compilation without warnings
54
+
55
+ ### Step 2: Complete Test Suite ✅
56
+
57
+ **Requirements**:
58
+ - ALL existing tests pass (100% success rate) - not just tests you created
59
+ - No timeouts or hanging tests
60
+ - Comprehensive test coverage validation
61
+
62
+ **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.
63
+
64
+ **Commands to Run** (use customizations.validation.smokeTestCommand from config if available):
65
+ ```bash
66
+ # Run the comprehensive test suite (use customizations.validation.smokeTestCommand if available)
67
+ npm test
68
+ ```
69
+
70
+ **What to Look For**:
71
+ - "All tests passed" or similar success message
72
+ - No "FAILED" or "ERROR" in output
73
+ - Test count should include existing tests + any new tests you added
74
+ - No timeout messages
75
+ - Verify that existing functionality tests are included in the run
76
+
77
+ **Example Expected Output**:
78
+ ```
79
+ ✅ Running 45 tests (including existing + new tests)
80
+ ✅ All tests passed
81
+ ✅ Test suite completed successfully
82
+ ```
83
+
84
+ ### Step 3: Git Status Check ✅
85
+
86
+ **Requirements**:
87
+ - Git status is clean
88
+ - Only intended changes present
89
+ - No untracked files (except evidence docs)
90
+
91
+ **Commands to Run**:
92
+ ```bash
93
+ # Check git status
94
+ git status
95
+
96
+ # Check recent commits
97
+ git log --oneline -3
98
+ ```
99
+
100
+ **What to Look For**:
101
+ - Only intended files are modified
102
+ - No accidentally modified files
103
+ - Clean working directory
104
+ - Meaningful commit messages
105
+
106
+ ### Step 4: Code Quality Verification ✅
107
+
108
+ **Requirements**:
109
+ - No type bypassing
110
+ - No debugging code remains
111
+ - No task placeholder comments in core functionality
112
+
113
+ **Commands to Run**:
114
+ ```bash
115
+ # Check for type bypassing
116
+ grep -r "as any" src/ || echo "✅ No type bypassing found"
117
+
118
+ # Look for debugging code
119
+ grep -r "console.log" src/ | grep -v "logger" | grep -v "// OK" || echo "✅ No debug logs found"
120
+
121
+ # Check for task placeholder comments
122
+ grep -r "task-placeholder" src/ || echo "✅ No task placeholders found"
123
+ ```
124
+
125
+ **What to Look For**:
126
+ - Zero instances of "as any" (or only justified ones with comments)
127
+ - No console.log statements (except intentional logging)
128
+ - No task placeholder comments in critical code
129
+
130
+ ## 🛠️ TECHNICAL COMMANDS REFERENCE
131
+
132
+ ### Project-Specific Commands (Read from .fraim/config.json)
133
+ ```bash
134
+ # Check your project's custom validation commands:
135
+ cat .fraim/config.json | grep -A 5 "validation"
136
+ ```
137
+
138
+ ### Quick Health Check
139
+ ```bash
140
+ # One-liner using project defaults (customize based on your config)
141
+ npm run build && npm test && git status
142
+ ```
143
+
144
+ ## VALIDATION
145
+
146
+ ### Phase Complete When:
147
+ - ✅ Build succeeds without errors
148
+ - ✅ All tests pass (100% success rate)
149
+ - ✅ Git status clean (only intended changes)
150
+ - ✅ No "as any" type bypassing
151
+ - ✅ No debugging code remains
152
+ - ✅ No task placeholder comments in core functionality
153
+ - ✅ All technical checks documented
154
+
155
+ ### Phase Incomplete If:
156
+ - ❌ Build fails
157
+ - ❌ ANY test fails
158
+ - ❌ Git status shows unintended changes
159
+ - ❌ Code quality issues found
160
+
161
+ **If ANY check fails, return to implement-code phase immediately.**
162
+
163
+ ## RULES FOR THIS PHASE
164
+
165
+ ### Technical Standards
166
+ - Read `.fraim/config.json` for the architecture document path (`customizations.architectureDoc`), then read the local architecture document to understand the full technical standards
167
+ - Use Successful Debugging Patterns from `rules/successful-debugging-patterns.md` via `get_fraim_file`
168
+ - When using git commands directly (if MCP tools unavailable), read `rules/git-safe-commands.md` via `get_fraim_file`
169
+
170
+ ### Failure Handling
171
+ - **If ANY technical check fails**: Return to implement-code phase
172
+ - **Do not proceed to regression phase** if smoke tests fail
173
+ - Fix the implementation first, then re-run smoke tests
174
+
175
+ ## SCRIPTS
176
+
177
+ **Run all technical checks:**
178
+ ```bash
179
+ npm run build && npm test && git status
180
+ ```
181
+
182
+ **Run smoke tests specifically:**
183
+ ```bash
184
+ npm run test-smoke-ci
185
+ ```
186
+
187
+ ### Report Back:
188
+ When you complete this phase, call:
189
+
190
+ ```javascript
191
+ seekCoachingOnNextStep({
192
+ workflowType: "implement",
193
+ issueNumber: "{issue_number}",
194
+ currentPhase: "implement-smoke",
195
+ status: "complete",
196
+ findings: {
197
+ issueType: "bug" // or "feature" - Required for phase validation
198
+ },
199
+ evidence: {
200
+ buildPassed: "YES", // Did `npm run build` succeed?
201
+ allTestsPassed: "YES", // Did `npm test` show 100% pass rate?
202
+ gitStatusClean: "YES", // Does `git status` show only intended changes?
203
+ noTypeBypass: "YES", // Did `grep -r "as any" src/` find zero instances?
204
+ noDebugCode: "YES", // Did you remove console.log statements?
205
+ registryValid: "YES", // Did `npm run validate:registry` pass?
206
+ commandsRun: "npm run build && npm test && git status",
207
+ summary: "All technical checks passed. Build succeeds, all tests pass, git status clean."
208
+ }
209
+ })
210
+ ```
211
+
212
+ If any technical check fails:
213
+ ```javascript
214
+ seekCoachingOnNextStep({
215
+ workflowType: "implement",
216
+ issueNumber: "{issue_number}",
217
+ currentPhase: "implement-smoke",
218
+ status: "incomplete",
219
+ findings: {
220
+ issueType: "bug" // or "feature" - Required for phase validation
221
+ },
222
+ evidence: {
223
+ buildPassed: "NO", // Specify what failed
224
+ allTestsPassed: "NO", // Be specific about failures
225
+ issues: ["Build failed with TypeScript errors", "3 tests failing"],
226
+ commandsRun: "npm run build && npm test",
227
+ nextAction: "Returning to implement phase to fix technical issues"
228
+ }
229
+ })
230
+ ```
@@ -0,0 +1,121 @@
1
+ # Phase: Implement-Spike (Features Only)
2
+
3
+ ## INTENT
4
+ To build a proof-of-concept that validates the technical approach, tests uncertain or risky aspects, and confirms the design is viable before full implementation.
5
+
6
+ ## OUTCOME
7
+ A working POC that:
8
+ - Validates key technical assumptions
9
+ - Tests risky or uncertain aspects
10
+ - Gets user approval
11
+ - Informs any necessary design updates
12
+
13
+ ## PRINCIPLES
14
+ - **Spike-First Development**: Follow the spike-first rule for unfamiliar technology
15
+ - **Risk Reduction**: Focus on highest-risk or most uncertain aspects
16
+ - **Quick Validation**: Build minimal POC, not production code
17
+ - **User Approval**: Get explicit approval before proceeding
18
+ - **Design Updates**: Update design doc with findings
19
+
20
+ ## WORKFLOW
21
+
22
+ ### Step 1: Review Design Document
23
+ - Read the technical design/RFC thoroughly
24
+ - Identify technical assumptions
25
+ - Note any unfamiliar technologies or patterns
26
+ - List risky or uncertain aspects
27
+
28
+ ### Step 2: Identify Spike Scope
29
+ **Focus on:**
30
+ - Unfamiliar technology or libraries
31
+ - Integration points with external systems
32
+ - Performance-critical components
33
+ - Complex algorithms or logic
34
+ - Uncertain technical feasibility
35
+
36
+ **Do NOT spike:**
37
+ - Well-understood patterns
38
+ - Standard CRUD operations
39
+ - Simple UI changes
40
+ - Routine implementations
41
+
42
+ ### Step 3: Build Proof-of-Concept
43
+ - Create minimal code to test assumptions
44
+ - Focus on proving/disproving technical approach
45
+ - Don't worry about production quality
46
+ - Document what you're testing
47
+
48
+ ### Step 4: Test Key Assumptions
49
+ - Run the POC
50
+ - Verify it works as expected
51
+ - Test edge cases if relevant
52
+ - Document findings
53
+
54
+ ### Step 5: Get User Approval
55
+ - Present POC to user
56
+ - Explain what was validated
57
+ - Share any findings or concerns
58
+ - **Wait for explicit approval** before proceeding
59
+
60
+ ### Step 6: Update Design Document
61
+ If POC revealed:
62
+ - Better approaches
63
+ - Technical constraints
64
+ - Performance considerations
65
+ - Integration challenges
66
+
67
+ **Update the design document** with findings
68
+
69
+ ## VALIDATION
70
+
71
+ ### Phase Complete When:
72
+ - ✅ POC built and tested
73
+ - ✅ Key technical assumptions validated
74
+ - ✅ User has approved the approach
75
+ - ✅ Design document updated (if needed)
76
+ - ✅ Ready to proceed with full implementation
77
+
78
+ ### Phase Incomplete If:
79
+ - ❌ POC doesn't work as expected
80
+ - ❌ Technical approach not viable
81
+ - ❌ User hasn't approved
82
+ - ❌ Significant findings not documented
83
+
84
+ ## RULES FOR THIS PHASE
85
+
86
+ ### Spike-First Development
87
+ Read `registry/rules/spike-first-development.md` via `get_fraim_file` for complete spike methodology.
88
+
89
+ ### Architecture Compliance
90
+ Read `.fraim/config.json` for the architecture document path (`customizations.architectureDoc`), then read the local architecture document to understand the full architecture guidelines.
91
+
92
+ ### Git Operations (if needed)
93
+ 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.
94
+
95
+ ## SCRIPTS
96
+ Run POC:
97
+ ```bash
98
+ npm run spike # or appropriate command
99
+ node spike/your-poc.js
100
+ ```
101
+
102
+ ### Report Back:
103
+ When you complete this phase, call:
104
+
105
+ ```javascript
106
+ seekCoachingOnNextStep({
107
+ workflowType: "implement",
108
+ issueNumber: "{issue_number}",
109
+ currentPhase: "implement-spike",
110
+ status: "complete",
111
+ findings: {
112
+ issueType: "feature" // Required for phase validation
113
+ },
114
+ evidence: {
115
+ pocLocation: "spike/auth-flow.ts",
116
+ validationResults: "OAuth2 integration works as expected",
117
+ userApproval: "User approved approach on [date]",
118
+ designUpdates: "Updated design doc with token refresh findings"
119
+ }
120
+ })
121
+ ```