sync-overleaf
Skill17 starsChanged 3 months agoMITView on GitHub
Use after producing or updating empirical tables/figures that belong in a paper, and before writing any file in an Overleaf-synced folder. Gets artifacts into the Overleaf folder (or confirms the producers already wrote them there), protects the user's web-editor edits, catches Dropbox conflicted copies, and verifies the compile.
In this repository14 other files it gives its agents.
- codex-bridgeSkill
- codex-review-planSkill
- overleafSkill
- plan-debateSkill
- power-firstSkill
- referee-panelSkill
- refresh-pipelineSkill
- review-codex-planSkill
- robustness-batterySkill
- spec-curve-sweepSkill
- stata-preflightSkill
- tableSkill
- verify-claimsSkill
- verify-numbers-pipelineSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 14
Run overleaf-sync-now sync <folder> first.
- Very specific: line 15
Read/Edit/Write; Bash cp/rsync and Python rewrites bypass it.
- Distinctive: line 18
If the user says they are revising a file by hand, leave it alone until they say otherwise.
- Distinctive: line 20
Keep Overleaf comment anchors and coauthors' comments intact when editing nearby text.
- Distinctive: line 36
Never delete files in the Overleaf folder — only add or overwrite.
- Very specific: line 45
Don't run overleaf-sync-now sync in a loop right after writing — that invites the round-trip race.
- Distinctive: line 52
If Overleaf still doesn't show the change after ~20 minutes (the bridge has stalled for hours before), say so and tell the user.
- Distinctive: line 57
Diff before writing: If the pulled Overleaf version differs from the local copy, show the diff and ask which to keep.
- Very specific: line 59
Targeted edits only: Never regenerate or overwrite a whole .tex file when an Edit on the specific block will do — regenerating clobbers the …
- Distinctive: line 61
If an Edit fails because the file changed underneath (the sync hook updated it mid-edit), re-read and redo the edit.
- Very specific: line 66
After any table or figure edit, recompile the root that \inputs it (see the table skill: tectonic -Z continue-on-errors --keep-logs -o …
≈ “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
Sync Overleaf
Overleaf folders live under ~/Dropbox/Apps/Overleaf/<paper>/ (or your Dropbox root's
equivalent) — confirm the folder before writing; project folders may sit in a different Dropbox root. Overleaf ↔ Dropbox
is a two-way bridge, and the user edits in the Overleaf web editor between turns.
1. Before ANY write under Apps/Overleaf/
- Run
overleaf-sync-now sync <folder>first. The PreToolUse hook only fires on Read/Edit/Write; Bashcp/rsyncand Python rewrites bypass it. - Edit the Overleaf-folder copy in place. Never keep a separate "master" copy and
cpit over — that has clobbered the user's web edits before. - If the user says they are revising a file by hand, leave it alone until they say otherwise. Re-read a file right before editing so you never overwrite edits they just made.
- Keep Overleaf comment anchors and coauthors' comments intact when editing nearby text.
.bibfiles come from Zotero. Never edit them directly; tell the user what to add in Zotero.
2. Getting tables and figures in
Find out which case the project uses:
- Producers write straight into the Overleaf folder (esttab or a generator writes both the
project's
tables/and Overleaf'sTables/). Don't copy — verify:for f in tables/*.tex; do cmp -s "$f" "$OL/Tables/$(basename "$f")" || echo "DIFFERS $f"; done - Copy mode (artifacts exist only in the project):
diff -qeach source against the destination and list NEW / CHANGED / UNCHANGED. Runoverleaf-sync-now sync, then copy only NEW + CHANGED, preserving filenames so\input{}/\includegraphics{}calls don't change.
Never delete files in the Overleaf folder — only add or overwrite. If a filename collides but the content differs on purpose (e.g. an anonymized version), ask before overwriting.
3. After writing — confirm it actually landed
Dropbox can silently demote a just-written file to <name> (… conflicted copy <date>).tex
and restore Overleaf's older content as the live file, keeping the old mtime. A compile right after the write proves nothing.
- Save a copy of each edited file outside Dropbox (scratchpad) before anything else.
- Don't run
overleaf-sync-now syncin a loop right after writing — that invites the round-trip race. Adropbox_echoresult doesn't mean the edit reached Overleaf. - A minute or two later, re-read the file and check the change is still there. Run
find "$OL" -name "*conflicted copy*"before concluding anything is lost. - To confirm real sync, download
https://www.overleaf.com/project/<id>/download/zipwith theoverleaf_session2cookie from~/.overleaf-sync/cookies.jsonandshasumthe file against local. - If Overleaf still doesn't show the change after ~20 minutes (the bridge has stalled for hours before), say so and tell the user. Don't keep rewriting the file.
4. Editing .tex files
- Diff before writing. If the pulled Overleaf version differs from the local copy, show the diff and ask which to keep. Do not merge on your own.
- Targeted edits only. Never regenerate or overwrite a whole
.texfile when an Edit on the specific block will do — regenerating clobbers the user's web-editor prose. - If an Edit fails because the file changed underneath (the sync hook updated it mid-edit), re-read and redo the edit. Don't fall back to rewriting the file.
5. Verify the compile before reporting done
After any table or figure edit, recompile the root that \inputs it (see the table skill:
tectonic -Z continue-on-errors --keep-logs -o "$TMP" <root>.tex). Check the affected page —
fit, float placement, header layout — and report the actual measurement (e.g.
Overfull \hbox (83.0pt too wide) at line 412). Never say a fit is "fixed" without a compile
that shows it. Render the page with pdftoppm and show the PNG so the user can check it without
opening the PDF.
Reporting
List NEW and CHANGED paths with sizes (≤ 10 lines). When the user asks to see a table, show it — the table itself or the rendered page.
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.

