You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
focus: "Documentation extraction and formatting rules, including documentation style guides, API documentation patterns, and content organization",
267
+
}
268
+
default:
269
+
returnnull
270
+
}
271
+
})
272
+
.filter((rule): rule is RuleInstruction=>rule!==null)
273
+
220
274
// Create a comprehensive message for the rules generation task
221
275
consttaskMessage=`Analyze this codebase and generate comprehensive rules for AI agents working in this repository.
222
276
@@ -233,18 +287,35 @@ ${codebaseSummary}
233
287
- Project-specific conventions and best practices
234
288
- File organization patterns
235
289
236
-
3. **Save the rules** to the file at exactly this path: .roo/rules/coding-standards.md
237
-
- The .roo/rules directory has already been created for you
238
-
- Always overwrite the existing file if it exists
239
-
- Use the \`write_to_file\` tool to save the content
290
+
3. **Generate and save the following rule files**:
291
+
${ruleInstructions
292
+
.map(
293
+
(rule,index)=>`
294
+
${index+1}. **${rule.path}**
295
+
- Focus: ${rule.focus}
296
+
- The directory has already been created for you
297
+
- Always overwrite the existing file if it exists
298
+
- Use the \`write_to_file\` tool to save the content${alwaysAllowWriteProtected ? "\n - Note: Auto-approval for protected file writes is enabled, so you can write to .roo directories without manual approval" : ""}`,
299
+
)
300
+
.join("\n")}
240
301
241
302
4. **Open the generated file** in the editor for review
242
303
243
304
The rules should be about 20-30 lines long and focus on the most important guidelines for this specific project. Make them actionable and specific to help AI agents work effectively in this codebase.
244
305
245
306
If there are existing rules files (like CLAUDE.md, .cursorrules, .cursor/rules, .github/copilot-instructions.md), incorporate and improve upon them.
246
307
247
-
Use the \`safeWriteJson\` utility from \`src/utils/safeWriteJson.ts\` for any JSON file operations to ensure atomic writes.`
308
+
Use the \`safeWriteJson\` utility from \`src/utils/safeWriteJson.ts\` for any JSON file operations to ensure atomic writes.
309
+
310
+
${
311
+
addToGitignore
312
+
? `5. **Add the generated files to .gitignore**:
313
+
- After generating all rule files, add entries to .gitignore to prevent them from being committed
314
+
- Add each generated file path to .gitignore (e.g., .roo/rules/coding-standards.md)
315
+
- If .gitignore doesn't exist, create it
316
+
- If the entries already exist in .gitignore, don't duplicate them`
0 commit comments