/handbook-dotnet:dotnet-analyzers [diagnostic ID or 'verify' or 'list' or '--dashboard' or '--sarif']from handbook-dotnet
Fixes .NET code style and analyzer diagnostics (IDE*, CA*, SA*) using dotnet format. Lists violations first, then auto-fixes on confirmation.
Ships in handbook-dotnet. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Fix code style and analyzer diagnostics using dotnet format.
Arguments: $ARGUMENTS
dotnet format does its own internal compilation — it does NOT depend on cached build outputEnableNETAnalyzers is true| Task | Command |
|---|---|
| Fix specific style diagnostic | dotnet format style --diagnostics IDE0005 --severity warn |
| Fix specific analyzer diagnostic | dotnet format analyzers --diagnostics CA1305 --severity warn |
| Fix all style issues | dotnet format style --severity warn |
| Fix all analyzer issues | dotnet format analyzers --severity warn |
| Fix everything | dotnet format --severity warn |
| Verify only (CI) | dotnet format --verify-no-changes --severity warn |
| List violations without fixing | dotnet format style --verify-no-changes --severity warn -v diag |
| Scope to folder | dotnet format style --diagnostics IDE0005 --include src/MyProject/ |
dotnet format style| ID | Description |
|---|---|
| IDE0005 | Unnecessary using directive |
| IDE0055 | Fix formatting |
| IDE0090 | Simplify new expression |
| IDE0161 | File-scoped namespace |
| IDE0251 | Make member readonly |
dotnet format analyzers| ID | Description |
|---|---|
| CA1305 | Specify IFormatProvider |
| CA1822 | Mark members as static |
| CA1859 | Use concrete types for performance |
| CA2000 | Dispose objects before losing scope |
IMPORTANT: Always start in verify/list mode. NEVER auto-fix without explicit user confirmation.
Always start by showing what would change — never fix automatically.
Use --report "$TEMP/dotnet-format" to get structured JSON, then process with jq.
# List all style violations as JSON report
dotnet format style --verify-no-changes --severity warn --report "$TEMP/dotnet-format" <PROJECT_OR_SOLUTION> 2>/dev/null
# List specific diagnostic
dotnet format style --verify-no-changes --diagnostics IDE0005 --severity warn --report "$TEMP/dotnet-format" <PROJECT_OR_SOLUTION> 2>/dev/null
# List analyzer violations
dotnet format analyzers --verify-no-changes --severity warn --report "$TEMP/dotnet-format" <PROJECT_OR_SOLUTION> 2>/dev/null
Process the JSON report with jq:
# Summary: count violations per diagnostic ID
jq '[.[].FileChanges[].DiagnosticId] | group_by(.) | map({id: .[0], count: length}) | sort_by(-.count)' "$TEMP/dotnet-format/format-report.json"
# List affected files
jq '[.[].FilePath] | unique | .[]' "$TEMP/dotnet-format/format-report.json"
# Show details for a specific diagnostic
jq '[.[] | {file: .FilePath, changes: [.FileChanges[] | select(.DiagnosticId == "IDE0005")]} | select(.changes | length > 0)]' "$TEMP/dotnet-format/format-report.json"
Summarize the violations found using the JSON report and ask the user if they want to apply fixes.
dotnet format style --diagnostics IDE0005 --severity warn
Or for analyzer rules:
dotnet format analyzers --diagnostics CA1305 --severity warn
dotnet build -p:WarningLevel=0 /clp:ErrorsOnly
--dashboard)Only generate when user explicitly passes --dashboard. Do NOT suggest or run this unprompted.
--sarif selects SARIF mode: the script runs its own dotnet build -t:Rebuild and harvests _analyzer-diag.sarif files. It is NOT a request to run dotnet build separately — passing the flag through to generate-report.sh is the entire job. Without --sarif, the script uses the faster dotnet format path. SARIF mode respects editorconfig severity (filters level=note/none and source-suppressed entries). See Mode comparison for when to pick which.
Generate an interactive HTML dashboard from live dotnet format output. No AI involved — purely deterministic.
Default mode uses dotnet format (fast, fixable diagnostics only):
# From repo root (defaults to current dir, outputs analyzer-dashboard.html)
bash ~/.claude/skills/dotnet-analyzers/scripts/generate-report.sh
# Explicit solution/project path and output
bash ~/.claude/skills/dotnet-analyzers/scripts/generate-report.sh ./MyProject.sln analyzer-dashboard-generated.html
SARIF mode runs dotnet build -t:Rebuild and harvests Roslyn ErrorLog SARIF (slower, comprehensive):
# Run ONLY when user explicitly asks for full coverage / "report everything"
bash ~/.claude/skills/dotnet-analyzers/scripts/generate-report.sh --sarif presales.slnx analyzer-dashboard-sarif.html
Flag parsing: --sarif and --dashboard may appear in any order; --dashboard is a no-op (dashboard is always emitted) but accepted so user invocations like --dashboard --sarif work as expected. Positional args are [project] [output.html].
When the user asks for both dashboards, generate them with distinct output names:
bash ~/.claude/skills/dotnet-analyzers/scripts/generate-report.sh presales.slnx analyzer-dashboard.html
bash ~/.claude/skills/dotnet-analyzers/scripts/generate-report.sh --sarif presales.slnx analyzer-dashboard-sarif.html
| Aspect | default (dotnet format) | --sarif (Roslyn ErrorLog) |
|---|---|---|
| Speed | Fast (~10s) | Slow (full rebuild, ~1–2 min) |
| Coverage | Fixable analyzers only (CA*, S*, IDE*, IDISP*) | All Roslyn diagnostics: CS* + CA* + S* + IDE* + IDISP* + ASP* + MUD* + xUnit* etc. |
| CS* compiler warnings (CS8602, CS0618, …) | ❌ skipped | ✅ included |
| Editorconfig severity respected | ✅ | ✅ (filters SARIF level=note/none and suppressions[]) |
| NU* (NuGet vulnerabilities) | ❌ | ❌ (restore phase, not in SARIF) |
| MSB* (MSBuild engine) | ❌ | ❌ (build engine, not in SARIF) |
| Side effects | None | Forces full rebuild; writes per-project _analyzer-diag.sarif |
dotnet format fixes.--sarif — only when user explicitly asks for "everything", "full picture", "real warning count", or notices the default dashboard is undercounting compared to dotnet build. Never run unprompted: it triggers a full rebuild.Default mode:
dotnet format style --verify-no-changes --severity warn --report <tmpdir>dotnet format analyzers --verify-no-changes --severity warn --report <tmpdir>format-report.json via jq into violation summaries and file-level detailsscripts/template.html, writes output HTML--sarif mode:
_analyzer-diag.sarif filesdotnet build <project> -t:Rebuild -p:ErrorLog=_analyzer-diag.sarif%2cversion=2.1level∉{warning,error} results, dedupes by (ruleId, uri, line, col) (collapses multi-target duplicates)template.htmlWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub nikiforovall/claude-code-rules --plugin handbook-dotnet9 skills in this plugin
/coverage-reportGenerate a .NET code coverage report scoped to files changed in the current branch. Runs tests with coverage collection and produces filtered HTML reports./dotnet-dependencyThis skill should be used when investigating .NET project dependencies, understanding why packages are included, listing references, or auditing for outdated/vulnerable packages./dotnet-inspectQuery .NET APIs across NuGet packages, platform libraries, and local files. Search for types, list API surfaces, compare and diff versions, find extension methods and implementors. Use whenever you need to answer questions about .NET library contents./dotnet-run-fileRun script-like CSharp programs using dotnet run file.cs. Use this skill when users want to execute CSharp code directly, write one-liner scripts via stdin, or learn about run file directives./dotnet-testThis skill should be used when running .NET tests selectively with a build-first, test-targeted workflow. Use it for running tests with xUnit focus./dotnet-verifyThis skill should be used when working with Verify snapshot tests in .NET projects. Use when updating verified snapshots after intentional code changes, accepting new snapshots, discovering verify tests, or troubleshooting snapshot mismatches. Trigger phrases include "verify tests", "update snapshots", "accept snapshots", "verified files", ".verified.txt".Other plugins' skills for the same job