/xberg:xberg-picking-a-formatfrom xberg
Guides selection of xberg's --format and --content-format flags for extracted documents. Maps consumer type (LLM, RAG, parser, archive) to the correct output format.
Ships in xberg. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Xberg has two orthogonal format knobs. Get them right up front and the downstream code stays simple.
| Knob | What it controls | Values | Default |
|---|---|---|---|
--format | How the CLI prints the result | text, json, toon | text (extract), json (batch) |
--content-format | How extracted content is rendered inside result | plain, markdown, djot, html, json, doctags | plain |
--token-reduction | Strip whitespace / boilerplate for LLM contexts | off, light, moderate, aggressive, maximum | off |
--format json returns an envelope wrapping the ExtractedDocument — the
document lives under .result for extract and under .results[] for
batch, with content, metadata, tables, and images as fields of
that nested document. --format text prints just content.
--content-format is what shows up inside that content field.
Who consumes the output?
├── LLM (Claude, GPT, Gemini, local) — embed/prompt context
│ --format text --content-format markdown
├── Vector store / RAG indexer
│ --format json --content-format markdown
│ (markdown preserves structure for chunking)
├── Downstream parser that expects machine-readable JSON
│ --format json --content-format plain
│ (cleanest text + structured metadata)
├── Human review / archival
│ --format text --content-format markdown
├── HTML re-rendering / web display
│ --format json --content-format html
├── Lossless intermediate for pandoc / academic tooling
│ --format json --content-format djot
└── Token-budget-constrained pipeline
--format text --content-format plain
(drops markup; add --token-reduction moderate for further savings)
Feed a PDF directly into an LLM:
xberg extract paper.pdf --content-format markdown
Index a corpus into a RAG store with tables and headings preserved:
xberg batch docs/*.pdf --format json --content-format markdown \
| jq -c '.result | {content: .content, tables: .tables}'
Strip a file to bare text for a token-tight summarizer:
xberg extract long.pdf \
--content-format plain \
--token-reduction moderate
Pull metadata only, ignore content:
xberg extract file.pdf --format json | jq '.result.metadata'
markdown as the content format. It is the best
compromise across LLMs, RAG, and human review, and Xberg has the
most faithful renderer for it.plain only when downstream cannot tolerate any markup.djot only if you're already in a djot/pandoc pipeline.html only when re-rendering for the web.json for a heading-driven content tree, or doctags for Docling-compatible output.--token-reduction collapses whitespace, strips repeated headers/footers,
and trims boilerplate. It composes with any --content-format:
off (default), light, moderate, aggressive, maximum.Use moderate as a safe starting point for LLM context windows. maximum
is lossy — verify before relying on it.
See references/cli-reference.md for the full flag set and
references/configuration.md for the equivalent output_format and
token_reduction keys in xberg.toml.
index.md (opens in a new tab)references/advanced-features.md (opens in a new tab)references/cli-reference.md (opens in a new tab)references/configuration.md (opens in a new tab)references/nodejs-api.md (opens in a new tab)references/other-bindings.md (opens in a new tab)references/python-api.md (opens in a new tab)references/rust-api.md (opens in a new tab)references/supported-formats.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub xberg-io/xberg --plugin xberg7 skills in this plugin
/xbergExtract text, tables, metadata, and images from 107 document formats (PDF, Office, images, HTML, email, archives, academic) using Xberg. Use when writing code that calls Xberg APIs in Python, Node.js/TypeScript, Rust, or CLI. Covers installation, extraction (sync/async), configuration (OCR, chunking, output format), batch processing, error handling, and plugins./xberg-batch-extractionUse when extracting from many files at once with shared config, bounded parallelism, per-file overrides, and error recovery. Covers the `batch` command, `--file-configs`, `--max-concurrent`, and output layout./xberg-chunkingUse when splitting extracted text into chunks for LLM context windows or RAG ingestion. Covers chunk size, overlap, markdown/yaml/semantic chunkers, tokenizer-based sizing, and the standalone `chunk` command.Other plugins' skills for the same job