Skip to content

Add support for VS Code instruction file discovery pattern matching in GitHub Coding Agent #255913

@rebornix

Description

@rebornix

To ensure consistent behavior between local VS Code AI features and GitHub Coding Agent, the same instruction file discovery and pattern matching system used in VS Code needs to be supported by the GitHub Coding Agent.

VS Code's instruction file discovery system works as follows:

  • File discovery
    • Default location: instructions folder (**/.github/instructions/*.instructions.md)
    • Copilot instructions: **/.github/copilot-instructions.md
    • Configurable locations: Users can configure additional locations via chat.instructionsFilesLocations setting
  • Pattern Matching
    • Each instruction file can have frontmatter with an applyTo field that defines glob patterns applyTo: "**/*.ts"

The first step toward alignment would be for the GitHub Coding Agent to adopt the same file discovery mechanism, and include a list of all discovered instruction files directly in the prompt (and potentially key metadata such as applyTo values,

return [
'Here is a list of instruction files that contain rules for modifying or creating new code.',
'These files are important for ensuring that the code is modified or created correctly.',
'Please make sure to follow the rules specified in these files when working with the codebase.',
`If the file is not already available as attachment, use the \`${toolName}\` tool to acquire it.`,
'Make sure to acquire the instructions before making any changes to the code.',
'| Pattern | File Path | Description |',
'| ------- | --------- | ----------- |',
].concat(entries);
). This allows the model to understand what files are available and which ones it should consider when generating responses.

cc @aeschli , please correct me if I miss anything critical.

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions