agentleFS
yqi96yqi96/warranted/skills/overleaf-setup/SKILL.md

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

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    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.

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
  1. Very specific:

    Ask the user to open https://www.overleaf.com, log in, then go to DevTools → Application → Cookies → copy the value of overleaf_session2 …

    line 41
  2. Very specific:

    Write the value to ~/.olauth

    line 42
  3. Distinctive:

    Ask the user whether they want to sync to an existing project or create a new one.

    line 49
  4. Very specific:

    Existing project: run leaf list, show the output, ask which project to use.

    line 51
  5. Distinctive:

    New project: ask for a project name, then run:

    line 53

≈ “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.

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

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-agents

Verify:

leaf --version

Step 2 — Authenticate

leaf login

A 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 list

Fallback — if leaf login fails (no Chrome / CDP error):

  1. Ask the user to open https://www.overleaf.com, log in, then go to DevTools → Application → Cookies → copy the value of overleaf_session2 (starts with s%3A)
  2. Write the value to ~/.olauth
  3. 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_DIR

This 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_DIR changed are skipped."

The skill is complete. Do not proceed further.


Error handling reference

ErrorFix
leaf.toml not found on pushRe-run Step 4
CSRF / 401 / 403Session expired — re-run Step 2
HTTP 422Re-run Step 4
~/.olauth missingNot logged in — re-run Step 2
Proposition IDs not in mapThe proposition has no PDF attached — attach the paper file in Warranted before the next edit
Proposition does not existRepoint prop_N to an existing proposition; never create a replacement merely to preserve an obsolete number
Only non-PDF attachmentsAttach the original paper PDF. Notes, tables, and extracted text may remain attached but cannot provide a bibliography key
Attached PDF is missingRestore the file at the reported project-relative path, or update the proposition attachment before retrying
PDF stem absent from .bibRename the PDF so its stem equals the intended BibTeX key, or add the matching entry to the LaTeX project's .bib file
Several PDF attachmentsSupported: \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 notesSupported: 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_NThe 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

Download now (ZIP)

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.