From word-to-pdf-suite
Batch-convert Word documents (.doc/.docx) under to-convert-word-files/ to PDFs under converted-pdf-files/. With no arguments, processes every file that is missing or stale. Args — pattern (glob filter, default = all), plus optional --list (dry-run) and --debug flags.
How this skill is triggered — by the user, by Claude, or both
Slash command
/word-to-pdf-suite:convert-to-pdf [pattern] [--list] [--debug][pattern] [--list] [--debug]patternThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Enumerates source files under `to-convert-word-files/`, decides which
/convert-to-pdf — Word-to-PDF batch converter skillEnumerates source files under to-convert-word-files/, decides which
need conversion (missing or stale .pdf in converted-pdf-files/),
and runs the conversion binary once per file to produce the output.
Unlike the markdown converter, this skill does not dispatch a per-file agent — DOCX→PDF is a mechanical binary transform, not an interpretive read. The skill drives the converter directly via Bash.
The skill needs one of these installed and on PATH:
soffice or libreoffice
binary. Invocation: soffice --headless --convert-to pdf <file> --outdir <dir>.pandoc <file> -o <out.pdf>. Quality is lower than
LibreOffice for complex Word documents; use only if soffice is
unavailable.Detection order at run time:
command -v soffice, then command -v libreoffice,
then command -v pandoc. Use the first one that resolves to a
path. Do not invoke the binary with --version for detection
— on Windows, soffice --version (without --headless) can spawn
a console window that prompts on first launch and blocks the
Bash tool waiting on Enter.| Invocation | pattern | list | debug | Effect |
|---|---|---|---|---|
/convert-to-pdf | **/*.{doc,docx} | off | off | Convert every pending file under to-convert-word-files/. |
/convert-to-pdf reports/*.docx | reports/*.docx | off | off | Convert pending DOCX files in to-convert-word-files/reports/ only. |
/convert-to-pdf --list | (all) | on | off | Print the pending queue. Do NOT convert. |
/convert-to-pdf --list --debug | (all) | on | on | Print the queue with per-file mtime details. |
/convert-to-pdf *.docx --debug | *.docx | off | on | Convert pending DOCX files at the top level, with per-file debug. |
Worth knowing:
Debug or
LIST won't be detected.-- (e.g. list,
debug) is treated as a glob pattern, not a flag.Inputs from the platform:
$1 — first positional token (a glob, relative to to-convert-word-files/).$ARGUMENTS — the full whitespace-separated argument string.Scan $ARGUMENTS for the standalone tokens --list and --debug.
Each found token sets the corresponding boolean and is removed from
further consideration.
pattern_clean = strip(',', strip_whitespace($1))
If pattern_clean == "--list" or pattern_clean == "--debug", treat
it as the flag (set the boolean) and clear pattern_clean.
If pattern_clean is empty, use **/*.{doc,docx}.
/.../.If either rule is violated, abort with one error line and exit.
/convert-to-pdf — invalid arguments. Expected: /convert-to-pdf [pattern] [--list] [--debug]. Got: pattern="<raw>" args="<raw>". Example: /convert-to-pdf reports/*.docx --debug
Do not convert anything, do not write any file.
Glob against to-convert-word-files/${pattern_clean} to
enumerate matching files. Filter case-insensitively to keep only
.doc and .docx. Skip Word lock files (anything starting
with ~$) — these are open-in-Word markers, not real documents.rel = source path minus the "to-convert-word-files/" prefix
dest = "converted-pdf-files/" + rel with extension swapped to ".pdf"
Bash to read mtimes (cross-platform):
mtime() {
stat -c %Y "$1" 2>/dev/null || stat -f %m "$1" 2>/dev/null || echo 0
}
pending — missing if dest does not exist.pending — stale if mtime(source) > mtime(dest).up-to-date if mtime(dest) >= mtime(source).--list)Print the queue and stop. Format:
Conversion queue (N pending, M up-to-date):
- to-convert-word-files/foo.docx → converted-pdf-files/foo.pdf (missing)
- to-convert-word-files/reports/2026/q1.docx → converted-pdf-files/reports/2026/q1.pdf (stale; source 2026-04-30 14:12, dest 2026-04-30 11:00)
Do not run any conversion. With --list --debug, append per-file
mtime details (epoch + human readable).
For each pending file in deterministic order (alphabetical by source path):
mkdir -p "$(dirname "$dest")"
/dev/null so the binary can never block on an interactive
prompt (relevant on Windows where soffice may otherwise wait
for keyboard input on first launch).
soffice --headless --convert-to pdf "$src" --outdir "$(dirname "$dest")" < /dev/null
Note: soffice names the output <basename>.pdf in the outdir,
which matches our convention. No rename needed unless the source
basename differs from what soffice emits.pandoc "$src" -o "$dest" < /dev/null
Conversion complete — N converted, K failed (out of M pending).
Up-to-date files skipped: U.
✓ to-convert-word-files/foo.docx → converted-pdf-files/foo.pdf
✗ to-convert-word-files/reports/broken.docx → conversion failed: <stderr excerpt>
If a single file fails, continue with the rest. Do not abort the batch.
--debug)When --debug is on:
When --debug is off, output stays terse — one line per file.
converted-pdf-files/, preserving the source's relative path and
swapping the extension to .pdf.converted-pdf-files/.converted-pdf-files/.to-convert-word-files/.../) and absolute paths are rejected at
argument validation.~$* lock files silently — they are not real documents.--list is a pure read; it never writes anything.--debug only adds instrumentation — it never changes which files
get converted.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub baruchihalamish20/ai-agents --plugin word-to-pdf-suite