Skip to content
Skillpedia
PDF, Word & slides9.5k Β· #12273

xberg-picking-a-format

What it does

This skill explains which output format to pick when extracting text from documents. It is for people feeding results into AI tools, search databases or other software.

When to use it

  • βœ“When you are sending extracted text to an AI model and want clean output.
  • βœ“When you are loading documents into a vector store or search index.
  • βœ“When you need structured output that another program can read.

Skill link

https://github.com/xberg-io/xberg/blob/main/plugin/.ai-rulez/skills/xberg-picking-a-format/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/xberg-io/xberg/blob/main/plugin/.ai-rulez/skills/xberg-picking-a-format/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œI am extracting documents for my AI chatbot. Which output format should I use?”

5 new skills a week. 1 minute to read.

How it works

The agent matches the consumer of the output to the right format and content setting, such as markdown for an AI model or JSON for a program, and can also strip extra whitespace.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Picking a format

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.

Decision tree

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)

Examples

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'

When in doubt

  • Default to 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.
  • Reach for plain only when downstream cannot tolerate any markup.
  • Reach for djot only if you're already in a djot/pandoc pipeline.
  • Reach for html only when re-rendering for the web.
  • Reach for json for a heading-driven content tree, or doctags for Docling-compatible output.

Token-reduction (orthogonal)

--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.

FAQ

What is the difference between format and content format?

Format sets how the command prints the result, while content format sets how the text inside it is written.

Which format suits an AI model?

The skill suggests text or markdown output for AI model context.

What does token reduction do?

It removes extra whitespace and boilerplate, in levels from off to maximum, to save room in AI prompts.

Details

Original description by the author

Use when choosing an output format for extracted documents β€” plain text, markdown, djot, HTML, JSON, or DocTags. Maps consumer (LLM, parser, archive) to the right `--format` / `--content-format` pair.

repo: xberg-io/xberg

Popularity

GitHub stars
9.5k
Ranking position
#12273
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills