proagents 1.6.18 → 1.6.20

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.
@@ -8,8 +8,50 @@ import yaml from 'js-yaml';
8
8
  const __filename = fileURLToPath(import.meta.url);
9
9
  const __dirname = dirname(__filename);
10
10
 
11
+ // Load platforms from YAML (single source of truth)
12
+ // Priority: 1) User's project .proagents/platforms.yaml, 2) npm package's platforms.yaml
13
+ function loadPlatformsFromYaml() {
14
+ // First, try user's project directory
15
+ const userYamlPath = join(process.cwd(), '.proagents', 'platforms.yaml');
16
+ if (existsSync(userYamlPath)) {
17
+ try {
18
+ const content = readFileSync(userYamlPath, 'utf-8');
19
+ return yaml.load(content);
20
+ } catch (error) {
21
+ // Fall through to npm package
22
+ }
23
+ }
24
+
25
+ // Fallback to npm package's platforms.yaml
26
+ const packageYamlPath = join(__dirname, '..', '..', '.proagents', 'platforms.yaml');
27
+ if (existsSync(packageYamlPath)) {
28
+ try {
29
+ const content = readFileSync(packageYamlPath, 'utf-8');
30
+ return yaml.load(content);
31
+ } catch (error) {
32
+ console.warn('Warning: Could not load platforms.yaml, using defaults');
33
+ }
34
+ }
35
+
36
+ // Fallback to defaults if YAML doesn't exist
37
+ return null;
38
+ }
39
+
40
+ // Load from YAML or use defaults
41
+ const platformsConfig = loadPlatformsFromYaml();
42
+
11
43
  // AI Platform definitions grouped by type
