Skip to content

Commit c0fab86

Browse files
committed
Clarify dotnet bootstrap guidance across skills
1 parent 6e0cf10 commit c0fab86

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

skills/mcaf-dotnet-code-analysis/SKILL.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@ compatibility: "Requires a .NET SDK-based repository; respects the repo's `AGENT
4747
4. Use `dotnet build` as the analyzer execution gate in CI.
4848
5. Add third-party analyzers only for real gaps that first-party rules do not cover.
4949

50+
## Bootstrap When Missing
51+
52+
If first-party .NET code analysis is requested but not configured yet:
53+
54+
1. Detect current state:
55+
- `dotnet --info`
56+
- `rg -n "EnableNETAnalyzers|AnalysisLevel|AnalysisMode|TreatWarningsAsErrors" -g '*.csproj' -g 'Directory.Build.*' .`
57+
2. Treat SDK analyzers as built-in functionality, not as a separate third-party install path.
58+
3. Enable the needed properties in the solution's MSBuild config, typically in `Directory.Build.props` or the target project file:
59+
- `EnableNETAnalyzers`
60+
- `AnalysisLevel`
61+
- `AnalysisMode` when needed
62+
- warning policy such as `TreatWarningsAsErrors`
63+
4. Keep rule-level severity in the repo-root `.editorconfig`.
64+
5. Run `dotnet build <solution-or-project>` and return `status: configured` or `status: improved`.
65+
6. If the repo intentionally defers analyzer policy to another documented build layer, return `status: not_applicable`.
66+
5067
## Deliver
5168

5269
- first-party analyzer policy that is explicit and reviewable

skills/mcaf-dotnet-format/SKILL.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@ compatibility: "Requires a .NET SDK-based repository; respects the repo's `AGENT
4646
4. Keep `.editorconfig` as the source of truth for style preferences.
4747
5. If the repo also uses `CSharpier`, document which tool owns which file types or rules.
4848

49+
## Bootstrap When Missing
50+
51+
If `dotnet format` is requested but not available yet:
52+
53+
1. Detect current state:
54+
- `dotnet --info`
55+
- `dotnet format --version`
56+
2. Treat `dotnet format` as SDK-provided, not as a separate repo-local tool by default.
57+
3. If the command is missing, install or upgrade to a supported .NET SDK, then recheck `dotnet format --version`.
58+
4. Add explicit local and CI commands to `AGENTS.md`, usually:
59+
- `dotnet format <target> --verify-no-changes`
60+
5. Run the chosen command once and return `status: configured` or `status: improved`.
61+
6. If the repo intentionally uses only `CSharpier` for formatting ownership, return `status: not_applicable`.
62+
4963
## Deliver
5064

5165
- explicit `dotnet format` commands for local and CI runs

skills/mcaf-dotnet-tunit/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@ compatibility: "Requires a .NET solution or project with TUnit packages; respect
4848
5. Run the narrowest useful scope first. If the repo hasn't documented filter switches for TUnit yet, prefer project-level focused runs over guessed runner arguments.
4949
6. Use `[Test]`, `[Arguments]`, hooks, and dependencies only when they make the scenario clearer, not because the framework allows it.
5050

51+
## Bootstrap When Missing
52+
53+
If `TUnit` is requested but not configured yet:
54+
55+
1. Detect current state:
56+
- `rg -n "TUnit|Microsoft\\.Testing\\.Platform" -g '*.csproj' -g 'Directory.Build.*' .`
57+
2. Add the minimal package set to the test project:
58+
- `dotnet add <test-project>.csproj package TUnit`
59+
- `dotnet add <test-project>.csproj package Microsoft.NET.Test.Sdk`
60+
3. Keep the runner model explicit in `AGENTS.md` and CI:
61+
- record that the repo uses Microsoft.Testing.Platform-compatible execution for this test project
62+
- record the exact `dotnet test <test-project>.csproj` command the repo will use
63+
4. Add one small executable test using `[Test]`.
64+
5. Run `dotnet test <test-project>.csproj` and return `status: configured` or `status: improved`.
65+
6. If the repo intentionally standardizes on xUnit or MSTest, return `status: not_applicable` unless migration is explicitly requested.
66+
5167
## Deliver
5268

5369
- TUnit tests that respect source generation and parallel execution

0 commit comments

Comments
 (0)