К основному содержанию
скилл CX Codex

build-fix — скилл для Claude Code: что делает и как установить

Запускает автономный цикл починки сборки и тестов в проектах на .NET. Скилл разбирает ошибки компилятора, исправляет код и останавливается при регрессиях.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add codewithmukesh/dotnet-claude-kit --skill build-fix -a claude-code
Открыть на GitHub

Что делает build-fix

Скилл выполняет dotnet build, парсит коды ошибок и группирует их по первопричине. Правки вносятся короткими шагами. По умолчанию даётся не более пяти итераций, а жёсткий лимит равен десяти попыткам.

Для упавших тестов работает цикл с запуском dotnet test --no-build. Скилл не ослабляет проверки в ассертах ради зелёного статуса, а устраняет сбой в коде. Вспомогательные данные поступают из MCP-инструментов get_diagnostics и find_symbol.

Скилл мгновенно останавливает работу и зовёт человека, если видит повреждённый файл проекта или несовместимый .NET SDK.

Какие задачи решает

  • исправить ошибки компиляции после обновления пакетов NuGet
  • разобрать каскадные ошибки сборки после рефакторинга методов
  • довести проваленные тесты до успешного прогона без ослабления проверок
  • откатить правку при росте числа ошибок компилятора

Примеры запросов агенту

  • /build-fix
  • Почини сборку проекта и доведи тесты до зелёного статуса
  • Исправь ошибки компиляции после обновления зависимостей

Как установить build-fix

1Через Skills CLI (Vercel)

npx skills add codewithmukesh/dotnet-claude-kit --skill build-fix -a claude-code

2Вручную: положить файлы

~/.claude/skills/build-fix/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/build-fix/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о build-fix

Как установить build-fix в Claude Code?

Выполните команду npx skills add codewithmukesh/dotnet-claude-kit --skill build-fix -a claude-code в терминале.

Что делает скилл build-fix?

Он циклично вызывает dotnet build или dotnet test, группирует ошибки по кодам и последовательно исправляет исходники до успешной сборки.

Сколько итераций делает build-fix перед остановкой?

Стандартный лимит составляет пять итераций, а предельный — десять. Цикл прерывается сразу, если правка вызвала рост числа ошибок компилятора.

Исходный текст

SKILL.md · MIT
---
name: build-fix
description: >
  Autonomous iteration loops for .NET: drive a broken build or failing test
  suite to green with bounded iterations, progress detection, and fail-safe
  guards that prevent infinite retries and wasted tokens. The build-fix loop
  (dotnet build, parse, categorize, fix, rebuild) is the primary flow; the
  test-fix loop is a first-class variant. Invoke when the build is broken,
  after a major refactor or dependency update, or when the user says "fix the
  build", "build is broken", "make it compile", "make the tests pass", "fix
  failing tests", "keep going until it works", "autonomous", "loop",
  "auto-fix", or "keep fixing".
---

# /build-fix

## What

The kit's autonomous iteration-loop skill. It drives a broken `dotnet build`
(or failing `dotnet test`) to green by looping: run, parse failures,
categorize by root cause, apply targeted fixes, re-run. It repeats until
green or a guard fires — the same way an experienced developer works through
a wall of red, but with hard limits that stop it from thrashing.

This is not a single-pass fix. It handles cascading errors where fixing one
issue reveals the next.

## When

- The build is broken and there are multiple compiler errors
- Tests are failing after code changes or a build-fix pass
- After a major refactor that touched type names, namespaces, or signatures
- After updating NuGet packages (especially major version bumps)
- After merging a branch with conflicts resolved but not compiled
- After scaffolding or code generation that needs manual adjustments
- User says: "fix the build", "make it compile", "make the tests pass",
  "keep going until it works", "keep fixing"

## How

### Loop Discipline (applies to every loop)

1. **Bounded iteration, always** — Default max 5 iterations, hard cap 10
   (user "keep going" extends by 3, never past 10). If 5 iterations cannot
   solve it, the problem needs human judgment, not a 6th identical attempt.
