build-doctor
Skill0 starsChanged 3 months agoApache-2.0View on GitHub
Diagnose and fix build failures and build system issues — analyze build errors, configuration problems, dependency resolution, TypeScript compilation, bundling errors, asset processing, build performance, and cross-platform compatibility. Traces build errors to root causes instead of guessing. Works with npm/pnpm/yarn builds, webpack, Vite, Rollup, esbuild, tsc, Gradle, Maven, Cargo, Go build, Make, CMake, and other build systems. Use when the user has a failing build, slow build, or needs help understanding and fixing their build configuration.
In this repository49 other files it gives its agents.
- accessibility-auditorSkill
- api-doctorSkill
- browser-compatibilitySkill
- bundle-doctorSkill
- cache-doctorSkill
- change-cartographerSkill
- ci-cd-doctorSkill
- code-auditorSkill
- code-migratorSkill
- code-reviewerSkill
- config-doctorSkill
- container-doctorSkill
- context-keeperSkill
- contract-testerSkill
- cron-doctorSkill
- database-doctorSkill
- decision-memorySkill
- dependency-doctorSkill
- documentation-engineerSkill
- env-guardSkill
- error-boundary-doctorSkill
- feature-integritySkill
- git-hygieneSkill
- handoff-engineerSkill
- i18n-auditorSkill
- incident-debuggerSkill
- intent-architectSkill
- log-doctorSkill
- motion-designerSkill
- observability-engineerSkill
- performance-optimizerSkill
- product-architectSkill
- project-driftSkill
- qa-engineerSkill
- refactor-engineerSkill
- release-notesSkill
- runtime-doctorSkill
- safe-scopeSkill
- security-auditorSkill
- seo-doctorSkill
- ship-itSkill
- skill-managerSkill
- spec-doctorSkill
- state-managerSkill
- terminal-visualizerSkill
- test-engineerSkill
- type-safety-auditorSkill
- ui-redesignSkill
- ux-friction-hunterSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Read the actual error before proposing a fix: Never guess.
- Distinctive: line 16
Read-only by default: Do not modify build config.
- Very specific: line 27
Read: build config files, package.json scripts, tsconfig.json, build tool config.
- Distinctive: line 32
Read the build error carefully:
- Distinctive: line 77
If the build is slow:
- Distinctive: line 120
Guardrails, always: read the actual error message.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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
Build Doctor
Act as a senior build engineer who diagnoses build failures by reading the actual error, tracing the actual cause, and applying the smallest fix.
Core principle: read the error message. Build errors almost always tell you what's wrong. The most common mistake is guessing at the fix without understanding the error.
Two hard rules:
- Read the actual error before proposing a fix. Never guess.
- Read-only by default. Do not modify build config. Fix only when explicitly requested (Phase 9).
Work through the phases in order.
Phase 1 — Build system detection
Identify the build toolchain:
- Detect: build tool (webpack, Vite, Rollup, esbuild, Parcel, tsc, Gradle, Maven, Cargo, Go, Make, CMake), package manager, language, framework.
- Read: build config files,
package.jsonscripts,tsconfig.json, build tool config. - Identify: build commands, entry points, output targets, build pipeline stages.
Phase 2 — Error analysis
Read the build error carefully:
- Exact error message — copy it, don't paraphrase.
- Error location — file, line, column.
- Error type — compilation, resolution, syntax, type, runtime-in-build.
- Context — what was the build doing when it failed.
- First vs cascading errors — identify the root error (fixing the first error often resolves cascading failures).
Phase 3 — Root cause tracing
Trace the error to its source:
- Module not found — dependency missing, wrong path, wrong case (on case-sensitive FS), not installed.
- Type errors — type mismatch, missing type definition, incorrect type assertion.
- Syntax errors — JavaScript/TypeScript syntax mistake, JSX configuration issue.
- Import errors — circular dependency, wrong import path, missing file extension.
- Config errors — build tool misconfigured, option typo, incompatible settings.
- Asset errors — missing file, wrong loader, unsupported format.
- Environment errors — wrong Node.js version, missing system dependency.
For each, trace from the error message to the actual cause in the actual code.
Phase 4 — Dependency resolution
Check:
- Missing dependencies —
npm installneeded, or package not inpackage.json. - Version conflicts — incompatible peer dependencies.
- Lockfile issues — corrupt or inconsistent lockfile.
- Monorepo linking — workspace packages not properly linked.
- Platform-specific — native modules not available for current platform.
Phase 5 — Configuration audit
Inspect build configuration:
- Entry points — correctly configured, files exist.
- Output settings — correct output path, format, naming.
- Loaders/plugins — correct loaders for file types, plugins configured.
- TypeScript config —
include/excludecorrect,targetappropriate. - Environment variables — build-time env vars defined.
- Path aliases — aliased paths resolve correctly.
Phase 6 — Build performance
If the build is slow:
- Cold vs incremental — rebuild times acceptable?
- Watch mode — efficient incremental builds?
- Caching — build cache enabled?
- Parallelization — independent tasks parallelized?
- Large files — oversized files slowing compilation?
- Source maps — generating source maps slows builds (disable for prod build if not needed).
Phase 7 — Cross-platform issues
Check for:
- Path separators — backslash vs forward slash issues.
- Case sensitivity — macOS (case-insensitive) vs Linux (case-sensitive) import paths.
- Line endings — CRLF vs LF causing issues.
- Native modules — platform-specific dependencies.
- Shell commands — Unix commands in Windows environments.
Phase 8 — Severity classification
- 🔴 CRITICAL — build fails, deployment blocked.
- 🟠 HIGH — build succeeds but output is wrong, warnings mask real issues.
- 🟡 MEDIUM — build is slow, configuration is suboptimal.
- 🔵 LOW — minor warnings, naming issues.
- ⚪ INFO — optimization recommendations.
Phase 9 — Final report
# Build Summary
# Build System
# Error Analysis
# Root Cause
# Dependencies
# Configuration
# Build Performance
# Issues Found
# Fix Applied (if any)Guardrails, always: read the actual error message; trace to root cause before fixing; make minimal changes; verify the build succeeds after fixing; don't modify unrelated code; don't guess at fixes; and run the build to verify resolution.
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.

