skills/latex-fix-compilation/SKILL.md
Diagnose and fix LaTeX compilation errors using CI error logs committed to the repo. Trigger: When a LaTeX document fails to compile in CI, when .errlog files exist, or when user asks to fix a broken LaTeX build.
npx skillsauth add 333-333-333/agents latex-fix-compilationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
.errlog file exists in docs/latex/.error-logs/The CI pipeline (compile-docs.yml) compiles each LaTeX document in a separate parallel job. When compilation fails, the pipeline:
.log as docs/latex/.error-logs/{document-name}.errlogerrlog-{name}).errlog to the repo so it's available locallydocs/latex/.error-logs/
├── business-case.errlog # failed compilation log for business-case.tex
├── interview-owners.errlog # failed compilation log for interview-owners.tex
└── ...
File naming convention: {document-name}.errlog maps to docs/latex/**/{document-name}.tex.
Follow these steps in order. Do NOT skip steps.
git pull origin main
The error logs are committed by CI, so you need the latest state.
ls docs/latex/.error-logs/
Each .errlog file corresponds to a document that failed. The filename (without .errlog) is the document name.
If the user specified a document, look for {document-name}.errlog.
# Read the full error log
cat docs/latex/.error-logs/{document-name}.errlog
Focus on these patterns in the log:
| Pattern | Meaning | Common Fix |
|---------|---------|------------|
| ! LaTeX Error: | LaTeX-level error | Read the message, usually missing package or bad command |
| ! Undefined control sequence | Unknown command | Check spelling, add missing \usepackage{} |
| ! Missing $ inserted | Math mode issue | Wrap in $...$ or escape special chars (\_, \&, \%) |
| ! File ... not found | Missing input file | Check \input{} / \include{} paths are relative to root |
| ! Emergency stop | Fatal — look at lines ABOVE this | The real error is earlier in the log |
| Runaway argument | Unclosed brace or environment | Find the mismatched { or \begin{} without \end{} |
| ! Package ... Error: | Package-specific error | Read the package docs or check options |
| ! I can't find file | Wrong path in \input | Paths must be relative to the compilation working directory (repo root) |
.tex fileFind the root document:
# Find the .tex file for this document
find docs/latex/ -name "{document-name}.tex" -type f
Read the file, find the line referenced in the error log, and fix the issue.
Common fixes:
Missing package → Add \usepackage{package-name} to preamble AND add it to extra_packages in .github/workflows/compile-docs.yml if it's not a standard package.
Bad \input path → Paths in \input{} must be relative to the repo root (the working_directory in the CI action), e.g. \input{docs/latex/research/owners/preamble} — NOT \input{owners/preamble}.
Special characters → Escape: \_ \& \% \# \$ \{ \}
Encoding issues → Ensure \usepackage[utf8]{inputenc} is present.
Missing module file → If \input{path/to/module} references a file that doesn't exist, create it or remove the \input.
After fixing, remove the .errlog file so it doesn't linger:
rm docs/latex/.error-logs/{document-name}.errlog
If the directory is now empty, remove it too:
rmdir docs/latex/.error-logs/ 2>/dev/null || true
git add docs/latex/
git commit -m "fix(docs): resolve compilation error in {document-name}"
git push
The push will trigger the CI pipeline again, which will attempt to recompile the fixed document. The pipeline only triggers on changes to docs/latex/**/*.tex.
After pushing, check the CI pipeline status:
gh run list --workflow=compile-docs.yml --limit=1
If it fails again, repeat from Step 2.
.errlog first — Don't guess. The log tells you exactly what's wrong..tex source, not the log — The log is read-only diagnostic output..errlog after fixing — Stale logs cause confusion.extra_packages in the workflow — If you add a new \usepackage{}, make sure the package is listed in .github/workflows/compile-docs.yml under extra_packages.working_directory: . (repo root). All \input{} paths must work from there.# Check for error logs
ls docs/latex/.error-logs/
# Read a specific error log
cat docs/latex/.error-logs/{name}.errlog
# Find the source .tex file
find docs/latex/ -name "{name}.tex"
# Clean up after fix
rm docs/latex/.error-logs/{name}.errlog
# Check CI status
gh run list --workflow=compile-docs.yml --limit=3
# Watch a running CI job
gh run watch
testing
Review Flutter components and screens for UX/UI compliance. Trigger: When user invokes /ux-review command or requests UX audit.
development
TypeScript strict patterns and best practices. Trigger: When implementing or refactoring TypeScript in .ts/.tsx (types, interfaces, generics, const maps, type guards, removing any, tightening unknown).
testing
Testing philosophy and strategy for every feature: test pyramid, mandatory levels per change type, completion checklist, and skill delegation. Trigger: When planning tests for a feature, reviewing test coverage, defining acceptance criteria, or asking what tests a change needs.
development
Terraform security practices: sensitive variables, secret management, state protection, .gitignore patterns, and CI/CD credential handling. Trigger: When handling secrets in Terraform, configuring state backends, reviewing .gitignore for Terraform, or setting up CI/CD pipelines for infrastructure.