fraim-framework 1.0.4 ā 1.0.5
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.
- package/bin/fraim.js +17 -9
- package/package.json +1 -1
- package/setup.js +105 -7
package/bin/fraim.js
CHANGED
|
@@ -83,7 +83,20 @@ async function runSetup() {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
function
|
|
86
|
+
async function runWizard() {
|
|
87
|
+
try {
|
|
88
|
+
// Import and run the wizard function
|
|
89
|
+
const { runWizard: wizardFunction } = require('../setup.js');
|
|
90
|
+
await wizardFunction();
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.error('ā Failed to run wizard:', error.message);
|
|
93
|
+
console.log('\nš” Try running the setup script directly:');
|
|
94
|
+
console.log(' node setup.js');
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function main() {
|
|
87
100
|
const args = process.argv.slice(2);
|
|
88
101
|
|
|
89
102
|
if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
|
|
@@ -99,20 +112,15 @@ function main() {
|
|
|
99
112
|
if (args.includes('init') || args.includes('setup')) {
|
|
100
113
|
console.log(banner);
|
|
101
114
|
console.log('š Setting up FRAIM in current repository...\n');
|
|
102
|
-
runSetup();
|
|
115
|
+
await runSetup();
|
|
103
116
|
return;
|
|
104
117
|
}
|
|
105
118
|
|
|
106
119
|
if (args.includes('wizard')) {
|
|
107
120
|
console.log(banner);
|
|
108
121
|
console.log('š® FRAIM Interactive Setup Wizard\n');
|
|
109
|
-
console.log('
|
|
110
|
-
|
|
111
|
-
console.log(' 2. AI agent setup (with tested rules)');
|
|
112
|
-
console.log(' 3. Workflow customization');
|
|
113
|
-
console.log(' 4. Team member onboarding\n');
|
|
114
|
-
console.log('š” Starting setup wizard...\n');
|
|
115
|
-
runSetup();
|
|
122
|
+
console.log('Starting interactive wizard...\n');
|
|
123
|
+
await runWizard();
|
|
116
124
|
return;
|
|
117
125
|
}
|
|
118
126
|
|
package/package.json
CHANGED
package/setup.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const { execSync } = require('child_process');
|
|
6
|
+
const readline = require('readline');
|
|
6
7
|
|
|
7
8
|
// Colors for console output
|
|
8
9
|
const colors = {
|
|
@@ -41,6 +42,10 @@ function logHeader(message) {
|
|
|
41
42
|
log('ā'.repeat(message.length));
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
function logStep(message) {
|
|
46
|
+
log(`\n${colors.bright}${colors.magenta}${message}${colors.reset}`);
|
|
47
|
+
}
|
|
48
|
+
|
|
44
49
|
function ensureDirectory(dirPath) {
|
|
45
50
|
if (!fs.existsSync(dirPath)) {
|
|
46
51
|
fs.mkdirSync(dirPath, { recursive: true });
|
|
@@ -73,6 +78,22 @@ function copyDirectory(src, dest) {
|
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
80
|
|
|
81
|
+
function askQuestion(question, defaultValue = 'y') {
|
|
82
|
+
return new Promise((resolve) => {
|
|
83
|
+
const rl = readline.createInterface({
|
|
84
|
+
input: process.stdin,
|
|
85
|
+
output: process.stdout
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const defaultText = defaultValue ? ` (${defaultValue})` : '';
|
|
89
|
+
rl.question(`${question}${defaultText}: `, (answer) => {
|
|
90
|
+
rl.close();
|
|
91
|
+
const finalAnswer = answer.trim() || defaultValue;
|
|
92
|
+
resolve(finalAnswer.toLowerCase());
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
76
97
|
function createGitHubLabels() {
|
|
77
98
|
const labels = [
|
|
78
99
|
{ name: 'phase:design', color: '0e8a16', description: 'Design phase - RFC creation and review' },
|
|
@@ -229,12 +250,92 @@ function createAgentFolders() {
|
|
|
229
250
|
}
|
|
230
251
|
}
|
|
231
252
|
|
|
253
|
+
async function runWizard() {
|
|
254
|
+
logHeader('š® FRAIM Interactive Setup Wizard');
|
|
255
|
+
log('Welcome to the FRAIM setup wizard! I\'ll guide you through each step.\n');
|
|
256
|
+
|
|
257
|
+
try {
|
|
258
|
+
// Check prerequisites
|
|
259
|
+
logStep('Step 1: Checking Prerequisites');
|
|
260
|
+
|
|
261
|
+
// Check if gh CLI is available
|
|
262
|
+
try {
|
|
263
|
+
execSync('gh --version', { stdio: 'pipe' });
|
|
264
|
+
logSuccess('GitHub CLI (gh) is available');
|
|
265
|
+
} catch (error) {
|
|
266
|
+
logError('GitHub CLI (gh) is not installed or not available');
|
|
267
|
+
logInfo('Please install GitHub CLI: https://cli.github.com/');
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Check if we're in a git repository
|
|
272
|
+
try {
|
|
273
|
+
execSync('git rev-parse --git-dir', { stdio: 'pipe' });
|
|
274
|
+
logSuccess('Running in a git repository');
|
|
275
|
+
} catch (error) {
|
|
276
|
+
logError('Not in a git repository');
|
|
277
|
+
logInfo('Please run this command from within a git repository');
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Step 2: AI Agent Setup
|
|
282
|
+
logStep('Step 2: AI Agent Configuration');
|
|
283
|
+
const setupAgents = await askQuestion('Would you like to set up AI agent configurations (.cursor, .windsurf, CLAUDE.md)?', 'y');
|
|
284
|
+
|
|
285
|
+
if (setupAgents === 'y' || setupAgents === 'yes') {
|
|
286
|
+
createAgentFolders();
|
|
287
|
+
} else {
|
|
288
|
+
logInfo('Skipping AI agent setup');
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Step 3: GitHub Workflows
|
|
292
|
+
logStep('Step 3: GitHub Workflows');
|
|
293
|
+
const setupWorkflows = await askQuestion('Would you like to set up GitHub workflows for automation?', 'y');
|
|
294
|
+
|
|
295
|
+
if (setupWorkflows === 'y' || setupWorkflows === 'yes') {
|
|
296
|
+
ensureDirectory('.github/workflows');
|
|
297
|
+
createGitHubWorkflows();
|
|
298
|
+
} else {
|
|
299
|
+
logInfo('Skipping GitHub workflow setup');
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Step 4: GitHub Labels
|
|
303
|
+
logStep('Step 4: GitHub Labels');
|
|
304
|
+
const setupLabels = await askQuestion('Would you like to create GitHub labels for FRAIM?', 'y');
|
|
305
|
+
|
|
306
|
+
if (setupLabels === 'y' || setupLabels === 'yes') {
|
|
307
|
+
createGitHubLabels();
|
|
308
|
+
} else {
|
|
309
|
+
logInfo('Skipping GitHub label setup');
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Step 5: Summary
|
|
313
|
+
logStep('Step 5: Setup Summary');
|
|
314
|
+
logHeader('š Setup Complete!');
|
|
315
|
+
logSuccess('FRAIM has been successfully set up in your repository!');
|
|
316
|
+
logInfo('Next steps:');
|
|
317
|
+
logInfo('1. Commit and push these files to GitHub');
|
|
318
|
+
logInfo('2. Create your first issue with phase labels');
|
|
319
|
+
logInfo('3. Start coordinating your AI agents!');
|
|
320
|
+
|
|
321
|
+
logInfo('\nš Learn more about FRAIM:');
|
|
322
|
+
logInfo('https://github.com/mathursrus/Ashley-Calendar-AI/tree/master/FRAIM');
|
|
323
|
+
|
|
324
|
+
logInfo('\nš§ Learn the RIGOR methodology:');
|
|
325
|
+
logInfo('npx fraim-framework rigor');
|
|
326
|
+
|
|
327
|
+
} catch (error) {
|
|
328
|
+
logError(`Wizard failed: ${error.message}`);
|
|
329
|
+
process.exit(1);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
232
333
|
function runSetup() {
|
|
233
|
-
logHeader('š FRAIM Setup
|
|
334
|
+
logHeader('š FRAIM Quick Setup');
|
|
234
335
|
log('Setting up FRAIM in current repository...\n');
|
|
235
336
|
|
|
236
337
|
try {
|
|
237
|
-
// Check
|
|
338
|
+
// Check prerequisites
|
|
238
339
|
try {
|
|
239
340
|
execSync('gh --version', { stdio: 'pipe' });
|
|
240
341
|
} catch (error) {
|
|
@@ -243,7 +344,6 @@ function runSetup() {
|
|
|
243
344
|
process.exit(1);
|
|
244
345
|
}
|
|
245
346
|
|
|
246
|
-
// Check if we're in a git repository
|
|
247
347
|
try {
|
|
248
348
|
execSync('git rev-parse --git-dir', { stdio: 'pipe' });
|
|
249
349
|
} catch (error) {
|
|
@@ -252,10 +352,8 @@ function runSetup() {
|
|
|
252
352
|
process.exit(1);
|
|
253
353
|
}
|
|
254
354
|
|
|
255
|
-
// Create
|
|
355
|
+
// Create everything at once
|
|
256
356
|
ensureDirectory('.github/workflows');
|
|
257
|
-
|
|
258
|
-
// Create all components
|
|
259
357
|
createAgentFolders();
|
|
260
358
|
createGitHubWorkflows();
|
|
261
359
|
createGitHubLabels();
|
|
@@ -285,4 +383,4 @@ if (require.main === module) {
|
|
|
285
383
|
runSetup();
|
|
286
384
|
}
|
|
287
385
|
|
|
288
|
-
module.exports = { runSetup };
|
|
386
|
+
module.exports = { runSetup, runWizard };
|