agentleFS
ljdstechvaljdstechva/ogent-an-office-agent/AGENTS.md

ogent-an-office-agent

AGENTS.md0 starsChanged 4 months agoMITView on GitHub

PDFs are never edited directly. Convert the PDF to DOCX, edit the DOCX with officecli, then export a new PDF:

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

We split this AGENTS.md into the rules it gives an agent

9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

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

    Document tasks are SINGLE-AGENT.

    line 4
  2. Distinctive:

    Never use Start-Sleep / sleep / polling loops.

    line 7
  3. Very specific:

    Verify content with officecli view <file> text or officecli get --json.

    line 11
  4. Distinctive:

    Do NOT render page images to check work.

    line 12
  5. Very specific:

    Prefer one atomic officecli batch over many single edits.

    line 15
  6. Very specific:

    Do not rely on idle auto-flush.

    line 18
  7. Distinctive:

    Never commit or push personal documents.

    line 21
  8. Very specific:

    Use officecli for editable Word, Excel, and PowerPoint files.

    line 27
  9. Very specific:

    If conversion reports [SCANNED_PDF], stop and explain that OCR is required.

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md 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
AGENTS.md

Ogent workspace instructions

Speed rules for document tasks (mandatory)

  • Document tasks are SINGLE-AGENT. Never spawn a team, teammate, or subagent for creating/editing docx/xlsx/pptx/pdf. Reviews happen as a second sequential message in the same conversation, after the artifact exists.
  • Never use Start-Sleep / sleep / polling loops. Check outputs directly.
  • PDF is never edited directly. Pipeline: tools\pdf2docx.ps1 (Word COM first) -> edit the .docx with officecli -> tools\docx2pdf.ps1. Scanned/image PDFs: stop and report "needs OCR" honestly.
  • Verify content with officecli view <file> text or officecli get --json. Do NOT render page images to check work; render at most once at final delivery, only if the user asks.
  • officecli syntax unsure? Run officecli help <format> <element> — never guess.
  • Prefer one atomic officecli batch over many single edits.
  • LIVE PREVIEW: OFFICECLI_RESIDENT_FLUSH=each is set machine-wide (user env var), so every mutation is flushed to disk immediately and AionUi's preview panel updates live. Do not rely on idle auto-flush. OFFICECLI_NO_AUTO_RESIDENT=1 remains a valid per-shell alternative (direct mode); either is fine, never assume unflushed resident state is visible to other programs.
  • Never commit or push personal documents; pushes to public repos require the user's explicit yes.

Office document work

  • Work single-agent for document tasks. Do not spawn a team.
  • Use officecli for editable Word, Excel, and PowerPoint files. Inspect the relevant officecli help entry before guessing a command.
  • Preserve user originals. Unless the user explicitly requests an in-place edit, create a clearly named working copy and a new final output.
  • Close an officecli resident before another application reads the file. Validate final Office files and PDFs before reporting success; render once only when the user requests a final visual check.

PDF workflow

PDFs are never edited directly. Convert the PDF to DOCX, edit the DOCX with officecli, then export a new PDF:

powershell -NoProfile -ExecutionPolicy Bypass -File ".\tools\pdf2docx.ps1" -Pdf "<input.pdf>" -OutDocx "<working.docx>"
$env:OFFICECLI_NO_AUTO_RESIDENT = "1"
officecli view "<working.docx>" text
# Make the requested officecli edit in direct mode. Query both the old and new
# text afterward; do not trust the mutation command alone.
officecli query "<working.docx>" 'p:contains("<new text>")'
officecli query "<working.docx>" 'p:contains("<old text>")'
# Release any resident that was started before direct mode.
officecli close "<working.docx>"
powershell -NoProfile -ExecutionPolicy Bypass -File ".\tools\docx2pdf.ps1" -Docx "<working.docx>" -OutPdf "<output.pdf>"
  • In AionUi, set OFFICECLI_NO_AUTO_RESIDENT=1 before officecli mutations. The live acceptance test found that auto-resident mode could report success without persisting the change; direct mode plus old/new queries prevented a false positive.
  • If conversion reports [SCANNED_PDF], stop and explain that OCR is required; do not pretend the image-only PDF is editable.
  • Word PDF Reflow is the preferred engine. LibreOffice is an emergency fallback whose PDF import is shape based and may not expose normal paragraphs to officecli.
  • Reflow is not pixel-perfect for complex columns, floating graphics, or embedded fonts. Verify content and structure by default; if exact visual fidelity matters, ask the user for one final rendered comparison or rebuild from the source document.

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.