Skip to content

Custom instruction files analysis#209

Merged
rajbos merged 21 commits into
rajbos:mainfrom
FokkoVeegens:main
Feb 11, 2026
Merged

Custom instruction files analysis#209
rajbos merged 21 commits into
rajbos:mainfrom
FokkoVeegens:main

Conversation

@FokkoVeegens
Copy link
Copy Markdown
Collaborator

This pull request adds robust support for scanning and analyzing Copilot customization files across workspaces. It introduces a new customizationPatterns.json configuration, 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:

  • Added a new customizationPatterns.json file that defines patterns for detecting Copilot customization files (e.g., instructions, skills, agents) and configuration for staleness and directory exclusions.
  • Updated the README.md to document the purpose and structure of customizationPatterns.json, including instructions for updating patterns.

Workspace Scanning and Analysis:

  • Implemented logic in extension.ts to resolve workspace folder paths from session files, scan for customization files based on the defined patterns, and cache the results for performance. [1] [2]
  • Added new interfaces and types to represent customization files and the workspace customization matrix, including staleness detection and per-type status. [1] [2] [3]

Usage Analysis Enhancements:

  • Integrated customization file scanning into the usage analysis workflow, building a matrix that summarizes the presence and health (fresh, stale, missing) of customization files per workspace. [1] [2] [3] [4]
  • Extended the usage analysis API response to include the customization matrix, enabling the webview to display this information.

Other Improvements:

  • Updated the session file cache version to ensure correct cache invalidation with the new workspace path logic.
  • Imported the new customizationPatterns.json in the extension entrypoint.

Copilot AI review requested due to automatic review settings February 11, 2026 12:46
Comment thread src/extension.ts Fixed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json to 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.

Comment thread src/extension.ts Outdated
Comment thread src/customizationPatterns.json Outdated
Comment thread src/extension.ts Outdated
Comment thread src/extension.ts Outdated
Comment thread src/extension.ts Outdated
Comment thread src/webview/usage/main.ts Outdated
Comment thread src/webview/usage/styles.css Outdated
Comment thread src/customizationPatterns.json Outdated
Comment thread src/webview/usage/main.ts Outdated
FokkoVeegens and others added 11 commits February 11, 2026 13:59
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>
Copy link
Copy Markdown
Owner

@rajbos rajbos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Looks good!

@rajbos rajbos merged commit 179d02c into rajbos:main Feb 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants