From kingbob
Diagnose and fix LaTeX compilation errors and warnings. Optionally pass the exact error/warning text (pasted from the log); with no arguments it compiles the document, collects every error and warning, and explains how to fix each one. Applies safe fixes directly but asks for a greenlight before any big change. Use when the user has a LaTeX error, their document won't compile, or they say "/fix-latex-errors".
How this skill is triggered — by the user, by Claude, or both
Slash command
/kingbob:fix-latex-errors [exact error or warning text] [main .tex file][exact error or warning text] [main .tex file]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Fix LaTeX compilation problems — a single pasted error, or a full sweep of
Fix LaTeX compilation problems — a single pasted error, or a full sweep of every error and warning in the document.
The arguments may contain, in any order:
! Undefined control sequence. or
LaTeX Warning: Reference 'fig:foo' on page 3 undefined..tex file (optional): the main document. If absent, detect it.Pick the mode:
| Given | Mode |
|---|---|
| error/warning | Targeted mode: diagnose and fix that one issue (Step 2 onward, scoped to it) |
| nothing | Sweep mode: compile, collect every error and warning, triage all of them |
**/*.tex and pick the file containing \documentclass (if several,
prefer one named main.tex/paper.tex/thesis.tex or referenced by a
latexmkrc/Makefile; if still ambiguous, ask).latexmkrc, Makefile,
magic comments (% !TEX program = xelatex), \usepackage{fontspec} →
xelatex/lualatex, biblatex with backend=biber → biber.Compile to get a fresh, complete log:
latexmk -interaction=nonstopmode -file-line-error -halt-on-error=false <engine flag> main.tex
(Fall back to running the engine directly with
-interaction=nonstopmode -file-line-error if latexmk is unavailable. If no
TeX distribution is installed, say so and work statically from the sources
and any existing .log file instead.)
Parse the .log (and .blg for bibliography runs) for, in priority order:
! (with -file-line-error, the
file:line: message form). These block compilation; fix first. Note that
one real error often cascades into dozens of bogus follow-ups — diagnose
the first error, fix, recompile, repeat, rather than chasing the cascade.LaTeX Warning: Reference ... undefined,
Citation ... undefined, There were undefined references. Check whether
the label/key exists (Grep the sources and .bib); distinguish a typo'd
key from a genuinely missing entry from a stale build needing another
pass.Overfull \hbox/\vbox, underfull boxes. Report
the worst offenders (say, > 10pt) with their source location; tiny
overfulls can be listed in one line as ignorable.Produce a numbered report, one entry per root cause (deduplicate repeats of the same warning), each with:
file:line,Classify each proposed fix:
Safe — apply directly (after listing it in the report): single-site,
mechanical, content-preserving fixes. Examples: escaping a stray %/&/_,
closing an unclosed $ or environment, fixing a typo'd \ref/\cite key,
adding a missing \usepackage for a command that clearly needs it, fixing a
malformed table column spec, renaming one duplicate label and its references.
Big — greenlight first via AskUserQuestion, presenting what would change and why, with a do-nothing option. Anything that:
Group related big changes into one question rather than asking five times. If the user declines, leave that item in the report as "flagged, not fixed — here's the manual fix" and move on.
compiles cleanly / compiles with N warnings / still fails at ...)..aux, .log, …) alone — do not clean up unless
asked.Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub harshagrawal13/kingbob-claude-plugins --plugin kingbob