Template Compliance
Compare a research project's LaTeX preamble against the working-paper template bundled with the installed
latexskill. Classify every difference, produce a scored report, and optionally apply changes interactively.
When to Use
- After the template has been updated and you want to check older papers
- Before submission — verify the preamble is clean and up to date
- When a paper has mysterious compilation issues (often a stale preamble)
- During periodic maintenance or
system-audit - When starting work on a paper that hasn't been touched in a while
When NOT to Use
- Setting up a new project — the separate
init-project-researchworkflow
copies the template; this skill audits an existing project
- Fixing compilation errors — use
latexfirst, then run this - Non-LaTeX projects — this skill is LaTeX-specific
Critical Rules
- Never edit without
--apply. Default mode is report-only. Without--apply, the skill produces a report and exits. - Never auto-apply Conflict items. Conflicts always require explicit user confirmation via
the available structured-question mechanism. - Semantic comparison, not line-by-line. Compare packages, options, commands, and environments as logical units — not raw text diffs.
- Preserve project-specific additions. Items classified as Keep are informational. Never suggest removing them unless they conflict with a template feature.
- Template is the reference, not the authority. Projects may legitimately diverge. The skill reports differences — the user decides what to act on.
- Compile after applying. If
--applymakes any changes, always verify withlatex.
Protocol
Phase 1: Locate & Parse
- Resolve the project path. Accept as argument or use CWD. Resolve to absolute path.
- Find the project's preamble files. The canonical location is the Overleaf document, accessed via the
paper/symlink in the project directory. Search in this order:
- New format (
.styfiles):paper/your-template.sty+paper/your-bib-template.sty(Overleaf symlink — preferred) - Legacy format:
paper/settings.tex(Overleaf symlink) - If no
paper/symlink exists, check the project root foryour-template.sty(orsettings.tex) - Project root:
your-template.sty+your-bib-template.styorsettings.tex(for local-only projects without Overleaf) - Any
\input{settings}or\usepackage{your-template}inmain.texpointing elsewhere
NEVER check settings/style files in subdirectories like docs/, to-sort/, docs/venues/, or any non-paper location. Only the main paper's preamble is relevant.
New papers: copy templates/venues/_shared/user-math.sty in alongside the venue kit and \usepackage{user-math} (clash-safe; [notheorems] if the kit owns theorem envs) rather than hand-declaring \E/\Prob/\R/\argmax. Existing compiling papers are not retrofitted — see templates/venues/_shared/README.md.
If no preamble files are found, report error and exit.
- Read the template. Resolve the sibling installed skill path, then use
../latex/templates/working-paper/ relative to this skill. Compare the two
.sty files there, with settings.tex as a legacy fallback when present.
If no template files are found, report "Bundled working-paper template not
found — reinstall or repair the latex skill" and exit.
- Parse both files into semantic blocks:
| Block | What to extract |
|-------|----------------|
| Packages | Package name + options (e.g., [dvipsnames]{xcolor}) |
| Hyperref | All \hypersetup{} key-value pairs + \urlstyle |
| Bibliography | System (biblatex/natbib), all options, \addbibresource, source mappings, field clearing (\AtEveryBibitem), possessive citation commands |
| Custom commands | All \newcommand, \renewcommand, \DeclareMathOperator, \newcolumntype |
| Theorem environments | All \newtheorem declarations with their styles and counters |
| Build config | Canonical .latexmkrc byte identity and optional .latexmkrc.local validity |
For packages, normalise options: \usepackage[a,b]{pkg} and \usepackage[b,a]{pkg} are equivalent.
Phase 2: Compare
For each semantic block, compare the project against the template. Detailed check tables for each block: