agentleFS
PKU-DAIRPKU-DAIR/AutoSci/.claude/skills/paper-compile/SKILL.md

paper-compile

Skill1.7k starsChanged 34 days agoMITView on GitHub

LaTeX compile → PDF — latexmk compile + auto-fix + page count/anonymity/font/[UNCONFIRMED] checks + submission checklist

  • Installs packages

We split this skill into the rules it gives an agent

23 rules. 0 are common, 10 are distinctive, and 13 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If --fix: modified .tex files (auto-fixed)

    line 24
  2. Very specific:

    If --fix is enabled, attempt to auto-fix each error type:

    line 66
  3. Very specific:

    If not installable: comment out the \usepackage{xxx} line and annotate % TODO: install package {xxx}

    line 75
  4. Distinctive:

    If not: attempt to match from wiki papers and add an [UNCONFIRMED] entry

    line 80
  5. Very specific:

    If present but bibtex has not run: re-run latexmk (latexmk usually handles this automatically)

    line 81
  6. Very specific:

    Check if paper/figures/ contains a file with a different extension (.pdf vs .png vs .eps)

    line 84
  7. Very specific:

    If found: correct the \includegraphics path

    line 85
  8. Very specific:

    If not found: replace with placeholder \missingfigure{xxx} (requires todonotes package)

    line 86
  9. Distinctive:

    If auto-fix is not possible: report error location and suggestions

    line 91
  10. Distinctive:

    After successful compilation, run the following checks:

    line 100
  11. Very specific:

    Search for author names (if \author{} is non-empty → warn)

    line 119
  12. Distinctive:

    Search for institution names (university, lab, institute → warn)

    line 120
  13. Distinctive:

    Search for GitHub/GitLab links (may reveal identity → warn)

    line 121
  14. Distinctive:

    Search for "our previous work" / "we previously" → should use third-person citation

    line 122
  15. Very specific:

    Search for \thanks{} / \acknowledgments → remove for anonymous submission

    line 123
  16. Distinctive:

    If [UNCONFIRMED] markers exist: list each one.

    line 130
  17. Distinctive:

    Check the "emb" column: all fonts should be "yes"

    line 137
  18. Very specific:

    Search for TODO, FIXME, XXX markers

    line 141
  19. Very specific:

    Search for \missingfigure, empty sections (\section{X} followed by no content)

    line 142
  20. Very specific:

    Search for unreferenced figures/tables (\includegraphics present but no \ref)

    line 143
  21. Distinctive:

    Check that the abstract exists and is non-empty

    line 144
  22. Very specific:

    Do not modify wiki content: only operate on the paper/ directory and wiki/log.md

    line 203
  23. Distinctive:

    pdfinfo/pdffonts dependency: if not installed, skip the corresponding check and annotate "tool not available"

    line 208

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/paper-compile

Compile a LaTeX paper to PDF, auto-fix common errors, and verify submission requirements. Input: the paper/ directory generated by /paper-draft. Run latexmk compilation, parse errors and attempt auto-fix (missing packages, undefined references, figure paths). Verify page limit, anonymous compliance, font embedding, and clearance of [UNCONFIRMED] markers. Generate a submission checklist.

Inputs

  • paper_dir (optional, default paper/): LaTeX project directory containing main.tex
  • --fix (optional): enable auto-fix mode (automatically install missing packages, correct paths)
  • --checklist (optional): generate a detailed submission checklist (check only, no compilation)

Outputs

  • paper/main.pdf — compiled PDF
  • COMPILE_REPORT (printed to terminal) — compilation status, check results, submission checklist
  • If --fix: modified .tex files (auto-fixed)

Wiki Interaction

Reads

  • wiki/outputs/paper-plan-*.md — retrieve venue information (page limit, anonymity requirements)
  • .claude/skills/shared-references/citation-verification.md — [UNCONFIRMED] marker check rules

Writes

  • paper/main.pdf — compilation output
  • wiki/log.md — appended compilation log

Graph edges created

  • None

Workflow

