coder-config 0.41.29 → 0.41.30

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/constants.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Constants and tool path configurations
3
3
  */
4
4
 
5
- const VERSION = '0.41.29';
5
+ const VERSION = '0.41.30';
6
6
 
7
7
  // Tool-specific path configurations
8
8
  const TOOL_PATHS = {
@@ -628,6 +628,51 @@ function workstreamCheckPath(installDir, targetPath, silent = false) {
628
628
  return isWithin;
629
629
  }
630
630
 
631
+ /**
632
+ * Generate rules/context from project repositories using Claude Code
633
+ * Runs `claude -p` to analyze repos and generate smart context
634
+ */
635
+ async function generateRulesWithClaude(projects) {
636
+ if (!projects || projects.length === 0) {
637
+ return '';
638
+ }
639
+
640
+ const { execFileSync } = require('child_process');
641
+
642
+ const projectPaths = projects.map(p =>
643
+ path.resolve(p.replace(/^~/, process.env.HOME || ''))
644
+ );
645
+
646
+ const projectList = projectPaths.map(p => `- ${p}`).join('\n');
647
+
648
+ const prompt = `Analyze these project repositories and generate concise workstream context rules for an AI coding assistant. Focus on:
649
+ 1. What each project does (brief description)
650
+ 2. Key technologies and frameworks used
651
+ 3. How the projects relate to each other (if multiple)
652
+ 4. Any important conventions or patterns to follow
653
+
654
+ Projects:
655
+ ${projectList}
656
+
657
+ Output markdown suitable for injecting into an AI assistant's context. Keep it concise (under 500 words). Do not include code blocks or examples - just descriptions and guidelines.`;
658
+
659
+ try {
660
+ // Run claude -p with the prompt using execFileSync (safer than exec)
661
+ const result = execFileSync('claude', ['-p', prompt], {
662
+ cwd: projectPaths[0],
663
+ encoding: 'utf8',
664
+ timeout: 60000, // 60 second timeout
665
+ maxBuffer: 1024 * 1024, // 1MB buffer
666
+ });
667
+
668
+ return result.trim();
669
+ } catch (error) {
670
+ console.error('Claude generation failed:', error.message);
671
+ // Fall back to simple generation
672
+ return generateRulesFromRepos(projects);
673
+ }
674
+ }
675
+
631
676
  /**
632
677
  * Generate rules/context from project repositories
633
678
  * Reads README.md, package.json, CLAUDE.md, etc. to create a summary
@@ -853,4 +898,5 @@ module.exports = {
853
898
  workstreamDeactivate,
854
899
  workstreamCheckPath,
855
900
  generateRulesFromRepos,
901
+ generateRulesWithClaude,
856
902
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder-config",
3
- "version": "0.41.29",
3
+ "version": "0.41.30",
4
4
  "description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
5
5
  "author": "regression.io",
6
6
  "main": "config-loader.js",