feat: support external custom instruction files and extension-based targeting #6099
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements two enhancements to improve the flexibility and scalability of RooCode's custom instruction system as requested in #6098:
1. Support for External Instruction Files with Path Reference
./.github/copilot-instructions.md
2. Extension-Based Instruction Targeting
loadExtensionSpecificInstructions
that loads instructions based on file extensionspy-instruction.md
for Python files,ts-instruction.md
for TypeScript files, etc..roo
directory.roo
directoryChanges
addCustomInstructions
to support loading instructions from file pathsloadExtensionSpecificInstructions
function for extension-based targetingTesting
Fixes #6098
Important
This PR adds support for external instruction files and extension-based targeting in RooCode's custom instruction system, enhancing flexibility and scalability.
addCustomInstructions
now supports loading instructions from file paths, falling back to literal strings if files don't exist.loadExtensionSpecificInstructions
function loads instructions based on file extensions, checking.roo
directories and project root.loadInstructionFromPath
to read instructions from file paths incustom-instructions.ts
.addCustomInstructions
to integrate file path support.loadExtensionSpecificInstructions
to handle extension-based targeting.custom-instructions.spec.ts
for various scenarios including non-existent files and multiple instruction sources.This description was created by
for 29d1bb8. You can customize this summary. It will automatically update as commits are pushed.