Split C# files into one type per file across a whole repo. Fixes StyleCop SA1402 where dotnet format can't. Agent-friendly .NET CLI.
FAQ (answers come from our records)
How do I install it?
We did not find an install command for this repository (our install coverage is only about 4%). Check its README or releases page.
Who is it for?
We filed it under these tags: 开源项目. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository rjmurillo/agentic-roslyn-tool;first catalogued 2026-10-12;last seen 2026-10-12。There is no official certification or quality rating here — we record sources and dates only.
AgenticRoslynTool
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
AgenticRoslynTool splits C# files into one class per file across a whole repository, so you can fix StyleCop SA1402 without ReSharper or Visual Studio. Its split-types command gives each top-level type (class, struct, record, interface, enum, delegate) its own file.
It is not an MCP server. For when to use a Roslyn MCP server instead, see docs/roslyn-mcp-vs-cli.md.
Why this exists
dotnet format cannot fix SA1402 across a repository. SA1402CodeFixProvider does not implement Fix All. As a result, this command succeeds without changing files:
Production testing confirmed this behavior before development started. This tool provides the missing repository-wide operation.
Full walkthrough: docs/fix-sa1402-whole-repo.md.
Install
The tool ships as a .NET tool package on NuGet and needs the .NET 10 SDK.
Run it once without installing:
The -- matters. Without it, dnx reads options such as --help as its own.
Install it globally:
Install it into a repository so every contributor gets the same version:
The examples below use agentic-roslyn-tool. Substitute dnx AgenticRoslynTool --
or dotnet agentic-roslyn-tool if you picked one of the other two.
Build from source
Usage
Start with --dry-run. Without --phase or --dry-run, the tool runs the content
phase, which rewrites files. Run plan, then renames, then content, as
docs/fix-sa1402-whole-repo.md walks through.
split-types requires --input, which identifies the C# files to process. It accepts a
directory to scan, a single .cs file, a CSV with a file column, a text file with one
path per line, or - to read paths from standard input.
Use these options to control the operation:
| Option | Purpose |
| --- | --- |
| --phase plan\|renames\|content | Selects a phase. Defaults to content, which rewrites files. |
| --dry-run | Runs the plan phase without changing source files. |
| --input | Supplies the required file list. |
| --repo-root | Sets the repository root. |
| --manifest | Sets the CSV manifest path. |
| --json | Prints one JSON report to standard output instead of CSV. |
| --require-header | Prepends to every emitted file and fails the split if any output does not start with it. Off by default. |
| --exclude | Skips any input whose path contains . Repeatable. Off by default. |
Driving it from an agent
Point it at a tree and read the JSON. Nothing has to be written to disk first:
Discovery walks the directory for .cs files and skips bin and obj, because a build
owns those and recreates them. Piping works too, so a git diff or a ripgrep result can
feed the tool directly:
Standard output carries a parseable document or nothing: the manifest CSV in plan, the
JSON report under --json, and nothing at all in renames and content without --json.
The manifest path, the one-line summary, and every error go to standard error, so a pipe
stays clean. The JSON report leads with counts:
Exit codes are distinct so a caller can branch without parsing anything:
| Code | Meaning |
| --- | --- |
| 0 | The run completed and nothing failed. A run that skips every file also exits 0, so read summary to learn whether work happened. |
| 1 | The run completed and at least one file failed. |
| 2 | The command line was wrong. |
| 3 | The run could not start or could not finish, for example a missing input file. |
Errors print as a single error: line on standard error. No error path prints a
stack trace. --version prints the package version and exits 0.
Use --exclude for directories a generator owns, so the tool records them as skipped
instead of rewriting output that will be regenerated anyway. Matching is case insensitive
and separator agnostic, so one pattern works on Windows and Linux:
Use --require-header when your repository mandates a file header, for example a
license or copyright line. Pass the exact text of the first header line:
The header is normalized to the newline style of each source file, so you can pass it with