Agent skill

Dotnet Analyzers

by NikiforovAll in NikiforovAll/claude-code-rules

Run dotnet format to fix code style and analyzer diagnostics (IDE0005, CA, SA).

Apache-2.0Auto-check passed

Install Dotnet Analyzers

skills CLI
$ npx skills add NikiforovAll/claude-code-rules --skill dotnet-analyzers -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install NikiforovAll/claude-code-rules dotnet-analyzers --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/NikiforovAll/claude-code-rules.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/handbook-dotnet/skills/dotnet-analyzers .claude/skills/dotnet-analyzers && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dotnet-analyzers
GitHub stars
141
Token cost
~1.9k tokens
SKILL.md length
650 words
Files
3 (incl. scripts)
Skills in repo
26
Repo updated
First seen
Licence
Apache-2.0

At a glance

Run dotnet format to fix code style and analyzer diagnostics (IDE0005, CA, SA).

  • Works in 4 steps: List violations (default) → Report findings to user → Apply fixes (only after user confirms) → …
  • Fixing unnecessary usings
  • SKILL.md covers Key Concepts, Command Reference, Common Diagnostics and Workflow, plus 1 more section
  • Runs Shell scripts from its folder; calls dotnet, bash and jq

What it does

Dotnet Analyzers is an agent skill from NikiforovAll/claude-code-rules. Run dotnet format to fix code style and analyzer diagnostics (IDE0005, CA, SA). Use when fixing unnecessary usings, code style violations, analyzer warnings, or verifying format compliance

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including scripts (for example `scripts/generate-report.sh`).

It works with .NET. The repository describes itself as: Learn practical techniques to enhance your AI-assisted development workflow with Claude Code. The licence is Apache-2.0.

When your agent uses it

  • Fixing unnecessary usings
  • Code style violations
  • Analyzer warnings
  • Verifying format compliance

Example prompts

  • “/dotnet-analyzers”

Requirements

  • A Bash shell
  • Pre-approved tools (allowed-tools): Bash(dotnet format *), Bash(dotnet clean *), Bash(jq *), Bash(bash *generate-report*), Read, Grep, Glob

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. List violations (default)
  2. Report findings to user
  3. Apply fixes (only after user confirms)
  4. Verify build still passes

What it can do on your machine

Read from SKILL.md and the folder at commit 281c063. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(dotnet format *)
    • Bash(dotnet clean *)
    • Bash(jq *)
    • Bash(bash *generate-report*)
    • Read
    • Grep
    • Glob

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • dotnet
    • bash
    • jq

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dotnet Analyzers loads about 1.9k tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 650 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~52
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from NikiforovAll/claude-code-rules at commit 281c063, republished under its Apache-2.0 licence (© NikiforovAll). 650 words, ~1,938 tokens.

Download SKILL.mdSave it as .claude/skills/dotnet-analyzers/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
dotnet-analyzers
description
Run dotnet format to fix code style and analyzer diagnostics (IDE0005, CA*, SA*). Use when fixing unnecessary usings, code style violations, analyzer warnings, or verifying format compliance
allowed-tools
Bash(dotnet format *), Bash(dotnet clean *), Bash(jq *), Bash(bash *generate-report*), Read, Grep, Glob
argument-hint
[diagnostic ID or 'verify' or 'list' or '--dashboard' or '--sarif']

.NET Analyzers & Code Format

Fix code style and analyzer diagnostics using dotnet format.

Arguments: $ARGUMENTS

Key Concepts

  • dotnet format does its own internal compilation — it does NOT depend on cached build output
  • CA*/SA* rules (analyzers) run during build if EnableNETAnalyzers is true

Command Reference

TaskCommand
Fix specific style diagnosticdotnet format style --diagnostics IDE0005 --severity warn
Fix specific analyzer diagnosticdotnet format analyzers --diagnostics CA1305 --severity warn
Fix all style issuesdotnet format style --severity warn
Fix all analyzer issuesdotnet format analyzers --severity warn
Fix everythingdotnet format --severity warn
Verify only (CI)dotnet format --verify-no-changes --severity warn
List violations without fixingdotnet format style --verify-no-changes --severity warn -v diag
Scope to folderdotnet format style --diagnostics IDE0005 --include src/MyProject/

Common Diagnostics

Style (IDE*) — use dotnet format style
IDDescription
IDE0005Unnecessary using directive
IDE0055Fix formatting
IDE0090Simplify new expression
IDE0161File-scoped namespace
IDE0251Make member readonly
Analyzers (CA*) — use dotnet format analyzers
IDDescription
CA1305Specify IFormatProvider
CA1822Mark members as static
CA1859Use concrete types for performance
CA2000Dispose objects before losing scope

