iwork-studio
AGENTS.md3 starsChanged 20 days agoMITView on GitHub
Instructions for any AI agent (Claude Code, Codex, Cursor, Copilot, Gemini, …) working with or on this repo. iWork Studio creates, reads, edits, formats, themes and exports Apple Numbers (.numbers), Keynote (.key) and Pages (.pages) files. Use it whenever a request touches one of those. Pick your interface, in this order: 1. MCP tools (names start with iwork, numbers, keynote, pages) — install as in the table above. 2. Skill — skill-pack/SKILL.md (also at .claude/skills/iwork-studio/): CLI scripts with JSON output.…
- Pipes a download into a shell
- Installs packages
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 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.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
If the user only needs some apps, load fewer tools: env IWORK_STUDIO_TOOLSETS = any of files, numbers, keynote, pages, design …
- Distinctive: line 29
Use it whenever a request touches one of those.
- Distinctive: line 65
Every write is backed up, checked and atomic: If a tool errors, the file is untouched.
- Very specific: line 70
Start with
iwork_capabilities: when unsure what the machine can do. - Very specific: line 83
Preview broad changes: every write on an existing file takes dry_run=true (real change on a throwaway copy, returns what would change).
- Very specific: line 86
Make it look designed: use a design kit (the user's saved brand kit if they have one) and follow skill-pack/references/design-guide.md (one …
- Very specific: line 90
Check before you say done: after building or restyling a deck, run keynote_review_deck, fix every error (shorten text or split the slide), …
- Very specific: line 109
After an important write, offer iwork_verify_render.
- Very specific: line 126
Every new write route must ride the write protocol: versioned backup → change a scratch copy → re-read + compare → atomic os.replace → …
- Distinctive: line 128
Add headless tests that stub the app and prove the rollback.
- Very specific: line 133
Keep personal data out of the repo: no hostnames, home paths, names or machine logs.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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.
Files
AGENTS.md — iWork Studio
Instructions for any AI agent (Claude Code, Codex, Cursor, Copilot, Gemini, …) working with or on this repo.
Setting this up for a user? (do this first)
| User's app | Command |
| Claude desktop app (Mac) | curl -LsSf https://raw.githubusercontent.com/Arkanji/iwork-studio/main/install.sh | sh, then the user quits Claude (Cmd-Q) and reopens |
| Claude Code (plugin: tools + skill) | claude plugin marketplace add Arkanji/iwork-studio then claude plugin install iwork-studio@iwork-studio |
| Claude Code (tools only) | claude mcp add iwork-studio -- uvx --from iwork-studio@latest iwork-studio-mcp |
| Any other MCP client | uvx --from iwork-studio@latest iwork-studio-mcp config → paste the printed JSON into the client's MCP config |
| Hermes Agent | hermes plugins install iwork-studio, then hermes plugins enable iwork-studio |
- The installer installs
uvif missing; uv brings its own Python. Don't tell the user to install Python. - Recommend a folder fence:
… | sh -s -- --roots ~/Documents ~/Desktop(or envIWORK_STUDIO_ROOTS,:-separated). - If the user only needs some apps, load fewer tools: env
IWORK_STUDIO_TOOLSETS= any offiles,numbers,keynote,pages,design(comma-separated; default all).iwork_capabilitiesshows what's loaded. - The desktop app needs the absolute uvx path in its config; the installer and
confighandle that. Never hand-write a bare"command": "uvx"for the desktop app. .mcp.jsonin this repo runs the released package from PyPI (directories read it as the install config).hermes/is the Hermes catalog package (Agent Plugins v1:plugin.json,mcp.json,skills/). Its server is pinned to the exact release, never@latest: the catalog bans self-updating code. Each release bumps its version, then a PR on NousResearch/hermes-agent moves the catalog pin;tests/test_packaging.pychecks the versions agree.- First run: macOS asks once to let Claude control Keynote/Pages/Numbers → user clicks OK (fix later in System Settings → Privacy & Security → Automation). Logs:
~/Library/Logs/Claude/mcp-server-iwork-studio.log. - Verify: call
iwork_capabilities.
Using it: edit iWork files for a user
iWork Studio creates, reads, edits, formats, themes and exports Apple
Numbers (.numbers), Keynote (.key) and Pages (.pages) files.
Use it whenever a request touches one of those.
Pick your interface, in this order:
- MCP tools (names start with
iwork_,numbers_,keynote_,pages_) — install as in the table above. - Skill —
skill-pack/SKILL.md(also at.claude/skills/iwork-studio/): CLI scripts with JSON output. - Python —
pip install -e ., theniwork_studio.numbers_io,numbers_format,numbers_structure,keynote_io,keynote_slides,keynote_theme,keynote_deck,design,preview,pages_io,app_ops,exporter,helpers,backups.
What each route needs
| Task | Tools | Needs |
| Read any file · find files · metadata · thumbnail | iwork_read, iwork_find, iwork_metadata, iwork_thumbnail | Python only (.pages read needs the app) |
Create .numbers from data / CSV · insert/delete rows & columns · add tables | numbers_create, numbers_import_csv, numbers_insert, numbers_delete, numbers_add_table | Python only |
Edit / format .numbers (cells, style, number format, borders, sizes, headers, merge) | numbers_edit_cell, numbers_inspect_format, numbers_set_*, numbers_merge_cells | Python only |
| Formulas · recalculate · sort | numbers_set_formula, numbers_recalculate, numbers_sort | macOS + Numbers + GUI session |
Find/replace .key text | keynote_replace_text | Python only |
| Keynote slides: add, duplicate, delete, move, hide, notes, images, charts, tables, transitions | keynote_list_slides, keynote_*_slide, keynote_set_presenter_notes, keynote_add_image, keynote_add_chart, keynote_add_table, keynote_set_transition | macOS + Keynote + GUI session |
| Build a deck from an outline (with chart and table slides, from data or a Numbers table) · slide titles/bullets | keynote_build_deck, keynote_set_slide_text | macOS + Keynote + GUI session |
| Check a deck's design as rendered · look at a slide | keynote_review_deck, keynote_slide_image | macOS + Keynote + GUI session |
| Keynote theming: theme, layout, text font/size/colour | keynote_list_themes, keynote_inspect_style, keynote_set_theme, keynote_set_slide_layout, keynote_format_text | macOS + Keynote + GUI session |
| Design kits: designed decks and tables | iwork_list_design_kits, keynote_apply_design, numbers_apply_design | Keynote: macOS + Keynote · Numbers: Python only |
| The user's brand kit: from their own file, saved by name | iwork_extract_design_kit, iwork_save_design_kit, iwork_delete_design_kit | from .numbers or saving: Python only · from .key: macOS + Keynote |
| Present | keynote_slideshow | macOS + Keynote + GUI session |
| Pages text and tables | pages_preflight, pages_replace_all, pages_set_body, pages_list_placeholders, pages_fill_placeholders, pages_read_tables, pages_set_table_cells | macOS + Pages + GUI session |
| New file from Apple's templates · from the user's own file | iwork_list_templates, iwork_create · iwork_create_from_template | the app · Python only |
| Export (PDF, xlsx, csv, docx, epub, pptx, images, movie…) | iwork_export | macOS + the app |
| Check the rendered result | iwork_verify_render, iwork_verify_format | macOS + the app + GUI session |
| Undo any write | iwork_list_backups, iwork_restore_backup | works anywhere |
Rules — follow them, don't work around them
- Every write is backed up, checked and atomic. If a tool errors, the file is untouched. Report the error to the user; do not retry with tricks.
- Open files are refused (
DocumentOpenError) by every write: ask the user to save and close the file.AutomationDeniedErrormeans the user must allow Automation once in System Settings;AppTimeoutErrormeans a dialog is open in the app. - Start with
iwork_capabilitieswhen unsure what the machine can do.AquaSessionError= no macOS GUI here: say so, don't retry. - Charts: the no-app routes refuse files with charts (
ChartRefusalError); the app-driven routes work on them and check every chart is kept. Add Keynote charts withkeynote_add_chart; Numbers/Pages charts can't be created. Never bypass a refusal. - Pages has four writes:
pages_replace_all,pages_set_body(resets body formatting — warn the user),pages_fill_placeholdersandpages_set_table_cells(existing tables only; new tables can't be created). Anything richer is out of scope (PagesOutOfScopeError). Runpages_preflightfirst; aPagesUnavailableError/ -1712 means a human must dismiss a dialog once. Page-layout documents (most letter/flyer templates) have no body text: onlypages_fill_placeholdersapplies to them. - Preview broad changes: every write on an existing file takes
dry_run=true(real change on a throwaway copy, returns what would change). Use it before restyling, deleting or replacing widely, and show the user. - Make it look designed: use a design kit (the user's saved brand kit if they have one) and follow
skill-pack/references/design-guide.md(one idea per slide, titles state the takeaway, right-aligned numbers; numbers go in chart or table slides, not bullets). - Check before you say done: after building or restyling a deck, run
keynote_review_deck, fix every error (shorten text or split the slide), and look at a slide withkeynote_slide_image. - New files never overwrite. Pick a new name if the tool says it exists.
- Stale totals: Numbers doesn't recalculate on open. When a no-app edit
returns
formulas_need_recalc, runnumbers_recalculate(Mac) or tell the user. - Sorting:
numbers_sortrefuses a table whose formulas read other rows (SortBreaksFormulasError). Offerto_new_table=true(a sorted values-only copy); never rewrite the user's formulas to force a sort. - Formula tables: rows/columns can only be appended headlessly
(
StructureErrorotherwise); suggest doing mid-table inserts in Numbers. - Keynote slide/theme/image/transition ops refuse a deck open in Keynote (
DocumentOpenError): ask the user to save and close it. Slide numbers are 1-based. The last slide can't be deleted. Keynote tables can be added but not deleted (Keynote refuses); a failed add is undone from the backup. - Arabic/RTL: text round-trips exactly. For
iwork_verify_render, assert ONE Arabic word — multi-word RTL extracts reordered and fails falsely. - Never convert to docx/pptx/xlsx and back (lossy), and never AppleScript
save in <path>(sandbox denies it; in-place save + export only). - After an important write, offer
iwork_verify_render; after a mistake, offeriwork_restore_backup.
Working on it: change this codebase
- To run your local changes from a clone:
claude mcp add iwork-studio-dev -- uv run --quiet --project . iwork-studio-mcp. - Planning uses Spec Kit: the constitution is
.specify/memory/constitution.md, specs are inspecs/. The agent skills (/speckit-*) aren't committed; recreate them withuvx --from git+https://github.com/github/spec-kit.git specify init --here --force --integration claude(thengit checkout -- .specify/memory/constitution.mdto keep the constitution). - Python 3.12.
uv run --extra test pytest -m "not aqua"= the headless suite (what CI runs, withruff check src tests scripts).pytest -m aqua(orscripts/live.sh, unattended: logs and quits the apps it opened) +scripts/probe_keynote_slides.py= the live lane; needs a Mac with iWork (classic or Creator Studio). Clone outside iCloud-synced folders. - Dependency pins:
pyproject.tomlmust equalskill-pack/references/pins.txt(a test enforces it). - Every new write route must ride the write protocol: versioned backup → change
a scratch copy → re-read + compare → atomic
os.replace→ rollback on failure. Add headless tests that stub the app and prove the rollback. src/iwork_studio/mcp_server.pymust never print to stdout (it is the MCP wire); a test fails if anything does.- Known scripting traps:
skill-pack/references/jxa-traps.md,capability-matrix.md. - Keep personal data out of the repo: no hostnames, home paths, names or
machine logs. Live-probe output stays in
~/.iwork-studio/probes/.
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 28,693 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.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- iwork-studioSkill
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.

