diff --git a/scripts/modules/rule-transformer.js b/scripts/modules/rule-transformer.js index 3295df71..67d9381b 100644 --- a/scripts/modules/rule-transformer.js +++ b/scripts/modules/rule-transformer.js @@ -214,11 +214,11 @@ function convertAllRulesToBrandRules(projectDir, profile) { let success = 0; let failed = 0; - // Process each file in the Cursor rules directory + // Only copy files listed in fileMap (main rules folder) const getTargetRuleFilename = profile.getTargetRuleFilename || ((f) => f); - fs.readdirSync(cursorRulesDir).forEach((file) => { - if (file.endsWith('.mdc')) { - const sourcePath = path.join(cursorRulesDir, file); + Object.keys(profile.fileMap).forEach((file) => { + const sourcePath = path.join(cursorRulesDir, file); + if (fs.existsSync(sourcePath)) { const targetFilename = getTargetRuleFilename(file); const targetPath = path.join(brandRulesDir, targetFilename); @@ -228,6 +228,11 @@ function convertAllRulesToBrandRules(projectDir, profile) { } else { failed++; } + } else { + log( + 'warn', + `File listed in fileMap not found in rules dir: ${sourcePath}` + ); } }); diff --git a/scripts/profiles/cursor.js b/scripts/profiles/cursor.js index b388579b..a90dc43a 100644 --- a/scripts/profiles/cursor.js +++ b/scripts/profiles/cursor.js @@ -6,7 +6,11 @@ const rulesDir = '.cursor/rules'; // File name mapping (specific files with naming changes) const fileMap = { - // No explicit mappings; keep original .mdc filenames + 'cursor_rules.mdc': 'cursor_rules.mdc', + 'dev_workflow.mdc': 'dev_workflow.mdc', + 'self_improve.mdc': 'self_improve.mdc', + 'taskmaster.mdc': 'taskmaster.mdc' + // Add other mappings as needed }; const globalReplacements = [ diff --git a/scripts/profiles/roo.js b/scripts/profiles/roo.js index bfb058f8..9d3c74ac 100644 --- a/scripts/profiles/roo.js +++ b/scripts/profiles/roo.js @@ -12,7 +12,10 @@ const rulesDir = '.roo/rules'; // File name mapping (specific files with naming changes) const fileMap = { - 'cursor_rules.mdc': 'roo_rules.md' + 'cursor_rules.mdc': 'roo_rules.md', + 'dev_workflow.mdc': 'dev_workflow.md', + 'self_improve.mdc': 'self_improve.md', + 'taskmaster.mdc': 'taskmaster.md' // Add other mappings as needed }; diff --git a/scripts/profiles/windsurf.js b/scripts/profiles/windsurf.js index 7118da41..4aee0d00 100644 --- a/scripts/profiles/windsurf.js +++ b/scripts/profiles/windsurf.js @@ -6,7 +6,10 @@ const rulesDir = '.windsurf/rules'; // File name mapping (specific files with naming changes) const fileMap = { - 'cursor_rules.mdc': 'windsurf_rules.md' + 'cursor_rules.mdc': 'windsurf_rules.md', + 'dev_workflow.mdc': 'dev_workflow.md', + 'self_improve.mdc': 'self_improve.md', + 'taskmaster.mdc': 'taskmaster.md' // Add other mappings as needed };