Precondition: confirm paper/main.tex exists. Confirm latexmk is installed (which latexmk).

Step 1: Compile

  1. First compilation:
    cd paper/ && latexmk -pdf -interaction=nonstopmode main.tex 2>&1
  2. Parse compilation output:
    • Collect all errors (! ...)
    • Collect all warnings (Warning: / Overfull / Underfull)
    • Classify:
      • Missing package: ! LaTeX Error: File 'xxx.sty' not found
      • Undefined reference: LaTeX Warning: Reference 'xxx' on page N undefined
      • Undefined citation: LaTeX Warning: Citation 'xxx' on page N undefined
      • Missing figure: ! LaTeX Error: File 'figures/xxx' not found
      • Syntax error: other errors beginning with !
      • Overfull/Underfull: typesetting warnings (non-blocking)
  3. If compilation succeeds (main.pdf generated): proceed to Step 3
  4. If compilation fails: proceed to Step 2

Step 2: Auto-Fix

If --fix is enabled, attempt to auto-fix each error type:

2a. Missing package:

# check if the package is installable via TeX Live
tlmgr info {package-name} 2>/dev/null
# if installable and user confirms:
tlmgr install {package-name}

If not installable: comment out the \usepackage{xxx} line and annotate % TODO: install package {xxx}

2b. Undefined reference/citation:

  • Undefined reference: check if the corresponding \label{} exists; if not, add a placeholder label
  • Undefined citation: check if references.bib contains the key
    • If not: attempt to match from wiki papers and add an [UNCONFIRMED] entry
    • If present but bibtex has not run: re-run latexmk (latexmk usually handles this automatically)

2c. Missing figure:

  • Check if paper/figures/ contains a file with a different extension (.pdf vs .png vs .eps)
  • If found: correct the \includegraphics path
  • If not found: replace with placeholder \missingfigure{xxx} (requires todonotes package)

2d. Syntax error:

  • Common fixes: unclosed {}, mismatched \begin{}/\end{}, illegal characters
  • Attempt to locate the error line number; provide specific fix suggestions
  • If auto-fix is not possible: report error location and suggestions

Re-compile after fixes (up to 3 fix-compile cycles):

cd paper/ && latexmk -pdf -interaction=nonstopmode main.tex 2>&1

Step 3: Verification Checks

After successful compilation, run the following checks:

3a. Page count check:

# get PDF page count
python3 -c "
import subprocess
result = subprocess.run(['pdfinfo', 'paper/main.pdf'], capture_output=True, text=True)
for line in result.stdout.splitlines():
    if line.startswith('Pages:'):
        print(line.split(':')[1].strip())
"

Compare against the venue page limit (retrieved from the PAPER_PLAN venue or the venue table in academic-writing.md).

  • Exceeds limit: report number of pages over limit; suggest compressing or moving content to appendix
  • Under limit: report remaining space; suggest adding content

3b. Anonymity check: Scan all .tex files:

  • Search for author names (if \author{} is non-empty → warn)
  • Search for institution names (university, lab, institute → warn)
  • Search for GitHub/GitLab links (may reveal identity → warn)
  • Search for "our previous work" / "we previously" → should use third-person citation
  • Search for \thanks{} / \acknowledgments → remove for anonymous submission

3c. [UNCONFIRMED] marker check:

# scan references.bib and all .tex files
grep -rn "VERIFY" paper/
  • If [UNCONFIRMED] markers exist: list each one; flag as submission blocker
  • Per citation-verification.md: [UNCONFIRMED] is a hard submission blocker

3d. Font embedding check:

pdffonts paper/main.pdf
  • Check the "emb" column: all fonts should be "yes"
  • Unembedded fonts: report font names; suggest adding font embedding to compile options

3e. Content completeness check:

  • Search for TODO, FIXME, XXX markers
  • Search for \missingfigure, empty sections (\section{X} followed by no content)
  • Search for unreferenced figures/tables (\includegraphics present but no \ref)
  • Check that the abstract exists and is non-empty

Step 4: Generate Submission Checklist and Report

# Compile Report

