agentic-readiness
Audit and improve repositories for reliable agentic work across Codex and Codex App, Claude Code, and OpenCode. Use when…
Rename and refactor C# symbols in a .NET solution or multi-solution monorepo with a one-shot Roslyn CLI. Use when the user asks to rename a symbol, preview impact, update references across a solution, or refactor shared projects across several solutions.
$ npx -y skills add CodeAlive-AI/ai-driven-development --skill refactoring-csharp --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/refactoring-csharpContext preview
The summary Claude sees to decide when to auto-load this skill.
Rename and refactor C# symbols in a .NET solution or multi-solution monorepo with a one-shot Roslyn CLI. Use when the user asks to rename a symbol, preview impact, update references across a solution, or refactor shared projects across several solutions.
name: refactoring-csharp description: Rename and refactor C# symbols in a .NET solution or multi-solution monorepo with a one-shot Roslyn CLI. Use when the user asks to rename a symbol, preview impact, update references across a solution, or refactor shared projects across several solutions.
This skill ships a Roslyn-based C# rename CLI in `src/`. It is intentionally one-shot and stateless: one call resolves the target, validates the request, and returns either a preview or an applied rename. There is no public prepare step.
If the skill was installed by `install.sh`, prefer the prebuilt CLI:
bin/csharp-refactor rename-symbol <sln|slnx|directory> <file> <line> <oldName> <newName> [dryRun=false|true]
Otherwise run the bundled source CLI from the skill directory:
dotnet run --project src/CSharpRefactoring.Cli -- rename-symbol <sln|slnx|directory> <file> <line> <oldName> <newName> [dryRun=false|true]
When invoked from outside the skill directory, use an absolute project path:
/<skill-dir>/bin/csharp-refactor rename-symbol <sln|slnx|directory> <file> <line> <oldName> <newName> [dryRun=false|true] # or, if no prebuilt binary is installed: dotnet run --project /path/to/refactoring-csharp/src/CSharpRefactoring.Cli -- rename-symbol <sln|slnx|directory> <file> <line> <oldName> <newName> [dryRun=false|true]
The tool project may create normal `bin/` and `obj/` directories under the skill. That is expected and useful: it lets repeated runs reuse the .NET build cache instead of rebuilding the CLI from scratch.
The target solution is not redirected to a temporary build output. The CLI opens the solution from the solution directory and lets Roslyn/MSBuild use the target project's normal build cache (`obj/`, `bin/`, or the repository's configured artifacts layout). This is intentional: it avoids creating a second cache tree for the project being refactored and lets repeated renames benefit from the project's existing MSBuild/Roslyn design-time build cache.
| Field | Required | Default | Notes | | --- | --- | --- | --- | | `solution_path` | yes | - | Absolute path to the `.sln`/`.slnx` file, or a repository directory for monorepo-wide refactoring. | | `file_path` | yes | - | Absolute path to a file inside the solution. | | `line_number` | yes | - | 1-based line number. Use the value reported by `rg -n`. | | `old_name` | yes | - | Exact current identifier on that line. This is the anchor. | | `new_name` | yes | - | Must be a valid C# identifier. | | `dry_run` | no | `false` | Apply changes by default. Preview only when explicitly set to `true`. | | `rename_overloads` | no | `false` | Keep overloads unchanged by default. | | `rename_in_strings` | no | `false` | String literals stay untouched by default. | | `rename_in_comments` | no | `true` | Comments are renamed by default. | | `rename_file` | no | `true` | Safe file move for supported named types. Never recreate the file as delete+add. |
1. Use `rg -n` to locate the symbol and copy the 1-based line number directly. 2. Call `rename-symbol` once without the `dryRun` argument for normal rename requests. This applies the rename. 3. Use `dryRun=true` only when the user explicitly asks for preview, when the target is ambiguous, or when the rename is unusually broad/risky and applying immediately would be irresponsible. The CLI also accepts `true`, `--dry-run`, `dryRun=false`, `false`, and `--no-dry-run`; invalid values fail fast and must never silently apply. 4. Do not run a dry run just because the tool supports it. The tool loads the solution on every call, so preview+apply doubles the cost on large projects. 5. Summarize the result by reporting the original name, new name, changed document count, total text changes, changed files, and any file move.
Use directory mode only when a repository contains multiple `.sln`/`.slnx` files or shared projects that are not all present in one normal solution. For ordinary repositories, pass the specific solution file because it is faster and avoids scanning unrelated projects.
When `solution_path` is a directory:
Practices, protocols, and skills for AI-driven software development. Skills and safety hooks for Claude Code, Codex, OpenCode, Cursor, Antigravity, and any agent supporting the Agent Skills standard.
Audit and improve repositories for reliable agentic work across Codex and Codex App, Claude Code, and OpenCode. Use when…
8-step disciplined bug-fix protocol that treats every production bug as two failures — the code defect itself and the testing…
Copy text to clipboard with optional rich formatting. Triggers on "copy to clipboard", "copy that", "pbcopy", "copy formatted",…
Software-engineering heuristics based on Mark Seemann's Code That Fits in Your Head (2021), updated for agent-driven development.…
Fetch a web page (URL) and return clean Markdown via local trafilatura, with Exa MCP as a fallback for JS-rendered or anti-bot…
Use First Principles Framework (FPF) to decompose problems, architect systems, evaluate alternatives, define quality, qualify and…