refactor:dotnet

Refactor ASP.NET Core/C# projects into Clean Architecture with modern C# 12 features.

9|1|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/SnakeO/claude-debug-and-refactor-skills-plugin --skill refactor-dotnet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor:dotnet
Source: https://github.com/SnakeO/claude-debug-and-refactor-skills-plugin/tree/main/plugins/debug-and-refactor/skills/refactor-dotnet
Command: npx skills add https://github.com/SnakeO/claude-debug-and-refactor-skills-plugin --skill refactor-dotnet

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill refactors ASP.NET Core/C# projects to improve maintainability, readability, and alignment with modern .NET practices.

Core Features & Use Cases

  • Code reorganization: Extracts business logic from controllers into services, applies Clean Architecture, and enforces SRP.
  • Modern C# idioms: Introduces primary constructors, records, nullable reference types, and pattern matching for clearer code.
  • Use Case: Refactor a fat ASP.NET controller into thin controllers and focused services, improving testability and DI design.

Quick Start

Start by identifying a fat controller, extract the business logic into a service, and apply DI. Then build and run tests with dotnet test to verify behavior.

Frequently Asked Questions about refactor:dotnet

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor a fat ASP.NET Core controller to use Clean Architecture?

Refactoring fat ASP.NET Core controllers involves extracting business logic into dedicated services and applying Dependency Injection. This reorganization enforces the Single Responsibility Principle, producing thin controllers and focused services for better maintainability.

How do I propagate cancellation tokens through async/await in C#?

Propagating cancellation tokens through async/await in C# involves threading tokens down through service calls. This refactor enforces proper token propagation without changing external behavior.

What modern C# 12 features improve code readability and maintainability?

Modern C# 12 features like primary constructors and records improve code readability by reducing boilerplate. This refactoring process introduces these idioms alongside nullable reference types and pattern matching for clearer code.

Can I refactor ASP.NET Core background processes without changing external behavior?

Yes, you can refactor ASP.NET Core background processes without changing external behavior. This skill targets services and repositories across background tasks, enforcing clean patterns and enabling nullable annotations safely.

When do I need to apply SOLID principles and DI patterns in C#?

You need to apply SOLID principles and DI patterns in C# when controllers or services become bloated with mixed responsibilities. This refactoring approach extracts logic to enforce SRP and improves DI design.