xberg-picking-a-format
できること
このスキルは、文書から文字を抽出する際にどの出力形式を選ぶかを説明します。結果をAIツール、検索データベース、ほかのソフトに渡す人向けです。
使う場面
- ✓抽出したテキストをAIモデルに渡し、きれいな出力が欲しいとき。
- ✓文書をベクトルストアや検索インデックスに読み込むとき。
- ✓別のプログラムが読める構造化された出力が必要なとき。
スキルのリンク
https://github.com/xberg-io/xberg/blob/main/plugin/.ai-rulez/skills/xberg-picking-a-format/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“AIチャットボットのために文書を抽出しています。どの出力形式を使うべきですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、出力を使う相手に応じて形式を選びます。たとえば、AIモデル向けにはMarkdown、プログラム向けにはJSONです。また、余分な空白を取り除くこともできます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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
markdownas 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
plainonly when downstream cannot tolerate any markup. - Reach for
djotonly if you're already in a djot/pandoc pipeline. - Reach for
htmlonly when re-rendering for the web. - Reach for
jsonfor a heading-driven content tree, ordoctagsfor 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.
よくある質問
形式と内容の形式の違いは何ですか?
形式はコマンドが結果を出力する方法を決め、内容の形式は結果の中のテキストの書き方を決めます。
AIモデルにはどの形式が向いていますか?
このスキルは、AIモデルの文脈には、テキストかMarkdownの出力を勧めています。
トークン削減とは何ですか?
余分な空白や定型的な部分を取り除く機能です。オフから最大までの段階があり、AIのプロンプトの容量を節約します。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 9.5k
- ランキング
- #12273
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
xberg-batch-extraction
9.5kエージェントがXbergで多数の文書を一括処理できるよう支援します。共通の設定を使い、同時処理数を制限し、失敗したファイルで全体が止まらないようにします。
xberg-chunking
9.5kエージェントが長い文書のテキストを、AIのプロンプトや検索インデックス向けに小分けできるよう支援します。サイズと重なりを指定できます。
xberg-extracting-keywords
9.5kエージェントが、Xbergのキーワード設定を使って、文書の主なキーワードやキーフレーズを抽出し、言語を判定できるよう支援します。
xberg-extracting-tables
9.5kエージェントが、PDF、表計算ファイル、画像から表を抽出できるよう支援します。行と列を崩さず、MarkdownまたはJSON形式の構造化データとして取り出します。
似ているスキル
feishu-doc
394kテキスト、画像、表を含むFeishuのクラウドドキュメントを、ドキュメントツールを使って読み、作成し、編集するようエージェントを支援します。
feishu-drive
394kボットと共有されたFeishuのクラウドフォルダ内のファイルを閲覧、整理、コメントできるようエージェントを支援します。
feishu-perm
394kFeishuのファイルにアクセスできる人を確認し、変更するようエージェントを支援します。依頼を満たす最小の権限を選びます。