Install any skill in seconds. Free to start, no credit card required.
Get Started Free →How Xberg resolves configuration — CLI-mode and server/MCP-mode precedence orders, config file auto-discovery (xberg.{toml,yaml,json}), field-level inline JSON merge (merge_json_into_config), config file formats, and apply_extraction_overrides. Load when adding a config flag or env var, changing config precedence, or debugging why a setting is or isn't taking effect.
.claude/skills/xberg-io-config-loading-precedence/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -10% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -19% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 3% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -35% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -6% | 0% |
--ocr, --output-format, --chunk)--config-json or --config-json-base64)--config path.toml)xberg.toml in cwd/parents, then the user config dir)--host, --port)XBERG_HOST, XBERG_PORT)[server] section127.0.0.1:8000)ExtractionConfig::discover() (core/config/extraction/loaders.rs) does two different things:
xberg.toml only — no.yaml/.yml/.json at this stage. First hit wins.
(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.
Field-level merge (not whole-object replacement):
rustfn 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.
TOML (xberg.toml):
tomluse_cache = true [ocr] backend = "tesseract" languages = ["eng", "deu"] [security_limits] max_archive_size = 524288000
YAML and JSON follow equivalent structure.
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.
Inline JSON enters through apply_json_overrides(config, config_json, config_json_base64) (crates/xberg-cli/src/input.rs), which delegates to merge_json_into_config.
Duplicate Default impls. TesseractConfig is defined twice — public (types/formats.rs, binding-friendly types) and internal (ocr/types.rs, engine-side types) — bridged by a From impl, each with its own Default. Changing one default fixes only the routes that materialise that struct. Before changing any config default, grep the bare type name (a pub use module::*; makes a qualified path unsearchable) and check for a second definition.
Unknown keys are ignored. #[serde(deny_unknown_fields)] is on exactly two structs: ExtractionConfig (core/config/extraction/core.rs) and UrlExtractionConfig (core/config/extraction/types.rs). Every nested config silently ignores a typo'd key, so a wrong setting parses clean, does nothing, and the test still passes. Write config fixtures against the serde wire names (ChunkingConfig declares max_characters but renames to max_chars), and assert the parsed config differs from the default rather than that it parsed.
xberg.toml only; other extensions need --config--config-json-base64 for shell-safe JSON passing[server] section + extraction config| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-19 | pass→pass | 15,224 | 7,021 | -54% | 1 | 1 | 0% | 2,332 | 2,330 | -0% | 0 | 0 | — |
case-01 | fail→pass | 19,247 | 19,964 | +4% | 1 | 1 | 0% | 3,098 | 2,803 | -10% | 0 | 0 | — |
case-02 | pass→pass | 15,669 | 7,889 | -50% | 1 | 1 | 0% | 2,445 | 2,359 | -4% | 0 | 0 | — |
case-03 | fail→pass | 20,589 | 9,219 | -55% | 1 | 1 | 0% | 3,116 | 2,512 | -19% | 0 | 0 | — |
case-04 | pass→pass | 11,138 | 4,849 | -56% | 1 | 1 | 0% | 1,998 | 1,899 | -5% | 0 | 0 | — |
case-05 | fail→pass | 10,151 | 4,756 | -53% | 1 | 1 | 0% | 1,735 | 1,792 | +3% | 0 | 0 | — |
case-06 | fail→pass | 16,688 | 3,884 | -77% | 1 | 1 | 0% | 2,498 | 1,631 | -35% | 0 | 0 | — |
case-07 | fail→pass | 11,944 | 4,311 | -64% | 1 | 1 | 0% | 1,941 | 1,827 | -6% | 0 | 0 | — |
case-08 | fail→pass | 9,878 | 3,318 | -66% | 1 | 1 | 0% | 1,774 | 1,619 | -9% | 0 | 0 | — |
case-09 | fail→pass | 8,088 | 5,945 | -26% | 1 | 1 | 0% | 1,492 | 1,374 | -8% | 0 | 0 | — |
case-10 | fail→pass | 8,446 | 3,368 | -60% | 1 | 1 | 0% | 1,427 | 1,619 | +13% | 0 | 0 | — |
case-11 | fail→pass | 13,629 | 4,460 | -67% | 1 | 1 | 0% | 2,102 | 1,832 | -13% | 0 | 0 | — |
case-12 | fail→pass | 16,676 | 3,374 | -80% | 1 | 1 | 0% | 2,488 | 1,555 | -38% | 0 | 0 | — |
case-13 | pass→pass | 12,599 | 5,874 | -53% | 1 | 1 | 0% | 2,000 | 1,919 | -4% | 0 | 0 | — |
case-14 | fail→pass | 13,484 | 5,951 | -56% | 1 | 1 | 0% | 2,243 | 2,056 | -8% | 0 | 0 | — |
case-15 | fail→pass | 8,952 | 5,196 | -42% | 1 | 1 | 0% | 1,669 | 2,019 | +21% | 0 | 0 | — |
case-16 | pass→pass | 6,882 | 3,157 | -54% | 1 | 1 | 0% | 1,158 | 1,517 | +31% | 0 | 0 | — |
case-17 | pass→pass | 16,644 | 6,446 | -61% | 1 | 1 | 0% | 2,768 | 2,155 | -22% | 0 | 0 | — |
case-18 | fail→pass | 12,740 | 2,497 | -80% | 1 | 1 | 0% | 2,058 | 1,371 | -33% | 0 | 0 | — |
case-20 | pass→pass | 12,288 | 8,801 | -28% | 1 | 1 | 0% | 2,326 | 2,830 | +22% | 0 | 0 | — |
case-21 | pass→pass | 15,507 | 11,466 | -26% | 1 | 1 | 0% | 2,275 | 2,770 | +22% | 0 | 0 | — |
case-22 | pass→pass | 12,776 | 12,578 | -2% | 1 | 1 | 0% | 2,077 | 3,195 | +54% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +59 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 8/11/2026 | +27% |
Other measured skills in the registry, with their headline benchmark lift.