## Compilation
- Status: {SUCCESS / FAILED}
- Compiler: latexmk + pdflatex
- Rounds: {N} (including auto-fix rounds)
- Errors: {N} (fixed: {M}, remaining: {K})
- Warnings: {N} (overfull: {O}, underfull: {U}, other: {W})

## Verification Results

| Check | Status | Details |
|-------|--------|---------|
| Page count | {PASS/FAIL} | {N} pages (limit: {L}) |
| Anonymous | {PASS/WARN} | {details} |
| [UNCONFIRMED] citations | {PASS/FAIL} | {N} remaining |
| Fonts embedded | {PASS/FAIL} | {details} |
| No TODOs | {PASS/WARN} | {N} remaining |
| Figures referenced | {PASS/WARN} | {details} |
| Abstract present | {PASS/FAIL} | {details} |

## Submission Checklist

- [ ] PDF compiles without errors
- [ ] Page count within venue limit ({L} pages)
- [ ] All [UNCONFIRMED] citations resolved
- [ ] Anonymous submission (no author info)
- [ ] All fonts embedded
- [ ] No TODO/FIXME markers
- [ ] All figures referenced in text
- [ ] Abstract present and complete
- [ ] Supplementary material prepared (if applicable)
- [ ] Paper title matches submission system

## Blocking Issues
{list of FAIL items that must be resolved before submission}

## Warnings (non-blocking)
{list of WARN items for consideration}

## Next Steps
- {specific actions to resolve blocking issues}
- Run `/refine paper/main.tex --focus writing` for final polish
- Manual review of anonymous compliance

Append log:

python3 tools/research_wiki.py log wiki/ \
  "paper-compile | {SUCCESS/FAILED} | {pages} pages, {errors} errors, {verify_count} [UNCONFIRMED], {checks_passed}/{checks_total} checks passed"

Constraints

  • Do not modify wiki content: only operate on the paper/ directory and wiki/log.md
  • Auto-fix requires --fix: by default, only report errors; do not fix
  • [UNCONFIRMED] is a hard blocker: [UNCONFIRMED] present in submission checklist = not submittable
  • Maximum 3 fix-compile rounds: prevent infinite fix loops
  • Do not delete user content: auto-fix only adds or corrects; does not delete hand-written content
  • pdfinfo/pdffonts dependency: if not installed, skip the corresponding check and annotate "tool not available"
  • Anonymity check is heuristic: may produce false positives; annotate as WARN rather than FAIL

Error Handling

  • main.tex not found: error; suggest running /paper-draft first
  • latexmk not installed: error; provide installation command (sudo apt install texlive-full or brew install --cask mactex)
  • Compilation failed and auto-fix unsuccessful: output full error log + locate specific .tex file and line number
  • pdfinfo/pdffonts not installed: skip page count / font checks; annotate in report
  • PAPER_PLAN not found: skip venue info extraction; use default limit (10 pages); warn user
  • Permission issue (tlmgr requires sudo): report list of packages requiring manual installation

Dependencies

Tools(via Bash)

  • latexmk — LaTeX compilation
  • pdfinfo — PDF page count check (poppler-utils)
  • pdffonts — font embedding check (poppler-utils)
  • python3 tools/research_wiki.py log wiki/ "<message>" — append log

MCP Servers

  • None

Claude Code Native

  • Read — read .tex files and compilation logs
  • Edit — auto-fix .tex files (--fix mode)
  • Bash — execute compilation and check commands
  • Grep — search for [UNCONFIRMED], TODO, anonymity violations

Shared References

  • .claude/skills/shared-references/citation-verification.md — [UNCONFIRMED] marker check rules
  • .claude/skills/shared-references/academic-writing.md — venue page limit reference

Called by

  • /research Stage 5 (paper compilation stage)
  • Manual user invocation

Download now (ZIP)

Trending

More talk lately.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the PKU-DAIR/AutoSci repository that our weekly crawl found: only 1 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about PKU-DAIR/AutoSci

The biggest 1 of 1 mention linking to the repository that our crawl found. Each line is their own headline.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.