12
- export const AI_PLATFORMS = {
44
+ export const AI_PLATFORMS = platformsConfig ? {
45
+ ide: {
46
+ label: platformsConfig.ide?.label || 'IDE-based AI Assistants',
47
+ platforms: platformsConfig.ide?.platforms || []
48
+ },
49
+ web: {
50
+ label: platformsConfig.web?.label || 'Web-based AI Platforms',
51
+ platforms: platformsConfig.web?.platforms || []
52
+ }
53
+ } : {
54
+ // Fallback defaults (only used if platforms.yaml is missing)
13
55
  ide: {
14
56
  label: 'IDE-based AI Assistants',
15
57
  platforms: [
@@ -18,34 +60,28 @@ export const AI_PLATFORMS = {
18
60
  { id: 'windsurf', name: 'Windsurf', file: '.windsurfrules', desc: 'Codeium Windsurf IDE' },
19
61
  { id: 'copilot', name: 'GitHub Copilot', file: '.github/copilot-instructions.md', desc: 'GitHub Copilot' },
20
62
  { id: 'kiro', name: 'AWS Kiro', file: 'KIRO.md', desc: 'AWS Kiro IDE' },
21
- { id: 'antigravity', name: 'Antigravity', file: 'ANTIGRAVITY.md', desc: 'Antigravity IDE (Gemini/Claude)' },
63
+ { id: 'gemini', name: 'Gemini', file: 'GEMINI.md', desc: 'Google Gemini / AI Studio' },
22
64
  ]
23
65
  },
24
66
  web: {
25
67
  label: 'Web-based AI Platforms',
26
68
  platforms: [
27
- { id: 'chatgpt', name: 'ChatGPT', file: 'CHATGPT.md', desc: 'OpenAI ChatGPT' },
28
- { id: 'gemini', name: 'Gemini', file: 'GEMINI.md', desc: 'Google Gemini' },
29
69
  { id: 'replit', name: 'Replit AI', file: 'REPLIT.md', desc: 'Replit Ghostwriter' },
30
70
  { id: 'bolt', name: 'Bolt.new', file: 'BOLT.md', desc: 'StackBlitz Bolt' },
31
71
  { id: 'lovable', name: 'Lovable', file: 'LOVABLE.md', desc: 'Lovable (GPT Engineer)' },
32
- { id: 'groq', name: 'Groq', file: 'GROQ.md', desc: 'Groq fast inference' },
33
- ]
34
- },
35
- cli: {
36
- label: 'CLI-based AI Agents',
37
- platforms: [
38
- { id: 'codex', name: 'Codex CLI', file: 'AGENTS.md', desc: 'OpenAI Codex CLI' },
39
72
  ]
40
73
  }
41
74
  };
42
75
 
76
+ // Auto-handled platforms (use AGENTS.md, no separate file needed)
77
+ export const AUTO_HANDLED_PLATFORMS = platformsConfig?.auto_handled ||
78
+ ['ChatGPT', 'Groq', 'Antigravity', 'Codex CLI', 'OpenAI API'];
79
+
43
80
  // Get all platforms as flat array
44
81
  export function getAllPlatforms() {
45
82
  return [
46
83
  ...AI_PLATFORMS.ide.platforms,
47
84
  ...AI_PLATFORMS.web.platforms,
48
- ...AI_PLATFORMS.cli.platforms,
49
85
  ];
50
86
  }
51
87
 
@@ -115,7 +151,12 @@ export async function selectPlatforms(previouslySelected = []) {
115
151
  const preselected = [...new Set([...autoSelected, ...(previouslySelected || [])])];
116
152
 
117
153
  console.log('\n' + chalk.bold('Which AI platform(s) do you use?'));
118
- console.log(chalk.gray('(Enter numbers separated by commas, or "all" for all platforms)\n'));
154
+ console.log(chalk.gray('(Enter numbers separated by commas, or "all" for all platforms)'));
155
+
156
+ // Show auto-handled platforms info
157
+ console.log(chalk.cyan.bold('\n Auto-handled (via AGENTS.md):'));
158
+ console.log(chalk.gray(' ' + AUTO_HANDLED_PLATFORMS.join(', ')));
159
+ console.log(chalk.gray(' → These work automatically, no installation needed\n'));
119
160
 
120
161
  let index = 1;
121
162
  const indexMap = {};
@@ -155,20 +196,6 @@ export async function selectPlatforms(previouslySelected = []) {
155
196
 
156
197
  console.log('');
157
198
 
158
- // CLI-based platforms
159
- console.log(chalk.cyan.bold(` ${AI_PLATFORMS.cli.label}:`));
160
- for (const platform of AI_PLATFORMS.cli.platforms) {
161
- const wasPreviouslySelected = previouslySelected && previouslySelected.includes(platform.id);
162
- const isPreselected = preselected.includes(platform.id);
163
- const marker = wasPreviouslySelected ? chalk.green(' ✓ (previously selected)') : '';
164
- console.log(chalk.white(` ${index}. ${platform.name}`) + chalk.gray(` - ${platform.desc}`) + marker);
165
- indexMap[index] = platform.id;
166
- if (isPreselected) preSelectedIndices.push(index);
167
- index++;
168
- }
169
-
170
- console.log('');
171
-
172
199
  // Show default based on preselected (auto-detected + previously selected)
173
200
  const defaultHint = preSelectedIndices.length > 0
174
201
  ? `Enter for selected: ${preSelectedIndices.join(',')}`
@@ -253,12 +280,9 @@ function removeProagentsSectionFromFile(filePath) {
253
280
  return 'cleaned';
254
281
  }
255
282
  } else {
256
- // No ProAgents markers - file was created by ProAgents (not merged)
257
- // Check if it's a ProAgents-generated file by looking for ProAgents reference
258
- if (content.includes('proagents') || content.includes('ProAgents') || content.includes('.proagents/')) {
259
- rmSync(filePath, { force: true });
260
- return 'deleted';
261
- }
283
+ // No ProAgents markers found - we cannot safely determine what to remove
284
+ // Don't delete the file as it may contain user's own configuration
285
+ // User should manually clean up files without proper markers
262
286
  return 'skipped';
263
287
  }
264
288
  } catch (error) {
@@ -346,6 +370,24 @@ export function copyPlatformFiles(selectedIds, sourceDir, targetDir) {
346
370
  return results;
347
371
  }
348
372
 
373
+ /**
374
+ * Copy universal AGENTS.md file (always present, not a selectable platform)
375
+ * @param {string} sourceDir - Source directory (.proagents folder in npm package)
376
+ * @param {string} targetDir - Target directory (project root)
377
+ * @returns {string} - 'created', 'updated', or 'skipped'
378
+ */
379
+ export function copyUniversalAIFile(sourceDir, targetDir) {
380
+ const sourcePath = join(sourceDir, 'AGENTS.md');
381
+ const targetPath = join(targetDir, 'AGENTS.md');
382
+
383
+ if (!existsSync(sourcePath)) {
384
+ return 'skipped';
385
+ }
386
+
387
+ const result = mergeAIInstructions(sourcePath, targetPath);
388
+ return result;
389
+ }
390
+
349
391
  /**
350
392
  * Save selected platforms to config
351
393
  */
@@ -431,6 +473,20 @@ export function getInstalledPlatforms(targetDir, configPath) {
431
473
  * Show available platforms that can be added
432
474
  */
433
475
  export function showAvailablePlatforms(currentIds) {
476
+ // Show auto-handled platforms info
477
+ console.log(chalk.cyan.bold('\n Auto-handled (via AGENTS.md):'));
478
+ console.log(chalk.gray(' ' + AUTO_HANDLED_PLATFORMS.join(', ')));
479
+ console.log(chalk.gray(' → These work automatically, no installation needed'));
480
+ console.log(chalk.yellow(' ⚠️ Do not remove AGENTS.md - required for these platforms'));
481
+
482
+ // Show user's installed platforms
483
+ const installedNames = currentIds
484
+ .map(id => getPlatformById(id)?.name)
485
+ .filter(Boolean);
486
+ if (installedNames.length > 0) {
487
+ console.log(chalk.green('\n Your platforms: ') + chalk.white(installedNames.join(', ')));
488
+ }
489
+
434
490
  console.log('\n' + chalk.bold('Available AI Platforms:\n'));
435
491
 
436
492
  let index = 1;
@@ -464,21 +520,6 @@ export function showAvailablePlatforms(currentIds) {
464
520
  index++;
465
521
  }
466
522
 
467
- console.log('');
468
-
469
- // CLI-based platforms
470
- console.log(chalk.cyan.bold(` ${AI_PLATFORMS.cli.label}:`));
471
- for (const platform of AI_PLATFORMS.cli.platforms) {
472
- const status = currentIds.includes(platform.id)
473
- ? chalk.green(' ✓ (installed)')
474
- : chalk.gray(' (not installed)');
475
- console.log(chalk.white(` ${index}. ${platform.name}`) + status);
476
- if (!currentIds.includes(platform.id)) {
477
- available.push({ index, platform });
478
- }
479
- index++;
480
- }
481
-
482
523
  return available;
483
524
  }
484
525
 
@@ -540,6 +581,12 @@ export async function aiAddCommand() {
540
581
  // Copy files for new platforms
541
582
  const results = copyPlatformFiles(toAdd, sourceDir, targetDir);
542
583
 
584
+ // Ensure universal AGENTS.md exists (auto-handled platforms)
585
+ const agentsResult = copyUniversalAIFile(sourceDir, targetDir);
586
+ if (agentsResult === 'created') {
587
+ results.created.push('AGENTS.md (auto-handled)');
588
+ }
589
+
543
590
  // Update config
544
591
  const newIds = [...currentIds, ...toAdd];
545
592
  savePlatformConfig(newIds, configPath);
@@ -658,6 +705,8 @@ export async function aiRemoveCommand() {
658
705
  results.deleted.push(platform.name);
659
706
  } else if (result === 'cleaned') {
660
707
  results.cleaned.push(platform.name);
708
+ } else if (result === 'skipped') {
709
+ results.skipped.push(platform.name);
661
710
  }
662
711
  }
663
712
  }
@@ -670,6 +719,9 @@ export async function aiRemoveCommand() {
670
719
  if (results.cleaned.length > 0) {
671
720
  console.log(chalk.green(`✓ Cleaned ProAgents section from: ${results.cleaned.join(', ')} (kept your custom config)`));
672
721
  }
722
+ if (results.skipped.length > 0) {
723
+ console.log(chalk.yellow(`⚠ Skipped: ${results.skipped.join(', ')} (no ProAgents markers found - manual cleanup may be needed)`));
724
+ }
673
725
 
674
726
  console.log(chalk.gray('\nConfig updated in proagents.config.yaml\n'));
675
727
  }
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'url';
4
4
  import { createInterface } from 'readline';
5
5
  import chalk from 'chalk';
6
6
  import yaml from 'js-yaml';
7
- import { selectPlatforms, copyPlatformFiles, savePlatformConfig, loadPlatformConfig } from './ai.js';
7
+ import { selectPlatforms, copyPlatformFiles, copyUniversalAIFile, savePlatformConfig, loadPlatformConfig } from './ai.js';
8
8
 
9
9
  const __filename = fileURLToPath(import.meta.url);
10
10
  const __dirname = dirname(__filename);
@@ -213,9 +213,12 @@ const FRAMEWORK_FILES = [
213
213
  'GETTING-STARTED-STORY.md',
214
214
  'slash-commands.json',
215
215
  'AI_INSTRUCTIONS.md', // Universal instructions kept for reference
216
- 'AGENTS.md', // Universal AI instruction file (works with most AI platforms)
216
+ 'platforms.yaml', // Single source of truth for AI platforms
217
217
  ];
218
218
 
219
+ // Universal AI file - always copied to project root (not selectable)
220
+ const UNIVERSAL_AI_FILE = 'AGENTS.md';
221
+
219
222
  // Project type definitions for detection
220
223
  const PROJECT_TYPES = [
221
224
  {
@@ -1243,6 +1246,14 @@ For detailed commands, see \`./.proagents/PROAGENTS.md\`
1243
1246
  // Copy AI instruction files for selected platforms (merges with existing files)
1244
1247
  const aiResults = copyPlatformFiles(selectedPlatforms, sourceDir, targetDir);
1245
1248
 
1249
+ // Always copy universal AGENTS.md
1250
+ const agentsResult = copyUniversalAIFile(sourceDir, targetDir);
1251
+ if (agentsResult === 'created') {
1252
+ aiResults.created.push('AGENTS.md');
1253
+ } else if (agentsResult === 'updated') {
1254
+ aiResults.updated.push('AGENTS.md');
1255
+ }
1256
+
1246
1257
  if (aiResults.created.length > 0) {
1247
1258
  console.log(chalk.green(`✓ Created AI files: ${aiResults.created.join(', ')}`));
1248
1259
  }
@@ -1376,21 +1387,28 @@ async function smartUpdate(sourceDir, targetDir) {
1376
1387
 
1377
1388
  // Copy AI instruction files for configured platforms (merges with existing files)
1378
1389
  const projectRoot = join(targetDir, '..');
1379
- const configPath = join(targetDir, 'proagents.config.yaml');
1390
+ const configPath = join(projectRoot, 'proagents.config.yaml');
1380
1391
  const selectedPlatforms = loadPlatformConfig(configPath);
1381
1392
 
1382
- if (selectedPlatforms.length > 0) {
1383
- const aiResults = copyPlatformFiles(selectedPlatforms, sourceDir, projectRoot);
1393
+ // Copy AI instruction files for configured platforms
1394
+ const aiResults = copyPlatformFiles(selectedPlatforms, sourceDir, projectRoot);
1384
1395
 
1385
- if (aiResults.created.length > 0) {
1386
- console.log(chalk.green(`✓ Created new AI files: ${aiResults.created.join(', ')}`));
1387
- }
1388
- if (aiResults.updated.length > 0) {
1389
- console.log(chalk.green(`✓ Updated AI files: ${aiResults.updated.join(', ')}`));
1390
- }
1391
- if (aiResults.merged.length > 0) {
1392
- console.log(chalk.green(`✓ Merged with existing: ${aiResults.merged.join(', ')}`));
1393
- }
1396
+ // Always copy universal AGENTS.md
1397
+ const agentsResult = copyUniversalAIFile(sourceDir, projectRoot);
1398
+ if (agentsResult === 'created') {
1399
+ aiResults.created.push('AGENTS.md');
1400
+ } else if (agentsResult === 'updated') {
1401
+ aiResults.updated.push('AGENTS.md');
1402
+ }
1403
+
1404
+ if (aiResults.created.length > 0) {
1405
+ console.log(chalk.green(`✓ Created new AI files: ${aiResults.created.join(', ')}`));
1406
+ }
1407
+ if (aiResults.updated.length > 0) {
1408
+ console.log(chalk.green(`✓ Updated AI files: ${aiResults.updated.join(', ')}`));
1409
+ }
1410
+ if (aiResults.merged.length > 0) {
1411
+ console.log(chalk.green(`✓ Merged with existing: ${aiResults.merged.join(', ')}`));
1394
1412
  }
1395
1413
 
1396
1414
  // Update framework files within preserved paths (templates, README, schemas)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proagents",
3
- "version": "1.6.18",
3
+ "version": "1.6.20",
4
4
  "description": "AI-agnostic development workflow framework that automates the full software development lifecycle",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -1,59 +0,0 @@
1
- # ProAgents Commands for Antigravity IDE
2
-
3
- This project uses ProAgents - an AI-agnostic development workflow framework.
4
-
5
- ## ⚠️ MANDATORY: Every pa: Command Flow
6
-
7
- ### BEFORE Any pa: Command (Auto-Sync)
8
-
9
- **Read these files FIRST before doing anything:**
10
-
11
- ```bash
12
- cat .proagents/worklog/_context.md # Current state
13
- cat .proagents/changelog/_recent.md # Recent changes
14
- tail -10 .proagents/activity.log # Recent activity
15
- ```
16
-
17
- **This applies to EVERY command:** `pa:fix`, `pa:feature`, `pa:test`, `pa:doc`, etc.
18
-
19
- ### AFTER Any pa: Command (Auto-Log)
20
-
21
- **After EVERY file edit, IMMEDIATELY update these files:**
22
-
23
- 1. `.proagents/changelog/_recent.md` - Prepend change summary
24
- 2. `.proagents/changelog/modules/[module].md` - Based on file path
25
- 3. `.proagents/worklog/_context.md` - Update current state
26
-
27
- Module detection: `src/api/*`→api, `src/auth/*`→auth, `src/components/*`→ui
28
-
29
- ## Essential Commands
30
-
31
- | Command | Action |
32
- |---------|--------|
33
- | `pa:feature "name"` | Start new feature workflow |
34
- | `pa:fix "bug"` | Quick bug fix mode |
35
- | `pa:doc` | Documentation options |
36
- | `pa:qa` | Quality assurance checks |
37
- | `pa:test` | Run test workflow |
38
- | `pa:deploy` | Deployment preparation |
39
- | `pa:status` | Show current progress |
40
-
41
- ## Full Command Reference
42
-
43
- For complete command list, see: `./.proagents/AI_INSTRUCTIONS.md`
44
-
45
- ## On `pa:` Command
46
-
47
- 1. Read the corresponding file from `./.proagents/prompts/` or `./.proagents/workflow-modes/`
48
- 2. Follow the workflow instructions
49
- 3. Use project config from `./.proagents/proagents.config.yaml`
50
-
51
- ## Key Files
52
-
53
- - `./.proagents/AI_INSTRUCTIONS.md` - Complete command reference
54
- - `./.proagents/WORKFLOW.md` - Full 10-phase workflow
55
- - `./.proagents/prompts/` - Phase-specific prompts
56
-
57
- ## Note
58
-
59
- Works with both Gemini and Claude models in Antigravity.
@@ -1,55 +0,0 @@
1
- # ProAgents Commands for ChatGPT / Codex
2
-
3
- This project uses ProAgents - an AI-agnostic development workflow framework.
4
-
5
- ## ⚠️ MANDATORY: Every pa: Command Flow
6
-
7
- ### BEFORE Any pa: Command (Auto-Sync)
8
-
9
- **Read these files FIRST before doing anything:**
10
-
11
- ```bash
12
- cat .proagents/worklog/_context.md # Current state
13
- cat .proagents/changelog/_recent.md # Recent changes
14
- tail -10 .proagents/activity.log # Recent activity
15
- ```
16
-
17
- **This applies to EVERY command:** `pa:fix`, `pa:feature`, `pa:test`, `pa:doc`, etc.
18
-
19
- ### AFTER Any pa: Command (Auto-Log)
20
-
21
- **After EVERY file edit, IMMEDIATELY update these files:**
22
-
23
- 1. `.proagents/changelog/_recent.md` - Prepend change summary
24
- 2. `.proagents/changelog/modules/[module].md` - Based on file path
25
- 3. `.proagents/worklog/_context.md` - Update current state
26
-
27
- Module detection: `src/api/*`→api, `src/auth/*`→auth, `src/components/*`→ui
28
-
29
- ## Essential Commands
30
-
31
- | Command | Action |
32
- |---------|--------|
33
- | `pa:feature "name"` | Start new feature workflow |
34
- | `pa:fix "bug"` | Quick bug fix mode |
35
- | `pa:doc` | Documentation options |
36
- | `pa:qa` | Quality assurance checks |
37
- | `pa:test` | Run test workflow |
38
- | `pa:deploy` | Deployment preparation |
39
- | `pa:status` | Show current progress |
40
-
41
- ## Full Command Reference
42
-
43
- For complete command list, see: `./.proagents/AI_INSTRUCTIONS.md`
44
-
45
- ## On `pa:` Command
46
-
47
- 1. Read the corresponding file from `./.proagents/prompts/` or `./.proagents/workflow-modes/`
48
- 2. Follow the workflow instructions
49
- 3. Use project config from `./.proagents/proagents.config.yaml`
50
-
51
- ## Key Files
52
-
53
- - `./.proagents/AI_INSTRUCTIONS.md` - Complete command reference
54
- - `./.proagents/WORKFLOW.md` - Full 10-phase workflow
55
- - `./.proagents/prompts/` - Phase-specific prompts
@@ -1,55 +0,0 @@
1
- # ProAgents Commands for Groq
2
-
3
- This project uses ProAgents - an AI-agnostic development workflow framework.
4
-
5
- ## ⚠️ MANDATORY: Every pa: Command Flow
6
-
7
- ### BEFORE Any pa: Command (Auto-Sync)
8
-
9
- **Read these files FIRST before doing anything:**
10
-
11
- ```bash
12
- cat .proagents/worklog/_context.md # Current state
13
- cat .proagents/changelog/_recent.md # Recent changes
14
- tail -10 .proagents/activity.log # Recent activity
15
- ```
16
-
17
- **This applies to EVERY command:** `pa:fix`, `pa:feature`, `pa:test`, `pa:doc`, etc.
18
-
19
- ### AFTER Any pa: Command (Auto-Log)
20
-
21
- **After EVERY file edit, IMMEDIATELY update these files:**
22
-
23
- 1. `.proagents/changelog/_recent.md` - Prepend change summary
24
- 2. `.proagents/changelog/modules/[module].md` - Based on file path
25
- 3. `.proagents/worklog/_context.md` - Update current state
26
-
27
- Module detection: `src/api/*`→api, `src/auth/*`→auth, `src/components/*`→ui
28
-
29
- ## Essential Commands
30
-
31
- | Command | Action |
32
- |---------|--------|
33
- | `pa:feature "name"` | Start new feature workflow |
34
- | `pa:fix "bug"` | Quick bug fix mode |
35
- | `pa:doc` | Documentation options |
36
- | `pa:qa` | Quality assurance checks |
37
- | `pa:test` | Run test workflow |
38
- | `pa:deploy` | Deployment preparation |
39
- | `pa:status` | Show current progress |
40
-
41
- ## Full Command Reference
42
-
43
- For complete command list, see: `./.proagents/AI_INSTRUCTIONS.md`
44
-
45
- ## On `pa:` Command
46
-
47
- 1. Read the corresponding file from `./.proagents/prompts/` or `./.proagents/workflow-modes/`
48
- 2. Follow the workflow instructions
49
- 3. Use project config from `./.proagents/proagents.config.yaml`
50
-
51
- ## Key Files
52
-
53
- - `./.proagents/AI_INSTRUCTIONS.md` - Complete command reference
54
- - `./.proagents/WORKFLOW.md` - Full 10-phase workflow
55
- - `./.proagents/prompts/` - Phase-specific prompts