Skip to content

Add instructions and configuration for AI coding agents - #50

Closed
xperiandri wants to merge 9 commits into
mrlacey:mainfrom
xperiandri:ai-infrastructure
Closed

xperiandri wants to merge 9 commits into
mrlacey:mainfrom
xperiandri:ai-infrastructure

Conversation

@xperiandri

@xperiandri xperiandri commented Oct 26, 2026 •

Copy link
Copy Markdown

Summary

This pull request adds instructions and configuration for AI coding agents (GitHub Copilot, Claude Code and others), so that they build, test and change the extension the way the project expects. The extension code and the project files do not change; the only converted file is the solution, which moves from the .sln to the .slnx format (see below).

What is added

  • .github/copilot-instructions.md is the single source of the project instructions: the build and test commands, the layout of the repository, how the adornments are created and refreshed, the shared static state that the resource loading touches, and the rules for Visual Studio extensions. It also tells agents to leave the parts that belong to the original author alone: the sponsorship message, the telemetry and the signing of the release build. CLAUDE.md and AGENTS.md point to it.
  • .github/agents/vs-extension-expert.agent.md is a custom agent for the extension code (it refers to the instructions and the skills), and .github/prompts/create-pr-description.prompt.md is a prompt that writes pull request descriptions.
  • .github/skills/ holds six Visual Studio extension skills (handling-async-threading, handling-extension-errors, adding-editor-adornments, listening-text-view-events, adding-options-settings, handling-solution-events), copied unchanged from madskristensen/vs-agent-plugins at commit e971073e2163d4bc66d3e455e102c316e01c94c6. That repository is licensed under Apache-2.0, and its license text is included next to the skills. .claude/settings.json lets Claude Code offer the whole catalogue of that repository as a plugin.
  • .mcp.json lists the GitHub and Microsoft Learn MCP servers. .claude/scripts/github-mcp-headers.ps1 gives the GitHub server the token that Git Credential Manager already stores, because that server does not support the OAuth registration that Claude Code needs. Claude Code asks for approval before it starts a server of a project.
  • .github/workflows/copilot-setup-steps.yml restores the packages for the Copilot coding agent. It runs on windows-2022, like the existing build, because the extension targets Visual Studio 2022.
  • Directory.Build.targets creates .claude/skills as a junction to .github/skills when Visual Studio loads the project (a command-line build skips it), and .gitignore excludes the junction. .mcp.json and Directory.Build.targets are added to the solution items.

The nine commits can be reviewed one by one.

About the location of the solution

The solution is already in the repository root, which is the layout that Visual Studio needs for .mcp.json: Visual Studio reads the repository-level MCP configuration from the folder of the solution, and Claude Code reads it from the root of the repository.

Why the solution is converted to .slnx

The last commit converts StringResourceVisualizer.sln to StringResourceVisualizer.slnx with dotnet sln migrate. The projects and the solution items are the same, and the file has 11 lines instead of 38. The format is XML, easy to read and edit, and designed to reduce merge conflicts; dotnet new sln creates it by default since .NET 10. The project ids are the ones of the old solution (Visual Studio adds them to a .slnx otherwise).

The price is the tooling: building a .slnx needs the .NET SDK 9.0.200 or later, or MSBuild from Visual Studio or Build Tools 17.13 or later (the minimum that Microsoft states), so a Visual Studio 2022 older than 17.13 cannot open the solution. The build workflow, which used to find the only .sln in the folder by itself, names the new file now, and so do the setup steps and the instructions. The commit is the last one and independent of the others: without it the repository keeps the .sln, and everything else works.

Verification

  • A full rebuild before the change and after the last commit, through the .slnx, gives no errors, the same 26 distinct warnings and a VSIX of the same size (4,848,348 bytes). The machine that prepared this change has no .NET Framework 4.8.1 targeting pack, so the build used the MSBuild of Visual Studio 2026 with -p:TargetFrameworkVersion=v4.8.
  • The 4 tests pass before and after the change.
  • The change does not touch code, so the extension was not run in the Experimental instance.
  • CI: the workflows of this repository wait for the approval of a maintainer on this pull request. The same commits ran in a fork: Copilot Setup Steps passes, and Build builds the .slnx on windows-2022, runs the tests and uploads the VSIX, and then fails in its step Publish Test Results: the third-party action EnricoMi/publish-unit-test-result-action/windows@v2 finds no Python interpreter on the image (No python3 interpreter found; the message of the action suggests actions/setup-python). That step fails in the same way on the unchanged code of main (run in the fork), so this change does not cause it, and it is not fixed here.

🤖 Generated with Claude Code

xperiandri and others added 8 commits October 26, 2026 01:40
`.github/copilot-instructions.md` is the single source for GitHub Copilot, Claude Code and other agents: the build and test commands, the structure, how the adornments work, the parts that belong to the original author, the rules for Visual Studio extensions and the C# guidelines. `CLAUDE.md` imports it and `AGENTS.md` points to it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`create-pr-description.prompt.md` compares the branch with `origin/main` and fills in the pull request template. This repository has no template, so the prompt falls back to a default structure.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A custom agent for the extension code, based on `madskristensen/CustomAgents`. It refers to the project instructions and to the skills instead of repeating them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Six skills of `madskristensen/vs-agent-plugins` (commit e971073e2163d4bc66d3e455e102c316e01c94c6) that apply to this extension: `handling-async-threading`, `handling-extension-errors`, `adding-editor-adornments`, `listening-text-view-events`, `adding-options-settings` and `handling-solution-events`. The content is unchanged. The Apache License 2.0 of the upstream repository comes with them, and `README.md` names the source.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Git cannot store a Windows junction, so `Directory.Build.targets` creates it when Visual Studio loads the project, and `.gitignore` excludes it. A command-line build skips the target. `Directory.Build.targets` is a solution item.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`.claude/settings.json` registers the `vs-agent-plugins` marketplace and enables `vs-extensibility-skills`, the whole catalogue of 40 skills. If Claude Code does not offer to install it, `claude plugin install vs-extensibility-skills@vs-agent-plugins --scope project` does.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The job runs on `windows-2022`: the VSIX builds only with the MSBuild of Visual Studio, and the extension targets Visual Studio 2022. The integrated firewall of the agent is not compatible with Windows, so the agent runs without it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`.mcp.json` lists `GitHub` for Visual Studio and Claude Code, and `Microsoft Learn` for Claude Code only, because Visual Studio bundles that server itself.

The GitHub server does not support the OAuth dynamic client registration that Claude Code needs, so `.claude/scripts/github-mcp-headers.ps1` passes it the token that Git Credential Manager already stores. `.mcp.json` is a solution item.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`dotnet sln migrate` produced `StringResourceVisualizer.slnx` from `StringResourceVisualizer.sln`,
and the old file is removed. The projects and the solution items are the same. The `.slnx`
format is XML, much shorter than the `.sln`, and designed to reduce merge conflicts
(https://devblogs.microsoft.com/visualstudio/new-simpler-solution-file-format/).

Building it needs the .NET SDK 9.0.200 or later, or MSBuild from Visual Studio or Build Tools
17.13 or later. The project ids are the ones of the old solution, which is what Visual Studio
writes into the file itself. The build workflow names the solution now instead of relying on
MSBuild to find it, and the setup steps of the Copilot coding agent and the instructions name
the new file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@xperiandri

Copy link
Copy Markdown
Author

Closing in favor of two smaller pull requests with the same content: #53 (.slnx) and #54 (instructions and configuration for AI coding agents, which replaces this pull request). #54 is stacked on #53; the modernization steps that follow are #55 to #58.

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.

1 participant