claude-numbers
CLAUDE.md0 starsChanged 12 days agoMITView on GitHub
A Claude Code skill for reading, analyzing, and modifying Apple Numbers spreadsheets entirely through Numbers.app — no third-party Python packages required. Installed by ./install.sh, which symlinks skills/numbers/ into ~/.claude/skills/numbers. See README.md for full installation instructions. No dependencies to install. Any Python 3.9+ works (scripts use from __future__ import annotations for 3.9 compatibility — keep it when adding modules). Run the end-to-end smoke test (Numbers.app opens and is visible — expected): Or test scripts directly against a real .numbers file: After…
In this repositoryOne other file it gives its agents.
- numbersSkill
The file
We split this CLAUDE.md into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
No dependencies to install.
- Distinctive: line 37
Run the end-to-end smoke test (Numbers.app opens and is visible — expected):
- Very specific: line 52
After editing the skill, reload it in a running Claude Code session with /reload-plugins (no restart needed).
- Distinctive: line 56
All Numbers interaction is driven through macOS automation — no file format parsing:
- Very specific: line 60
set_value.py,set_formula.py, andadd_rows.py: use AppleScript (via a temp .applescript file) for writing, because its … - Very specific: line 81
Versioning: keep version in sync between SKILL.md frontmatter and .claude-plugin/plugin.json.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.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
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What This Repo Is
A Claude Code skill for reading, analyzing, and modifying Apple Numbers spreadsheets entirely through Numbers.app — no third-party Python packages required. Installed by ./install.sh, which symlinks skills/numbers/ into ~/.claude/skills/numbers. See README.md for full installation instructions.
Repository Structure
claude-numbers/
├── .claude-plugin/
│ └── plugin.json Plugin manifest (name, version)
├── skills/
│ └── numbers/
│ ├── SKILL.md Skill definition — instructions Claude receives when activated
│ └── scripts/
│ ├── _common.py Shared helpers: osascript runner, doc handlers, escaping
│ ├── inspect.py Structure + preview + formulas as JSON (JXA)
│ ├── export_csv.py Table(s) to CSV (JXA read, stdlib csv write)
│ ├── export.py Whole document to xlsx/PDF via native export (AppleScript)
│ ├── set_value.py Writes literal values to cells (AppleScript)
│ ├── set_formula.py Writes formulas to cells (AppleScript)
│ └── add_rows.py Appends data rows to a table (AppleScript)
├── tests/
│ ├── make_fixture.py Builds a sample two-sheet .numbers file via Numbers.app
│ └── smoke_test.py End-to-end test of every script against the fixture
├── install.sh Symlinks skills/numbers into ~/.claude/skills
└── CLAUDE.mdDevelopment Setup
No dependencies to install. Any Python 3.9+ works (scripts use from __future__ import annotations for 3.9 compatibility — keep it when adding modules).
Run the end-to-end smoke test (Numbers.app opens and is visible — expected):
python3 tests/smoke_test.py # pass --keep to retain the workdirOr test scripts directly against a real .numbers file:
python3 skills/numbers/scripts/inspect.py ~/Desktop/sample.numbers
python3 skills/numbers/scripts/export_csv.py ~/Desktop/sample.numbers --output /tmp/out.csv
python3 skills/numbers/scripts/set_formula.py ~/Desktop/sample.numbers /tmp/out.numbers \
--formula B2 "=SUM(A1:A10)"After editing the skill, reload it in a running Claude Code session with /reload-plugins (no restart needed).
Architecture
All Numbers interaction is driven through macOS automation — no file format parsing:
inspect.pyandexport_csv.pyuse JXA (osascript -l JavaScript) for reading. JXA can batch-read an entire row as a native JS array viatable.rows[r].cells.value()(and.formula()), which is significantly faster than calling AppleScript per cell. The JXA source is a string constant; file paths and sheet/table names are passed as argv, never interpolated into the source (names containing quotes must not break or inject into the script).set_value.py,set_formula.py, andadd_rows.pyuse AppleScript (via a temp.applescriptfile) for writing, because its save-to-new-path behavior (save in POSIX file) is more reliable for mutations. They share thebuild_writer_script()skeleton in_common.py.export.pyuses Numbers' nativeexport ... as Microsoft Excel / PDFAppleScript command — one operation regardless of document size.
Conventions in _common.py (each guards against a real failure mode)
- Target Numbers by bundle id (
application id "com.apple.Numbers"), never by display name — the app bundle can be renamed on disk. - Match documents by path, falling back to name (with and without extension) — some Numbers builds fail to return the
pathproperty over AppleEvents, andname of documentomits the extension when Finder hides it. Never usewhose path is ...filters: they error if any open document is unsaved. - Retry
openwith polling — a cold-launching Numbers can silently drop the first open event, andopen's return value is unreliable (sometimesmissing value). - Every osascript call has a timeout — Numbers blocks AppleEvents while showing a modal dialog (e.g. the password prompt for an encrypted file); without a timeout the scripts would hang forever.
- Scripts only close documents they opened — a window the user already had open is never closed.
- AppleScript values are rendered with
applescript_value()/esc()— neverrepr(), which emits single-quoted strings AppleScript cannot parse.
Editing Guidelines
SKILL.md is the most important file — it is the prompt Claude receives when the skill activates:
description(frontmatter) controls when Claude auto-activates the skill. Changes here directly affect triggering behavior.allowed-tools(frontmatter) lists tools Claude can use without per-call permission; it is scoped topython3andosascriptdeliberately.
inspect.py JSON output field names (sheets, tables, num_rows, num_cols, header_rows, footer_rows, headers, preview, formulas) are referenced by name in SKILL.md and asserted in tests/smoke_test.py. Renaming them requires updating all three.
Versioning: keep version in sync between SKILL.md frontmatter and .claude-plugin/plugin.json. Patch for script fixes, minor for new scripts or significant SKILL.md changes, major for breaking changes to inspect.py JSON output shape.
Test Checklist
tests/smoke_test.py covers all of the following except the encrypted-file case;
run it after any script change:
inspect.pyruns on a multi-sheet file and outputs valid JSONinspect.py --show-formulasreports formula cells (incl. cross-sheet)inspect.pyhandles a missing file gracefully (clear error, exit 1)export_csv.pyexports all cell types and computed formula valuesexport_csv.py --all-tableswrites one CSV per tableexport_csv.pyreports a clear error for unknown sheet/table namesset_value.pywrites typed values and formulas recalculateset_value.pyrejects values starting with=set_formula.pywrites a formula readable viainspect.pyset_formula.pyrejects--outputequal to input pathadd_rows.pyappends rows with correct valuesexport.pyproduces non-empty.xlsxand.pdf, refuses overwrite without--force- Scripts reuse an already-open document and never close the user's windows
- Manual only: an encrypted file fails with a clear error (open retry exhausts → exit 1)
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.

