fraim-framework 1.0.0 → 1.0.1

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 (3) hide show
  1. package/bin/fraim.js +16 -8
  2. package/package.json +1 -1
  3. package/setup.js +365 -73
package/bin/fraim.js CHANGED
@@ -70,6 +70,19 @@ function showRigor() {
70
70
  console.log('✨ Every rule has been tested and proven in real project environments.');
71
71
  }
72
72
 
73
+ async function runSetup() {
74
+ try {
75
+ // Import and run the setup script
76
+ const { runSetup: setupFunction } = require('../setup.js');
77
+ setupFunction();
78
+ } catch (error) {
79
+ console.error('❌ Failed to run setup:', error.message);
80
+ console.log('\n💡 Try running the setup script directly:');
81
+ console.log(' node setup.js');
82
+ process.exit(1);
83
+ }
84
+ }
85
+
73
86
  function main() {
74
87
  const args = process.argv.slice(2);
75
88
 
@@ -86,13 +99,7 @@ function main() {
86
99
  if (args.includes('init') || args.includes('setup')) {
87
100
  console.log(banner);
88
101
  console.log('🚀 Setting up FRAIM in current repository...\n');
89
- console.log('📋 This will:');
90
- console.log(' • Create GitHub labels for AI management');
91
- console.log(' • Set up automated workflows');
92
- console.log(' • Configure AI agent rules (all tested & proven)');
93
- console.log(' • Initialize documentation\n');
94
- console.log('💡 Run: npx fraim-framework init # For full setup');
95
- console.log('🔧 Or run: npx fraim-framework wizard # For interactive setup');
102
+ runSetup();
96
103
  return;
97
104
  }
98
105
 
@@ -104,7 +111,8 @@ function main() {
104
111
  console.log(' 2. AI agent setup (with tested rules)');
105
112
  console.log(' 3. Workflow customization');
106
113
  console.log(' 4. Team member onboarding\n');
107
- console.log('💡 Run: npx fraim-framework wizard # To start the wizard');
114
+ console.log('💡 Starting setup wizard...\n');
115
+ runSetup();
108
116
  return;
109
117
  }
110
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-framework",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
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
@@ -1,86 +1,378 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- /**
4
- * FRAIM Setup Script
5
- * Framework for Rigor-based AI Management
6
- *
7
- * This script sets up the FRAIM framework in a GitHub repository,
8
- * implementing the RIGOR methodology for coordinated AI agent development.
9
- */
10
-
11
- const { program } = require('commander');
12
3
  const fs = require('fs');
13
4
  const path = require('path');
14
5
 
15
- // FRAIM branding
16
- const FRAIM_BANNER = `
17
- ╔══════════════════════════════════════════════════════════════╗
18
- ║ 🚀 FRAIM Setup ║
19
- ║ Framework for Rigor-based AI Management ║
20
- ║ Where humans become AI managers ║
21
- ╚══════════════════════════════════════════════════════════════╝
6
+ // Colors for console output
7
+ const colors = {
8
+ reset: '\x1b[0m',
9
+ bright: '\x1b[1m',
10
+ red: '\x1b[31m',
11
+ green: '\x1b[32m',
12
+ yellow: '\x1b[33m',
13
+ blue: '\x1b[34m',
14
+ magenta: '\x1b[35m',
15
+ cyan: '\x1b[36m'
16
+ };
17
+
18
+ function log(message, color = 'reset') {
19
+ console.log(`${colors[color]}${message}${colors.reset}`);
20
+ }
21
+
22
+ function logSuccess(message) {
23
+ log(`✅ ${message}`, 'green');
24
+ }
25
+
26
+ function logInfo(message) {
27
+ log(`ℹ️ ${message}`, 'blue');
28
+ }
29
+
30
+ function logWarning(message) {
31
+ log(`⚠️ ${message}`, 'yellow');
32
+ }
33
+
34
+ function logError(message) {
35
+ log(`❌ ${message}`, 'red');
36
+ }
37
+
38
+ function logHeader(message) {
39
+ log(`\n${colors.bright}${colors.cyan}${message}${colors.reset}`);
40
+ log('─'.repeat(message.length));
41
+ }
42
+
43
+ function ensureDirectory(dirPath) {
44
+ if (!fs.existsSync(dirPath)) {
45
+ fs.mkdirSync(dirPath, { recursive: true });
46
+ logSuccess(`Created directory: ${dirPath}`);
47
+ }
48
+ }
49
+
50
+ function writeFile(filePath, content) {
51
+ ensureDirectory(path.dirname(filePath));
52
+ fs.writeFileSync(filePath, content);
53
+ logSuccess(`Created file: ${filePath}`);
54
+ }
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"
22
128
  `;
23
129
 
24
- // FRAIM methodology labels
25
- const FRAIM_LABELS = [
26
- // Phase Labels (RIGOR methodology)
27
- { name: 'phase:design', color: 'C2E0C6', description: 'Design phase - RFC creation and review (RIGOR: Reviews)' },
28
- { name: 'phase:impl', color: 'FEF2C0', description: 'Implementation phase - code development (RIGOR: Idempotency)' },
29
- { name: 'phase:tests', color: 'D4C5F9', description: 'Testing phase - test creation and validation (RIGOR: Observability)' },
30
-
31
- // Status Labels
32
- { name: 'status:wip', color: 'FBCA04', description: 'Work in progress' },
33
- { name: 'status:needs-review', color: 'EB6420', description: 'Ready for review' },
34
- { name: 'status:complete', color: '0E8A16', description: 'Work completed' },
35
-
36
- // AI Agent Labels (AI Management)
37
- { name: 'ai-agent:cursor', color: '1F77B4', description: 'Assigned to Cursor agent (IDE development)' },
38
- { name: 'ai-agent:claude', color: 'FF7F0E', description: 'Assigned to Claude agent (Conversational AI)' },
39
- { name: 'ai-agent:windsurf', color: '2CA02C', description: 'Assigned to Windsurf agent (Code understanding)' },
40
-
41
- // Priority Labels (optional)
42
- { name: 'priority:critical', color: 'D93F0B', description: 'Critical priority' },
43
- { name: 'priority:high', color: 'FBCA04', description: 'High priority' },
44
- { name: 'priority:medium', color: '0E8A16', description: 'Medium priority' },
45
- { name: 'priority:low', color: '0366D6', description: 'Low priority' }
46
- ];
47
-
48
- // Main setup function
49
- async function setupFRAIM(options) {
50
- console.log(FRAIM_BANNER);
51
- console.log('🚀 Setting up FRAIM in your repository...\n');
130
+ writeFile('.github/workflows/phase-change.yml', phaseChangeWorkflow);
131
+ writeFile('.github/workflows/status-change.yml', statusChangeWorkflow);
52
132
 
53
- console.log('📋 This will create:');
54
- console.log(' • GitHub labels for AI management');
55
- console.log(' • Automated workflows');
56
- console.log(' • AI agent configurations');
57
- console.log(' • Documentation templates\n');
133
+ logSuccess('GitHub workflows created');
134
+ }
135
+
136
+ function createAgentConfigs() {
137
+ // Cursor rules
138
+ const cursorRules = `# FRAIM Cursor Rules
139
+
140
+ ## Core Rules (Always Apply)
141
+ - **ashley-architecture.mdc** - Follow the established architecture patterns
142
+ - **continuous-learning.mdc** - Always review retrospectives and RFCs before starting work
143
+ - **local-development.mdc** - Work locally, coordinate remotely
144
+ - **simplicity.mdc** - Keep it simple, don't over-engineer
145
+ - **software-development-lifecycle.mdc** - Follow the established SDLC
146
+
147
+ ## Phase-Specific Rules (Manual Trigger Only)
148
+ - **prep.mdc** - Preparation phase rules
149
+ - **design.mdc** - Design phase rules
150
+ - **implement.mdc** - Implementation phase rules
151
+ - **test.mdc** - Testing phase rules
152
+ - **resolve.mdc** - Resolution phase rules
153
+ - **cursor-workflow.mdc** - Cursor-specific workflow rules
154
+
155
+ ## Key Behavioral Requirements
156
+ - Always verify actions taken
157
+ - Never expect user verification
158
+ - Run tests to verify expected behavior
159
+ - Link work to issues with "Closes #<n>"
160
+ - Open Draft PRs early for review
161
+
162
+ ## Project Structure Awareness
163
+ - Work in feature branches only
164
+ - Never push to master
165
+ - Use local file system for development
166
+ - Coordinate through GitHub issues and PRs
167
+
168
+ ## Tool Usage Guidelines
169
+ - Use local file system for development work
170
+ - Use GitHub MCP for issue management
171
+ - Use local Git for version control
172
+ - Test locally before committing
173
+
174
+ ## FRAIM Integration
175
+ - Follow the RIGOR methodology
176
+ - Maintain isolation between agents
177
+ - Use GitOps for coordination
178
+ - Enable observability through clear documentation
179
+ `;
180
+
181
+ // Claude rules
182
+ const claudeRules = `# FRAIM Claude Rules
183
+
184
+ ## Always-On Rules
185
+ - **ashley-architecture.mdc** - Follow the established architecture patterns
186
+ - **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
192
+
193
+ ## Key Behavioral Requirements
194
+ - Always verify actions taken
195
+ - Never expect user verification
196
+ - Run tests to verify expected behavior
197
+ - Link work to issues with "Closes #<n>"
198
+ - Open Draft PRs early for review
199
+
200
+ ## Project Structure Awareness
201
+ - Work in feature branches only
202
+ - Never push to master
203
+ - Use local file system for development
204
+ - Coordinate through GitHub issues and PRs
205
+
206
+ ## Tool Usage Guidelines
207
+ - Use local file system for development work
208
+ - Use GitHub MCP for issue management
209
+ - Use local Git for version control
210
+ - Test locally before committing
211
+
212
+ ## FRAIM Integration
213
+ - Follow the RIGOR methodology
214
+ - Maintain isolation between agents
215
+ - Use GitOps for coordination
216
+ - Enable observability through clear documentation
217
+ `;
218
+
219
+ // Windsurf rules
220
+ const windsurfRules = `# FRAIM Windsurf Rules
221
+
222
+ ## Core Rules (Always Apply)
223
+ - **ashley-architecture.mdc** - Follow the established architecture patterns
224
+ - **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
228
+
229
+ ## Key Behavioral Requirements
230
+ - Always verify actions taken
231
+ - Never expect user verification
232
+ - Run tests to verify expected behavior
233
+ - Link work to issues with "Closes #<n>"
234
+ - Open Draft PRs early for review
235
+
236
+ ## Project Structure Awareness
237
+ - Work in feature branches only
238
+ - Never push to master
239
+ - Use local file system for development
240
+ - Coordinate through GitHub issues and PRs
241
+
242
+ ## Tool Usage Guidelines
243
+ - Use local file system for development work
244
+ - Use GitHub MCP for issue management
245
+ - Use local Git for version control
246
+ - Test locally before committing
247
+
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
259
+ `;
260
+
261
+ writeFile('.cursorrules', cursorRules);
262
+ writeFile('CLAUDE.md', claudeRules);
263
+ writeFile('.windsurfrules', windsurfRules);
58
264
 
59
- if (options.dryRun) {
60
- console.log('🔍 DRY RUN MODE - No changes will be made\n');
61
- }
265
+ logSuccess('AI agent configurations created');
266
+ }
267
+
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
274
+
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
+ \`\`\`
279
+
280
+ 2. **AI agents will automatically coordinate** through GitHub state:
281
+ - Claude creates RFC → Cursor implements → Windsurf optimizes
282
+
283
+ 3. **Use phase labels** to manage workflow:
284
+ - \`phase:design\` → \`phase:impl\` → \`phase:tests\`
285
+
286
+ ## 🏷️ Available Labels
287
+
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\`
291
+
292
+ ## 📚 Learn More
293
+
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)
297
+
298
+ ## 🤖 AI Agent Rules
299
+
300
+ Each AI agent has specific rules and configurations:
301
+ - **Cursor**: \`.cursorrules\`
302
+ - **Claude**: \`CLAUDE.md\`
303
+ - **Windsurf**: \`.windsurfrules\`
304
+
305
+ ---
306
+
307
+ *Powered by FRAIM: Where humans become AI managers through rigorous methodology*
308
+ `;
309
+
310
+ const fraimConfig = {
311
+ version: "1.0.0",
312
+ framework: "FRAIM",
313
+ description: "Framework for Rigor-based AI Management",
314
+ created: new Date().toISOString(),
315
+ features: [
316
+ "GitHub label automation",
317
+ "AI agent coordination",
318
+ "Phase-based workflows",
319
+ "RIGOR methodology implementation"
320
+ ],
321
+ agents: {
322
+ cursor: ".cursorrules",
323
+ claude: "CLAUDE.md",
324
+ windsurf: ".windsurfrules"
325
+ },
326
+ workflows: [
327
+ ".github/workflows/phase-change.yml",
328
+ ".github/workflows/status-change.yml"
329
+ ]
330
+ };
331
+
332
+ writeFile('README.md', readme);
333
+ writeFile('fraim-config.json', JSON.stringify(fraimConfig, null, 2));
62
334
 
63
- console.log('🎯 Ready to become an AI manager?');
64
- console.log(' Run: npx @fraim/framework init # For full setup');
65
- console.log(' Or: npx @fraim/framework wizard # For interactive setup');
335
+ logSuccess('Documentation created');
336
+ }
337
+
338
+ function runSetup() {
339
+ logHeader('🚀 FRAIM Setup Wizard');
340
+ log('Setting up FRAIM in current repository...\n');
341
+
342
+ try {
343
+ // Create directory structure
344
+ ensureDirectory('.github/workflows');
345
+ ensureDirectory('examples');
346
+
347
+ // Create all components
348
+ createGitHubLabels();
349
+ createGitHubWorkflows();
350
+ createAgentConfigs();
351
+ createDocumentation();
352
+
353
+ logHeader('🎉 Setup Complete!');
354
+ logSuccess('FRAIM has been successfully set up in your repository!');
355
+ logInfo('Next steps:');
356
+ logInfo('1. Commit and push these files to GitHub');
357
+ logInfo('2. Import the GitHub labels from .github/labels.json');
358
+ logInfo('3. Create your first issue with phase labels');
359
+ logInfo('4. Start coordinating your AI agents!');
360
+
361
+ logInfo('\n📚 Learn more about FRAIM:');
362
+ logInfo('https://github.com/mathursrus/Ashley-Calendar-AI/tree/master/FRAIM');
363
+
364
+ logInfo('\n🧠 Learn the RIGOR methodology:');
365
+ logInfo('npx fraim-framework rigor');
366
+
367
+ } catch (error) {
368
+ logError(`Setup failed: ${error.message}`);
369
+ process.exit(1);
370
+ }
66
371
  }
67
372
 
68
- // CLI setup
69
- program
70
- .name('fraim-setup')
71
- .description('Setup FRAIM framework in your repository')
72
- .version('1.0.0')
73
- .option('--repo <repository>', 'GitHub repository (owner/repo)')
74
- .option('--config <file>', 'Configuration file path')
75
- .option('--dry-run', 'Show what would be done without making changes')
76
- .option('--labels-only', 'Only setup GitHub labels')
77
- .option('--workflows-only', 'Only setup GitHub workflows')
78
- .action(setupFRAIM);
79
-
80
- // Parse arguments
81
- program.parse();
82
-
83
- // If no arguments provided, show help
84
- if (process.argv.length === 2) {
85
- program.help();
373
+ // Run setup if this script is executed directly
374
+ if (require.main === module) {
375
+ runSetup();
86
376
  }
377
+
378
+ module.exports = { runSetup };