refactoring-fix

Categorize and fix high-volume build errors and test failures after large refactors.

2|Updated Aug 2, 2026
One-click install
npx skills add https://github.com/Arasz/ai-raccoon --skill refactoring-fix-arasz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-fix
Source: https://github.com/Arasz/ai-raccoon/tree/main/.ai-badger/skills/learned/uncategorized/refactoring-fix
Command: npx skills add https://github.com/Arasz/ai-raccoon --skill refactoring-fix-arasz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Large refactors in C#/.NET and TypeScript/Angular projects often produce hundreds of build errors and test failures at once. Blindly applying global find-and-replace in this situation breaks contexts you haven't examined and causes cascading regressions. This Skill provides a disciplined triage workflow for safely working through high-volume post-refactor breakage. ## Core Features & Use Cases - Error categorization workflow: Group compiler errors by code and symbol (e.g., CS0117, CS1503, CS0246), hypothesize root causes per category, and present the analysis to the user before fixing anything. - Category-by-category fixing: Fix one error category at a time, verifying with dotnet build that counts drop by exactly the expected amount after each pass. - Pitfall library: 28+ documented C# pitfalls (record private init, nameof(T) on generics, JSON camelCase serialization, NSubstitute expression-tree limits, stale --no-build binaries) plus Angular/TypeScript pitfalls (vitest setup, package.json duplicate keys, SPA rewrites). - Use Case: After renaming a domain type across a .NET solution, you face 365 build errors. Use this Skill to group them into ~8 root-cause categories, confirm the plan with the user, then fix each category with verified incremental builds. ## Quick Start Ask the AI to triage and fix the build errors from your recent refactor using the refactoring-fix approach, starting with categorizing errors by code and symbol before making any changes.

Frequently Asked Questions about refactoring-fix

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

FAQPage Schema
How do I fix hundreds of build errors after a refactor?

Group errors by compiler code and symbol using grep/awk on the build output, hypothesize a root cause per category, and present the categories for review before fixing. Then fix one category at a time, verifying the error count drops by the expected amount after each pass.

Why is global find-and-replace dangerous after refactoring?

The same symbol often appears in different contexts — a property on a domain aggregate versus a DTO, or an object initializer versus property access. Global replacement breaks contexts you haven't examined, which is the leading cause of cascading regressions in high-volume triage.

Why do tests still fail after fixing source files with dotnet test?

Running `dotnet test --no-build` executes the previously compiled binary, so source fixes are not reflected. Remove `--no-build` or run `dotnet build` first to recompile before retesting.

Can I run vitest directly on Angular spec files?

No. Angular configures test globals and zone.js through `ng test`, so running `npx vitest run` directly fails with 'describe is not defined'. Always use the project's configured test command such as `npm run test:single`.

Why does dotnet build show fewer errors than expected after a rename?

The Roslyn compiler server can serve cached compilations, hiding stale errors even after clean rebuilds. Force a full recompile by adding a new probe file or running `dotnet test`, and cross-check the true blast radius by grepping the old symbol repo-wide.

When should I not use bulk replacement for refactoring fixes?

Avoid bulk replacement whenever a method signature changed to require new per-call-site arguments, or when the same symbol exists on both domain types and DTOs with different intended shapes. Each call site needs individual analysis in those cases.