2. **Progress or exit** — Each iteration must reduce the error/failure count.
   Same errors after a fix attempt = STUCK: stop, report, and re-plan with a
   different approach. Never retry the same fix that already failed.
3. **Categorize before fixing** — Group errors by root cause and fix the
   highest-leverage first (one missing `using` can erase a dozen downstream
   errors).
4. **Transparency per iteration** — Report what changed and why:
   `Iteration 3/5: fixed CS0246 by adding using System.Text.Json, 2 remain`.
   Never modify files silently.
5. **Atomicity** — Each iteration leaves the codebase no worse than before.
   If iteration 3 fails, the code stays in iteration 2's state.

### Primary Flow: Build-Fix Loop (max 5 iterations)

1. **Build** — Run `dotnet build`, capture full error output
2. **Parse** — Extract every `error CS####` with file, line, and message
3. **Categorize** — Group by root cause:

   | Category | Codes | Fix strategy |
   |---|---|---|
   | Missing using/reference | CS0246, CS0234 | Add using, package, or project ref |
   | Type mismatch | CS0029, CS1503 | Check expected type, cast or convert |
   | API change | CS0117, CS7036 | Check new signature, update call sites |
   | Nullability | CS8600–CS8604 | Add null check, `?.` or `??` |
   | Ambiguity / duplicate | CS0104, CS0121, CS0111 | Qualify namespace, remove dupe |
   | Missing member | CS1061 | Check spelling, verify member exists |
   | Missing implementation | CS0535 | Implement interface/abstract members |
   | Obsolete API | CS0618 | Replace with recommended alternative |

4. **Fix** — Apply targeted fixes, root-cause/highest-leverage errors first
5. **Rebuild** — Run `dotnet build` again, compare error count
6. **Evaluate** — Zero errors: run `dotnet test` as a sanity check, report
   success. Fewer errors: continue. Same errors: STUCK — exit and re-plan.
   More errors: revert the iteration, report REGRESSION.

### Variant: Test-Fix Loop (max 5; 3 if it follows a build-fix pass)

Same loop, same guards, with `dotnet test --no-build` as the runner and one
critical extra step — **diagnose before fixing**:

1. Read the test — understand the assertion and setup
2. Read the production code — understand the actual behavior
3. Decide where the bug lives: wrong expectation → fix the test; production
   bug → fix the code; incomplete setup → fix the setup; contract changed →
   update the test to match
4. **Never weaken an assertion to make a test pass.**
   BAD: `Assert.Equal(expected, actual)` → `Assert.NotNull(actual)`.
   GOOD: fix the production code so the original assertion passes.

### Fail-Safe Guards (immediate exit)

- **STUCK** — same errors/failures after a fix, or count oscillates
  (3 → 2 → 3): report what could not be fixed and what a human should check
- **REGRESSION** — an iteration introduced more errors than it fixed: revert
  its changes, report
- **Cascading failures** — fixing one error spawns 3+ new ones twice in a
  row: the approach is wrong, stop
- **Critical error** — wrong SDK, missing project file, corrupted solution,
  or the test runner itself fails: human intervention needed, stop
- **User interruption** — finish the current iteration, report progress, ask
  how to proceed

### Other Loops

The same discipline — bounded iterations, progress detection, fail-safe
guards — governs refactor passes (`/de-sloppify`: verify build + tests after
each target, revert on failure) and scaffolding (`/scaffold`: generate, then
run nested build-fix and test-fix loops). Nested loops get a smaller budget
(parent 5 → nested 3), max nesting depth 2, total budget 15.

## Invokes

| Type  | Name                   | Purpose                                    |
|-------|------------------------|--------------------------------------------|
| Skill | `instinct-system` | Capture fix patterns in MEMORY.md          |
| Agent | `dotnet-architect`     | Consulted for architectural error patterns |

### MCP Tools Used

- `get_diagnostics` — Compiler errors/warnings scoped to file or project
- `find_symbol` — Locate moved or renamed types
- `find_references` — Assess blast radius of a broken API change
- `get_project_graph` — Dependency order for fixing reference errors

## Example

