fraim-framework 2.0.26 → 2.0.30

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 (104) hide show
  1. package/.github/workflows/deploy-fraim.yml +1 -1
  2. package/dist/registry/scripts/build-scripts-generator.js +205 -0
  3. package/dist/registry/scripts/cleanup-branch.js +258 -0
  4. package/dist/registry/scripts/evaluate-code-quality.js +66 -0
  5. package/dist/registry/scripts/exec-with-timeout.js +142 -0
  6. package/dist/registry/scripts/fraim-config.js +61 -0
  7. package/dist/registry/scripts/generate-engagement-emails.js +630 -0
  8. package/dist/registry/scripts/generic-issues-api.js +100 -0
  9. package/dist/registry/scripts/newsletter-helpers.js +731 -0
  10. package/dist/registry/scripts/openapi-generator.js +664 -0
  11. package/dist/registry/scripts/performance/profile-server.js +390 -0
  12. package/dist/registry/scripts/run-thank-you-workflow.js +92 -0
  13. package/dist/registry/scripts/send-newsletter-simple.js +85 -0
  14. package/dist/registry/scripts/send-thank-you-emails.js +54 -0
  15. package/dist/registry/scripts/validate-openapi-limits.js +311 -0
  16. package/dist/registry/scripts/validate-test-coverage.js +262 -0
  17. package/dist/registry/scripts/verify-test-coverage.js +66 -0
  18. package/dist/src/cli/commands/init.js +14 -12
  19. package/dist/src/cli/commands/sync.js +19 -2
  20. package/dist/src/cli/fraim.js +24 -22
  21. package/dist/src/cli/setup/first-run.js +13 -6
  22. package/dist/src/fraim/config-loader.js +0 -8
  23. package/dist/src/fraim/db-service.js +26 -15
  24. package/dist/src/fraim/issues.js +67 -0
  25. package/dist/src/fraim/setup-wizard.js +1 -69
  26. package/dist/src/fraim/types.js +0 -11
  27. package/dist/src/fraim-mcp-server.js +272 -18
  28. package/dist/src/utils/git-utils.js +1 -1
  29. package/dist/src/utils/version-utils.js +32 -0
  30. package/dist/tests/debug-tools.js +79 -0
  31. package/dist/tests/esm-compat.js +11 -0
  32. package/dist/tests/test-chalk-esm-issue.js +159 -0
  33. package/dist/tests/test-chalk-real-world.js +265 -0
  34. package/dist/tests/test-chalk-regression.js +327 -0
  35. package/dist/tests/test-chalk-resolution-issue.js +304 -0
  36. package/dist/tests/test-cli.js +0 -2
  37. package/dist/tests/test-fraim-install-chalk-issue.js +254 -0
  38. package/dist/tests/test-fraim-issues.js +59 -0
  39. package/dist/tests/test-genericization.js +1 -3
  40. package/dist/tests/test-mcp-connection.js +166 -0
  41. package/dist/tests/test-mcp-issue-integration.js +144 -0
  42. package/dist/tests/test-mcp-lifecycle-methods.js +312 -0
  43. package/dist/tests/test-node-compatibility.js +71 -0
  44. package/dist/tests/test-npm-install.js +66 -0
  45. package/dist/tests/test-npm-resolution-diagnostic.js +140 -0
  46. package/dist/tests/test-session-rehydration.js +145 -0
  47. package/dist/tests/test-standalone.js +2 -8
  48. package/dist/tests/test-sync-version-update.js +93 -0
  49. package/dist/tests/test-telemetry.js +190 -0
  50. package/package.json +10 -8
  51. package/registry/agent-guardrails.md +62 -54
  52. package/registry/rules/agent-success-criteria.md +52 -0
  53. package/registry/rules/agent-testing-guidelines.md +502 -502
  54. package/registry/rules/communication.md +121 -121
  55. package/registry/rules/continuous-learning.md +54 -54
  56. package/registry/rules/ephemeral-execution.md +10 -5
  57. package/registry/rules/hitl-ppe-record-analysis.md +302 -302
  58. package/registry/rules/local-development.md +251 -251
  59. package/registry/rules/software-development-lifecycle.md +104 -104
  60. package/registry/rules/successful-debugging-patterns.md +482 -478
  61. package/registry/rules/telemetry.md +67 -0
  62. package/registry/scripts/build-scripts-generator.ts +216 -215
  63. package/registry/scripts/cleanup-branch.ts +303 -284
  64. package/registry/scripts/code-quality-check.sh +559 -559
  65. package/registry/scripts/detect-tautological-tests.sh +38 -38
  66. package/registry/scripts/evaluate-code-quality.ts +1 -1
  67. package/registry/scripts/generate-engagement-emails.ts +744 -744
  68. package/registry/scripts/generic-issues-api.ts +110 -150
  69. package/registry/scripts/newsletter-helpers.ts +874 -874
  70. package/registry/scripts/openapi-generator.ts +695 -693
  71. package/registry/scripts/performance/profile-server.ts +5 -3
  72. package/registry/scripts/prep-issue.sh +468 -455
  73. package/registry/scripts/validate-openapi-limits.ts +366 -365
  74. package/registry/scripts/validate-test-coverage.ts +280 -280
  75. package/registry/scripts/verify-pr-comments.sh +70 -70
  76. package/registry/scripts/verify-test-coverage.ts +1 -1
  77. package/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +53 -53
  78. package/registry/templates/evidence/Implementation-BugEvidence.md +85 -85
  79. package/registry/templates/evidence/Implementation-FeatureEvidence.md +120 -120
  80. package/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +66 -0
  81. package/registry/workflows/bootstrap/create-architecture.md +2 -2
  82. package/registry/workflows/bootstrap/evaluate-code-quality.md +3 -3
  83. package/registry/workflows/bootstrap/verify-test-coverage.md +2 -2
  84. package/registry/workflows/customer-development/insight-analysis.md +156 -156
  85. package/registry/workflows/customer-development/interview-preparation.md +421 -421
  86. package/registry/workflows/customer-development/strategic-brainstorming.md +146 -146
  87. package/registry/workflows/customer-development/thank-customers.md +193 -191
  88. package/registry/workflows/customer-development/weekly-newsletter.md +362 -352
  89. package/registry/workflows/improve-fraim/contribute.md +32 -0
  90. package/registry/workflows/improve-fraim/file-issue.md +32 -0
  91. package/registry/workflows/marketing/hbr-article.md +73 -0
  92. package/registry/workflows/performance/analyze-performance.md +63 -59
  93. package/registry/workflows/product-building/design.md +3 -2
  94. package/registry/workflows/product-building/implement.md +4 -3
  95. package/registry/workflows/product-building/prep-issue.md +28 -17
  96. package/registry/workflows/product-building/resolve.md +3 -2
  97. package/registry/workflows/product-building/retrospect.md +3 -2
  98. package/registry/workflows/product-building/spec.md +5 -4
  99. package/registry/workflows/product-building/test.md +3 -2
  100. package/registry/workflows/quality-assurance/iterative-improvement-cycle.md +562 -562
  101. package/registry/workflows/replicate/website-discovery-analysis.md +3 -3
  102. package/registry/workflows/reviewer/review-implementation-vs-design-spec.md +632 -632
  103. package/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +669 -669
  104. package/tsconfig.json +2 -1
