fix-build-errors
Skill47 starsChanged 4 months agoMITView on GitHub
Use when a build, compilation, or type-check fails — diagnose the error, identify root cause, and apply the minimal fix to get green
- Reads credentials
- Installs packages
In this repository111 other files it gives its agents.
- AGENTS.mdAGENTS.md
- COPILOT-INSTRUCTIONS.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- ai-visibilitySkill
- content-strategySkill
- seoSkill
- actions-debuggingSkill
- agentic-engineeringSkill
- autopilot-patternsSkill
- background-agentSkill
- context-primeSkill
- copilot-memorySkill
- cross-session-memorySkill
- ecosystem-intakeSkill
- fleet-parallelSkill
- github-code-searchSkill
- github-codespaces-efficiencySkill
- github-issue-triageSkill
- github-pr-workflowSkill
- ide-switchingSkill
- knowledge-curatorSkill
- mcp-builderSkill
- mcp-ecosystemSkill
- multi-model-strategySkill
- plan-mode-masterySkill
- scope-guardSkill
- session-managementSkill
- stack-detectorSkill
- sub-agent-sandboxingSkill
- task-intake-routerSkill
- team-plannerSkill
- token-cost-optimizerSkill
- api-and-interface-designSkill
- code-reviewSkill
- context-engineeringSkill
- cpp-debuggingSkill
- deprecation-and-migrationSkill
- diagnoseSkill
- fix-github-issueSkill
- implementSkill
- improve-codebase-architectureSkill
- nestjs-prismaSkill
- nextjs-prismaSkill
- performance-optimizationSkill
- pr-multi-perspective-reviewSkill
- prototypeSkill
- react-vitestSkill
- receiving-code-reviewSkill
- refactor-cleanSkill
- reviewSkill
- skill-creatorSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- systematic-debuggingSkill
- tdd-workflowSkill
- zoom-outSkill
- add-to-changelogSkill
- api-documentationSkill
- architecture-decisionsSkill
- code-tourSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 43
Read errors from top to bottom — later errors are often caused by earlier ones.
- Very specific: line 83
Use edit for surgical changes to specific lines:
- Distinctive: line 103
If fixing one error reveals more:
- Distinctive: line 107
If the error count isn't decreasing, you may be fixing symptoms — step back and find the root cause
- Very specific: line 148
Use task agent to run builds — it returns brief output on success, full output on failure
- Distinctive: line 149
After fixing, always run the full test suite, not just the build
- Distinctive: line 150
If a dependency update caused the break, check its changelog for breaking changes
- Very specific: line 158
Keep tsconfig.json / build configs in source control so you can diff changes
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fix Build Errors
When to Use
- Build or compilation fails after code changes
- CI pipeline reports build failures
- TypeScript, ESLint, or other static analysis errors
- Dependency resolution failures after package updates
- Build works locally but fails in CI (or vice versa)
Prerequisites
- Access to the build command and its output
- The project's build toolchain is installed
- Source control so you can compare against a known-good state
Workflow
1. Capture the Full Error Output
# Run the build and capture output — use task agent to keep context clean
npm run build 2>&1 | Out-StringOr use the task agent for long builds:
task agent_type: "task"
prompt: "Run 'npm run build' and report all errors"2. Categorize the Errors
Read errors from top to bottom — later errors are often caused by earlier ones.
| Error Type | Example | Typical Fix |
| Import/Module | Cannot find module 'x' | Install dependency, fix path |
| Type | Type 'string' not assignable to 'number' | Fix type annotation or cast |
| Syntax | Unexpected token | Fix syntax error, check for missing brackets |
| Lint | no-unused-vars | Remove unused variable or disable rule |
| Config | Invalid tsconfig option | Fix config file |
| Dependency | Peer dependency not met | Install or update package |
3. Fix the Root Cause (Not Symptoms)
# Find the first error — it's usually the root cause
npm run build 2>&1 | Select-String "error" | Select-Object -First 5
# Navigate to the file and line
# Use view tool to see context around the errorFor import errors:
# Check if the module exists
glob pattern="**/*moduleName*"
# Check if it's installed
npm ls module-name 2>&1For type errors:
# See the full type definition
grep -rn "interface|type" --include="*.ts" -A 5 src/ | Select-String "TypeName"4. Apply the Fix
Use edit for surgical changes to specific lines:
edit path: "src/broken-file.ts"
old_str: "const x: string = 42;"
new_str: "const x: number = 42;"5. Verify the Fix
# Rebuild — should succeed now
npm run build 2>&1 | Select-Object -Last 10
# Run tests to ensure the fix didn't break behavior
npm test 2>&1 | Select-Object -Last 106. Handle Cascading Errors
If fixing one error reveals more:
- Rebuild after each fix
- Address new errors from top to bottom
- If the error count isn't decreasing, you may be fixing symptoms — step back and find the root cause
Examples
Missing Dependency
# Error: Cannot find module 'lodash'
npm install lodash
npm install --save-dev @types/lodash # for TypeScript
npm run buildTypeScript Strict Mode Errors After Upgrade
# Find all strictNullChecks errors
npx tsc --noEmit 2>&1 | Select-String "possibly 'null'" | Measure-Object -Line
# Fix them one file at a time, starting with leaf modules (no imports from your code)
npx tsc --noEmit 2>&1 | Select-String "possibly 'null'" | Select-Object -First 3CI vs Local Mismatch
# Check Node/npm version differences
node --version
npm --version
# Check for OS-specific path issues
grep -rn "\\\\" src/ --include="*.ts" # Windows backslashes in code
# Check for missing environment variables
grep -rn "process.env" src/ --include="*.ts" | Select-String -NotMatch "NODE_ENV"Tips
- Fix the first error first — many later errors are caused by earlier ones
- Use
taskagent to run builds — it returns brief output on success, full output on failure - After fixing, always run the full test suite, not just the build
- If a dependency update caused the break, check its changelog for breaking changes
For persistent issues, compare against the last known-good commit:
git --no-pager log --oneline -10 git --no-pager diff <last-good-commit> -- src/- Keep
tsconfig.json/ build configs in source control so you can diff changes
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

