proagents 1.0.2 → 1.0.4
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/lib/commands/feature.js +1 -1
- package/lib/commands/fix.js +2 -2
- package/lib/commands/help.js +10 -10
- package/lib/commands/init.js +164 -10
- package/package.json +1 -1
package/lib/commands/feature.js
CHANGED
|
@@ -77,7 +77,7 @@ function startFeature(name, activeFeaturesDir) {
|
|
|
77
77
|
console.log('\n' + chalk.bold('Now use your AI assistant with this prompt:'));
|
|
78
78
|
console.log(chalk.cyan('─'.repeat(50)));
|
|
79
79
|
console.log(chalk.white(`
|
|
80
|
-
|
|
80
|
+
pa:feature "${name}"
|
|
81
81
|
|
|
82
82
|
Or paste this to your AI:
|
|
83
83
|
|
package/lib/commands/fix.js
CHANGED
|
@@ -24,7 +24,7 @@ export async function fixCommand(description, options = {}) {
|
|
|
24
24
|
console.log(chalk.white('Use this prompt with your AI:'));
|
|
25
25
|
console.log(chalk.cyan('─'.repeat(50)));
|
|
26
26
|
console.log(chalk.white(`
|
|
27
|
-
|
|
27
|
+
pa:feature "Fix: ${description}"
|
|
28
28
|
|
|
29
29
|
This bug fix has been upgraded to full workflow mode.
|
|
30
30
|
Please follow all phases in ./proagents/WORKFLOW.md
|
|
@@ -39,7 +39,7 @@ Please follow all phases in ./proagents/WORKFLOW.md
|
|
|
39
39
|
console.log(chalk.bold('Use this prompt with your AI assistant:'));
|
|
40
40
|
console.log(chalk.cyan('─'.repeat(50)));
|
|
41
41
|
console.log(chalk.white(`
|
|
42
|
-
|
|
42
|
+
pa:fix "${description}"
|
|
43
43
|
|
|
44
44
|
Or paste this to your AI:
|
|
45
45
|
|
package/lib/commands/help.js
CHANGED
|
@@ -39,17 +39,17 @@ export async function helpCommand() {
|
|
|
39
39
|
console.log(chalk.cyan('proagents --version') + ' Show version');
|
|
40
40
|
console.log('');
|
|
41
41
|
|
|
42
|
-
//
|
|
43
|
-
console.log(chalk.bold.white('
|
|
42
|
+
// Commands for AI Assistants
|
|
43
|
+
console.log(chalk.bold.white('Commands (for AI Assistants)'));
|
|
44
44
|
console.log(chalk.gray('─'.repeat(40)));
|
|
45
|
-
console.log(chalk.cyan('
|
|
46
|
-
console.log(chalk.cyan('
|
|
47
|
-
console.log(chalk.cyan('
|
|
48
|
-
console.log(chalk.cyan('
|
|
49
|
-
console.log(chalk.cyan('
|
|
50
|
-
console.log(chalk.cyan('
|
|
51
|
-
console.log(chalk.cyan('
|
|
52
|
-
console.log(chalk.cyan('
|
|
45
|
+
console.log(chalk.cyan('pa:init') + ' Initialize ProAgents');
|
|
46
|
+
console.log(chalk.cyan('pa:feature "name"') + ' Start a feature');
|
|
47
|
+
console.log(chalk.cyan('pa:fix "description"') + ' Quick bug fix');
|
|
48
|
+
console.log(chalk.cyan('pa:status') + ' Check status');
|
|
49
|
+
console.log(chalk.cyan('pa:doc') + ' Generate documentation');
|
|
50
|
+
console.log(chalk.cyan('pa:qa') + ' Quality assurance');
|
|
51
|
+
console.log(chalk.cyan('pa:test') + ' Run tests');
|
|
52
|
+
console.log(chalk.cyan('pa:deploy') + ' Deployment workflow');
|
|
53
53
|
console.log('');
|
|
54
54
|
|
|
55
55
|
// Examples
|
package/lib/commands/init.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, cpSync, writeFileSync, readFileSync } from 'fs';
|
|
1
|
+
import { existsSync, mkdirSync, cpSync, writeFileSync, readFileSync, readdirSync, rmSync } from 'fs';
|
|
2
2
|
import { join, dirname } from 'path';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
import chalk from 'chalk';
|
|
@@ -6,6 +6,85 @@ import chalk from 'chalk';
|
|
|
6
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = dirname(__filename);
|
|
8
8
|
|
|
9
|
+
// Files/folders to preserve during update (user customizations)
|
|
10
|
+
const PRESERVE_PATHS = [
|
|
11
|
+
'active-features', // User's work in progress
|
|
12
|
+
'proagents.config.yaml', // User's configuration
|
|
13
|
+
'.learning', // Learned patterns
|
|
14
|
+
'cache', // Cached analysis
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
// Files that should always be updated (framework files)
|
|
18
|
+
const FRAMEWORK_FOLDERS = [
|
|
19
|
+
'prompts',
|
|
20
|
+
'templates',
|
|
21
|
+
'checklists',
|
|
22
|
+
'standards',
|
|
23
|
+
'examples',
|
|
24
|
+
'git',
|
|
25
|
+
'ui-integration',
|
|
26
|
+
'workflow-modes',
|
|
27
|
+
'security',
|
|
28
|
+
'performance',
|
|
29
|
+
'testing-standards',
|
|
30
|
+
'patterns',
|
|
31
|
+
'scaffolding',
|
|
32
|
+
'cli',
|
|
33
|
+
'adr',
|
|
34
|
+
'ai-models',
|
|
35
|
+
'ai-training',
|
|
36
|
+
'api-versioning',
|
|
37
|
+
'approval-workflows',
|
|
38
|
+
'automation',
|
|
39
|
+
'changelog',
|
|
40
|
+
'cicd',
|
|
41
|
+
'collaboration',
|
|
42
|
+
'compliance',
|
|
43
|
+
'config-versioning',
|
|
44
|
+
'config',
|
|
45
|
+
'contract-testing',
|
|
46
|
+
'cost',
|
|
47
|
+
'database',
|
|
48
|
+
'dependency-management',
|
|
49
|
+
'disaster-recovery',
|
|
50
|
+
'environments',
|
|
51
|
+
'existing-projects',
|
|
52
|
+
'feature-flags',
|
|
53
|
+
'getting-started',
|
|
54
|
+
'i18n',
|
|
55
|
+
'ide-integration',
|
|
56
|
+
'integrations',
|
|
57
|
+
'learning',
|
|
58
|
+
'logging',
|
|
59
|
+
'mcp',
|
|
60
|
+
'metrics',
|
|
61
|
+
'migrations',
|
|
62
|
+
'monitoring',
|
|
63
|
+
'multi-project',
|
|
64
|
+
'notifications',
|
|
65
|
+
'offline-mode',
|
|
66
|
+
'parallel-features',
|
|
67
|
+
'plugins',
|
|
68
|
+
'pm-integration',
|
|
69
|
+
'reporting',
|
|
70
|
+
'reverse-engineering',
|
|
71
|
+
'rules',
|
|
72
|
+
'runbooks',
|
|
73
|
+
'secrets',
|
|
74
|
+
'team',
|
|
75
|
+
'troubleshooting',
|
|
76
|
+
'webhooks',
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
// Root files to always update
|
|
80
|
+
const FRAMEWORK_FILES = [
|
|
81
|
+
'README.md',
|
|
82
|
+
'WORKFLOW.md',
|
|
83
|
+
'PROAGENTS.md',
|
|
84
|
+
'GETTING-STARTED-STORY.md',
|
|
85
|
+
'slash-commands.json',
|
|
86
|
+
];
|
|
87
|
+
|
|
9
88
|
/**
|
|
10
89
|
* Initialize ProAgents in the current project
|
|
11
90
|
*/
|
|
@@ -18,16 +97,37 @@ export async function initCommand(options = {}) {
|
|
|
18
97
|
console.log(chalk.blue('========================\n'));
|
|
19
98
|
|
|
20
99
|
// Check if already initialized
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
100
|
+
const alreadyInitialized = existsSync(proagentsDir);
|
|
101
|
+
|
|
102
|
+
if (alreadyInitialized && !options.force) {
|
|
103
|
+
// Smart update mode - preserve user files, update framework
|
|
104
|
+
console.log(chalk.cyan('ℹ️ ProAgents detected. Running smart update...'));
|
|
105
|
+
console.log(chalk.gray(' (Preserving your customizations)\n'));
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
await smartUpdate(sourceDir, proagentsDir);
|
|
109
|
+
console.log(chalk.green('\n✓ ProAgents updated successfully!\n'));
|
|
110
|
+
console.log(chalk.gray('Preserved:'));
|
|
111
|
+
console.log(chalk.gray(' • active-features/ (your work in progress)'));
|
|
112
|
+
console.log(chalk.gray(' • proagents.config.yaml (your configuration)'));
|
|
113
|
+
console.log(chalk.gray(' • .learning/ (learned patterns)'));
|
|
114
|
+
console.log(chalk.gray(' • cache/ (analysis cache)\n'));
|
|
115
|
+
return;
|
|
116
|
+
} catch (error) {
|
|
117
|
+
console.error(chalk.red('\n✗ Error updating ProAgents:'));
|
|
118
|
+
console.error(chalk.red(error.message));
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
25
121
|
}
|
|
26
122
|
|
|
27
123
|
try {
|
|
28
|
-
|
|
124
|
+
if (options.force && alreadyInitialized) {
|
|
125
|
+
console.log(chalk.yellow('⚠️ Force mode: Overwriting all files...'));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Fresh install or force overwrite
|
|
29
129
|
console.log(chalk.gray('Copying framework files...'));
|
|
30
|
-
cpSync(sourceDir, proagentsDir, { recursive: true, force:
|
|
130
|
+
cpSync(sourceDir, proagentsDir, { recursive: true, force: true });
|
|
31
131
|
console.log(chalk.green('✓ Framework files copied to ./proagents/'));
|
|
32
132
|
|
|
33
133
|
// Create config if not skipped
|
|
@@ -52,7 +152,6 @@ export async function initCommand(options = {}) {
|
|
|
52
152
|
}
|
|
53
153
|
if (!existsSync(releasesDir)) {
|
|
54
154
|
mkdirSync(releasesDir, { recursive: true });
|
|
55
|
-
// Create releases index
|
|
56
155
|
writeFileSync(join(releasesDir, 'README.md'),
|
|
57
156
|
`# Release History
|
|
58
157
|
|
|
@@ -143,12 +242,10 @@ For detailed commands, see \`./proagents/PROAGENTS.md\`
|
|
|
143
242
|
if (existsSync(readmePath)) {
|
|
144
243
|
const readmeContent = readFileSync(readmePath, 'utf-8');
|
|
145
244
|
if (!readmeContent.includes('PROAGENTS:START')) {
|
|
146
|
-
// Prepend to existing README
|
|
147
245
|
writeFileSync(readmePath, proagentsSection + readmeContent);
|
|
148
246
|
console.log(chalk.green('✓ Added ProAgents commands to README.md'));
|
|
149
247
|
}
|
|
150
248
|
} else {
|
|
151
|
-
// Create new README with ProAgents section
|
|
152
249
|
writeFileSync(readmePath, proagentsSection + `# Project Name\n\nProject description.\n`);
|
|
153
250
|
console.log(chalk.green('✓ Created README.md with ProAgents commands'));
|
|
154
251
|
}
|
|
@@ -173,3 +270,60 @@ For detailed commands, see \`./proagents/PROAGENTS.md\`
|
|
|
173
270
|
process.exit(1);
|
|
174
271
|
}
|
|
175
272
|
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Smart update - preserves user files, updates framework files
|
|
276
|
+
*/
|
|
277
|
+
async function smartUpdate(sourceDir, targetDir) {
|
|
278
|
+
// Backup preserved paths
|
|
279
|
+
const backups = {};
|
|
280
|
+
for (const path of PRESERVE_PATHS) {
|
|
281
|
+
const fullPath = join(targetDir, path);
|
|
282
|
+
if (existsSync(fullPath)) {
|
|
283
|
+
backups[path] = fullPath;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Update framework folders
|
|
288
|
+
let updatedCount = 0;
|
|
289
|
+
for (const folder of FRAMEWORK_FOLDERS) {
|
|
290
|
+
const sourcePath = join(sourceDir, folder);
|
|
291
|
+
const targetPath = join(targetDir, folder);
|
|
292
|
+
|
|
293
|
+
if (existsSync(sourcePath)) {
|
|
294
|
+
// Remove old folder and copy new
|
|
295
|
+
if (existsSync(targetPath)) {
|
|
296
|
+
rmSync(targetPath, { recursive: true, force: true });
|
|
297
|
+
}
|
|
298
|
+
cpSync(sourcePath, targetPath, { recursive: true });
|
|
299
|
+
updatedCount++;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
console.log(chalk.green(`✓ Updated ${updatedCount} framework folders`));
|
|
303
|
+
|
|
304
|
+
// Update framework root files
|
|
305
|
+
let filesUpdated = 0;
|
|
306
|
+
for (const file of FRAMEWORK_FILES) {
|
|
307
|
+
const sourcePath = join(sourceDir, file);
|
|
308
|
+
const targetPath = join(targetDir, file);
|
|
309
|
+
|
|
310
|
+
if (existsSync(sourcePath)) {
|
|
311
|
+
cpSync(sourcePath, targetPath, { force: true });
|
|
312
|
+
filesUpdated++;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
console.log(chalk.green(`✓ Updated ${filesUpdated} framework files`));
|
|
316
|
+
|
|
317
|
+
// Ensure preserved paths still exist (they should, but just in case)
|
|
318
|
+
for (const [path, fullPath] of Object.entries(backups)) {
|
|
319
|
+
if (!existsSync(fullPath)) {
|
|
320
|
+
console.log(chalk.yellow(`⚠️ ${path} was removed during update, restoring...`));
|
|
321
|
+
// The backup reference is the same as the original, so if it doesn't exist
|
|
322
|
+
// it means we need to recreate the structure
|
|
323
|
+
if (path === 'active-features') {
|
|
324
|
+
mkdirSync(fullPath, { recursive: true });
|
|
325
|
+
writeFileSync(join(fullPath, '.gitkeep'), '');
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|