claude-autopm 2.8.8 → 2.8.9

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/install/install.js +77 -0
  2. package/package.json +1 -1
@@ -840,9 +840,86 @@ See: https://github.com/rafeekpro/ClaudeAutoPM
840
840
  processedContent = processedContent.replace(regex, value);
841
841
  }
842
842
 
843
+ // Generate agent @include directives from installed plugins
844
+ const agentIncludes = this.generateAgentIncludes();
845
+ processedContent = processedContent.replace(
846
+ /<!-- AGENTS_START -->\s*<!-- AGENTS_END -->/,
847
+ `<!-- AGENTS_START -->\n${agentIncludes}\n<!-- AGENTS_END -->`
848
+ );
849
+
843
850
  return processedContent;
844
851
  }
845
852
 
853
+ generateAgentIncludes() {
854
+ if (!this.currentConfig?.installedPlugins) {
855
+ return '';
856
+ }
857
+
858
+ const packagesDir = path.join(this.baseDir, 'packages');
859
+ const agentsByCategory = {};
860
+
861
+ // Collect all agents from installed plugins
862
+ for (const plugin of this.currentConfig.installedPlugins) {
863
+ const pluginPath = path.join(packagesDir, plugin.name);
864
+ const pluginJsonPath = path.join(pluginPath, 'plugin.json');
865
+
866
+ if (!fs.existsSync(pluginJsonPath)) {
867
+ continue;
868
+ }
869
+
870
+ try {
871
+ const metadata = JSON.parse(fs.readFileSync(pluginJsonPath, 'utf-8'));
872
+
873
+ if (metadata.agents && metadata.agents.length > 0) {
874
+ for (const agent of metadata.agents) {
875
+ const category = agent.category || 'other';
876
+
877
+ if (!agentsByCategory[category]) {
878
+ agentsByCategory[category] = [];
879
+ }
880
+
881
+ // Build installed path: .claude/agents/{category}/{filename}
882
+ // agent.file contains the full path like "agents/core/agent-manager.md"
883
+ // We extract just the filename and use category for the directory
884
+ const filename = path.basename(agent.file);
885
+ const installedPath = `.claude/agents/${category}/${filename}`;
886
+
887
+ agentsByCategory[category].push({
888
+ name: agent.name,
889
+ path: installedPath,
890
+ description: agent.description
891
+ });
892
+ }
893
+ }
894
+ } catch (error) {
895
+ this.printWarning(`Failed to read plugin metadata for ${plugin.name}: ${error.message}`);
896
+ }
897
+ }
898
+
899
+ // Generate @include directives organized by category
900
+ const lines = [];
901
+ const categoryOrder = ['core', 'languages', 'frameworks', 'testing', 'devops', 'cloud', 'databases', 'data', 'ai', 'ml'];
902
+
903
+ for (const category of categoryOrder) {
904
+ if (agentsByCategory[category]) {
905
+ for (const agent of agentsByCategory[category]) {
906
+ lines.push(`- @include ${agent.path}`);
907
+ }
908
+ }
909
+ }
910
+
911
+ // Add any remaining categories not in the order list
912
+ for (const category of Object.keys(agentsByCategory)) {
913
+ if (!categoryOrder.includes(category)) {
914
+ for (const agent of agentsByCategory[category]) {
915
+ lines.push(`- @include ${agent.path}`);
916
+ }
917
+ }
918
+ }
919
+
920
+ return lines.join('\n');
921
+ }
922
+
846
923
  async installPlugins() {
847
924
  if (!this.currentConfig || !this.currentConfig.plugins) {
848
925
  this.printStep('No plugins configured for this scenario');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-autopm",
3
- "version": "2.8.8",
3
+ "version": "2.8.9",
4
4
  "description": "Autonomous Project Management Framework for Claude Code - Advanced AI-powered development automation",
5
5
  "main": "bin/autopm.js",
6
6
  "workspaces": [