api-versioning
API versioning strategies for ASP.NET Core. Covers Asp.Versioning library, URL segment,…
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
$ npx -y skills add codewithmukesh/dotnet-claude-kit --skill build-fix --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/build-fixContext preview
The summary Claude sees to decide when to auto-load this skill.
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
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".
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.
"keep going until it works", "keep fixing"
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.
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.
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.
(3 → 2 → 3): report what could not be fixed and what a human should check
its changes, report
row: the approach is wrong, stop
or the test runner itself fails: human intervention needed, stop
how to proceed
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.
| Type | Name | Purpose | |-------|------------------------|--------------------------------------------| | Skill | `instinct-system` | Capture fix patterns in MEMORY.md | | Agent | `dotnet-architect` | Consulted for architectural error patterns |
API versioning strategies for ASP.NET Core. Covers Asp.Versioning library, URL segment,…
Architecture conformance check: verifies an existing codebase against its declared…
Architecture selection advisor for .NET applications. Asks structured questions about domain…
.NET Aspire for cloud-native orchestration. Covers AppHost configuration, service defaults,…
Authentication and authorization for ASP.NET Core. Covers JWT bearer tokens, OpenID Connect,…
Caching strategies for .NET 10 applications. Covers HybridCache (the default), output…