fraim-framework 1.0.1 → 1.0.3

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 (2) hide show
  1. package/package.json +1 -1
  2. package/setup.js +152 -152
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-framework",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "FRAIM: Framework for Rigor-based AI Management - Where humans become AI managers through rigorous methodology",
5
5
  "main": "index.js",
6
6
  "bin": {
package/setup.js CHANGED
@@ -53,88 +53,13 @@ function writeFile(filePath, content) {
53
53
  logSuccess(`Created file: ${filePath}`);
54
54
  }
55
55
 
56
- function createGitHubLabels() {
57
- const labels = [
58
- { name: 'phase:design', color: '0e8a16', description: 'Design phase - RFC creation and review' },
59
- { name: 'phase:impl', color: '1d76db', description: 'Implementation phase - coding and testing' },
60
- { name: 'phase:tests', color: 'fef2c0', description: 'Testing phase - validation and QA' },
61
- { name: 'status:wip', color: 'fbca04', description: 'Work in progress' },
62
- { name: 'status:needs-review', color: 'd93f0b', description: 'Ready for review' },
63
- { name: 'status:complete', color: '0e8a16', description: 'Completed and approved' },
64
- { name: 'ai-agent:cursor', color: '5319e7', description: 'Assigned to Cursor AI agent' },
65
- { name: 'ai-agent:claude', color: 'c2e0c6', description: 'Assigned to Claude AI agent' },
66
- { name: 'ai-agent:windsurf', color: 'bfdadc', description: 'Assigned to Windsurf AI agent' }
67
- ];
68
-
69
- const labelsContent = JSON.stringify(labels, null, 2);
70
- writeFile('.github/labels.json', labelsContent);
71
-
72
- logInfo('GitHub labels configuration created');
73
- logInfo('You can import these labels using GitHub CLI or the web interface');
74
- }
75
-
76
- function createGitHubWorkflows() {
77
- // Phase change workflow
78
- const phaseChangeWorkflow = `name: Phase Change Automation
79
-
80
- on:
81
- issues:
82
- types: [labeled, unlabeled]
83
-
84
- jobs:
85
- phase-change:
86
- runs-on: ubuntu-latest
87
- if: contains(github.event.issue.labels.*.name, 'phase:') || contains(github.event.label.name, 'phase:')
88
- steps:
89
- - name: Checkout
90
- uses: actions/checkout@v4
91
-
92
- - name: Phase Change Handler
93
- run: |
94
- echo "Phase change detected for issue #\${{ github.event.issue.number }}"
95
- echo "New phase: \${{ github.event.label.name || 'phase removed' }}"
96
-
97
- - name: Update Issue Status
98
- if: contains(github.event.label.name, 'phase:')
99
- run: |
100
- gh issue edit \${{ github.event.issue.number }} --add-label "status:wip"
101
- echo "Status updated to WIP for new phase"
102
- `;
103
-
104
- // Status change workflow
105
- const statusChangeWorkflow = `name: Status Change Automation
106
-
107
- on:
108
- issues:
109
- types: [labeled, unlabeled]
110
-
111
- jobs:
112
- status-change:
113
- runs-on: ubuntu-latest
114
- if: contains(github.event.issue.labels.*.name, 'status:') || contains(github.event.label.name, 'status:')
115
- steps:
116
- - name: Checkout
117
- uses: actions/checkout@v4
118
-
119
- - name: Status Change Handler
120
- run: |
121
- echo "Status change detected for issue #\${{ github.event.issue.number }}"
122
- echo "New status: \${{ github.event.label.name || 'status removed' }}"
123
-
124
- - name: Notify Team
125
- if: contains(github.event.label.name, 'status:needs-review')
126
- run: |
127
- echo "Issue ready for review - notifying team"
128
- `;
129
-
130
- writeFile('.github/workflows/phase-change.yml', phaseChangeWorkflow);
131
- writeFile('.github/workflows/status-change.yml', statusChangeWorkflow);
132
-
133
- logSuccess('GitHub workflows created');
134
- }
56
+ function createAgentStructure() {
57
+ // Create the proper agent directory structure
58
+ ensureDirectory('agents/cursor/rules');
59
+ ensureDirectory('agents/claude/rules');
60
+ ensureDirectory('agents/windsurf/rules');
135
61
 
136
- function createAgentConfigs() {
137
- // Cursor rules
62
+ // Create .cursorrules that references modular rules
138
63
  const cursorRules = `# FRAIM Cursor Rules
139
64
 
140
65
  ## Core Rules (Always Apply)
@@ -178,17 +103,15 @@ function createAgentConfigs() {
178
103
  - Enable observability through clear documentation
179
104
  `;
180
105
 
181
- // Claude rules
182
- const claudeRules = `# FRAIM Claude Rules
106
+ // Create .windsurfrules that references modular rules
107
+ const windsurfRules = `# FRAIM Windsurf Rules
183
108
 
184
- ## Always-On Rules
109
+ ## Core Rules (Always Apply)
185
110
  - **ashley-architecture.mdc** - Follow the established architecture patterns
186
111
  - **continuous-learning.mdc** - Always review retrospectives and RFCs before starting work
187
-
188
- ## Phase-Specific Rules (Manual Trigger Only)
189
- - **design.mdc** - Design phase rules
190
- - **implement.mdc** - Implementation phase rules
191
- - **test.mdc** - Testing phase rules
112
+ - **local-development.mdc** - Work locally, coordinate remotely
113
+ - **simplicity.mdc** - Keep it simple, don't over-engineer
114
+ - **issue-resolution-process.mdc** - Follow the established issue resolution process
192
115
 
193
116
  ## Key Behavioral Requirements
194
117
  - Always verify actions taken
@@ -209,22 +132,30 @@ function createAgentConfigs() {
209
132
  - Use local Git for version control
210
133
  - Test locally before committing
211
134
 
212
- ## FRAIM Integration
213
- - Follow the RIGOR methodology
214
- - Maintain isolation between agents
215
- - Use GitOps for coordination
216
- - Enable observability through clear documentation
135
+ ## Architecture and Optimization Principles
136
+ - Follow established patterns
137
+ - Optimize for performance and maintainability
138
+ - Document architectural decisions
139
+ - Consider scalability and security
140
+
141
+ ## Your Role in FRAIM
142
+ - Provide technical expertise and optimization
143
+ - Maintain code quality and standards
144
+ - Ensure architectural consistency
145
+ - Support other agents with technical guidance
217
146
  `;
218
147
 
219
- // Windsurf rules
220
- const windsurfRules = `# FRAIM Windsurf Rules
148
+ // Create CLAUDE.md that references modular rules
149
+ const claudeRules = `# FRAIM Claude Rules
221
150
 
222
- ## Core Rules (Always Apply)
151
+ ## Always-On Rules
223
152
  - **ashley-architecture.mdc** - Follow the established architecture patterns
224
153
  - **continuous-learning.mdc** - Always review retrospectives and RFCs before starting work
225
- - **local-development.mdc** - Work locally, coordinate remotely
226
- - **simplicity.mdc** - Keep it simple, don't over-engineer
227
- - **issue-resolution-process.mdc** - Follow the established issue resolution process
154
+
155
+ ## Phase-Specific Rules (Manual Trigger Only)
156
+ - **design.mdc** - Design phase rules
157
+ - **implement.mdc** - Implementation phase rules
158
+ - **test.mdc** - Testing phase rules
228
159
 
229
160
  ## Key Behavioral Requirements
230
161
  - Always verify actions taken
@@ -245,68 +176,139 @@ function createAgentConfigs() {
245
176
  - Use local Git for version control
246
177
  - Test locally before committing
247
178
 
248
- ## Architecture and Optimization Principles
249
- - Follow established patterns
250
- - Optimize for performance and maintainability
251
- - Document architectural decisions
252
- - Consider scalability and security
253
-
254
- ## Your Role in FRAIM
255
- - Provide technical expertise and optimization
256
- - Maintain code quality and standards
257
- - Ensure architectural consistency
258
- - Support other agents with technical guidance
179
+ ## FRAIM Integration
180
+ - Follow the RIGOR methodology
181
+ - Maintain isolation between agents
182
+ - Use GitOps for coordination
183
+ - Enable observability through clear documentation
259
184
  `;
260
185
 
261
186
  writeFile('.cursorrules', cursorRules);
262
- writeFile('CLAUDE.md', claudeRules);
263
187
  writeFile('.windsurfrules', windsurfRules);
188
+ writeFile('CLAUDE.md', claudeRules);
264
189
 
265
- logSuccess('AI agent configurations created');
190
+ logSuccess('AI agent configuration files created');
266
191
  }
267
192
 
268
- function createDocumentation() {
269
- const readme = `# FRAIM-Enabled Repository
270
-
271
- This repository is configured with FRAIM (Framework for Rigor-based AI Management) to enable coordinated AI agent development.
272
-
273
- ## 🚀 Quick Start
193
+ function createGitHubWorkflows() {
194
+ // Phase change workflow
195
+ const phaseChangeWorkflow = `name: Phase Change Automation
274
196
 
275
- 1. **Create an issue** with appropriate phase labels:
276
- \`\`\`bash
277
- gh issue create --title "Add user authentication" --label "phase:design,ai-agent:claude"
278
- \`\`\`
197
+ on:
198
+ issues:
199
+ types: [labeled, unlabeled]
279
200
 
280
- 2. **AI agents will automatically coordinate** through GitHub state:
281
- - Claude creates RFC → Cursor implements → Windsurf optimizes
201
+ jobs:
202
+ phase-change:
203
+ runs-on: ubuntu-latest
204
+ if: contains(github.event.issue.labels.*.name, 'phase:') || contains(github.event.label.name, 'phase:')
205
+ steps:
206
+ - name: Checkout
207
+ uses: actions/checkout@v4
208
+
209
+ - name: Phase Change Handler
210
+ run: |
211
+ echo "Phase change detected for issue #\${{ github.event.issue.number }}"
212
+ echo "New phase: \${{ github.event.label.name || 'phase removed' }}"
213
+
214
+ - name: Update Issue Status
215
+ if: contains(github.event.label.name, 'phase:')
216
+ run: |
217
+ gh issue edit \${{ github.event.issue.number }} --add-label "status:wip"
218
+ echo "Status updated to WIP for new phase"
219
+ `;
282
220
 
283
- 3. **Use phase labels** to manage workflow:
284
- - \`phase:design\` \`phase:impl\` \`phase:tests\`
221
+ // Status change workflow
222
+ const statusChangeWorkflow = `name: Status Change Automation
285
223
 
286
- ## 🏷️ Available Labels
224
+ on:
225
+ issues:
226
+ types: [labeled, unlabeled]
287
227
 
288
- - **Phase Labels**: \`phase:design\`, \`phase:impl\`, \`phase:tests\`
289
- - **Status Labels**: \`status:wip\`, \`status:needs-review\`, \`status:complete\`
290
- - **Agent Labels**: \`ai-agent:cursor\`, \`ai-agent:claude\`, \`ai-agent:windsurf\`
228
+ jobs:
229
+ status-change:
230
+ runs-on: ubuntu-latest
231
+ if: contains(github.event.issue.labels.*.name, 'status:') || contains(github.event.label.name, 'status:')
232
+ steps:
233
+ - name: Checkout
234
+ uses: actions/checkout@v4
235
+
236
+ - name: Status Change Handler
237
+ run: |
238
+ echo "Status change detected for issue #\${{ github.event.issue.number }}"
239
+ echo "New status: \${{ github.event.label.name || 'status removed' }}"
240
+
241
+ - name: Notify Team
242
+ if: contains(github.event.label.name, 'status:needs-review')
243
+ run: |
244
+ echo "Issue ready for review - notifying team"
245
+ `;
291
246
 
292
- ## 📚 Learn More
247
+ // Sync on PR review workflow
248
+ const syncOnPRReviewWorkflow = `name: Sync on PR Review
293
249
 
294
- - [FRAIM Framework](https://github.com/mathursrus/Ashley-Calendar-AI/tree/master/FRAIM)
295
- - [RIGOR Methodology](https://github.com/mathursrus/Ashley-Calendar-AI/tree/master/FRAIM#the-rigor-methodology)
296
- - [Getting Started Guide](https://github.com/mathursrus/Ashley-Calendar-AI/tree/master/FRAIM/docs/guides/getting-started.md)
250
+ on:
251
+ pull_request_review:
252
+ types: [submitted, edited, dismissed]
297
253
 
298
- ## 🤖 AI Agent Rules
254
+ jobs:
255
+ sync-review:
256
+ runs-on: ubuntu-latest
257
+ steps:
258
+ - name: Checkout
259
+ uses: actions/checkout@v4
260
+
261
+ - name: Sync Review Status
262
+ env:
263
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
264
+ run: |
265
+ PR_NUMBER="\${{ github.event.pull_request.number }}"
266
+ REVIEW_STATE="\${{ github.event.review.state }}"
267
+
268
+ echo "PR #\$PR_NUMBER review state: \$REVIEW_STATE"
269
+
270
+ if [ "\$REVIEW_STATE" = "approved" ]; then
271
+ echo "PR approved - updating status"
272
+ gh pr edit \$PR_NUMBER --add-label "status:approved"
273
+ elif [ "\$REVIEW_STATE" = "changes_requested" ]; then
274
+ echo "Changes requested - updating status"
275
+ gh pr edit \$PR_NUMBER --add-label "status:changes-requested"
276
+ fi
277
+
278
+ echo "Review sync complete"
279
+ `;
299
280
 
300
- Each AI agent has specific rules and configurations:
301
- - **Cursor**: \`.cursorrules\`
302
- - **Claude**: \`CLAUDE.md\`
303
- - **Windsurf**: \`.windsurfrules\`
281
+ writeFile('.github/workflows/phase-change.yml', phaseChangeWorkflow);
282
+ writeFile('.github/workflows/status-change.yml', statusChangeWorkflow);
283
+ writeFile('.github/workflows/sync-on-pr-review.yml', syncOnPRReviewWorkflow);
284
+
285
+ logSuccess('GitHub workflows created');
286
+ }
304
287
 
305
- ---
288
+ function createGitHubLabels() {
289
+ const labels = [
290
+ { name: 'phase:design', color: '0e8a16', description: 'Design phase - RFC creation and review' },
291
+ { name: 'phase:impl', color: '1d76db', description: 'Implementation phase - coding and testing' },
292
+ { name: 'phase:tests', color: 'fef2c0', description: 'Testing phase - validation and QA' },
293
+ { name: 'status:wip', color: 'fbca04', description: 'Work in progress' },
294
+ { name: 'status:needs-review', color: 'd93f0b', description: 'Ready for review' },
295
+ { name: 'status:complete', color: '0e8a16', description: 'Completed and approved' },
296
+ { name: 'status:approved', color: '0e8a16', description: 'Approved and ready to merge' },
297
+ { name: 'status:changes-requested', color: 'd93f0b', description: 'Changes requested in review' },
298
+ { name: 'ai-agent:cursor', color: '5319e7', description: 'Assigned to Cursor AI agent' },
299
+ { name: 'ai-agent:claude', color: 'c2e0c6', description: 'Assigned to Claude AI agent' },
300
+ { name: 'ai-agent:windsurf', color: 'bfdadc', description: 'Assigned to Windsurf AI agent' }
301
+ ];
306
302
 
307
- *Powered by FRAIM: Where humans become AI managers through rigorous methodology*
308
- `;
303
+ const labelsContent = JSON.stringify(labels, null, 2);
304
+ writeFile('.github/labels.json', labelsContent);
305
+
306
+ logInfo('GitHub labels configuration created');
307
+ logInfo('You can import these labels using GitHub CLI or the web interface');
308
+ logInfo('Or use the GitHub web interface: Settings > Labels > Import labels');
309
+ }
309
310
 
311
+ function createFRAIMConfig() {
310
312
  const fraimConfig = {
311
313
  version: "1.0.0",
312
314
  framework: "FRAIM",
@@ -325,14 +327,13 @@ Each AI agent has specific rules and configurations:
325
327
  },
326
328
  workflows: [
327
329
  ".github/workflows/phase-change.yml",
328
- ".github/workflows/status-change.yml"
330
+ ".github/workflows/status-change.yml",
331
+ ".github/workflows/sync-on-pr-review.yml"
329
332
  ]
330
333
  };
331
334
 
332
- writeFile('README.md', readme);
333
335
  writeFile('fraim-config.json', JSON.stringify(fraimConfig, null, 2));
334
-
335
- logSuccess('Documentation created');
336
+ logSuccess('FRAIM configuration created');
336
337
  }
337
338
 
338
339
  function runSetup() {
@@ -340,15 +341,14 @@ function runSetup() {
340
341
  log('Setting up FRAIM in current repository...\n');
341
342
 
342
343
  try {
343
- // Create directory structure
344
+ // Create only essential directory structure
344
345
  ensureDirectory('.github/workflows');
345
- ensureDirectory('examples');
346
346
 
347
347
  // Create all components
348
- createGitHubLabels();
348
+ createAgentStructure();
349
349
  createGitHubWorkflows();
350
- createAgentConfigs();
351
- createDocumentation();
350
+ createGitHubLabels();
351
+ createFRAIMConfig();
352
352
 
353
353
  logHeader('🎉 Setup Complete!');
354
354
  logSuccess('FRAIM has been successfully set up in your repository!');