An agent that edits your Word and Excel files — then looks at them, through real Microsoft Office, to check its own work
# Add to your Claude Code skills
git clone https://github.com/richardChenzhihui/OfficeBuddyOfficeBuddy is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by richardChenzhihui. An agent that edits your Word and Excel files — then looks at them, through real Microsoft Office, to check its own work. It has 50 GitHub stars.
OfficeBuddy's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/richardChenzhihui/OfficeBuddy" and add it to your Claude Code skills directory (see the Installation section above).
OfficeBuddy is primarily written in Python. It is open-source under richardChenzhihui on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh OfficeBuddy against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Most document agents write bytes into a file and hope. OfficeBuddy renders the document through Microsoft Word and Excel themselves after every single edit, diffs the pages, and hands the screenshot to a separate multimodal verifier that has to sign off before the next step begins. When the verifier objects, it says which page, which element, what is wrong — so the repair is targeted, not a blind retry.
The renderer is not a lookalike engine. It is Word.
Nothing below is a mockup. This is a real run on a real .docx, on a real Mac, rendered by
real Word — instruction: "Make the title bold, 24pt and centered; then add a 2×3 table at
the end with headers 任务/负责人/状态 and one data row, with black solid borders."
That red box is not decoration. It is drawn by a pixel diff against the last verified render, so the verifier is told exactly where to look instead of re-reading the whole page.
The complete evidence trail — the model's plan, every tool call, the rendered PDFs, and the
verifier's structured verdicts — is checked into
examples/harness-walkthrough/. Read it and grade the claim
yourself.
git clone https://github.com/richardChenzhihui/OfficeBuddy.git
cd OfficeBuddy
pip install -e .
export MINIMAX_API_KEY=... # Anthropic-compatible endpoint, model MiniMax-M3
officebuddy doctor # one-time automation-permission setup + self-check
Then just talk to it:
# one-shot, then drop into a REPL to keep going
officebuddy "把第一段改成 Times New Roman 12 号,并加粗标题" report.docx
# pure one-shot
officebuddy "add a totals row and bold it" sales.xlsx --one-shot
# interactive session
officebuddy
Useful flags:
| Flag | What it does |
|---|---|
--yes |
allow overwriting the original file (non-interactive use) |
--no-visual-verify |
skip the render loop — faster for pure data edits |
--verbose / -v |
show every tool call and its result |
--one-shot |
run the task and exit instead of entering the REPL |
--non-interactive |
never ask questions; take the safe default |
Requirements: macOS, Microsoft Word / Excel (they are the renderer), Python 3.10+, and a
MiniMax API key.
office-agent still works as an alias of the officebuddy command.
| Read | Edit | Rendered verification | |
|---|---|---|---|
Word (.docx) |
✅ | ✅ | ✅ |
Excel (.xlsx) |
✅ | ✅ | ✅ |
Word — text editing and find/replace (paragraph- and run-level), character styling (font,
size, bold/italic/underline, color, per-script CJK font slots), paragraph styling
(alignment, indent, spacing), inserting and deleting elements (paragraphs, tables, page
breaks), table and cell borders (tblBorders / tcBorders), and structure inspection.
Excel — cell read/write with type preservation, formulas, cell and range styling (font,
fill, alignment, number format, borders), conditional selection (row[Salary>5000]-style
predicates), row/column insertion and deletion, sheet management, freeze panes, charts, and a
fidelity guard that inventories the workbook's parts before and after a save and reports
exactly what the underlying reader would have dropped.
<name>.edited.<ext>. Overwriting the original requires an
interactive confirmation or --yes.undo and
restore work at any point.doctor walks you
through it.cli.py REPL / one-shot / doctor
agent/
loop.py main harness: plan → clarify → execute → render → verify → repair
verifier.py independent stateless visual verification (forced structured verdict)
budget.py error signatures + escalation ladder (retry → new strategy → ask)
history.py message history (images are kept out of the main loop's context)
tools/
registry.py pydantic models → tool schemas; uniform error envelope; auto-snapshot
word_tools.py word_edit_text / edit_style / insert_element / delete_element /
find_replace / read_content
excel_tools.py excel_write_cells / edit_formula / edit_style / conditional_select /
create_chart / manage_sheet / freeze_panes / fidelity_report / …
interaction_tools.py propose_plan / update_plan / ask_user / render_preview
render/
applescript.py Word/Excel → PDF (in-container, dialog-free, timeout + error classes)
pdf_to_images.py PDF → PNG (PyMuPDF, 144 dpi)
page_diff.py changed-page detection + red bounding-box annotation
renderer.py content-addressed render cache + verified-baseline ratchet
core/
session.py working-copy isolation (the original is touched only on explicit save)
snapshot_manager.py per-step byte snapshots + persistent index (undo / restore)
adapters/ stateless python-docx / openpyxl operation layer
After the first demo run, plain body text showed words that looked randomly bolder than
their neighbours — in a paragraph the agent had never touched. Chasing it down: the source
document.xml had no per-character formatting at all, but pdffonts showed the exported PDF
embedding both MS-Mincho and MicrosoftYaHei, and a per-span extraction confirmed Word was
guessing a fallback font per CJK character, because the document's Normal style declared
no east-asian font.
That is exactly the class of defect a byte-level assertion can never see and a rendered
screenshot cannot miss. The fix — proper w:eastAsia font slots in the Word adapter — and the
full investigation are written up in
examples/harness-walkthrough/README.md.
Longer write-ups on the edit layer live in docs/edit-layer-designs/:
the native-ops router, the
Excel fidelity guard, and the
Word raw-XML patch modality.
There is also a self-contained visual walkthrough of the harness design at
examples/harness-walkthrough/visualization/harness-design-manual.html
— download it and open it in a browser.
.xlsx that already contains charts or images and saving it loses them.
openpyxl's reader does not parse them. You are warned explicitly on open and told not to
overwrite the original; pure data and styling edits are unaffected.