dotnet-refactor

Identify code smells, coupling hotspots, and test gaps in .NET codebases.

Updated Sep 13, 2025
One-click install
npx skills add https://github.com/nobelk/claude-tools --skill dotnet-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-refactor
Source: https://github.com/nobelk/claude-tools/tree/main/skills/dotnet-refactor
Command: npx skills add https://github.com/nobelk/claude-tools --skill dotnet-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Principal-level C#/.NET codebase refactoring skill. Use when the user asks to refactor, restructure, clean up, or improve the quality of a C# or .NET codebase. Triggers include: requests to implement design patterns, decouple tightly coupled code, improve logging, apply clean code or SOLID principles, improve maintainability, reduce technical debt, or modernize legacy .NET code. Also use when asked to generate a refactoring plan, identify code smells, or prepare a codebase for scaling. Covers unit test strategy for regression safety before and after refactoring.

Core Features & Use Cases

  • Systematic discovery of code smells, dependencies, and coupling hotspots
  • Baseline test safety net with characterization tests for critical paths
  • Phased refactoring plan with independent, deployable phases
  • Stepwise execution focusing on one concern per commit
  • SOLID principles and design-pattern guidance for long-term maintainability
  • Verification, rollback strategies, and post-refactor validation

Quick Start

Provide the codebase context and the refactor goal, and I will generate a phased refactoring plan.

Frequently Asked Questions about dotnet-refactor

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

FAQPage Schema
How do I plan a phased refactoring of a legacy .NET codebase?

To plan a phased .NET refactoring, you must identify code smells and coupling hotspots, establish a baseline test safety net, and generate a deployable plan focusing on one concern per commit with rollback strategies for each phase.

What is the best way to decouple tightly coupled C# code?

The best way to decouple tightly coupled C# code involves applying SOLID principles and design-pattern guidance to systematically reduce technical debt while maintaining regression safety through characterization tests for critical paths.

Do I need existing unit tests before refactoring a C# project?

Yes, you need a baseline of existing unit tests before refactoring a C# project to ensure regression safety, alongside a plan for characterization tests to verify critical paths before and after structural changes.

How do I identify code smells and coupling hotspots in a .NET application?

Identifying code smells and coupling hotspots in a .NET application requires systematic discovery of dependencies and architectural flaws, checking SOLID adherence, logging gaps, and test coverage to inform a structured refactoring plan.

Can I apply SOLID principles to modernize legacy .NET code safely?

You can apply SOLID principles to modernize legacy .NET code safely by executing stepwise refactoring phases that are independently deployable, utilizing verification, rollback strategies, and post-refactor validation to prevent regressions.

Why does my .NET refactoring plan need rollback strategies for each phase?

A .NET refactoring plan needs rollback strategies for each phase to ensure that independently deployable changes can be safely reverted if post-refactor validation or characterization tests detect critical regression failures.