From 9eacd6e061c977711ec5ad67f06815eb73777974 Mon Sep 17 00:00:00 2001 From: Joe Danziger Date: Wed, 21 May 2025 12:28:56 -0400 Subject: [PATCH] add brandDir to remove ambiguity and support Cline --- mcp-server/src/core/direct-functions/rules.js | 4 ++-- scripts/modules/rule-transformer.js | 8 ++++---- scripts/profiles/cline.js | 2 ++ scripts/profiles/cursor.js | 2 ++ scripts/profiles/roo.js | 2 ++ scripts/profiles/windsurf.js | 2 ++ 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/mcp-server/src/core/direct-functions/rules.js b/mcp-server/src/core/direct-functions/rules.js index 654f944a..e64495e0 100644 --- a/mcp-server/src/core/direct-functions/rules.js +++ b/mcp-server/src/core/direct-functions/rules.js @@ -110,8 +110,8 @@ export async function rulesDirect(args, log, context = {}) { // Determine paths const rulesDir = profile.rulesDir; const brandRulesDir = path.join(projectRoot, rulesDir); - const brandDir = path.dirname(brandRulesDir); - const mcpPath = path.join(brandDir, 'mcp.json'); + const brandDir = profile.brandDir; + const mcpPath = path.join(projectRoot, brandDir, 'mcp.json'); // Check what was created const mcpConfigCreated = fs.existsSync(mcpPath); diff --git a/scripts/modules/rule-transformer.js b/scripts/modules/rule-transformer.js index 3b1e3b71..cae0938f 100644 --- a/scripts/modules/rule-transformer.js +++ b/scripts/modules/rule-transformer.js @@ -208,8 +208,8 @@ function convertAllRulesToBrandRules(projectDir, profile) { fs.mkdirSync(brandRulesDir, { recursive: true }); log('debug', `Created ${brandName} rules directory: ${brandRulesDir}`); // Also create MCP configuration in the brand directory - const brandDir = path.dirname(brandRulesDir); - setupMCPConfiguration(brandDir); + const brandDir = profile.brandDir; + setupMCPConfiguration(path.join(projectDir, brandDir)); } // Count successful and failed conversions @@ -259,9 +259,9 @@ function convertAllRulesToBrandRules(projectDir, profile) { */ function removeBrandRules(projectDir, profile) { const { brandName, rulesDir } = profile; + const brandDir = profile.brandDir; const brandRulesDir = path.join(projectDir, rulesDir); - const brandDir = path.dirname(brandRulesDir); - const mcpPath = path.join(brandDir, 'mcp.json'); + const mcpPath = path.join(projectDir, brandDir, 'mcp.json'); const result = { brandName, diff --git a/scripts/profiles/cline.js b/scripts/profiles/cline.js index 225c008c..059c4554 100644 --- a/scripts/profiles/cline.js +++ b/scripts/profiles/cline.js @@ -2,6 +2,7 @@ import path from 'path'; const brandName = 'Cline'; +const brandDir = '.clinerules'; const rulesDir = '.clinerules'; // File name mapping (specific files with naming changes) @@ -134,6 +135,7 @@ export { fileMap, globalReplacements, brandName, + brandDir, rulesDir, getTargetRuleFilename }; \ No newline at end of file diff --git a/scripts/profiles/cursor.js b/scripts/profiles/cursor.js index a90dc43a..5f02de26 100644 --- a/scripts/profiles/cursor.js +++ b/scripts/profiles/cursor.js @@ -2,6 +2,7 @@ import path from 'path'; const brandName = 'Cursor'; +const brandDir = '.cursor'; const rulesDir = '.cursor/rules'; // File name mapping (specific files with naming changes) @@ -80,6 +81,7 @@ export { fileMap, globalReplacements, brandName, + brandDir, rulesDir, getTargetRuleFilename }; diff --git a/scripts/profiles/roo.js b/scripts/profiles/roo.js index 9d3c74ac..17a50019 100644 --- a/scripts/profiles/roo.js +++ b/scripts/profiles/roo.js @@ -8,6 +8,7 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const brandName = 'Roo'; +const brandDir = '.roo'; const rulesDir = '.roo/rules'; // File name mapping (specific files with naming changes) @@ -236,6 +237,7 @@ export { fileMap, globalReplacements, brandName, + brandDir, rulesDir, getTargetRuleFilename, onPostConvertBrandRules diff --git a/scripts/profiles/windsurf.js b/scripts/profiles/windsurf.js index 4aee0d00..a635ed3e 100644 --- a/scripts/profiles/windsurf.js +++ b/scripts/profiles/windsurf.js @@ -2,6 +2,7 @@ import path from 'path'; const brandName = 'Windsurf'; +const brandDir = '.windsurf'; const rulesDir = '.windsurf/rules'; // File name mapping (specific files with naming changes) @@ -130,6 +131,7 @@ export { fileMap, globalReplacements, brandName, + brandDir, rulesDir, getTargetRuleFilename };