build-debug
Skill9 starsChanged 8 days agoMITView on GitHub
Diagnose TypeScript, Vite, webpack, Rollup, esbuild, and Sass build errors that reproduce locally and are unrelated to CI/CD or npm toolchain failures. Load ONLY for pure build-tool errors. Bounded, non-destructive triage; never auto-runs cache wipes or version downgrades without explicit confirmation.
- Deletes or force-pushes
- Installs packages
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- comprehension-workflowSkill
- dev-cleanupSkill
- angular-patternsSkill
- dotnet-conventionsSkill
- python-conventionsSkill
- github-actions-cicdSkill
- npm-debugSkill
- structural-searchSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 97
When any of these is genuinely needed, present the exact command and the files/paths affected, and wait for an explicit "yes" before …
- Very specific: line 102
After triage, the build-helper report SHOULD include:
- Distinctive: line 110
Keep the report compact; do not paste full build logs unless the failing line is itself the evidence.
- Very specific: line 114
Check for: missing engines.node paired with a tsconfig.json that assumes a newer TS, swallowed catch (e) {} blocks around bundler errors …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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-Tool Debugging
A bounded playbook for diagnosing build-tool failures that reproduce locally and are unrelated to CI/CD or
npm toolchain failures. This skill is opt-in for build-helper and SHOULD be loaded only after the
orchestrator has classified the failure as a pure build-tool error (see agents/orchestrator.md "Routing
Disambiguation: deploy-helper vs build-helper vs npm-helper vs pc-doctor").
Scope
In scope:
- TypeScript compile errors (
tsc,vue-tsc,tsgo) that are not application logic bugs. - Bundler errors: Vite, webpack, Rollup, esbuild, Parcel, Rspack.
- Sass / PostCSS / CSS-module pipeline errors.
- Source-map, asset, or
public/resolution failures inside the build. - Path-alias and
tsconfig.json/jsconfig.jsonresolution drift.
Out of scope — delegate to another helper:
- npm install / peer-dep / lockfile failures →
npm-helper(skills/npm-debug). - CI/CD pipeline or deploy-platform failures →
deploy-helper(skills/github-actions-cicd). - Windows-local environment issues →
pc-doctor.
Triage Order (Read Before Acting)
- Capture the exact failing command and its full stderr. Quote the first error line and the file:line it points at verbatim — most bundlers print the actionable line first, then a noise stack.
- Confirm the project shape:
package.jsonscripts, presence oftsconfig.json/jsconfig.json, bundler config file (e.g.vite.config.ts,webpack.config.js). Wrong-config-file-for-this-script is a common false lead when the repo has multiple build modes. - Check Node + bundler versions (
node -v,npm ls <bundler>). A version jump that changed defaults (Vite 4 → 5, webpack 4 → 5, TypeScript 4 → 5) is a frequent root cause. - Reproduce minimally: drop the watch flag and any dev-only plugins.
vite buildis more diagnostic thanvite dev;tsc --noEmitis more diagnostic than a bundler that wraps it. - Check for stale caches: the build tool's own cache, plus
node_modules/.cache, plus any.tsbuildinfofile. Only after the simple repro fails identically do you escalate to cache invalidation (see "Destructive Steps" below).
Common Failures and First-Line Fixes
Cannot find module / Cannot find type definitions
- Cause: missing dependency, missing
tsconfig.jsonpathsentry, or wrongbaseUrl/moduleResolution. - First-line fix: confirm the package exists in
node_modulesand is listed inpackage.json; if missing, this is annpm-helperfailure, not a build-tool failure. If present, checkpaths/baseUrl/moduleResolutionagainst the file's actual import path.
Type 'X' is not assignable to type 'Y' cascades
- Cause: a small upstream type change propagating through the dep graph.
- First-line fix: identify the exact mismatch and the introducing commit/PR before recommending any
suppression. Do NOT recommend blanket
// @ts-ignoreorskipLibCheck: truewithout surfacing the mismatch in the report.
Vite esbuild OOM during build
- Cause: large monorepo or aggressive
optimizeDepsconfiguration outrunning default memory. - First-line fix: raise
NODE_OPTIONS=--max-old-space-size=4096for the build script, then audit theoptimizeDeps.includelist for entries that pull entire UI libraries. Memory bumps are a diagnostic step, not a fix.
Sass deprecation warnings treated as errors
- Cause: a
sassupgrade promoted a deprecation to an error in CI but not locally. - First-line fix: confirm the
sass-embedded/sassversion, then map each deprecation to its specific replacement call. Do NOT silence withquietDeps: trueorsilenceDeprecationswithout documenting each silenced deprecation.
Chunk size > 500 kB warnings blocking CI
- Cause: a single bundle absorbed a heavy dep or there is no code-splitting on the entry route.
- First-line fix: identify the offending chunk (
rollup-plugin-visualizeror the bundler's built-in report) and propose a code-split boundary or a dynamic import, not a globalchunkSizeWarningLimitbump without surfacing the chunk contents.
Destructive Steps (Require Explicit Confirmation)
The following commands can lose build cache, lock state, or dev artifacts. The orchestrator MUST pause and
request explicit user confirmation before any of them are run, even when delegated to build-helper:
rm -rf node_modules/.cache— drops the bundler's transform cache; slow to rebuild.rm .tsbuildinfoor any*.tsbuildinfo— forces a full TypeScript re-check.rm -rf dist/rm -rf build— destroys the previous build output (usually safe to regenerate).- Downgrading a major version of a build tool (
npm install --save-dev vite@4) — silently changes behavior; the user MUST approve. - Editing
tsconfig.jsoncompilerOptionsto suppress a real type error (strict: false,skipLibCheck: true,noImplicitAny: false) — suppressions must be flagged in the report.
When any of these is genuinely needed, present the exact command and the files/paths affected, and wait for an explicit "yes" before executing.
Reporting Format
After triage, the build-helper report SHOULD include:
- Failing command (verbatim) and working directory.
- Bundler + Node versions, and the relevant
tsconfig.json/ config-file digest (not the full file). - The first actionable root cause, with the file:line or config key that supports it.
- The minimum fix (exact command, config change, or
package.jsonpatch) and whether it is destructive. - A short "what I did NOT do and why" line for ruled-out candidates, so the user can revisit them later.
Keep the report compact; do not paste full build logs unless the failing line is itself the evidence.
When Reviewing or Debugging
Check for: missing engines.node paired with a tsconfig.json that assumes a newer TS, swallowed
catch (e) {} blocks around bundler errors that hide the real failure, and peerDependencies declared
in the project's own package.json that the build tool cannot satisfy. These are higher priority than
formatting nits.
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.