@@ -1,122 +1,122 @@
1
- # Communication
2
-
3
- ## INTENT
4
- To establish clear communication patterns and progress reporting standards that enable effective coordination between agents and stakeholders, ensuring transparent progress tracking and proper status updates throughout the development process.
5
-
6
- ## PRINCIPLES
7
- - **Clear Communication**: Provide transparent progress updates
8
- - **Evidence-Based**: Show concrete progress with specific details
9
- - **Consistent Format**: Use standardized reporting templates
10
- - **Stakeholder Focus**: Communicate what matters to reviewers and users
11
- - **Actionable Updates**: Provide clear next steps and blocking issues
12
- - **Ask for help**: When blocked and out of options, ask user for help
13
- - **ABSOLUTE ACCOUNTABILITY**: Agent is 100% responsible for fixing their own work and mistakes
14
-
15
- ## COMMUNICATION REQUIREMENTS
16
-
17
- ### Progress Updates
18
- Always provide clear progress updates with:
19
- 1. **Actions executed** (imperative, past tense)
20
- 2. **Local progress** (files modified, tests run)
21
- 3. **Remote artifacts** (branch, PR status)
22
- 4. **Next steps** for this issue
23
- 5. **Blocking issues** (if any)
24
-
25
- ### Status Reporting
26
- - **Be specific**: "Fixed calendar sync timeout" not "Made changes"
27
- - **Include evidence**: "Tests run: npm test test-calendar-sync.ts ✅ PASSED"
28
- - **Show concrete progress**: "Files modified: src/calendar-api.ts, test-calendar-sync.ts"
29
- - **Indicate readiness**: "Ready for code review" vs "Still working on implementation"
30
-
31
- ### Communication Channel
32
- - **GitHub**: The PR is the best way to communicate with your stakeholders. Update the PR with standard templates as covered below
33
-
34
-
35
- ## COMMUNICATION TEMPLATES
36
- 1. When you need feedback on a completed spec - `.ai-agents/templates/evidence/Spec-Evidence.md`
37
- 2. When you need feedback on a completed design - `.ai-agents/templates/evidence/Design-Evidence.md`
38
- 3. When you need feedback on a completed bug fix implementation - `.ai-agents/templates/evidence/Implementation-BugEvidence.md`
39
- 4. When you need feedback on a completed feature implementation - `.ai-agents/templates/evidence/Implementation-FeatureEvidence.md`
40
- 5. When you are stuck and need help - `.ai-agents/templates/help/HelpNeeded.md`
41
-
42
- ## EXAMPLES
43
-
44
- ### Good: Clear Progress Update
45
- ```
46
- Summary:
47
- - Local progress: Fixed calendar sync timeout, added retry logic, ran tests
48
- - Files modified: src/calendar-api.ts, test-calendar-sync.ts
49
- - Tests run: npm test test-calendar-sync.ts ✅ PASSED
50
- - Remote status: Branch feature/84-fix-sync pushed, Draft PR created
51
- - Next steps: Wait for code review
52
- - Blocking issues: None
53
- ```
54
-
55
- ### Bad: Vague Progress Update
56
- ```
57
- Summary:
58
- - Local progress: Made some changes
59
- - Remote status: Something happened
60
- - Next steps: Not sure
61
- ```
62
-
63
- ### Good: Specific Status Update
64
- ```
65
- Issue #84: "Fix calendar sync timeout"
66
- - ✅ Identified root cause: Missing retry logic in calendar API
67
- - ✅ Implemented exponential backoff with jitter
68
- - ✅ Added comprehensive test coverage (5 new test cases)
69
- - ✅ All tests passing locally
70
- - ✅ Pushed to feature/84-fix-sync
71
- - ✅ Draft PR created and ready for review
72
- - Next: Waiting for code review feedback
73
- ```
74
-
75
- ### Bad: Generic Status Update
76
- ```
77
- Issue #84: "Fix calendar sync timeout"
78
- - Working on it
79
- - Made some changes
80
- - Need to test more
81
- ```
82
-
83
- ## ACCOUNTABILITY AND RESPONSIBILITY RULES
84
-
85
- ### ABSOLUTE ACCOUNTABILITY PRINCIPLE
86
- **The agent is 100% responsible for fixing their own work and mistakes. No exceptions.**
87
-
88
- ### PROHIBITED ACCOUNTABILITY DEFLECTION
89
- **NEVER suggest the user should handle the agent's responsibilities:**
90
-
91
- ❌ **PROHIBITED LANGUAGE:**
92
- - "Would you like me to work with you to fix this, or would you prefer to handle it yourself?"
93
- - "Should I do X or would you prefer to do Y?"
94
- - "Do you want to fix this yourself?"
95
- - "Can you handle this part for me?"
96
- - "Would you like to take over this task?"
97
-
98
- ✅ **REQUIRED LANGUAGE:**
99
- - "I will fix this myself"
100
- - "I am working to resolve this issue"
101
- - "I will complete the proper validation"
102
- - "I take full responsibility for this mistake"
103
-
104
- ### HELP vs RESPONSIBILITY DISTINCTION
105
-
106
- **APPROPRIATE Help Requests (when genuinely blocked):**
107
- - "I'm blocked on X technical issue, can you provide guidance?"
108
- - "I need clarification on Y requirement"
109
- - "I'm stuck on Z approach, what direction should I take?"
110
-
111
- **INAPPROPRIATE Responsibility Deflection:**
112
- - "Can you handle this testing for me?"
113
- - "Would you prefer to do this validation yourself?"
114
- - "Should I continue or do you want to take over?"
115
-
116
- ### OWNERSHIP PROTOCOL
117
- - **Agent breaks it** → **Agent fixes it**
118
- - **Agent makes mistake** → **Agent corrects it**
119
- - **Agent claims false success** → **Agent provides real validation**
120
- - **Agent creates problems** → **Agent solves them**
121
-
1
+ # Communication
2
+
3
+ ## INTENT
4
+ To establish clear communication patterns and progress reporting standards that enable effective coordination between agents and stakeholders, ensuring transparent progress tracking and proper status updates throughout the development process.
5
+
6
+ ## PRINCIPLES
7
+ - **Clear Communication**: Provide transparent progress updates
8
+ - **Evidence-Based**: Show concrete progress with specific details
9
+ - **Consistent Format**: Use standardized reporting templates
10
+ - **Stakeholder Focus**: Communicate what matters to reviewers and users
11
+ - **Actionable Updates**: Provide clear next steps and blocking issues
12
+ - **Ask for help**: When blocked and out of options, ask user for help
13
+ - **ABSOLUTE ACCOUNTABILITY**: Agent is 100% responsible for fixing their own work and mistakes
14
+
15
+ ## COMMUNICATION REQUIREMENTS
16
+
17
+ ### Progress Updates
18
+ Always provide clear progress updates with:
19
+ 1. **Actions executed** (imperative, past tense)
20
+ 2. **Local progress** (files modified, tests run)
21
+ 3. **Remote artifacts** (branch, PR status)
22
+ 4. **Next steps** for this issue
23
+ 5. **Blocking issues** (if any)
24
+
25
+ ### Status Reporting
26
+ - **Be specific**: "Fixed calendar sync timeout" not "Made changes"
27
+ - **Include evidence**: "Tests run: npm test test-calendar-sync.ts ✅ PASSED"
28
+ - **Show concrete progress**: "Files modified: src/calendar-api.ts, test-calendar-sync.ts"
29
+ - **Indicate readiness**: "Ready for code review" vs "Still working on implementation"
30
+
31
+ ### Communication Channel
32
+ - **GitHub**: The PR is the best way to communicate with your stakeholders. Update the PR with standard templates as covered below
33
+
34
+
35
+ ## COMMUNICATION TEMPLATES
36
+ 1. When you need feedback on a completed spec - Retrieve via `get_fraim_file({ path: "templates/evidence/Spec-Evidence.md" })`
37
+ 2. When you need feedback on a completed design - Retrieve via `get_fraim_file({ path: "templates/evidence/Design-Evidence.md" })`
38
+ 3. When you need feedback on a completed bug fix implementation - Retrieve via `get_fraim_file({ path: "templates/evidence/Implementation-BugEvidence.md" })`
39
+ 4. When you need feedback on a completed feature implementation - Retrieve via `get_fraim_file({ path: "templates/evidence/Implementation-FeatureEvidence.md" })`
40
+ 5. When you are stuck and need help - Retrieve via `get_fraim_file({ path: "templates/help/HelpNeeded.md" })`
41
+
42
+ ## EXAMPLES
43
+
44
+ ### Good: Clear Progress Update
45
+ ```
46
+ Summary:
47
+ - Local progress: Fixed calendar sync timeout, added retry logic, ran tests
48
+ - Files modified: src/calendar-api.ts, test-calendar-sync.ts
49
+ - Tests run: npm test test-calendar-sync.ts ✅ PASSED
50
+ - Remote status: Branch feature/84-fix-sync pushed, Draft PR created
51
+ - Next steps: Wait for code review
52
+ - Blocking issues: None
53
+ ```
54
+
55
+ ### Bad: Vague Progress Update
56
+ ```
57
+ Summary:
58
+ - Local progress: Made some changes
59
+ - Remote status: Something happened
60
+ - Next steps: Not sure
61
+ ```
62
+
63
+ ### Good: Specific Status Update
64
+ ```
65
+ Issue #84: "Fix calendar sync timeout"
66
+ - ✅ Identified root cause: Missing retry logic in calendar API
67
+ - ✅ Implemented exponential backoff with jitter
68
+ - ✅ Added comprehensive test coverage (5 new test cases)
69
+ - ✅ All tests passing locally
70
+ - ✅ Pushed to feature/84-fix-sync
71
+ - ✅ Draft PR created and ready for review
72
+ - Next: Waiting for code review feedback
73
+ ```
74
+
75
+ ### Bad: Generic Status Update
76
+ ```
77
+ Issue #84: "Fix calendar sync timeout"
78
+ - Working on it
79
+ - Made some changes
80
+ - Need to test more
81
+ ```
82
+
83
+ ## ACCOUNTABILITY AND RESPONSIBILITY RULES
84
+
85
+ ### ABSOLUTE ACCOUNTABILITY PRINCIPLE
86
+ **The agent is 100% responsible for fixing their own work and mistakes. No exceptions.**
87
+
88
+ ### PROHIBITED ACCOUNTABILITY DEFLECTION
89
+ **NEVER suggest the user should handle the agent's responsibilities:**
90
+
91
+ ❌ **PROHIBITED LANGUAGE:**
92
+ - "Would you like me to work with you to fix this, or would you prefer to handle it yourself?"
93
+ - "Should I do X or would you prefer to do Y?"
94
+ - "Do you want to fix this yourself?"
95
+ - "Can you handle this part for me?"
96
+ - "Would you like to take over this task?"
97
+
98
+ ✅ **REQUIRED LANGUAGE:**
99
+ - "I will fix this myself"
100
+ - "I am working to resolve this issue"
101
+ - "I will complete the proper validation"
102
+ - "I take full responsibility for this mistake"
103
+
104
+ ### HELP vs RESPONSIBILITY DISTINCTION
105
+
106
+ **APPROPRIATE Help Requests (when genuinely blocked):**
107
+ - "I'm blocked on X technical issue, can you provide guidance?"
108
+ - "I need clarification on Y requirement"
109
+ - "I'm stuck on Z approach, what direction should I take?"
110
+
111
+ **INAPPROPRIATE Responsibility Deflection:**
112
+ - "Can you handle this testing for me?"
113
+ - "Would you prefer to do this validation yourself?"
114
+ - "Should I continue or do you want to take over?"
115
+
116
+ ### OWNERSHIP PROTOCOL
117
+ - **Agent breaks it** → **Agent fixes it**
118
+ - **Agent makes mistake** → **Agent corrects it**
119
+ - **Agent claims false success** → **Agent provides real validation**
120
+ - **Agent creates problems** → **Agent solves them**
121
+
122
122
  **No exceptions. No deflection. No user responsibility for agent mistakes.**
