[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79RT3X076QPZYK10QF6Q22X":3,"skill-same:01M79RT3X076QPZYK10QF6Q22X":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M79RT3X076QPZYK10QF6Q22X","mime-detection-routing",null,"MIME type detection and extractor routing in core\u002Fmime.rs and core\u002Fextractor\u002Fbytes.rs — the extension→EXT_TO_MIME→validate→registry→extractor flow, key detection functions, the 118+ case-insensitive extension map, priority-based registry selection, wildcard MIME families, and how to add a new MIME type. Load when adding a format, wiring an extractor to a MIME type, or debugging why a file routes to the wrong (or no) extractor.","jamon8888\u002Fhacienda-engine","jamon8888","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F145190?v=4","01M79RNFE7K7JZ1AZG8TACAV98","Jamin Rubio","01M79RNFEV6ZC1SZ4K04SHDY8Z",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjamon8888\u002Fhacienda-engine\u002Fblob\u002Fmain\u002F.ai-rulez\u002Fskills\u002Fmime-detection-routing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: mime-detection-routing\ndescription: MIME type detection and extractor routing in core\u002Fmime.rs and core\u002Fextractor\u002Fbytes.rs — the extension→EXT_TO_MIME→validate→registry→extractor flow, key detection functions, the 118+ case-insensitive extension map, priority-based registry selection, wildcard MIME families, and how to add a new MIME type. Load when adding a format, wiring an extractor to a MIME type, or debugging why a file routes to the wrong (or no) extractor.\n---\n\n# MIME Detection & Routing\n\n## Detection Flow\n\n```text\nExtension -> EXT_TO_MIME map -> validate -> Registry lookup -> Extractor\n```\n\n## Key Functions\n\n| Function                             | Location       | Purpose                                 |\n| ------------------------------------ | -------------- | --------------------------------------- |\n| `detect_mime_type(path, inspect)`    | `core\u002Fmime.rs` | Extension + optional content inspection |\n| `detect_mime_type_from_bytes(bytes)` | `core\u002Fmime.rs` | Magic number detection (infer crate)    |\n| `validate_mime_type(mime)`           | `core\u002Fmime.rs` | Check if any extractor supports it      |\n\n## Extension Mapping\n\n118+ extensions mapped in `EXT_TO_MIME` (`core\u002Fmime.rs`). Case-insensitive.\n\nKey mappings: `.pdf` -> `application\u002Fpdf`, `.docx` -> `application\u002Fvnd.openxmlformats-officedocument.wordprocessingml.document`, `.xlsx` -> spreadsheet variant, `.png`\u002F`.jpg` -> `image\u002F*`\n\n## Registry Selection\n\n```rust\n\u002F\u002F In core\u002Fextractor\u002Fbytes.rs\nfn select_extractor_for_mime(mime_type: &str) -> Result\u003CArc\u003Cdyn DocumentExtractor>> {\n    let registry = get_document_extractor_registry();\n    let registry_guard = registry.read()?;\n    registry_guard.get_for_mime_type(mime_type)\n        .ok_or_else(|| XbergError::UnsupportedFormat(mime_type.into()))\n}\n```\n\nSelects highest-priority extractor registered for that MIME type.\n\n## Adding New MIME Types\n\n1. Add extension mapping: `m.insert(\"ext\", \"application\u002Fx-new\");` in `core\u002Fmime.rs`\n2. Implement `DocumentExtractor` with `supported_mime_types()` returning the MIME\n3. Register in `register_default_extractors()`\n\n## Wildcard Support\n\nExtractors can register for MIME type families: `\"image\u002F*\"` matches `image\u002Fpng`, `image\u002Fjpeg`, etc.\n\n## Critical Rules\n\n1. Always `validate_mime_type()` before extraction\n2. Extension mapping is case-insensitive\n3. Content inspection (infer crate) is fallback for extension-less files\n4. Registry validation is final authority on supported types\n","# MIME Detection & Routing\n\n## Detection Flow\n\n```text\nExtension -> EXT_TO_MIME map -> validate -> Registry lookup -> Extractor\n```\n\n## Key Functions\n\n| Function                             | Location       | Purpose                                 |\n| ------------------------------------ | -------------- | --------------------------------------- |\n| `detect_mime_type(path, inspect)`    | `core\u002Fmime.rs` | Extension + optional content inspection |\n| `detect_mime_type_from_bytes(bytes)` | `core\u002Fmime.rs` | Magic number detection (infer crate)    |\n| `validate_mime_type(mime)`           | `core\u002Fmime.rs` | Check if any extractor supports it      |\n\n## Extension Mapping\n\n118+ extensions mapped in `EXT_TO_MIME` (`core\u002Fmime.rs`). Case-insensitive.\n\nKey mappings: `.pdf` -> `application\u002Fpdf`, `.docx` -> `application\u002Fvnd.openxmlformats-officedocument.wordprocessingml.document`, `.xlsx` -> spreadsheet variant, `.png`\u002F`.jpg` -> `image\u002F*`\n\n## Registry Selection\n\n```rust\n\u002F\u002F In core\u002Fextractor\u002Fbytes.rs\nfn select_extractor_for_mime(mime_type: &str) -> Result\u003CArc\u003Cdyn DocumentExtractor>> {\n    let registry = get_document_extractor_registry();\n    let registry_guard = registry.read()?;\n    registry_guard.get_for_mime_type(mime_type)\n        .ok_or_else(|| XbergError::UnsupportedFormat(mime_type.into()))\n}\n```\n\nSelects highest-priority extractor registered for that MIME type.\n\n## Adding New MIME Types\n\n1. Add extension mapping: `m.insert(\"ext\", \"application\u002Fx-new\");` in `core\u002Fmime.rs`\n2. Implement `DocumentExtractor` with `supported_mime_types()` returning the MIME\n3. Register in `register_default_extractors()`\n\n## Wildcard Support\n\nExtractors can register for MIME type families: `\"image\u002F*\"` matches `image\u002Fpng`, `image\u002Fjpeg`, etc.\n\n## Critical Rules\n\n1. Always `validate_mime_type()` before extraction\n2. Extension mapping is case-insensitive\n3. Content inspection (infer crate) is fallback for extension-less files\n4. Registry validation is final authority on supported types\n",{"name":5,"description":7},"main","613e6deee7a2f31f95bac8beec31dd5171193c8d",".ai-rulez\u002Fskills\u002Fmime-detection-routing",0,"https:\u002F\u002Fgithub.com\u002Fjamon8888\u002Fhacienda-engine","https:\u002F\u002Fhacienda-engine-hacienda-studio.vercel.app","https:\u002F\u002Fgithub.com\u002Fjamon8888","hacienda.diy","Maker","2026-11-15 05:01:55",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add jamon8888\u002Fhacienda-engine --skill mime-detection-routing",{"tool":40,"command":41},"bunx","bunx skills add jamon8888\u002Fhacienda-engine --skill mime-detection-routing",{"tool":43,"command":44},"pnpm","pnpm dlx skills add jamon8888\u002Fhacienda-engine --skill mime-detection-routing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjamon8888\u002Fhacienda-engine\u002Fblob\u002Fmain\u002F.ai-rulez\u002Fskills\u002Fmime-detection-routing\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M79RTKG5HB5PQ251W7J9C4S6","impeccable","Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.","https:\u002F\u002Fgithub.com\u002Fjamon8888\u002Fhacienda-engine\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fimpeccable\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M79RTFDA4MAD9PPF3N15B68Y","wasm-constraints","WASM build constraints for the crates\u002Fxberg-wasm crate — the wasm-target feature set, no-tokio sync-only internal APIs, the mandatory SyncExtractor trait for WASM-compatible extractors, the 2 MB HTML size limit, size-optimized build config (opt-level=\"z\"), and the async-wrapper\u002Fsync-internal API pattern. Load when building for wasm32, adding or modifying a WASM-compatible extractor, or debugging WASM build\u002Fruntime failures.","https:\u002F\u002Fgithub.com\u002Fjamon8888\u002Fhacienda-engine\u002Fblob\u002Fmain\u002F.ai-rulez\u002Fskills\u002Fwasm-constraints\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M79RTC4SV7NENKJXK2PSHK7H","release-versioning","How xberg versions are synced and released — Cargo.toml is the single source of truth, `task version:sync` propagates it to alef-managed binding manifests AND the integrations under integrations\u002F, which are versioned and published in lockstep with core (including -rc.N). Load before bumping a version, editing the version-sync task, or touching an integration's version\u002Fxberg dependency.","https:\u002F\u002Fgithub.com\u002Fjamon8888\u002Fhacienda-engine\u002Fblob\u002Fmain\u002F.ai-rulez\u002Fskills\u002Frelease-versioning\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M79RT94KWTS5R5T61S71H1AD","plugin-architecture-patterns","Plugin architecture, registration, and trait patterns","https:\u002F\u002Fgithub.com\u002Fjamon8888\u002Fhacienda-engine\u002Fblob\u002Fmain\u002F.ai-rulez\u002Fskills\u002Fplugin-architecture-patterns\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M79RSZYWZ6RSAM31N2Y0TXMN","format-specific-extraction","Format-specific document extraction workflows","https:\u002F\u002Fgithub.com\u002Fjamon8888\u002Fhacienda-engine\u002Fblob\u002Fmain\u002F.ai-rulez\u002Fskills\u002Fformat-specific-extraction\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M79RSVWDRR4V8H5Q3ECBADF4","feature-flag-policy","Cargo feature flags for crates\u002Fxberg — ORT-incompatible targets (WASM, Android x86_64 emulator), type-only and tract inference companion features, WASM\u002FAndroid-safe variants, PDF backend, mutually-exclusive ORT variants, platform-conditional deps, aggregate feature sets, and build profiles. Load when adding, wiring, or debugging a Cargo feature, or when reasoning about what compiles on WASM\u002FAndroid\u002FWindows\u002FmacOS-intel targets.","https:\u002F\u002Fgithub.com\u002Fjamon8888\u002Fhacienda-engine\u002Fblob\u002Fmain\u002F.ai-rulez\u002Fskills\u002Ffeature-flag-policy\u002FSKILL.md",[],[]]