xberg-chunking
Use when splitting extracted text into chunks for LLM context windows or RAG ingestion.
Skill by xberg-io
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/xberg-io-xberg-chunking
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/xberg-chunking
What's inside
- Skill name
xberg-chunking- Description
- Use 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.
- License
- MIT
- Instructions
- 153 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- name: missing
Files (2)
- SKILL.md
- index.md
SKILL.md (first lines)
# Chunking
Use this when feeding documents into an LLM context window or a vector
store. Xberg chunks two ways: inline during extraction (chunks land on
each document's `chunks` field), or standalone via the `chunk` command for text you
already have. Sizing is character-based by default, or token-based when a
tokenizer model is supplied.
## Inline during extraction
Turn on chunking with `--chunk` and the chunks appear on the structured
result under `chunks`:
```bash
# 1000-char chunks, 200-char overlap (defaults when --chunk is on)
xberg extract report.pdf --chunk --format json | jq '.result.chunks | length'
# Explicit size + overlap
xberg extract report.pdf --chunk --chunk-size 1500 --chunk-overlap 300 --format json
```
Overlap must be smaller than chunk size — the CLI rejects
`--chunk-overlap >= --chunk-size`. When you set only `--chunk-overlap`
against an existing config, an overlap that exceeds the size is clamped to
`chunk_size / 4`.
## Standalone `chunk` command
Chunk text you already have, from `--text` or stdin. Output defaults to
JSON:
```bash
# From a flag
xberg chunk --text "long document text ..." --chunk-size 800 --chunk-overlap 100
# From stdin (pipe extracted content straight in)
xberg extract notes.md | xberg chunk --chunk-size 500 --format json
```
JSON output carries `chunks` (array of strings), `chunk_count`, the
resolved `config` (`max_characters`, `overlap`, `chunker_type`), and
`input_size_bytes`. Use `--format text` for a human-readable dump with
`--- chunk N ---` separators.
> Note: in the JSON output, `chunker_type` is rendered capitalized (`"Text"`,
> `"Markdown"`, `"Yaml"`, `"Semantic"`) because it is emitted via Rust's Debug
> formatting, whereas the `--chunker-type` input flag is lowercase
> (`text`, `markdown`, `yaml`, `semantic`). Lowercase the value before
> comparing if you parse it back.
## Chunker types
`--chunker-type` selects the splitting strategy (standalone `chunk`
command):
| Type | Behavior |
| ---------- | ------------------------------------------------------------------- |
| `text` | **Default.** Plain character-window splitting with overlap. |
| `markdown` | Markdown-aware — splits on structure (headings, blocks) where possible. |
| `yaml` | YAML-aware splitting for structured config/data documents. |
| `semantic` | Topic-boundary splitting driven by `--topic-threshold` (0.0–1.0, default 0.75). |
```bash
# Markdown-aware chunking keeps headings and blocks intact
xberg chunk --text "$(cat README.md)" --chunker-type markdown
# Semantic chunking — lower threshold = more, smaller topic chunks
xberg chunk --text "$(cat transcript.txt)" --chunker-type semantic --topic-threshold 0.6
```
## Token-based sizing
By default `--chunk-size` counts characters. To size chunks by tokens for
a specific model, pass `--chunking-tokenizer` with a HuggingFace tokenizer
id. On the `extract` command this implicitly enables chunking. Requires the
`chunking-tokenizers` feature (present in the default CLI build).
```bash
# Size chunks by GPT-4o tokens during extraction
xberg extract report.pdf --chunking-tokenizer Xenova/gpt-4o --format json
# Or on the standalone command
xberg chunk --text "$(cat doc.txt)" --chunking-tokenizer Xenova/gpt-4o --chunk-size 512
```
With a tokenizer set, `--chunk-size` is interpreted in tokens, not
characters.
## Config file alternative
Field names in config files are snake_case under `[chunking]`:
```toml
[chunking]
max_characters = 1000
overlap = 200
chunker_type = "markdown"
```
```bash
xberg extract report.pdf --config xberg.toml --format json
```
> CLI flags map to config fields as `--chunk-size` → `max_characters` and
> `--chunk-overlap` → `overlap`. In config files use the snake_case names.
## Programmatic access
From Python, enable chunking on the config and read the chunks off the
document in the result envelope (`result.results[0].chunks`):
```python
from xberg import ExtractInput, extract, ExtractionConfig, ChunkingConfig
config = ExtractionConfig(
chunking=ChunkingConfig(max_characters=1000, overlap=200),
)
result = await extract(ExtractInput(uri="report.pdf"), config)
for chunk in result.results[0].chunks or []:From xberg-io/xberg, MIT.
More from xberg-io/xberg
- 0.769score
xberg-extracting-keywords
xberg-io
Use when extracting keywords (YAKE/RAKE) from documents — and, secondarily, when detecting document language or generating embeddings for RAG and search.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
xberg-extracting-with-ocr
xberg-io
Use when extracting text from scanned PDFs, photographed pages, or images that have no embedded text layer.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
xberg
xberg-io
Extract text, tables, metadata, and images from 107 document formats (PDF, Office, images, HTML, email, archives, academic) using Xberg.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
xberg-batch-extraction
xberg-io
Use when extracting from many files at once with shared config, bounded parallelism, per-file overrides, and error recovery.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
xberg-extracting-tables
xberg-io
Use when extracting tabular data from PDFs, spreadsheets, or images.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
config-loading-precedence
xberg-io
How Xberg resolves configuration — CLI-mode and server/MCP-mode precedence orders, project config walk-up, user config fallback, field-level inline JSON merge…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
crate-structure
xberg-io
The Xberg workspace layout — the version source of truth (root Cargo.toml [workspace.package] version), the 19 workspace members and 3 excluded crates, the…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
wasm-constraints
xberg-io
WASM build constraints for the crates/xberg-wasm crate — the wasm-target feature set, no-tokio sync-only internal APIs, the crate-private SyncExtractor trait…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
feature-flag-policy
xberg-io
Cargo feature flags for crates/xberg — ORT-incompatible targets (WASM, Android x86_64 emulator), type-only and tract inference companion features…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
mime-detection-routing
xberg-io
MIME type detection and extractor routing in core/mime.rs — the FORMATS registry that EXT_TO_MIME and SUPPORTED_MIME_TYPES are derived from, the path-based…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
alef-generated-bindings
xberg-io
Alef-managed generated bindings in packages/* and binding crates — the regeneration workflow (task alef:generate / alef:verify), the alef.toml section layout…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
xberg-picking-a-format
xberg-io
Use when choosing an output format for extracted documents — plain text, markdown, djot, HTML, JSON, or DocTags.
SkillAFreshness: A★ 9.4KClaude Code +9
Compare and alternatives
Featured in
Signals
- Stars
- 9,441
- Forks
- 600
- Open issues
- 7
- Last commit (this folder)
- Oct 14, 2026 (13 days ago)
- Last release
- Oct 13, 2026 (14 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/xberg-io/xberg
- Website
- docs.xberg.io
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.406score
xberg-chunking
xberg-io
Use when splitting extracted text into chunks for LLM context windows or RAG ingestion.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.406score
xberg-chunking
xberg-io
Use when splitting extracted text into chunks for LLM context windows or RAG ingestion.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.406score
xberg-chunking
xberg-io
Use when splitting extracted text into chunks for LLM context windows or RAG ingestion.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.406score
xberg-chunking
xberg-io
Use when splitting extracted text into chunks for LLM context windows or RAG ingestion.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.406score
xberg-chunking
xberg-io
Use when splitting extracted text into chunks for LLM context windows or RAG ingestion.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.406score
xberg-chunking
xberg-io
Use when splitting extracted text into chunks for LLM context windows or RAG ingestion.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.406score
xberg-chunking
xberg-io
Use when splitting extracted text into chunks for LLM context windows or RAG ingestion.
SkillAFreshness: A★ 9.4KClaude Code +9
More from xberg-io
- 0.769score
feature-flag-policy
xberg-io
Cargo feature flags for crates/xberg — ORT-incompatible targets (WASM, Android x86_64 emulator), type-only and tract inference companion features…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
crate-structure
xberg-io
The Xberg workspace layout — the version source of truth (root Cargo.toml [workspace.package] version), the 19 workspace members and 3 excluded crates, the…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
config-loading-precedence
xberg-io
How Xberg resolves configuration — CLI-mode and server/MCP-mode precedence orders, project config walk-up, user config fallback, field-level inline JSON merge…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
alef-generated-bindings
xberg-io
Alef-managed generated bindings in packages/* and binding crates — the regeneration workflow (task alef:generate / alef:verify), the alef.toml section layout…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
wasm-constraints
xberg-io
WASM build constraints for the crates/xberg-wasm crate — the wasm-target feature set, no-tokio sync-only internal APIs, the crate-private SyncExtractor trait…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
mime-detection-routing
xberg-io
MIME type detection and extractor routing in core/mime.rs — the FORMATS registry that EXT_TO_MIME and SUPPORTED_MIME_TYPES are derived from, the path-based…
SkillAFreshness: A★ 9.4KClaude Code +9
Cite this page
xberg-chunking skill. Agent Mart. https://agentmart.dev/skills/xberg-io-xberg-chunking (last updated 2026-10-24)