Best use case
mime-detection-routing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
mime detection routing
Teams using mime-detection-routing should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/mime-detection-routing/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How mime-detection-routing Compares
| Feature / Agent | mime-detection-routing | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
mime detection routing
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
SKILL.md Source
## priority: high
# MIME Detection & Routing
## Detection Flow
```text
Extension → EXT_TO_MIME map → validate → Registry lookup → Extractor
```
## Key Functions
| Function | Location | Purpose |
|----------|----------|---------|
| `detect_mime_type(path, inspect)` | `core/mime.rs` | Extension + optional content inspection |
| `detect_mime_type_from_bytes(bytes)` | `core/mime.rs` | Magic number detection (infer crate) |
| `validate_mime_type(mime)` | `core/mime.rs` | Check if any extractor supports it |
## Extension Mapping
118+ extensions mapped in `EXT_TO_MIME` (`core/mime.rs`). Case-insensitive.
Key mappings: `.pdf` → `application/pdf`, `.docx` → `application/vnd.openxmlformats-officedocument.wordprocessingml.document`, `.xlsx` → spreadsheet variant, `.png`/`.jpg` → `image/*`
## Registry Selection
```rust
// In core/extractor/bytes.rs
fn select_extractor_for_mime(mime_type: &str) -> Result<Arc<dyn DocumentExtractor>> {
let registry = get_document_extractor_registry();
let registry_guard = registry.read()?;
registry_guard.get_for_mime_type(mime_type)
.ok_or_else(|| KreuzbergError::UnsupportedFormat(mime_type.into()))
}
```
Selects highest-priority extractor registered for that MIME type.
## Adding New MIME Types
1. Add extension mapping: `m.insert("ext", "application/x-new");` in `core/mime.rs`
2. Implement `DocumentExtractor` with `supported_mime_types()` returning the MIME
3. Register in `register_default_extractors()`
## Wildcard Support
Extractors can register for MIME type families: `"image/*"` matches `image/png`, `image/jpeg`, etc.
## Critical Rules
1. Always `validate_mime_type()` before extraction
2. Extension mapping is case-insensitive
3. Content inspection (infer crate) is fallback for extension-less files
4. Registry validation is final authority on supported typesRelated Skills
mime-detection-implementation
mime detection implementation
kreuzberg
Extract text, tables, metadata, and images from 91+ document formats (PDF, Office, images, HTML, email, archives, academic) using Kreuzberg. Use when writing code that calls Kreuzberg APIs in Python, Node.js/TypeScript, Rust, or CLI. Covers installation, extraction (sync/async), configuration (OCR, chunking, output format), batch processing, error handling, and plugins.
wasm-constraints
wasm constraints
test-execution-patterns
test execution patterns
security-limits-dos-protection
security limits dos protection
plugin-architecture-patterns
plugin architecture patterns
ocr-backend-management
ocr uackend management
format-specific-extraction
format specific extraction
extraction-pipeline-patterns
extraction pipeline patterns
config-loading-precedence
config loading precedence
chunking-embeddings
chunking emueddings
api-server-mcp
api server mcp