Custom instruction files analysis#209
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds workspace-level scanning for Copilot customization files and surfaces results in the Usage Analysis webview via a customization “matrix” view.
Changes:
- Introduces
customizationPatterns.jsonto define file patterns, exclusions, and staleness rules. - Implements workspace resolution + scanning/caching in
src/extension.ts, and includes a customization matrix in the usage analysis payload. - Updates the Usage Analysis webview (TS + CSS) to render the customization matrix UI.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/extension.ts | Adds workspace path resolution, customization file scanning, caching, and matrix construction included in usage analysis response. |
| src/customizationPatterns.json | New configuration file defining customization file patterns and scanning rules. |
| src/webview/usage/main.ts | Renders customization matrix in the usage analysis webview and wires up UI handlers. |
| src/webview/usage/styles.css | Adds styles for the customization matrix table. |
| src/webview/shared/contextRefUtils.ts | Adds shared types for customization file entries and matrix structures. |
| src/README.md | Documents the purpose and structure of customizationPatterns.json. |
The oneLevel scan mode substitutes the first * with entry.name, which breaks patterns like .github/agents/*.md: for a file foo.md, substitution becomes foo.md.md and will never exist. Fix by matching entries against a compiled glob/regex (e.g., compute each candidate relative path like .github/agents/${entry.name} and test it with globToRegExp(relativePattern)), or by treating oneLevel as 'enumerate one directory then glob-match within it' rather than doing string replace('*', entry.name).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

This pull request adds robust support for scanning and analyzing Copilot customization files across workspaces. It introduces a new
customizationPatterns.jsonconfiguration, implements workspace scanning logic, and enhances the usage analysis to surface the presence and staleness of customization files in a matrix view. These changes improve visibility into Copilot customization adoption and make it easier to identify gaps or stale configurations across repositories.Customization Patterns and Scanning:
customizationPatterns.jsonfile that defines patterns for detecting Copilot customization files (e.g., instructions, skills, agents) and configuration for staleness and directory exclusions.README.mdto document the purpose and structure ofcustomizationPatterns.json, including instructions for updating patterns.Workspace Scanning and Analysis:
extension.tsto resolve workspace folder paths from session files, scan for customization files based on the defined patterns, and cache the results for performance. [1] [2]Usage Analysis Enhancements:
Other Improvements:
customizationPatterns.jsonin the extension entrypoint.