@@ -1,55 +1,55 @@
1
- # Continuous Learning
2
-
3
- ## INTENT
4
- To prevent repeating past mistakes and build upon existing solutions by systematically learning from retrospectives, RFCs, and historical issue patterns, ensuring continuous improvement and knowledge accumulation across all agents.
5
-
6
- ## PRINCIPLES
7
- - **Learn from History**: Always review past work before starting new tasks
8
- - **Build on Success**: Apply proven solutions rather than reinventing
9
- - **Avoid Known Pitfalls**: Use retrospectives to prevent recurring issues
10
- - **Share Knowledge**: Document learnings for future agents
11
- - **Pattern Recognition**: Identify recurring problems and solutions
12
-
13
- ## MANDATORY LEARNING WORKFLOW
14
-
15
- ### Before Starting Any Work
16
- 1. **Search retrospectives** for related issues or similar problems
17
- 2. **Read relevant RFCs** to understand the design context
18
- 3. **Review test cases** to see expected behavior
19
- 4. **Check issue comments** for previous attempts and solutions
20
-
21
- ### Knowledge Sources
22
- - **Retrospectives**: `/retrospectives/` folder for past problem analysis
23
- - **RFCs**: `/docs/rfcs/` for design decisions and architectural context
24
- - **Test Cases**: Existing tests show expected behavior patterns
25
- - **Issue History**: Comments and PRs reveal previous attempts and solutions
26
-
27
- ## EXAMPLES
28
-
29
- ### Good: Learning from History
30
- ```
31
- Issue: "Fix calendar sync timeout"
32
- Before Starting:
33
- - ✅ Read retrospective on issue-45 (similar timeout problem)
34
- - ✅ Found root cause: missing retry logic
35
- - ✅ Applied proven solution: exponential backoff
36
- - ✅ Avoided known pitfall: infinite retry loops
37
- Result: Fixed in 1 iteration using proven approach
38
- ```
39
-
40
- ### Bad: Ignoring History
41
- ```
42
- Issue: "Fix calendar sync timeout"
43
- Approach:
44
- - ❌ Started coding immediately without research
45
- - ❌ Implemented naive retry logic
46
- - ❌ Hit same infinite loop issue from issue-45
47
- - ❌ Wasted 3 iterations on known problem
48
- Result: Eventually found retrospective, but too late
49
- ```
50
-
51
- ## RETROSPECTIVE CREATION
52
- - **Use template**: `.ai-agents/templates/retrospective/RETROSPECTIVE-TEMPLATE.md` for consistent structure
53
- - **Follow process**: Use the `retrospect.mdc` rule for retrospective creation workflow
54
-
1
+ # Continuous Learning
2
+
3
+ ## INTENT
4
+ To prevent repeating past mistakes and build upon existing solutions by systematically learning from retrospectives, RFCs, and historical issue patterns, ensuring continuous improvement and knowledge accumulation across all agents.
5
+
6
+ ## PRINCIPLES
7
+ - **Learn from History**: Always review past work before starting new tasks
8
+ - **Build on Success**: Apply proven solutions rather than reinventing
9
+ - **Avoid Known Pitfalls**: Use retrospectives to prevent recurring issues
10
+ - **Share Knowledge**: Document learnings for future agents
11
+ - **Pattern Recognition**: Identify recurring problems and solutions
12
+
13
+ ## MANDATORY LEARNING WORKFLOW
14
+
15
+ ### Before Starting Any Work
16
+ 1. **Search retrospectives** for related issues or similar problems
17
+ 2. **Read relevant RFCs** to understand the design context
18
+ 3. **Review test cases** to see expected behavior
19
+ 4. **Check issue comments** for previous attempts and solutions
20
+
21
+ ### Knowledge Sources
22
+ - **Retrospectives**: `/retrospectives/` folder for past problem analysis
23
+ - **RFCs**: `/docs/rfcs/` for design decisions and architectural context
24
+ - **Test Cases**: Existing tests show expected behavior patterns
25
+ - **Issue History**: Comments and PRs reveal previous attempts and solutions
26
+
27
+ ## EXAMPLES
28
+
29
+ ### Good: Learning from History
30
+ ```
31
+ Issue: "Fix calendar sync timeout"
32
+ Before Starting:
33
+ - ✅ Read retrospective on issue-45 (similar timeout problem)
34
+ - ✅ Found root cause: missing retry logic
35
+ - ✅ Applied proven solution: exponential backoff
36
+ - ✅ Avoided known pitfall: infinite retry loops
37
+ Result: Fixed in 1 iteration using proven approach
38
+ ```
39
+
40
+ ### Bad: Ignoring History
41
+ ```
42
+ Issue: "Fix calendar sync timeout"
43
+ Approach:
44
+ - ❌ Started coding immediately without research
45
+ - ❌ Implemented naive retry logic
46
+ - ❌ Hit same infinite loop issue from issue-45
47
+ - ❌ Wasted 3 iterations on known problem
48
+ Result: Eventually found retrospective, but too late
49
+ ```
50
+
51
+ ## RETROSPECTIVE CREATION
52
+ - **Use template**: Retrieve via `get_fraim_file({ path: "templates/retrospective/RETROSPECTIVE-TEMPLATE.md" })` for consistent structure
53
+ - **Follow process**: Use the `get_fraim_file({ path: "workflows/product-building/retrospect.md" })` workflow for retrospective creation workflow
54
+
55
55
  Remember: The best code is often written by those who learn from history rather than repeat it.
