refactoring-csharp

Rename C# symbols across .NET solutions using file path, line, and identifier.

119|10|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/CodeAlive-AI/ai-driven-development --skill refactoring-csharp
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: refactoring-csharp
Source: https://github.com/CodeAlive-AI/ai-driven-development/tree/main/skills/refactoring-csharp
Command: npx skills add https://github.com/CodeAlive-AI/ai-driven-development --skill refactoring-csharp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the problem of safely and consistently renaming C# symbols across large .NET solutions without missing references or manually applying error-prone edits.

Core Features & Use Cases

  • Roslyn-based symbol rename: Renames a target C# symbol (e.g., method, property, field, type, namespace) using file path + 1-based line number + the current identifier name to avoid ambiguity.
  • Solution-wide update: Updates all impacted documents in the loaded solution so usages stay consistent after the rename.
  • Multi-solution monorepo directory mode: When given a repository directory, merges discovered solutions/projects into a temporary aggregate and then performs the rename across shared code, optionally including a safe file move for named type declarations.

Quick Start

Ask your agent to run refactoring-csharp to rename the symbol at a specific file and line by calling: rename-symbol <sln|slnx|directory> <file> <line> <oldName> <newName> dryRun=false

Frequently Asked Questions about refactoring-csharp

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

FAQPage Schema
How do I rename a C# symbol across an entire .NET solution without missing references?▼

To rename a C# symbol across a .NET solution, you specify the target file path, 1-based line number, and old identifier name, allowing Roslyn to accurately locate and update all usages solution-wide.

Can I rename symbols across multiple solutions in a monorepo directory?▼

Yes, renaming symbols in a monorepo works by pointing to a repository directory, which merges discovered solutions and projects into a temporary aggregate to update shared code consistently.

What types of C# symbols can I rename using Roslyn?▼

Supported C# symbol kinds include methods, properties, fields, types, namespaces, parameters, locals, and type parameters, ensuring comprehensive refactoring coverage for your .NET codebase.

How do I preview C# refactoring changes before applying them to my solution?▼

You can generate a dry-run preview of the symbol rename by setting the dryRun parameter to true, which reports the expected change counts and file move details without modifying files.

Does renaming a C# type also rename the file it is declared in?▼

Yes, when renaming named type declarations, the refactoring optionally plans safe file renames and moves, reporting the updated file move details alongside the solution-wide change counts.

What's the best way to avoid ambiguity when renaming a method in a large C# codebase?▼

To avoid ambiguity during a method rename, provide the exact file path, 1-based line number, and the current identifier name to precisely target the specific symbol instance.