Workflow

IMPORTANT: Always start in verify/list mode. NEVER auto-fix without explicit user confirmation.

Step 1: List violations (default)

Always start by showing what would change — never fix automatically. Use --report "$TEMP/dotnet-format" to get structured JSON, then process with jq.

bash
# 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:

bash
# 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"
Step 2: Report findings to user

Summarize the violations found using the JSON report and ask the user if they want to apply fixes.

Step 3: Apply fixes (only after user confirms)
bash
dotnet format style --diagnostics IDE0005 --severity warn

Or for analyzer rules:

bash
dotnet format analyzers --diagnostics CA1305 --severity warn
Step 4: Verify build still passes
bash
dotnet build -p:WarningLevel=0 /clp:ErrorsOnly

HTML Dashboard Report (--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.

Show full SKILL.md (288 more words)Show less
Usage

Default mode uses dotnet format (fast, fixable diagnostics only):

bash
# 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):

bash
# 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
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
Mode comparison
Aspectdefault (dotnet format)--sarif (Roslyn ErrorLog)
SpeedFast (~10s)Slow (full rebuild, ~1–2 min)
CoverageFixable 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 effectsNoneForces full rebuild; writes per-project _analyzer-diag.sarif
When to use which
  • Default (no flag) — quick triage of fixable issues; iterating on 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.
What it does

Default mode:

  1. Runs dotnet format style --verify-no-changes --severity warn --report <tmpdir>
  2. Runs dotnet format analyzers --verify-no-changes --severity warn --report <tmpdir>
  3. Transforms format-report.json via jq into violation summaries and file-level details
  4. Injects data into scripts/template.html, writes output HTML

--sarif mode:

  1. Cleans prior _analyzer-diag.sarif files
  2. Runs dotnet build <project> -t:Rebuild -p:ErrorLog=_analyzer-diag.sarif%2cversion=2.1
  3. Globs all per-project SARIF, drops source-suppressed and level∉{warning,error} results, dedupes by (ruleId, uri, line, col) (collapses multi-target duplicates)
  4. Routes IDE* into the style bucket, everything else into analyzer bucket, injects into template.html

© NikiforovAll, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in plugins/handbook-dotnet/skills/dotnet-analyzers of NikiforovAll/claude-code-rules.

  • SKILL.md
  • scripts/generate-report.sh
  • scripts/template.html

Open the folder on GitHubat commit 281c063

Compare with similar skills

Dotnet Analyzers next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dotnet Analyzers compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dotnet Analyzers this skillNikiforovAll/claude-code-rules141—~1.9kAutomated safety check: PassApache-2.0
Minimax DOCXpoco-ai/poco-claw1.4k7 repos~3.9kAutomated safety check: PassMIT
Microsoft Skill CreatorMicrosoftDocs/mcp1.9k3 repos~2.1kAutomated safety check: PassCC-BY-4.0
Speckit ConstitutionWeihanLi/WeihanLi.Common24211 repos~2.1kAutomated safety check: PassApache-2.0
Copilot Session Failure Analysisdotnet/maui23k—~3.4kAutomated safety check: PassMIT
Update .NET OS Packagesdotnet/core22k—~2.3kAutomated safety check: PassMIT

Similar skills

  • Minimax DOCX

    poco-ai/poco-claw

    Professional DOCX document creation, editing, and formatting using OpenXML SDK (.NET).

    1.4k GitHub starsUsed in 7 repos~3.9k tokens
    Documents & OfficeAuto-check passed
  • Microsoft Skill Creator

    MicrosoftDocs/mcp

    Official

    Create agent skills for Microsoft technologies using official documentation.

    1.9k GitHub starsUsed in 3 repos~2.1k tokens
    Agent WorkflowsAuto-check passed
  • Speckit Constitution

    WeihanLi/WeihanLi.Common

    Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.

    242 GitHub starsUsed in 11 repos~2.1k tokens
    DevelopmentAuto-check passed
  • Mines local Copilot CLI session logs for dotnet/maui to rank costly or failing runs, tag recurring failure modes, propose repo edits and emit guard evals.

    23k GitHub stars~3.4k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Official

    Audits and updates os-packages.json files listing the Linux packages each .NET release needs per distro, then regenerates the Markdown from the JSON.

    22k GitHub stars~2.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Microsoft Code Reference

    MicrosoftDocs/mcp

    Official

    Find working code samples, verify API signatures, and fix Microsoft SDK errors using official docs.

    1.9k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed

More from NikiforovAll/claude-code-rules

All 26 skills in this repo
  • Reflect Solution

    NikiforovAll/claude-code-rules

    Summarize WHAT WAS SHIPPED in a Claude Code session as a self-contained HTML slide deck — the elevator pitch (problem, solution, decisions, artifacts, verification, gaps), not a play-by-play of tool…

    141 GitHub stars~3.8k tokensUpdated 7 days ago
    Auto-check passed
  • Ilspy Decompile

    NikiforovAll/claude-code-rules

    Understand implementation details of .NET code by decompiling assemblies.

    141 GitHub starsUsed in 2 repos~760 tokens
    Auto-check passed
  • Reflect Tree

    NikiforovAll/claude-code-rules

    Visualize a Claude Code session as a quest/skill tree — a navigable SVG graph where nodes are turns and edges show flow, with distinct visual encoding for normal flow, dead-ends, corrections…

    141 GitHub stars~2.8k tokensUpdated 7 days ago
    Auto-check passed
  • Structured Plan Mode

    NikiforovAll/claude-code-rules

    This skill should be used when planning and tracking complex feature implementations that require systematic task decomposition.

    141 GitHub stars~4.2k tokensUpdated 7 days ago
    Auto-check passed
  • Glab

    NikiforovAll/claude-code-rules

    Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line.

    141 GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed
  • Version Bump

    NikiforovAll/claude-code-rules

    This skill automates version bumping during the release process for the Claude Code Handbook monorepo.

    141 GitHub stars~858 tokensUpdated 7 days ago
    Auto-check passed

Works with

Questions about Dotnet Analyzers

What does Dotnet Analyzers do?

Run dotnet format to fix code style and analyzer diagnostics (IDE0005, CA, SA). Dotnet Analyzers is an agent skill from NikiforovAll/claude-code-rules. Run dotnet format to fix code style and analyzer diagnostics (IDE0005, CA, SA).

When should I use Dotnet Analyzers?

Dotnet Analyzers fits situations like: fixing unnecessary usings; code style violations; analyzer warnings; verifying format compliance.

How do I install Dotnet Analyzers in Claude Code?

Run `npx skills add NikiforovAll/claude-code-rules --skill dotnet-analyzers -a claude-code`. Or copy the skill folder (plugins/handbook-dotnet/skills/dotnet-analyzers in NikiforovAll/claude-code-rules) into .claude/skills/dotnet-analyzers in your project. Claude Code loads it when a task matches its description.

How do I install Dotnet Analyzers in Codex?

Run `npx skills add NikiforovAll/claude-code-rules --skill dotnet-analyzers -a codex`. Or copy the skill folder (plugins/handbook-dotnet/skills/dotnet-analyzers in NikiforovAll/claude-code-rules) into .agents/skills/dotnet-analyzers in your project. Codex loads it when a task matches its description.

Can I use Dotnet Analyzers in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add NikiforovAll/claude-code-rules --skill dotnet-analyzers -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dotnet-analyzers, .gemini/skills/dotnet-analyzers, .github/skills/dotnet-analyzers and .opencode/skills/dotnet-analyzers in your project.

What does Dotnet Analyzers need to run?

Going by SKILL.md and its folder, Dotnet Analyzers needs a shell for the scripts in its folder and the command-line tools its instructions call (dotnet, bash and jq). Our summary lists: A Bash shell. Its frontmatter pre-approves these tools: Bash(dotnet format *), Bash(dotnet clean *), Bash(jq *), Bash(bash *generate-report*), Read, Grep, Glob.

Does Dotnet Analyzers access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Dotnet Analyzers safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Dotnet Analyzers use?

Dotnet Analyzers is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dotnet Analyzers use?

About 1.9k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dotnet Analyzers?

Skills that share tags, products or a category with Dotnet Analyzers: Minimax DOCX (poco-ai/poco-claw, 1.4k stars), Microsoft Skill Creator (MicrosoftDocs/mcp, 1.9k stars), Speckit Constitution (WeihanLi/WeihanLi.Common, 242 stars) and Copilot Session Failure Analysis (dotnet/maui, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dotnet Analyzers?

NikiforovAll (a GitHub user) maintains it in NikiforovAll/claude-code-rules, which has 141 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 2, 2026.

Source: NikiforovAll/claude-code-rules on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.