config-loading-precedence

config-loading-precedence is a skill for Claude Code from xberg-io/xberg. It costs 34 tokens per session (999 once invoked), scanned A, original, MIT.

A guide to how Xberg chooses settings from command-line options, JSON, configuration files, environment variables, and defaults. It also explains which configuration files Xberg finds automatically.

In plain words
What is it for?
Use it when configuring Xberg's document extraction or server mode, especially when combining command-line options, inline JSON, configuration files, and environment variables.
Why use it?
It prevents confusion when one setting overrides another or a configuration change appears to have no effect. It also clarifies why a project-local YAML or JSON file may not be loaded automatically.

Skill for Claude Code

Written for Claude Code: paths in frontmatter.

Good fit Use it when configuring Xberg's document extraction or server mode, especially when combining command-line options, inline JSON, configuration files, and environment variables.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xberg-io/xberg/config-loading-precedence
About the project

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.

xberg-io/xberg · 9,455 stars · on GitHub · docs.xberg.io

Install

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.

Any agent
npx skills add xberg-io/xberg --skill config-loading-precedence
Clone the repo
git clone --depth 1 https://github.com/xberg-io/xberg

Made for: Claude Code.

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

agentmods badge for config-loading-precedence

README.md
[![agentmods](https://agentmods.dev/badge/skills/xberg-io/xberg/config-loading-precedence/github.svg)](https://agentmods.dev/skills/xberg-io/xberg/config-loading-precedence)
Your own site
<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.

agentmods 80×15 button for config-loading-precedence

Your own site · 80×15
<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>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 999 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00034 $0.00999
Opus 5.5 $0.00014 $0.00400
Sonnet 5.5 $0.00007 $0.00200
Haiku 4.5 $0.00003 $0.00100

Measured today against content hash 4d31935db76a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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

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.

.ai-rulez/skills/config-loading-precedence/SKILL.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 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)

  1. Individual CLI flags (--ocr, --output-format, --chunk)
  2. Inline JSON config (--config-json or --config-json-base64)
  3. Config file (--config path.toml)
  4. Auto-discovered config (xberg.{toml,yaml,yml,json} in cwd/parents, then the user config dir)
  5. Default values

Server/MCP Mode Precedence

  1. CLI arguments (--host, --port)
  2. Environment variables (XBERG_HOST, XBERG_PORT)
  3. Config file [server] section
  4. Defaults (127.0.0.1:8000)

Config File Discovery

ExtractionConfig::discover() (core/config/extraction/loaders.rs) uses the same deterministic format precedence at every level:

  1. Walks the current directory and its parents, probing xberg.toml, xberg.yaml, xberg.yml, then xberg.json in each directory. The first hit wins.
  2. 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.

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

Read the full file on GitHub · 105 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. today Changed · -13 tokens per session 4d31935db76a
  2. yesterday Changed · +3 lines · -33 tokens per session 3a16cba2300a
  3. 13d ago Changed af4f6c37f3c5
  4. 16d ago Changed · +6 lines · -5 tokens per session c0a87f325bf2
  5. 27d ago Changed · -1 lines · -10 tokens per session a6fb5ec8c6de
  6. 1mo ago First seen · 97 lines · 95 tokens per session scan A 022cf6ef64fc

Subscribe to this mod's changes

config-loading-precedence is a skill published in the GitHub repository xberg-io/xberg (9,455 stars, last pushed today), licensed MIT. It adds 34 tokens to every session and 999 once invoked, about $0.0001 per session on Opus 5.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.

Related

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…

Shubhamsaboo/awesome-llm-apps · 127 tokens

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…

mem0ai/mem0 · 207 tokens

cli-release

Release and recover first-party Composio CLI binaries through Build CLI Binaries, including automatic beta builds, promote-stable dispatches, beta-tag selection, asset and installation verification, and failed release recovery. Use when a contributor asks to build a CLI beta, publish or promote a stable CLI version…

ComposioHQ/composio · 95 tokens

python-release

Handle Python SDK release, build, bump, packaging metadata, PyPI client pin, uv.lock, nox/build workflow, and publish verification changes. Use for Python release process work or dependency pin bumps; do not use for ordinary Python feature implementation.

ComposioHQ/composio · 53 tokens

gh

GitHub CLI skill for interacting with GitHub via the gh command line tool. Use when Bub needs to (1) Create, view, or manage GitHub repositories, (2) Work with issues and pull requests, (3) Create and manage releases, (4) Run and monitor GitHub Actions workflows, (5) Create and manage gists, (6) Install and manage…

bubbuild/bub · 96 tokens

commit-hygiene

Atomic commits, PR size limits, commit thresholds, stacked PRs.

alinaqi/maggy · 18 tokens