
Description
csharp-refactoring is an agent skill for C# and .NET code that changes the structure of a program without changing what it does. It covers renaming, moving, extracting, inlining, merging, consolidating and deduplicating code. Before any edit, the agent is asked to classify each requested operation: purely structural steps go ahead, while anything that would change behavior or a public contract is deferred. Once the edit is made, the skill has the agent confirm that behavior held, using a build and the relevant tests. The checks scale with the change, so a one-line local rename gets a light touch and a public, multi-targeted change gets the full process. It is for developers who use an AI coding agent on .NET projects and want refactors that stay safe.…
Highlights
- Renames, moves, extracts, inlines and merges C# code
- Classifies each request before editing so behavior changes are held back
- Confirms behavior with a build and the relevant tests
- Scales the checks to the size of the change
Ratings & Reviews
No ratings yet
Be the first to rate csharp-refactoring.
People also visit
csharp-refactoring FAQ
What does this skill do?
It guides an AI coding agent through behavior-preserving refactoring of C# and .NET code. It handles renaming, moving, extracting, inlining, merging, consolidating and deduplicating, then checks that the code still builds and the tests still pass.
Can it change how my code behaves?
The goal is no change in behavior. If a request mixes structural work with behavior or contract changes, the skill completes the structural part and defers the rest. If the two cannot be separated, it stops and says why.
Is a small rename handled differently from a large change?
Yes. The skill says a one-line local rename needs far less ceremony than a public, multi-targeted change, so the effort stays proportional to the edit.
How do I install it?
Run npx skills add https://github.com/dotnet/skills --skill csharp-refactoring in your project, then ask your agent to refactor C# code.
What security audits has it passed?
Gen Agent Trust Hub: Pass. Socket: Pass. Snyk: Pass.
What are the best csharp-refactoring alternatives?
Popular alternatives to csharp-refactoring include refactoring-patterns, safe-refactor and agent-lsp. See all csharp-refactoring alternatives















