Dotnet-skills dotnet-stylecop-analyzers
Use the open-source free `StyleCop.Analyzers` package for naming, layout, documentation, and style rules in .NET projects. Use when a repo wants stricter style conventions than the SDK analyzers alone provide.
install
source · Clone the upstream repo
git clone https://github.com/managedcode/dotnet-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/managedcode/dotnet-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/catalog/Tools/StyleCop-Analyzers/skills/dotnet-stylecop-analyzers" ~/.claude/skills/managedcode-dotnet-skills-dotnet-stylecop-analyzers && rm -rf "$T"
manifest:
catalog/Tools/StyleCop-Analyzers/skills/dotnet-stylecop-analyzers/SKILL.mdsource content
StyleCop Analyzers
Trigger On
- the repo wants
StyleCop.Analyzers - naming, layout, or documentation style needs stronger enforcement
- the team needs
guidancestylecop.json
Value
- produce a concrete project delta: code, docs, config, tests, CI, or review artifact
- reduce ambiguity through explicit planning, verification, and final validation skills
- leave reusable project context so future tasks are faster and safer
Do Not Use For
- repos that intentionally rely only on SDK analyzers
- repos where
overlaps too heavily with an existing style package and no consolidation is plannedStyleCop
Inputs
- the nearest
AGENTS.md - current
.editorconfig - any existing
stylecop.json
Quick Start
- Read the nearest
and confirm scope and constraints.AGENTS.md - Run this skill's
through theWorkflow
until outcomes are acceptable.Ralph Loop - Return the
with concrete artifacts and verification evidence.Required Result Format
Workflow
- Add
only if the repo wants its opinionated style rules.StyleCop.Analyzers - Keep severity in the root
..editorconfig - Use
only for StyleCop-specific behavioral options.stylecop.json - Prefer one checked-in
per repo unless a project genuinely needs its own behavior.stylecop.json - Avoid rule duplication with SDK analyzers or other analyzer packs when possible.
Bootstrap When Missing
If
StyleCop.Analyzers is not configured yet:
- Detect current state:
rg -n "StyleCop\\.Analyzers|stylecop\\.json" -g '*.csproj' -g 'stylecop.json' .
- Add package to the intended scope:
dotnet add PROJECT.csproj package StyleCop.Analyzers
- Keep severity in root
and use.editorconfig
only for StyleCop-specific behavior.stylecop.json - Prevent overlap with existing analyzer packs by defining ownership.
- Run
and returndotnet build SOLUTION_OR_PROJECT
orstatus: configured
.status: improved - If the repo intentionally uses SDK analyzers only, return
.status: not_applicable
Deliver
- explicit StyleCop package setup
- repo-owned StyleCop rule configuration
- clear split between root
and.editorconfigstylecop.json
Validate
- StyleCop severity is versioned in repo config
is used only where it adds valuestylecop.json
Ralph Loop
Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work.
- Plan first (mandatory):
- analyze current state
- define target outcome, constraints, and risks
- write a detailed execution plan
- list final validation skills to run at the end, with order and reason
- Execute one planned step and produce a concrete delta.
- Review the result and capture findings with actionable next fixes.
- Apply fixes in small batches and rerun the relevant checks or review steps.
- Update the plan after each iteration.
- Repeat until outcomes are acceptable or only explicit exceptions remain.
- If a dependency is missing, bootstrap it or return
with explicit reason and fallback path.status: not_applicable
Required Result Format
:status
|complete
|clean
|improved
|configured
|not_applicableblocked
: concise plan and current iteration stepplan
: concrete changes madeactions_taken
: final skills run, or skipped with reasonsvalidation_skills
: commands, checks, or review evidence summaryverification
: top unresolved items orremainingnone
For setup-only requests with no execution, return
status: configured and exact next commands.
Load References
references/stylecop-analyzers.mdreferences/rules.mdreferences/config.md
Example Requests
- "Add
to this solution."StyleCop.Analyzers - "Configure StyleCop without losing
ownership.".editorconfig