overleaf-setup
Skill3 starsChanged 3 months agoMITView on GitHub
Use once when a LaTeX project needs Overleaf synchronization with Warranted citation enforcement. Installs/authenticates leaf, binds a local LaTeX directory to an Overleaf project, and writes the Stop hook that pushes staged source with prop_N citations expanded.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- DanielHou315/overleaf-mcp-rttheir own version, first seen Sep 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- DanielHou315/overleaf-mcp-rt★ 10same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- browserSkill
- cite-reviewSkill
- literature-surveySkill
- literature-writingSkill
- paper-download-browserSkill
- paper-reproduceSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
Ask the user to open https://www.overleaf.com, log in, then go to DevTools → Application → Cookies → copy the value of overleaf_session2 …
- Very specific: line 42
Write the value to ~/.olauth
- Distinctive: line 49
Ask the user whether they want to sync to an existing project or create a new one.
- Very specific: line 51
Existing project: run leaf list, show the output, ask which project to use.
- Distinctive: line 53
New project: ask for a project name, then run:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Goal
Configure automatic Overleaf push so that every .tex edit triggers a push without further agent involvement. The skill ends when the hook is written to settings.local.json and the user has been told to restart Claude Code.
Step 1 — Install
uv tool install overleaf-for-agentsVerify:
leaf --versionStep 2 — Authenticate
leaf loginA browser window opens. Tell the user: "Log in to Overleaf and wait for your project dashboard to appear. Let me know when ready."
Verify after confirmation:
leaf listFallback — if leaf login fails (no Chrome / CDP error):
- Ask the user to open https://www.overleaf.com, log in, then go to DevTools → Application → Cookies → copy the value of
overleaf_session2(starts withs%3A) - Write the value to
~/.olauth - Retry
leaf list
Step 3 — Choose or create project, and local directory
Ask the user whether they want to sync to an existing project or create a new one.
Existing project: run leaf list, show the output, ask which project to use. Record PROJECT_ID (24-char hex).
New project: ask for a project name, then run:
leaf create "NAME"Record PROJECT_ID from the output.
Also ask which local directory contains the LaTeX files. Record LATEX_DIR (absolute path).
Step 4 — Init
leaf init --project PROJECT_ID --dir LATEX_DIRThis writes leaf.toml into LATEX_DIR. The push script copies it into staging on each run.
Step 5 — Write the hook
Determine SKILL_DIR (absolute path to ${CLAUDE_PLUGIN_ROOT}/skills/overleaf-setup) and DB_PATH (absolute path to .toulmin/graph.db).
Merge the following into .claude/settings.local.json, preserving any existing hooks:
{
"hooks": {
"Stop": [{
"hooks": [{
"type": "command",
"command": "uv run SKILL_DIR/scripts/overleaf-push.py --dir LATEX_DIR --db DB_PATH --require-prop-cites",
"timeout": 120,
"statusMessage": "Checking citations and pushing to Overleaf..."
}]
}]
}
}Replace LATEX_DIR, SKILL_DIR, and DB_PATH with the actual absolute paths before writing.
Step 6 — Done
Tell the user:
"Hook configured. Please restart Claude Code to activate it — hooks only take effect after a restart, and restarting also clears this setup context. After restart, Overleaf will be updated automatically at the end of each conversation turn. Turns where no files under
LATEX_DIRchanged are skipped."
The skill is complete. Do not proceed further.
Error handling reference
| Error | Fix |
leaf.toml not found on push | Re-run Step 4 |
| CSRF / 401 / 403 | Session expired — re-run Step 2 |
| HTTP 422 | Re-run Step 4 |
~/.olauth missing | Not logged in — re-run Step 2 |
| Proposition IDs not in map | The proposition has no PDF attached — attach the paper file in Warranted before the next edit |
| Proposition does not exist | Repoint prop_N to an existing proposition; never create a replacement merely to preserve an obsolete number |
| Only non-PDF attachments | Attach the original paper PDF. Notes, tables, and extracted text may remain attached but cannot provide a bibliography key |
| Attached PDF is missing | Restore the file at the reported project-relative path, or update the proposition attachment before retrying |
PDF stem absent from .bib | Rename the PDF so its stem equals the intended BibTeX key, or add the matching entry to the LaTeX project's .bib file |
| Several PDF attachments | Supported: \cite{prop_N} expands to every distinct PDF stem. Every PDF must exist and every stem must appear in a project .bib file |
| Several attachments including notes | Supported: non-PDF attachments remain audit evidence but are ignored for citation expansion; at least one valid original-paper PDF is still required |
legacy citation key statement_N | The key points into the archived Statement graph. Re-identify the finding it cited, create or reuse a proposition, and repoint the key — never map by number |
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
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.