```
User: /build-fix

Claude: Running dotnet build...
  Found 12 errors across 4 files.

  Iteration 1/5:
  - 6 errors: Missing namespace (CS0246) — adding using directives
  - 3 errors: Type mismatch (CS1503) — updating method signatures
  - 3 errors: Interface not implemented (CS0738) — package API changed

  Rebuilding... 3 errors remaining.

  Iteration 2/5:
  - 3 errors: CS0738 after xunit.v3 upgrade
    - IAsyncLifetime.InitializeAsync now returns ValueTask (was Task in v2),
      and DisposeAsync comes from IAsyncDisposable
    - Updating 3 test fixtures to the ValueTask signatures

  Rebuilding... 0 errors. Build is green.

  Running dotnet test... All 47 tests passed.
  Added to Memory > Packages: "xunit.v3 IAsyncLifetime uses ValueTask signatures"
```

## Related

- `/verify` — Full verification pass (build + test + format + diagnostics)
- `/tdd` — Red-green-refactor when building new features test-first
- `/de-sloppify` — Clean up code quality issues after the build is green

© codewithmukesh · MIT · codewithmukesh/dotnet-claude-kit

Похожие скиллы

Всё по теме «Бэкенд и API» →
csharp-testing affaan-m Скилл для написания и разбора тестов на C# и .NET: xUnit, FluentAssertions, моки, интеграционные тесты. CX Codex +1 4 500установок testability-obstacle dotnet Вводит минимальный шов в продакшен-код C#/.NET, чтобы тест перестал зависеть от реального времени, файлов и случайности. CX Codex +1 2 500установок microsoft-extensions-dependency-injection wshaddix Скилл для наведения порядка в регистрациях сервисов .NET: разбивает Program.cs на расширения и помогает выбрать время жизни сервиса. CX Codex +1 549установок including-generated-files dotnet Помогает подключить файлы, созданные во время сборки, к компиляции или выходным данным MSBuild. Нужен, когда созданный файл не подхватывается автоматически. CX Codex +1 3 400установок dotnet-xunit wshaddix Скилл для написания тестов на xUnit v3 в .NET: атрибуты, фикстуры, параллельный запуск, IAsyncLifetime. CX Codex +1 613установок dotnet-slopwatch Aaronontheweb Скилл отслеживает уловки нейросетей при правке кода C#: пропуск упавших тестов, скрытие предупреждений и пустые блоки catch. Он запускает утилиту slopwatch для защиты проекта от фиктивных правок. CX Codex +1 552установок

Из того же набора46

arch-check Сверяет кодовую базу с заявленной архитектурой: направление зависимостей, нарушения слоёв, утечки между модулями и циклы. Пригодится перед релизом или после крупной фичи. CX Codex +1 2 800установок migrate Скилл ведёт разработчика через миграции схемы EF Core, смену версии .NET и обновление NuGet. На каждом шаге он готовит план отката и запускает тесты. CX Codex +1 2 800установок plan Составляет план реализации для .NET-задач с учётом архитектуры проекта. Нужен перед изменениями, которые затрагивают несколько слоёв или модулей. CX Codex +1 2 800установок scaffold Создаёт полный набор файлов для новой фичи в .NET 10: endpoint, handler, валидатор, DTO, конфигурацию EF и интеграционные тесты. CX Codex +1 2 800установок spec Превращает сырую идею фичи в письменную спецификацию с критериями приёмки. Задаёт вопросы раундами, пока не закроет все пробелы. CX Codex +1 2 800установок checkpoint Делает git-коммит с описанием и короткую заметку о состоянии работы, не завершая сессию. Пригодится перед рискованным рефактором. CX Codex +1 2 800установок tdd Скилл ведёт строгий цикл разработки через тестирование в .NET 10: от падающего теста в xUnit v3 до минимального кода и рефакторинга. CX Codex +1 2 800установок dotnet-init Разбирает структуру .NET-решения, задаёт вопросы про архитектуру и стек и пишет готовый CLAUDE.md. Пригодится на старте проекта или при подключении набора к существующему коду. CX Codex +1 2 800установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой