Xberg is a document-intelligence engine that reads files, URLs, archives, and source trees and extracts text, metadata, images, tables, and structured data, with additional code-language understanding. Developers use it through language bindings, a command-line tool, REST API, or MCP server, and the catalogue entries support those integrations.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add xberg-io/xberg --skill config-loading-precedencegit clone --depth 1 https://github.com/xberg-io/xbergWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/xberg-io/xberg/config-loading-precedence)<a href="https://agentmods.dev/skills/xberg-io/xberg/config-loading-precedence"><img src="https://agentmods.dev/badge/skills/xberg-io/xberg/config-loading-precedence/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/xberg-io/xberg/config-loading-precedence"><img src="https://agentmods.dev/badge/skills/xberg-io/xberg/config-loading-precedence.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00095 | $0.01003 |
| Opus 5 | $0.00048 | $0.00502 |
| Sonnet 5 | $0.00019 | $0.00201 |
| Haiku 4.5 | $0.00010 | $0.00100 |
Grade A, and why
config-loading-precedence scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Configuration Loading & Precedence
CLI Mode Precedence (highest to lowest)
- Individual CLI flags (
--ocr,--output-format,--chunk) - Inline JSON config (
--config-jsonor--config-json-base64) - Config file (
--config path.toml) - Auto-discovered config (
xberg.tomlin cwd/parents, then the user config dir) - Default values
Server/MCP Mode Precedence
- CLI arguments (
--host,--port) - Environment variables (
XBERG_HOST,XBERG_PORT) - Config file
[server]section - Defaults (
127.0.0.1:8000)
Config File Discovery
ExtractionConfig::discover() (core/config/extraction/loaders.rs) does two different things:
- Walks the current directory and its parents looking for
xberg.tomlonly — no.yaml/.yml/.jsonat this stage. First hit wins. - If that finds nothing, falls back to the per-user global config directory
(
dirs::config_dir()/xberg) and probes four basenames in a fixed order:xberg.toml,xberg.yaml,xberg.yml,xberg.json.
So a project-local xberg.yaml is not auto-discovered — pass it with --config.
Inline JSON Config
Field-level merge (not whole-object replacement):
fn merge_json_into_config(base: &ExtractionConfig, json: Value) -> Result<ExtractionConfig> {
let mut config_json = serde_json::to_value(base)?;
// Merge fields from json into config_json
serde_json::from_value(merged)?
}
Use --config-json-base64 for shell escaping.
Config File Formats
TOML (xberg.toml):
use_cache = true
[ocr]
backend = "tesseract"
languages = ["eng", "deu"]
[security_limits]
max_archive_size = 524288000
YAML and JSON follow equivalent structure.
CLI Flag Overrides
crates/xberg-cli/src/commands/overrides.rs: the ExtractionOverrides struct's validate()
runs first, then apply(self, config: &mut ExtractionConfig) lays individual CLI flags over
the merged config. There is no apply_extraction_overrides() and no commands.rs —
commands/ is a directory.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 97 lines · 95 tokens per session scan A 022cf6ef64fc
config-loading-precedence is a skill published in the GitHub repository xberg-io/xberg (9,275 stars, last pushed yesterday), licensed MIT. It adds 95 tokens to every session and 1,003 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
project-graveyard
Scans the developer's machine for dead side projects, autopsies each one from its git history (died at the payments wall, killed by a newer project, finished but never shipped), surfaces their personal death patterns, and picks the corpse most worth resurrecting — then helps ship it. Use when the user mentions…
commit-archaeologist
Reconstructs why code exists from local git history, including the introducing commit, later changes, current authors, repeated companion files, and likely intent. Use when the user asks "why does this code exist", "who wrote this function and why", or to "explain the history of this function" before a rewrite…
scope-creep-detector
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad pull requests, changes that grew beyond a fix, dependency additions, public API renames, config or CI edits, oversized hunks, and formatting-only files. Use when the user asks whether a change grew beyond the fix, a PR is too…
git-workflow
Git workflow guidance for commits, branches, and pull requests.
mem0-test-integration
Verify a Mem0 integration produced by /mem0-integrate. Runs in the same workspace on the same branch (loose coupling) — installs dependencies, runs the repo's native test suite, then exercises a real end-to-end smoke flow against the user's API key. Produces a scorecard. TRIGGER when: user has just run /mem0-integrate…
marimo-pair
Work inside the user's live marimo notebook from the code editor: run Python in the same kernel the user does, inspect live notebook state, and commit durable notebook changes through code mode. Use whenever you create, analyze, or improve the user's marimo notebook.