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 mime-detection-routinggit 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/mime-detection-routing)<a href="https://agentmods.dev/skills/xberg-io/xberg/mime-detection-routing"><img src="https://agentmods.dev/badge/skills/xberg-io/xberg/mime-detection-routing/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/mime-detection-routing"><img src="https://agentmods.dev/badge/skills/xberg-io/xberg/mime-detection-routing.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.00014 | $0.00917 |
| Opus 5.5 | $0.00006 | $0.00367 |
| Sonnet 5.5 | $0.00003 | $0.00183 |
| Haiku 4.5 | $0.00001 | $0.00092 |
Grade A, and why
mime-detection-routing 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 1mo 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 — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MIME Detection & Routing
Detection Flow
Policy -> content and/or extension evidence -> validate_mime_type -> registry.get(mime) -> extractor
Key Functions
| Function | Location | Behaviour |
|---|---|---|
detect_mime_type(path, check_exists: bool) |
core/mime.rs |
Path-based only — never reads bytes. Lowercased extension → EXT_TO_MIME, then tree-sitter extension detection (feature tree-sitter), then mime_guess::from_path. check_exists gates a file-existence check, not content inspection. |
detect_mime_type_from_bytes(bytes) |
core/mime.rs |
Magic-number detection via the infer crate. The only content-sniffing entry point. |
validate_mime_type(mime) |
core/mime.rs |
Parses the media type, matches its case-insensitive essence against SUPPORTED_MIME_TYPES, and returns the registered MIME spelling. Parameters such as charset do not affect extractor routing. It does not consult the extractor registry. |
The FORMATS registry is the single source of truth
FORMATS: &[FormatEntry { extensions, mime_type, aliases }] in core/mime.rs.
EXT_TO_MIME and SUPPORTED_MIME_TYPES are LazyLocks derived from it by iteration —
there is no m.insert call site to add to, and hand-editing either is impossible.
The full registry publishes 106 formats, 140 unique extensions, and 53 aliases, verified by
scripts/sync_supported_counts.py verify. The published count constants describe that static
registry; runtime availability is its intersection with registered extractors. Extension lookup is
case-insensitive (the extension is lowercased before the map hit).
Registry Selection
let registry = get_document_extractor_registry(); // plugins/registry/mod.rs
let guard = registry.read()?;
let extractor: Arc<dyn DocumentExtractor> = guard.get(mime_type)?; // Result, not Option
DocumentExtractorRegistry::get (plugins/registry/extractor.rs) returns the
highest-priority() extractor for the MIME type, and returns Err — not None — when none
matches.
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.
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.
- 1mo ago Changed · -18 tokens per session 0467edb21a81
- 1mo ago Changed · -13 tokens per session ee4fb4b59c73
- 1mo ago Changed · +4 lines · -43 tokens per session 91bfa70e246e
- 1mo ago Changed · +6 lines · -5 tokens per session 40b22b8c97a1
- 3mo ago First seen · 70 lines · 93 tokens per session scan A bd944f15c60a
mime-detection-routing is a skill published in the GitHub repository xberg-io/xberg (9,631 stars, last pushed today), licensed MIT. It adds 14 tokens to every session and 917 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.
mime-detection-routing compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| mime-detection-routingxberg-io/xberg | Skill | 9.6k | today | MIT | A | 14 | Claude Code |
| first-readerShubhamsaboo/awesome-llm-apps | Skill | 146k | today | Apache-2.0 | A | 174 | Claude Code, Codex |
| mcp-apps-builderShubhamsaboo/awesome-llm-apps | Skill | 146k | today | Apache-2.0 | A | 139 | Claude Code, Codex |
| project-graveyardShubhamsaboo/awesome-llm-apps | Skill | 146k | today | Apache-2.0 | A | 127 | Claude Code, Codex |
| commit-archaeologistShubhamsaboo/awesome-llm-apps | Skill | 146k | today | Apache-2.0 | A | 82 | Claude Code, Codex |
| dependency-doctorShubhamsaboo/awesome-llm-apps | Skill | 146k | today | Apache-2.0 | A | 115 | Claude Code, Codex |
| scope-creep-detectorShubhamsaboo/awesome-llm-apps | Skill | 146k | today | Apache-2.0 | A | 98 | Claude Code, Codex |