skills/document-processor/SKILL.md
Convert documents (PDF, EPUB, HTML, DOCX, MD) to clean Markdown using pandoc and pdftotext for ingestion into project context
npx skillsauth add Thomashighbaugh/opencode document-processorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Convert a wide range of document formats into clean Markdown for project context ingestion. Supports PDF, EPUB, HTML, DOCX, ODT, RTF, Markdown, and plain text.
.opencode/context/research/pandoc — Universal document converter (handles PDF, EPUB, HTML, DOCX, MD, and 30+ formats)pdftotext — PDF text extraction fallback (faster, less formatting)webfetch — Fetch URLs to get HTML for conversionRead — Read files from the filesystemWrite — Save converted outputDetermine the source type and read it:
Local file:
pandoc /path/to/file.{pdf,epub,html,docx} -t markdown --wrap=none -o /tmp/opencode/converted.md
URL (fetch first, then convert):
# Fetch the URL content
webfetch the url
# Save as HTML, then convert
pandoc /tmp/opencode/page.html -t markdown --wrap=none -o /tmp/opencode/converted.md
Directory of documents:
for f in /path/to/dir/*.{pdf,epub,html,docx}; do
[ -f "$f" ] && pandoc "$f" -t markdown --wrap=none -o "/tmp/opencode/$(basename "$f").md"
done
| Input Format | Command |
|-------------|---------|
| PDF | pandoc input.pdf -t markdown --wrap=none -o output.md |
| PDF (fallback) | pdftotext -layout input.pdf output.md |
| EPUB | pandoc input.epub -t markdown --wrap=none -o output.md |
| HTML | pandoc input.html -t markdown --wrap=none -o output.md |
| DOCX | pandoc input.docx -t markdown --wrap=none -o output.md |
| ODT | pandoc input.odt -t markdown --wrap=none -o output.md |
| RTF | pandoc input.rtf -t markdown --wrap=none -o output.md |
| Plain Text | cp input.txt output.md |
After conversion, verify the output:
wc -l /tmp/opencode/converted.md
head -50 /tmp/opencode/converted.md
If the output has garbled text or bad formatting, try alternatives:
pdftotext -layout input.pdf output.md (better for column layouts)Save the converted Markdown to the project context directory:
cp /tmp/opencode/converted.md .opencode/context/research/{descriptive-name}.md
Or output the content directly for review before saving.
# Convert a PDF to Markdown
pandoc ./docs/api-manual.pdf -t markdown --wrap=none -o .opencode/context/research/api-manual.md
# Convert an EPUB to Markdown
pandoc ./ebook.epub -t markdown --wrap=none -o /tmp/opencode/ebook.md
Read /tmp/opencode/ebook.md
Write .opencode/context/research/ebook-summary.md (after summarizing)
# Convert a URL to context
webfetch https://example.com/docs
Save the content as .opencode/context/research/example-docs.md
# Bulk convert all PDFs in a directory
for f in ./references/*.pdf; do
pandoc "$f" -t markdown --wrap=none -o "/tmp/opencode/$(basename "$f" .pdf).md"
done
pdftotext which may return emptywebfetch firsttools
Create valid, type-safe TypeScript tools for OpenCode — generates correct boilerplate, typed interfaces, and handler stubs. Use when building new tools for global config or per-project .opencode/tools/.
testing
Explore multiple solution branches in parallel, evaluate each, and recommend the best path. Use when the user explicitly invokes /ideation tree-of-thoughts or asks for "tree of thought" / "branching exploration".
testing
Run multiple independent reasoning passes and find consensus. Use when the decision is critically important, the stakes are high, or the user explicitly requests "run it multiple times" / "check consistency" / "self-consistency".
testing
Optimization by PROmpting — generate candidate prompt variations, test each against a benchmark, and report the best performer. Use when the user invokes /ideation opro or asks for "prompt optimization" / "OPRO".