Skip to content
Agentmart
Submit a tool
This entry duplicates office-editing, which is the one we list in search.

office-editing

Use when reading or editing Microsoft Word (.docx) or Excel (.xlsx) files that live in MMA SharePoint/OneDrive — the synced folder…

Skill by mmaglobal

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/mmaglobal-office-editing

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when reading or editing Microsoft Word (.docx) or Excel (.xlsx) files that live in MMA SharePoint/OneDrive — the synced folder ~/Library/CloudStorage/OneDrive-MMAGlobal, or files only in SharePoint/Teams. Covers the OneDrive/SharePoint transport waterfall, the Word run-splitting gotcha, and reading Word comments. NOT needed for plain local files (e.g. ~/Downloads, a repo working copy) — those are edited directly with python-docx/openpyxl.

Use cases: documents, spreadsheets, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions: not checked yet.

What's inside

Skill name
office-editing
Description
Use when reading or editing Microsoft Word (.docx) or Excel (.xlsx) files that live in MMA SharePoint/OneDrive — the synced folder ~/Library/CloudStorage/OneDrive-MMAGlobal, or files only in SharePoint/Teams. Covers the OneDrive/SharePoint transport waterfall, the Word run-splitting gotcha, and reading Word comments. NOT needed for plain local files (e.g. ~/Downloads, a repo working copy) — those are edited directly with python-docx/openpyxl.
License
MIT
Instructions
59 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Editing Word & Excel files

Edit by running a Python script via Bash. **Don't read the whole document into the conversation** — the script makes the targeted change and returns only a confirmation. Both libraries are already installed (python-docx 1.2.0, openpyxl 3.1.5); don't reinstall.

**Scope:** this skill is for MMA SharePoint/OneDrive documents. For a **plain local file** (`~/Downloads`, a repo working copy, anything not in SharePoint/OneDrive), skip the transport section and just edit it in place with python-docx/openpyxl — editing local files is the default and this skill never blocks it. The run-splitting and comments sections below apply to any `.docx` regardless of where it lives.

- `.docx` → python-docx (`import docx`)
- `.xlsx` → openpyxl (`import openpyxl`)

## Waterfall (verified — quality is a tie, local wins on tokens)

The editor is python-docx/openpyxl either way — **ms365/Graph has no content-edit tool, it only moves bytes** — so editing fidelity is identical across methods. The choice is purely transport cost.

1. **File has a path on this Mac** (anywhere on disk, including OneDrive-synced `~/Library/CloudStorage/OneDrive-MMAGlobal/…`) → **edit in place by path. This is the default.** One Bash call, file bytes never enter the conversation (verified: full create→edit→save roundtrip in 0.03s). OneDrive files auto-download on open and re-sync on save (see below).
2. **File is only in SharePoint/Teams and NOT synced to this Mac** (no local path) → use ms365 as transport, via `curl` so bytes bypass context:
   - download: `get-drive-item` → take `@microsoft.graph.downloadUrl` → `curl -o /tmp/f.docx "<url>"`
   - edit `/tmp/f.docx` with python-docx
   - upload: `create-upload-session` → `curl -X PUT --data-binary @/tmp/f.docx "<uploadUrl>"`
   - **Avoid `download-bytes` / `upload-file-content`** except for tiny files — they pass the file as base64 through the conversation (token-expensive, 4MB cap).

## OneDrive online-only files

Files under `~/Library/CloudStorage/OneDrive-MMAGlobal` are usually online-only placeholders (0 blocks on disk). **Opening the path auto-downloads it** — python-docx, openpyxl, and `cat` all trigger hydration transparently, then proceed. Saving keeps the same path and OneDrive re-uploads automatically, so the file's link and "recent files" position are preserved.

- Check state: `stat -f '%b' "<file>"` → `0` = not downloaded yet (first open blocks while it pulls).
- Requires the OneDrive client running and online. For a large file, open it once to pre-warm.

## Word: the run-splitting gotcha

Word splits a paragraph's text across multiple "runs." Reading `paragraph.text` works, but **assigning to it does nothing** — you must write to runs. To replace text, capture the full text first, blank the extra runs, write the result into the first (this collapses to run 0's formatting, fine for plain text):

```python
for p in doc.paragraphs:
    if "OLD" in p.text:
        new = p.text.replace("OLD", "NEW")
        for r in p.runs[1:]:
            r.text = ""
        if p.runs:
            p.runs[0].text = new
```
Tables: iterate `doc.tables[i].rows[j].cells[k].paragraphs`.

## Reading Word comments (python-docx can't)

Comments live in `word/comments.xml` inside the .docx zip:

```python
import zipfile, defusedxml.ElementTree as ET  # defusedxml: safe vs XXE/billion-laughs
ns = {"w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}
with zipfile.ZipFile(path) as z:
    if "word/comments.xml" in z.namelist():
        root = ET.fromstring(z.read("word/comments.xml"))
        for c in root.findall("w:comment", ns):
            author = c.get(f"{{{ns['w']}}}author")
            text = "".join(t.text or "" for t in c.iter(f"{{{ns['w']}}}t"))
            print(author, ":", text)
```

From mmaglobal/MAVEN, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Jun 26, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Same skill elsewhere

Copies of this SKILL.md published by others; search shows only one of them.

More from mmaglobal

Cite this page

office-editing skill. Agent Mart. https://agentmart.dev/skills/mmaglobal-office-editing (last updated 2026-10-24)