---
name: build-error-resolver
description: "Reads a failing build log, finds the first real error behind the cascade, fixes it, and confirms the build passes instead of guessing at the later noise. Use when a build or CI job is failing with a long error log and the first real error needs to be isolated, fixed, and confirmed. Do not use for runtime bugs that appear after the build succeeds or slow build tuning. Related topics: coding, technical."
---

# Build Error Resolver

Reads a failing build log, finds the first real error behind the cascade, fixes it, and confirms the build passes instead of guessing at the later noise.

## When to use

Use this skill when a build or CI job is failing with a long error log and the first real error needs to be isolated, fixed, and confirmed. Do not use it for runtime bugs that appear after the build succeeds or slow build tuning.

## Workflow

1. Ask the user for each input listed below in a single message, skipping any they have already given. Where options are listed, offer them, but accept other answers too.
2. Read the log from the top and identify the first real error, setting aside warnings and follow-on failures.
3. Name the file, line, and underlying cause, checking recent changes and dependency bumps first.
4. Propose the smallest edit that fixes it and explain in a sentence why it works.
5. Rebuild with the exact failing command and confirm the original error is gone.
6. If a new error appears, repeat from the top of the new log until the build is green.

## Inputs

- **Build log** (longer free text)
- **Build tool** (free text, e.g. "Gradle or webpack or cargo")
- **What changed recently** (longer free text)
- **Relevant files** (longer free text)
- **Environment** (choose one: Local, CI, Docker build)
- **Command that fails** (free text, e.g. "The exact command")

## Output

The first error with its cause, the exact edit, the rebuild command with the expected clean result, and a note on any follow-up error handled.

## Prompt template

Fill the inputs into this template and follow it as the full instruction.

### Build Error Resolver

Find and fix the error that is breaking this build.

- Build log: {{Build log}}
- Build tool: {{Build tool}}
- What changed recently: {{What changed recently}}
- Relevant files: {{Relevant files}}
- Environment: {{Environment}}
- Command that fails: {{Command that fails}}

Read the log from the top, not the bottom: the first real error usually causes all the later ones, so ignore warnings and follow-on failures until it is fixed. Name that error, the file and line, and the rule or missing piece behind it (a type mismatch, a missing module, a version conflict, a path or case issue). Check what changed recently, since the cause is usually in the last diff or a dependency bump. Propose the smallest fix, show the exact edit, and say why it works. If the log is ambiguous, list the two most likely causes and the one command that separates them.

After the fix, give the command to rebuild and what a clean run should print. If new errors appear, repeat from the top of the new log rather than patching downward.

## Pitfalls

- Fixing the last error in the log, which is often just a symptom of an earlier failure.
- Deleting the lockfile or cache as a first move, which hides the cause and breaks reproducibility.
- Declaring the build fixed without re-running the exact failing command.
