Files
magnus919_agent-skills/documents
Magnus HedemarkGitHubfactory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
f37dc73829 feat(skill): add anydoc — office documents to GitHub-Flavored Markdown (#295)
* feat(skill): add anydoc core content and references

Add the anydoc skill content tree: SKILL.md (progressive-disclosure index
with frontmatter per ALLOWED_FIELDS), human-facing README, the five reference
files (formats, cli-reference, errors, workflows, sources), 24 committed
fixtures (valid + error cases), and a fixture-grounded eval manifest with 8
cases. Every documented behavior, exit code, and error message was verified
against the real pinned CLI (npx -y @firecrawl/anydoc@0.1.6); verbatim --help
and error transcripts are reproduced character-for-character.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* feat(skill): add anydoc wrapper script and unit tests

Implements scripts/anydoc, a stdlib-only Python wrapper around the pinned
@firecrawl/anydoc@0.1.6 CLI: convert/batch/info subcommands, global
--json/--dry-run, input and output pre-validation, friendly hints for the
no-OCR/encrypted/malformed/unsupported error classes, Node >= 20 and npx
availability checks, deterministic batch output naming with documented
duplicate/collision behavior, and exit codes 0/1/2. Adds offline unittest
suite (46 tests, real-CLI tests skip when npx is unavailable) and keeps the
wrapper contract documented in cli-reference.md and errors.md.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* feat(skill): ratchet anydoc evals to 14 grounded cases

Verify the pre-authored 8-case manifest and extend it with six
high-signal cases (PDF lower-fidelity pipeline, legacy .ppt table
flattening, ODP same-serializer, RTF, EPUB, CSV header promotion),
each grounded in real pinned-CLI runs against the committed fixtures.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* feat(skill): integrate anydoc into repo catalog and artifacts

Add the sorted anydoc catalog entry to README.md (between agent-skills
and api-design-and-evolution), regenerate the tracked catalog artifacts
(.claude-plugin/marketplace.json, .codex-plugin/plugin.json,
.agents/plugins/marketplace.json, llms.txt) with the ruby generators,
and add a routing note to documents/SKILL.md pointing office-document
to-markdown conversion at the anydoc skill.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* fix(skill): polish anydoc wrapper timeout, JSON shape, and docs

- run_cli raises CliTimeoutError on the 120s timeout; convert/batch with
  --json now emit one parseable JSON error envelope (error_class "timeout")
  on stdout before exiting, so --json always yields exactly one JSON doc
- batch JSON failure entries (pre-validation and CLI) now carry error_class
  ("io" for missing/dir inputs, mapped classes for CLI failures), so all
  batch failure entries share the same shape
- build_cli_command places -o/-f before the -- separator for dash-leading
  filenames, so `convert -f csv -- -weird` converts instead of misparsing
  ("unexpected second input"); absolute-path inputs unchanged
- workflows.md vault-ingestion recipe globs notes/* instead of docs/* and
  warns to run from a temp/vault dir, never touching repo-root docs/
- unit tests: +6 (timeout envelope x4, batch error_class shape,
  dash-leading filename); suite grows 46 -> 52

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

---------

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-08-06 20:11:19 -04:00
..

Documents — PDF, Word, Excel & PowerPoint Skill

One skill that lets your agent generate, inspect, validate, and fix PDF, Word (.docx), Excel (.xlsx), and PowerPoint (.pptx) files — with a shared workflow, per-format references, and a validation script that verifies output quality before anything ships.

Why Install This Skill

Document output is one of the most common things people ask agents to produce, yet it is easy to get subtly wrong: files that open in one viewer but corrupt in another, spreadsheets with broken cell references, decks with missing slide relationships. This skill packages the full generation-to-delivery loop so your agent produces files that are structurally sound and actually render.

After installing, your agent can turn a markdown brief into a formatted PDF, build a Word report with proper headings and tables, generate a spreadsheet from CSV data, assemble a slide deck from an outline — and then run the included validation script on every artifact to prove it is well-formed before you ever open it. Because the four formats share one workflow, one skill covers them all; you do not need four overlapping skills with four sets of instructions to maintain.

What You Get

Directory Purpose
SKILL.md Shared six-step workflow (scope → content model → template → render → validate → deliver) with per-format load-on-demand
references/pdf.md PDF generation, tooling, and validation specifics
references/word.md Word (.docx) package layout, generation, and validation specifics
references/excel.md Excel (.xlsx) workbook structure, generation, and validation specifics
references/powerpoint.md PowerPoint (.pptx) deck structure, generation, and validation specifics
references/output-quality.md Cross-format output-quality checklist for all four formats
scripts/validate-documents.py Stdlib-only validation script: structural sanity + optional render check, with --json output and graceful degradation when no renderer is installed
templates/pdf-template.md Fillable generation template for PDF (print-ready HTML/CSS or LaTeX)
templates/word-template.md Fillable generation template for Word documents
templates/excel-template.md Fillable generation template for Excel workbooks
templates/powerpoint-template.md Fillable generation template for PowerPoint decks
fixtures/ One small valid sample per format, used to smoke-test the validation script

Quick Start

# Validate a finished artifact (human report)
python3 scripts/validate-documents.py report.pdf

# Validate with a render check and machine-readable output
python3 scripts/validate-documents.py --render-check --json report.pdf data.xlsx deck.pptx

# Smoke-test the script against the bundled per-format fixtures
python3 scripts/validate-documents.py --json fixtures/sample.pdf fixtures/sample.docx fixtures/sample.xlsx fixtures/sample.pptx

The render check uses pdftoppm (poppler-utils) for PDF and LibreOffice for Office formats when they are installed. When neither is present, validation still performs full structural checks and reports the render check as unavailable instead of failing — no renderer required to use the skill.

Triggers

Load this skill when the user mentions any of:

  • Generating documents: "create a PDF report", "make a Word document", "turn this CSV into a spreadsheet", "build a slide deck"
  • Editing documents: "update the docx", "change the Excel file", "fix this presentation"
  • Extracting from documents: "read the text from this PDF", "pull the table out of this xlsx"
  • Converting: "docx to PDF", "export this data as an Excel file"
  • Validating: "check that this document is valid", "why won't this file open", "verify the output before sending"

Do not load for ebooks (use the epub skill), image/video/media production, or data pipeline work (use data-engineering).

Requirements

  • Python 3.8+ — the validation script uses only the standard library.
  • Optional renderers (only for the render-check step): pdftoppm/mutool/ghostscript for PDF, libreoffice/soffice for Office formats. Generation libraries such as python-docx, openpyxl, or python-pptx are optional per format and documented in the references.