$ show K-Dense-AI/mimeo
Mimeo is a Python CLI application that transforms a named expert's public body of work (essays, talks, interviews, podcasts, papers, etc.) into a structured, source-verified Agent Skill file (SKILL.md) and/or AGENTS.md, designed for AI coding agents to adopt the expert's reasoning style. The pipeline orchestrates identity resolution, source discovery via the Parallel API, content fetching (web, YouTube transcripts, optional audio transcription), LLM-based distillation and clustering (via OpenRouter), quote verification against source text, structured skill authoring, critique/refinement loops, and optional avatar generation. The output is a curated set of markdown files (principles, frameworks, mental models, anti-patterns, heuristics, quotes) organized per expert in the `output/` directory. The codebase is well-architected with async stages, a fingerprint-based caching layer, SSRF-safe HTTP helpers, prompt injection mitigations, and extensive offline tests using fake LLM/Parallel clients. While the primary purpose is the application tool, the generated output forms a reusable knowledge base of expert reasoning patterns, giving the repo a hybrid character.
The LLM identified 3 files worth highlighting for reuse:
Provides a generic, versioned, fingerprint-based cache for expensive operations (LLM calls, fetches). Uses SHA-256 digests of stage name, input data, and prompt/schema digests to generate cache keys. Handles corruption gracefully by treating legacy or corrupt entries as cache misses. The `canonical_data` function serializes Pydantic models, paths, sets, and dicts deterministically. This module is self-contained and could be extracted into any Python project needing a robust, content-addressable cache.
Implements SSRF-safe HTTP GET requests. Validates URLs are public (no private, loopback, or link-local addresses), performs DNS resolution to block internal IPs, caps redirects and response size, and rejects URLs containing credentials. The `safe_http_get` function is a standalone, reusable utility for any Python application that needs to fetch external resources without exposing internal infrastructure.
Provides utilities to mitigate prompt injection when inserting untrusted content (e.g., fetched web text) into LLM prompts. Includes `wrap_untrusted_block` to delimit untrusted content with XML-like tags, `escape_untrusted` to escape curly braces and other special tokens, and `sanitize_metadata` to strip suspicious patterns from source metadata. This module is self-contained and can be reused in any LLM application that incorporates external, user-supplied text.