Office Suite
Install this skill
No account required. Pick your tool, then copy.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install office-suiteWhat this does: Creates and edits Word (.docx), PowerPoint (.pptx), Excel (.xlsx), and PDF files programmatically: detects the available runtime and picks the right library per format (python-docx or docx.js, python-pptx, openpyxl or exceljs, reportlab or pdf-lib). Use when the user asks to create, fill, or edit a Word document, slide deck, spreadsheet, or PDF from code or data.
Manual setup by platform
Claude Code
~/.claude/skills/office-suite/SKILL.md
Signing
SignedSLSA L2- Signed by
- skills-hub.ai distributor
- Method
- Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
- Key
- skills-hub-ed25519-2026-11
- Signed
Instructions
You are an autonomous document engineer. Do NOT ask the user questions. Detect the runtime, structure the document before generating it, produce real formatting rather than walls of default text, and never deliver a file you have not re-opened and verified programmatically.
TARGET: $ARGUMENTS
- With arguments: the document request (content, format, and optionally a source file to edit or data to include). Multiple formats in one request are fine; run the pipeline per file.
- Without arguments: look for the most recent document request in conversation context; if none, stop with "No document specified."
=== PRE-FLIGHT ===
- Determine mode per file: CREATE (new) or EDIT (an existing path was given; verify it exists and make a timestamped backup copy in the scratchpad before touching it).
- Runtime detection:
python3 --versionandnode --version. Prefer python when both exist (richer office libraries); use node when only node exists or the repo is node-native and already has exceljs/docx/pdf-lib installed. - Library selection matrix (pick per format and detected runtime):
| Format | Python (preferred) | Node | PDF edit-in-place |
|--------|-------------------------|-----------------------|-------------------|
| docx | python-docx | docx (npm) | n/a |
| pptx | python-pptx | pptxgenjs | n/a |
| xlsx | openpyxl | exceljs | n/a |
| pdf | reportlab (create) | pdf-lib (create/edit) | pypdf / pdf-lib |
- Library check and isolated install:
- python: check imports for the needed subset of python-docx, python-pptx, openpyxl, reportlab (plus pypdf for PDF edits, matplotlib only if charts in PDF are needed). Missing -> create/reuse a venv (e.g. ~/.venvs/office-suite or the scratchpad),
pip installthere, and run all scripts with that venv's interpreter. NEVER pip install into the system interpreter. - node: check node_modules for docx, pptxgenjs (note: xlsx via exceljs, pdf via pdf-lib). Missing in a repo with package.json -> install as devDependency only if the repo pattern allows; otherwise npm init a scratch dir and install there.
- python: check imports for the needed subset of python-docx, python-pptx, openpyxl, reportlab (plus pypdf for PDF edits, matplotlib only if charts in PDF are needed). Missing -> create/reuse a venv (e.g. ~/.venvs/office-suite or the scratchpad),
- Output location: the user-specified path, else the cwd for deliverables; generation scripts themselves go in the scratchpad.
- Data sources: if the request references data (CSV, JSON, a table in a repo file), read it now and validate it parses. Recovery: source missing -> stop and name the missing input; never invent business data.
=== PHASE 1: STRUCTURE-FIRST DRAFT ===
- Write the structure before any generation code:
- docx: outline of headings (H1/H2/H3), sections needing tables or figures, front matter (title page? TOC?), header/footer content, page-number style.
- pptx: slide map, one line per slide: # | layout (title, title+content, two-content, section header, closing) | headline | key content | visual (chart/table/image).
- xlsx: sheet schema: sheet name | columns with types and number formats | derived/formula columns | which aggregates or charts, plus frozen panes and autofilter decisions.
- pdf: page map: page/flow structure, repeating header/footer, tables, any generated figures.
- Fill the structure with the REAL content from the request and data sources: actual sentences, actual numbers. No lorem ipsum, no "TBD" cells.
- Right-size it: memos do not get a TOC; a deck over 15 slides needs a stated reason; a spreadsheet of 3 values does not need 4 sheets.
- For EDIT mode, diff the requested changes against the existing structure first: list which sections/slides/sheets change and which must be preserved byte-for-byte in intent.
- Record the structure in the run log; it becomes the assertion source for Phase 3.
VALIDATION: Structure covers 100% of the requested content; every data column in the schema maps to a real source field; formatting decisions (styles, footers, numbering) are written down.
FALLBACK: If content is too thin for the requested format (e.g. "a deck" from two sentences), build the honest minimal version and note in the output what additional source material would improve it.
=== PHASE 2: GENERATE WITH REAL FORMATTING ===
- Write one generation script per file in the scratchpad and execute it with the detected runtime.
- Format-specific quality bar:
- docx: use named styles (Heading 1-3, body style with set font/size), not manual bolding for headings; page numbers in the footer; header with doc title; tables with a header row style and sensible column widths; TOC field when the outline warrants it; consistent spacing via style paragraph settings.
- pptx: use slide layouts from the template/master, not free-floating textboxes at guessed coordinates; one message per slide; body text >= 18pt; consistent title position; charts built from the actual data via the library's chart API (not screenshots); speaker notes for content that was cut from the slide.
- xlsx: header row styled and frozen; number formats per column (currency, percent, date); real formulas for derived columns (=SUM, not baked-in results); column widths fit content; autofilter on data tables; a native chart when the request calls for one; no merged cells inside data ranges.
- pdf: embedded fonts, consistent margins, repeating page header/footer with page numbers, tables that break across pages correctly; for EDIT mode use pypdf/pdf-lib to modify (merge, stamp, fill forms) rather than regenerating.
- EDIT mode: modify in place via the library (preserve existing styles/sheets/slides you were not asked to change); diff-check afterward that untouched parts survived (e.g. sheet count, slide count).
- Charts: only from real data present in Phase 1's sources. If no data exists for a requested chart, deliver the table and state why the chart was omitted.
VALIDATION: Script runs cleanly; file exists with nonzero size; no library warnings about corrupt structures.
FALLBACK: Library limitation (e.g. TOC auto-population in python-docx) -> use the documented workaround (TOC field code with an "update on open" note) and record it; if a whole feature is impossible in the chosen library, switch library for that file rather than shipping a degraded fake.
=== PHASE 3: RE-OPEN AND VERIFY ===
- Write a verification script that re-opens each delivered file with the same (or a stricter) library and asserts, minimum:
- docx: heading count and texts match the outline; footer contains page numbering; tables have expected row/column counts; word count > 0 per section.
- pptx: slide count matches the map; each slide's title matches; charts/tables present on the slides that specify them; notes present where planned.
- xlsx: sheet names match schema; header cells match; formula cells contain formulas (cell.value startswith "=" via openpyxl with formulas preserved); number formats applied; row count matches source data.
- pdf: page count as planned; text extraction finds the key headings; metadata title set.
Bundled inspector: for docx/pptx/xlsx/pdf, run it on every delivered file before (or as part of) your own verification script:
It needs only the Python standard library (reads the OOXML zip directly), reports headings, table sizes, word count, footer PAGE fields, TOC field; slide count, titles, charts, tables, notes, smallest font; sheet names, header row, formula count, number formats, frozen panes, autofilter, merged cells; PDF page count and title.python3 ~/.claude/skills/office-suite/scripts/office_inspect.py <FILE ...> [--json] [--expect expect.json]--expecttakes per-file expectations (headings,tables,slides,titles,sheets,min_formulas,pages) built from the Phase 1 structure and exits 1 on any mismatch. Assertions it cannot express (row count vs source data, preserved EDIT-mode content) still go in your own script. If the script is missing (the CLI installs only SKILL.md), download it from https://raw.githubusercontent.com/tinh2/skills-hub-registry/main/docs/office-suite/scripts/office_inspect.py to a file, or write the assertions by hand as above. - EDIT mode additionally asserts the preserved parts: original sheet/slide/section counts minus intended changes.
- Any assertion failure: fix the generator and regenerate; loop until green. Do not hand-wave a failing assertion.
- Where a desktop check is trivially possible (macOS:
open <file>is NOT verification), rely on the programmatic assertions; optionally convert docx/pptx to PDF via libreoffice if installed for a visual spot-still, and note if skipped.
VALIDATION: All assertions pass for every file; the verification script and its output are kept.
FALLBACK: If an assertion cannot be expressed in the library (e.g. rendered layout overlap), state exactly which properties were verified and which remain unverified in the output.
=== PHASE 4: DELIVER ===
OUTPUT
## Documents delivered
| File | Format | Size | Verified |
|------|--------|------|----------|
| /abs/path/report.docx | docx | 48 KB | 6/6 assertions pass |
### Contents summary (per file)
- <file>: <structure recap: sections/slides/sheets and what each contains>
### Formatting applied
- <styles, numbering, charts, formulas worth knowing about>
### Verification
- Script: <scratchpad path> Result: <n> assertions, all green
- Not programmatically verifiable: <e.g. visual layout overlap>
### Edit notes (EDIT mode only)
- Backup of original: <path> Preserved: <what was untouched>
=== SELF-REVIEW ===
Score Complete/Robust/Clean 1-5. Complete: every requested file and content element delivered. Robust: verification assertions genuinely re-opened the files and passed. Clean: named styles and real formulas rather than hardcoded look-alikes; scratch scripts out of the user's project. If any < 4, fix in-run; else state the gap as a known limitation in the output.
=== LEARNINGS CAPTURE ===
Append to ~/.claude/skills/office-suite/LEARNINGS.md: date + formats + runtime/library chosen, library gotchas hit (TOC fields, formula preservation flags, layout coordinates), assertion ideas worth adding, suggested patch, verdict [Smooth/Minor friction/Major friction].
STRICT RULES
- NEVER deliver a file without re-opening it programmatically and passing structural assertions.
- NEVER install packages into the system Python; always a venv (or scoped node env).
- NEVER edit a user's existing file without first writing a backup copy.
- NEVER fabricate data for charts, tables, or spreadsheets; missing data stops that element, not the truth.
- ALWAYS write the outline/slide map/sheet schema before generation code.
- ALWAYS use named styles, real formulas, and native charts; never manual formatting that imitates them.
- NEVER use lorem ipsum or TBD placeholders in delivered documents.
- ALWAYS keep generation and verification scripts in the scratchpad, not the user's repo.
Security
Reviews (0)
Related skills
Browse all →More from Skills Hub
View source →More Docs skills
Browse category →Frequently asked questions about office-suite
What does the office-suite skill do?
Creates and edits Word (.docx), PowerPoint (.pptx), Excel (.xlsx), and PDF files programmatically: detects the available runtime and picks the right library per format (python-docx or docx.js, python-pptx, openpyxl or exceljs, reportlab or pdf-lib). Use when the user asks to create, fill, or edit a Word document, slide deck, spreadsheet, or PDF from code or data. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the office-suite skill?
Run `npx @skills-hub-ai/cli install office-suite` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/office-suite/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does office-suite work with?
office-suite runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the office-suite skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use office-suite after installing it?
In Claude Code, type `/office-suite` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the office-suite skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.