dotnet / dotnet/aspnetcore

[Blazor] Optionally include a .github/copilot/settings.json file on the templates

Open
#67,126 5 comments 0 reactions 0 assignees View on GitHub
area-blazor feature-templates
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

This will make it so that the project/repo that is created automatically detects and enables the Blazor skills. This is meant to be repo specific.

## Background

Copilot CLI loads per-repo settings from `.github/copilot/settings.json` (relative to the git root). At startup it:

1. Reads the file and merges it into the effective settings.
2. Auto-installs any plugins listed under `enabledPlugins` from the declared marketplaces (after the usual first-time confirmation).
3. Emits any `companyAnnouncements` entries as a `● Company announcement: …` notification at the top of the session (and again, ephemerally, if the file changes mid-session). This is useful as a nudge for contributors that haven't auto-installed yet.

## Proposal

For Blazor templates we want:

- The `dotnet-skills` marketplace (`dotnet/skills` repo) registered.
- The `dotnet-blazor` plugin enabled (it lives at `plugins/dotnet-blazor` in that marketplace and ships Blazor-specific skills: component authoring, interactivity, web app patterns).

Concretely, the template would drop a `.github/copilot/settings.json` like:

```json
{
"extraKnownMarketplaces": {
"dotnet-skills": {
"source": {
"source": "github",
"repo": "dotnet/skills"
}
}
},
"enabledPlugins": {
"dotnet-blazor@dotnet-skills": true
},
"companyAnnouncements": [
"Run `/plugin install dotnet-blazor@dotnet-skills` to install Blazor-specific Copilot skills (component authoring, interactivity, web app patterns)."
]
}
```

Notes:

- The `enabledPlugins` entry triggers auto-install on the next CLI session, so most contributors won't need to run the command manually; the `companyAnnouncements` line is a fallback nudge for users on older CLI versions or who declined auto-install.
- We may also want to add `dotnet@dotnet-skills` (general .NET) for completeness; TBD whether the Blazor template should opt into that or leave it to a broader `dotnet-aspnetcore` plugin.
- The file is repo-scoped, so it should only be emitted by templates whose output is reasonably expected to live in its own git repository (e.g., `blazor`, `blazorwasm`, `blazorserver`). Item-templates that drop a single component into an existing project should not write it.

## Open questions

- Should this be guarded behind a template parameter (e.g., `--copilot` / `-cp`) so users can opt out?
- Do we want the announcement string at all, or rely solely on `enabledPlugins` auto-install?
- Coordinate with `dotnet/sdk` and `dotnet/aspnetcore` so the same pattern is consistent across SDK-shipped templates (`dotnet/sdk` already uses this file for the `dotnet-dnceng@dotnet-arcade-skills` plugin).

Contributor guide

Open the contributing guide

Research direction

Start by locating the Blazor, Blazor WebAssembly, and Blazor Server template entry points and the existing .github/copilot/settings.json pattern described in the issue. Confirm which repo-scoped templates should emit the file and whether template parameters are required. Done means selected templates generate the requested marketplace and plugin settings without affecting item templates.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.