ワンクリックで
latex-health-check
Use when you need to compile all LaTeX projects and check cross-project consistency.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when you need to compile all LaTeX projects and check cross-project consistency.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when you need to compare a project .bib against a Paperpile project/topic folder to find uncited papers or unfiled entries.
Use when you need to extract citations from a PDF and generate a validated .bib file. Reads the PDF, identifies all referenced works, constructs BibTeX entries with metadata verification, then runs bib-validate.
Use when you need to check a LaTeX submission against a PDF assessment brief.
Use when you need to replicate a quantitative analysis in a second language (R↔Python↔Stata↔Julia) to verify correctness. Level 1 of the verification hierarchy.
Use when you need to challenge research assumptions or stress-test arguments.
Review user-facing documentation for accuracy, consistency, and completeness across private, public, nested repos, and the user manual. Use when docs feel stale, after major changes, or before sharing. (Replaces `repo-doc-audit`)
| name | latex-health-check |
| description | Use when you need to compile all LaTeX projects and check cross-project consistency. |
| allowed-tools | ["Read","Edit","Write","Glob","Grep","Bash(latexmk*)","Bash(pdflatex*)","Bash(biber*)","Bash(bibtex*)","Bash(ls*)","Bash(mkdir*)","Bash(cp*)","Bash(ln*)","Bash(wc*)","Bash(readlink*)"] |
| argument-hint | [project-path | 'all' | 'quick'] |
Compile all LaTeX projects, auto-fix known errors iteratively, and verify cross-project consistency (symlinks, shared bibliographies, Overleaf separation).
| Mode | Trigger | What it does |
|---|---|---|
| Single project | Path argument | Compile + fix + verify one project |
| All projects | all argument | Discover and compile every LaTeX project |
| Quick | quick argument | Compile only, no fixes, report errors |
Find all directories containing a \documentclass in a .tex file:
Search locations in this order, checking that each exists:
~/Projects/ as a portable fallback for all mode.For each discovered project, record:
.latexmkrcout/ directorypaper/ subdirectory (Overleaf-linked)For each project:
.latexmkrc — create if missing (with $out_dir = 'out' and PDF copy-back)out/ directory if missingcd <project-dir> && latexmk -interaction=nonstopmode <main.tex> 2>&1
Engine selection: Do NOT hardcode -pdf. The project's .latexmkrc (created in 2a) controls the engine — it auto-detects xelatex via fontspec, or defaults to pdflatex. Passing -pdf overrides this and breaks xelatex/lualatex projects. Let latexmk read .latexmkrc.
Extract from out/*.log:
!)Warning-tagged lines)../shared/overfull-boxes.md, NOT a Warning grep (box lines carry no Warning token)For each error, apply the known fix from the database:
| Error pattern | Fix |
|---|---|
Missing package X | Add \usepackage{X} — but NEVER try xltabular or ltablex (use longtable instead) |
Undefined citation key | Check .bib file exists and is referenced; check for typos via edit distance |
| Overfull/underfull box | Flag location + width per ../shared/overfull-boxes.md — do NOT auto-fix prose (only safe auto-fix is adding microtype when absent) |
tcolorbox = or , in title | Wrap title in braces: title={...} |
| Font encoding warning | Add \usepackage[T1]{fontenc} if missing |
Missing \begin{document} | Check for corrupted preamble |
Broken symlink in \input{} or \includegraphics{} | Find the target and report |
| Build artifacts in source dir | Flag — offer to move to out/ |
After each fix, recompile. Max 3 iterations per project.
Why 3 iterations (not 5)? latex runs up to 5 iterations on a single project with deep error analysis. This skill trades depth for breadth — 3 iterations is enough to catch the common fleet-wide issues (missing packages, broken symlinks, stale cache) without spending excessive time on any one project. If a project still has errors after 3 iterations, mark it as ERROR and recommend running latex on it directly for deeper diagnosis.
{
"project": "project-name",
"path": "/full/path",
"status": "OK | FIXED | ERROR",
"errors_initial": 3,
"errors_final": 0,
"fixes_applied": ["added fontenc", "fixed tcolorbox title"],
"warnings": 2,
"undefined_citations": 0
}
After all projects are compiled:
paper/ directory for forbidden file types (.py, .R, .csv, .ipynb, etc.)Generate a summary report:
LaTeX Health Check — YYYY-MM-DD
Projects scanned: N
Compiled OK: N (list)
Fixed and OK: N (list + fixes applied)
Still broken: N (list + remaining errors)
Skipped: N (list + reason)
Cross-project issues:
Broken symlinks: N
Overleaf violations: N
Template drift: N
Warnings (not auto-fixed):
Overfull hboxes: N across M projects
Underfull hboxes: N across M projects
Print to stdout. If --save flag or 10+ projects scanned, also write to log/latex-health/YYYY-MM-DD.md.
When writing the report file, emit an outputs manifest and run the shared verifier per _shared/verify-outputs.md:
Write manifest to <project>/.claude/state/outputs-manifest-<UTC-timestamp>.json listing every file written this invocation, paths relative to the project root.
Run:
uv run python "<skills-root>/_shared/verify_outputs.py" \
--manifest "$MANIFEST" \
--project-root "$PROJECT_ROOT"
If the verifier exits non-zero, do not commit. Surface the missing-files list and stop.
Closes the "hallucinated outputs" failure class (commit b2cff75, 2026-04-18). Skip this sub-step entirely if --save was not passed and no log file was written.
| Skill | Relationship |
|---|---|
latex | Single-project deep fix (5 iterations). This skill runs a lighter version (3 iterations) at fleet scale. For ERROR projects, recommend running latex directly. |
latex | Manual compilation config and .latexmkrc reference — health-check creates .latexmkrc files using the conventions defined there. |
audit-project-research | Checks project structure (directories, files). This skill checks build health. |
bib-validate | Validates bibliography entries. This skill checks if citations compile. |
latex-template | Checks preamble alignment with the working paper template. Complementary: run after health-check to ensure preamble consistency. |