@@ -5,11 +5,15 @@ To maintain repository cleanliness, all automation scripts provided by FRAIM mus
5
5
  ## Policy
6
6
 
7
7
  1. **No Persistence**: Do NOT save FRAIM scripts (e.g., `.sh`, `.ts`, `.py`) to the local repository or any directory tracked by version control.
8
- 2. **Temporary Storage**: Use the system's temporary directory for script execution.
9
- * Windows: `%TEMP%`
10
- * Linux/macOS: `/tmp`
8
+ 2. **Temporary Storage**: Use the `.fraim/tmp` directory in the user's home folder for script execution.
9
+ * Windows: `%USERPROFILE%\.fraim\tmp`
10
+ * Linux/macOS: `~/.fraim/tmp`
11
11
  3. **Execute and Delete**: Immediately delete the script file after execution, regardless of whether the script succeeded or failed.
12
12
 
13
+ ## Directory Creation
14
+
15
+ If the `.fraim/tmp` directory does not exist, it should be created before saving the script.
16
+
13
17
  ## Implementation Pattern
14
18
 
15
19
  When a script is retrieved from the FRAIM MCP:
@@ -27,9 +31,10 @@ When a script is retrieved from the FRAIM MCP:
27
31
  SCRIPT_CONTENT=$(mcp_call get_fraim_file path="scripts/setup.sh")
28
32
 
29
33
  # Save to temp
30
- TEMP_FILE=$(mktemp /tmp/fraim_script.XXXXXX.sh)
34
+ FRAIM_TMP="$HOME/.fraim/tmp"
35
+ mkdir -p "$FRAIM_TMP"
36
+ TEMP_FILE=$(mktemp "$FRAIM_TMP/fraim_script.XXXXXX.sh")
31
37
  echo "$SCRIPT_CONTENT" > "$TEMP_FILE"
32
- chmod +x "$TEMP_FILE"
33
38
 
34
39
  # Execute
35
40
  bash "$TEMP_FILE"