Content type info metadata embedding
Skill kjuhwa/skills-hub/skills/data/content-type-info-metadata-embedding
Self-correcting knowledge corpus for Claude Code — 9 stable shape clusters, bias-correction pipeline baked into contribution flow. 47 papers, 45 techniques, 1.1k skills.
npx -y skills add kjuhwa/skills-hub --skill content-type-info-metadata-embeddingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Embed structured metadata per content type (mime_type, group, description, extensions, is_text) at codegen time so callers can convert predictions to human output or filter by group without lookup tables.
SKILL.md
1.9 KB, as published. Nobody here has run it
Content Type Info Metadata Embedding
Trigger: Building a classifier whose output needs human-readable enrichment (MIME type, file extensions, broad category) at every call site.
Steps
- Source metadata from a single canonical JSON (assets/content_types_kb.min.json).
- Code generator emits a const TypeInfo struct per content type with all metadata fields.
- Add an info() / get_info() method on the ContentType enum that returns the struct.
- Standardize the group taxonomy (text, image, archive, executable, binary, …) and document it.
- Allow filtering: content_types.filter(ct => ct.is_text) or ct.group == 'text'.
- Test that every label has complete metadata at codegen time — missing fields fail the build.
Counter / Caveats
- Metadata can be stale or wrong for obscure types; validate against real samples occasionally.
- MIME type is not 1-to-1 with label (e.g. .txt vs text/markdown); use is_text for binary/text filtering.
- Extensions list grows over time; document the preferred extension explicitly.
- Custom group taxonomy may not align with IANA / file(1) groups; document the difference for integrators.
Source
Extracted from magika (https://github.com/google/magika.git @ main).
Files of interest:
rust/gen/src/main.rs:65-82python/src/magika/types/content_type_info.pyjs/src/content-type-info.tsgo/magika/content.go