dotnet-format
Skill2 starsChanged 18 days agoMITView on GitHub
Run dotnet format (whitespace + style + analyzers) and region layout checks on C# files changed on the current branch and optionally auto-fix violations. Use it when asked to format or style-check C# changes before a commit or pull request.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Postpartum-genushyacinthus29/dotnet-skillstheir own version, first seen Mar 16, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Postpartum-genushyacinthus29/dotnet-skills★ 13same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- audit-repositorySkill
- change-skillSkill
- evaluate-skillSkill
- implement-changeSkill
- review-repositorySkill
- runtime-canarySkill
- shepherd-pull-requestsSkill
- audit-repositorySkill
- change-skillSkill
- evaluate-skillSkill
- implement-changeSkill
- review-repositorySkill
- runtime-canarySkill
- shepherd-pull-requestsSkill
- audit-ai-configSkill
- audit-skillSkill
- curate-agent-memorySkill
- dotnet-dependenciesSkill
- ejryan89-code-review-coreSkill
- ejryan89-skill-coreSkill
- flag-review-findingSkill
- github-activity-reportSkill
- repo-cleanupSkill
- review-documentSkill
- review-insightsSkill
- review-prsSkill
- update-coding-agent-skillsSkill
- update-pr-dashboardSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Check: Run both commands from step 1's values, giving the formatter run a 600000 ms timeout:
- Distinctive: line 42
Do not stage or commit fixed files.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Check the C# files changed on the current branch with the .NET SDK's dotnet format, or the dotnet-format global tool for a .sln holding a project that is not SDK-style (whitespace, code-style, and analyzer rules the repository configures), and with this skill's region layout checker, then offer to fix what they find. Every step is one script command, run exactly as shown. Each prints one tab-separated fact per line. Do not read the changed files, count braces, or edit source files yourself: the tools find and fix every violation. Act on the printed lines, not the exit code: a command that reports findings also exits 1. Report each REFUSED <path> <reason> line: the script left that path, outside the repository, behind a link, or read-only, unread or unwritten. A last line FAILED <reason> means stop: Read the end of the LOG file, when one was printed, and report the reason, the cause the log shows, and its path.
Steps
Resolve the targets from the directory the user invoked the skill in:
{{PYTHON}} -B "${CLAUDE_SKILL_DIR}/scripts/dotnet_format_targets.py" resolveSTOP <reason>means there is nothing to format: report the reason and stop. Report aFETCH_FAILED <reason>line (the base is origin as last fetched, so it may be stale) and go on. Report eachSKIPPED_ASPNET <file> <project>line (the solution is formatted with the global tool, which the skill does not run on ASP.NET projects) and eachOUTSIDE_SOLUTION <file>line (no project of the chosen solution owns it); the formatter skips both, and only the layout checker sees them. Keep the path from theREPO_ROOT <path>line, the solution from theSOLUTION <solution> <score>line (the score counts the changed files its projects own and is not passed on), and the path from theFILE_LIST <path>line as<REPO_ROOT>,<SOLUTION>, and<FILE_LIST>in the next steps.Check the layout analyzer configuration:
{{PYTHON}} -B "${CLAUDE_SKILL_DIR}/scripts/csharp_layout.py" config --repo-root "<REPO_ROOT>" --solution "<SOLUTION>" --file-list "<FILE_LIST>"The command evaluates each project that owns a changed file with MSBuild (
dotnet msbuild -getItem), which follows the project's imports and may resolve its SDK, as step 3's formatter does when it loads the solution, so it runs nothing adotnet formatof the same solution would not. Each setting is judged as the changed files see it, so path-specific sections and.globalconfigvalues count. If anySETTINGline saysmissing, list those settings and callAskUserQuestionwith Add settings / Skip. On Add settings, rerun the command with--applyand report itsADDEDlines, and eachUNREADABLE <.editorconfig> <reason>line, an.editorconfigit added nothing to, so its settings are still missing; it adds the missing settings as the first section of the outermost.editorconfig, so every existing section still overrides them. ASETTINGstate ofother:<value>is the repository's own choice: report it, never change it. IfPACKAGE Roslynator.Formatting.Analyzers missing, tell the user theRCS*layout rules run only once the solution references that NuGet package (for example aPackageReferencewithPrivateAssets="all"inDirectory.Build.props, followed by a restore or build, since the formatter runs with--no-restore). IfPACKAGE Roslynator.Formatting.Analyzers unknown <reason>, report the reason: whether theRCS*rules run could not be told. Never add the package yourself.Check. Run both commands from step 1's values, giving the formatter run a 600000 ms timeout:
{{PYTHON}} -B "${CLAUDE_SKILL_DIR}/scripts/run_dotnet_format.py" check --repo-root "<REPO_ROOT>" --solution "<SOLUTION>" --include-file "<FILE_LIST>" {{PYTHON}} -B "${CLAUDE_SKILL_DIR}/scripts/csharp_layout.py" check --repo-root "<REPO_ROOT>" --file-list "<FILE_LIST>"Each prints
DIAGNOSTICorVIOLATIONlines and aSUMMARY <count> <files> <rules>line; the formatter also printsLOG <path>with its full output when it ran. Report eachUNREADABLE <file> <reason>line: the layout checker left that file unchecked and unfixed.- If both summaries count 0 and neither command printed a
REFUSEDorUNREADABLEline, report "no formatting issues found on changed files" and stop. When both count 0 but a line wasREFUSEDorUNREADABLE, report that no issues were found in the files checked, name the files left unchecked, and stop. Otherwise report the counts, files, and distinct rules, and callAskUserQuestionwith Fix / Skip.region-scopeviolations are report-only: tell the user which#endregionto move into the scope where its#regionopened. - If Fix, run the step 3 formatter command with
fixin place ofcheck(same timeout) and the layout command with--fixadded, then rerun both step 3 commands once to re-verify. If the formatter's fix endsFAILED, report itsSAVED <file>lines (fixes already in the working tree) and itsUNFINISHED <file>lines (fixes not saved) with the reason, and stop. If the layout fix endsFAILED, report itsFIXEDlines before that line (fixes already in the working tree), the reason, and that the files after them are unfixed, and stop. Report what remains, with theLOGpath if the formatter still reports diagnostics; do not loop.
Important
- Do not stage or commit fixed files; leave them in the working tree for the developer to review.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

