mif-corpus
Skill1 starsChanged 35 days agoMITView on GitHub
Semantically index and query a corpus of MIF documents — ingest docs into a local vector store, run free-text search, find similar documents for cross-linking, and report corpus statistics via the optional mif-rs tools (mif-mcp MCP server or mif-cli). Use when a request needs discovery over existing MIF docs ("which doc covers X?", "what should this link to?"). Anti-trigger; for proving conformance use mif-validate — similarity is a suggestion signal, never a gate.
- Installs packages
In this repository46 other files it gives its agents.
- academicSkill
- adrSkill
- ai-architecture-docSkill
- arc42-arch-docSkill
- audit-docsSkill
- briefingSkill
- business-planSkill
- c4-model-diagramSkill
- changelogSkill
- clinical-submissionSkill
- competitive-quadrantSkill
- compliance-auditSkill
- computing-paperSkill
- diataxis-explanationSkill
- diataxis-how-toSkill
- diataxis-referenceSkill
- diataxis-tutorialSkill
- doc-set-plannerSkill
- ears-acceptance-criteriaSkill
- engineeringSkill
- exec-summarySkill
- feature-specSkill
- google-design-docSkill
- humanities-chicagoSkill
- humanities-mlaSkill
- kiro-designSkill
- kiro-requirementsSkill
- kiro-tasksSkill
- legal-memoSkill
- market-research-reportSkill
- mif-frontmatterSkill
- mif-provenanceSkill
- mif-to-pdfSkill
- mif-validateSkill
- nist-spSkill
- playbookSkill
- prdSkill
- python-pepSkill
- regulatory-disclosureSkill
- rust-rfcSkill
- security-pentestSkill
- sre-runbookSkill
- sustainability-reportSkill
- svg-chartsSkill
- systematic-reviewSkill
- trend-analysisSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Document ids are the MIF @id (urn:mif:<id> from the frontmatter id).
- Very specific: line 52
Search and similar results are (score, id) pairs, most similar first.
- Very specific: line 110
Every failure renders as an RFC 9457 application/problem+json envelope with type, status, detail, and often suggested_fix + code_actions[].
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
mif-corpus
Shared substrate for semantic discovery over MIF documents. Where
mif-validate proves what a document IS (deterministically), this skill finds
what a document is ABOUT — a local-embedding vector index queried by meaning,
not string match. It is backed entirely by the optional
mif-rs tools and is an
enhancement layer: nothing in this suite's conformance path depends on it.
Tool resolution order (never fake results)
- MCP tools — when an
mif-mcpserver is connected in the session, use its tools:ingest_mif_document,search_documents,find_similar_documents,corpus_stats(andvalidate_mif_document,resolve_ontology_referencefor the non-corpus operations). - CLI fallback — when only the
mif-clibinary is onPATH, use the matching subcommands:ingest,search,find-similar,corpus-stats. - Neither available — say so plainly, point at the install route
(attested release binaries from
modeled-information-format/mif-rs, orcargo install mif-cli mif-mcp), and stop. Do not simulate scores, invent matches, or substitute grep output labeled as semantic search.
Store convention
- The vector store lives at
.mif/vectors.db, created on first ingest. The tools' default is relative to the working directory — run them from the repo root so the store lands at<repo>/.mif/vectors.db(or pass--db-path/ thedb_pathparameter to pin it explicitly; a run from a subdirectory otherwise creates a second store silently). It is gitignored — a derived local index, never committed, never an authority. - Document ids are the MIF
@id(urn:mif:<id>from the frontmatterid). - Re-ingesting a changed document upserts its embedding; ingest is fail-closed — a document that fails schema validation or the lossless round-trip stores nothing.
Operations
| Operation | MCP tool | CLI | Behavior |
| Ingest | ingest_mif_document | mif-cli ingest <file> | validate + prove round-trip + embed + store |
| Search | search_documents | mif-cli search "<query>" | rank stored docs by cosine similarity to the query |
| Similar | find_similar_documents | mif-cli find-similar <id> | rank docs similar to an ingested one, anchor excluded |
| Stats | corpus_stats | mif-cli corpus-stats | count, embedding dimension, db path |
Search and similar results are (score, id) pairs, most similar first. Scores
are cosine similarity; on this suite's own corpus, useful matches typically
land in the ~0.55-0.78 range. Treat results as candidates for a human or a
genre skill to act on — never as a validation verdict.
Multi-root queries (spanning a shared central store)
search/find-similar/corpus-stats (CLI) and their MCP counterparts
search_documents/find_similar_documents/corpus_stats accept an
additional, repeatable root: --extra-db-path <path> on the CLI, an
extra_db_paths array parameter on the MCP tools. This lets a query span
the project-local .mif/vectors.db and any number of other vector
stores in one call — most commonly a shared, user-level central corpus that
multiple projects ingest into (e.g. the
claude-artifact-authoring
plugin's persist-artifact skill best-effort-ingests graded artifacts into
one via mif-corpus ingest, at an XDG-conformant path —
$HOME/.local/share/claude-artifact-authoring/corpus/vectors.db, i.e.
${XDG_DATA_HOME:-$HOME/.local/share} with the default expanded).
- Results are merge-ranked by cosine similarity across every root for
search/find-similar— not grouped or root-ordered — with each match additionally tagged with the root it came from. Single-root behavior (no--extra-db-path/extra_db_pathsgiven) is unchanged. corpus-stats/corpus_statsis not a ranked search — with extra roots it returns the primary root'scount/dimplus atotal_countand a per-root breakdown (extra_roots); nothing is merge-ranked, since there is no query vector in a stats call.- Fails closed per root: a root that cannot be opened or queried aborts the whole call rather than silently dropping it from the results. A root that has a valid parent directory but no database file yet (never ingested) is treated as empty, not an error.
- The same document id can legitimately exist in more than one root (e.g. a document ingested both locally and into the shared central store) — this is expected, not a collision to dedupe.
Known exclusion: documents with a description: key (the ADRs)
Documents carrying a top-level description: frontmatter key currently fail
the Rust round-trip check inside ingest (the key is dropped by the canonical
re-serialization; tracked upstream and in this repo's engine-convergence
epic). In this suite's corpus those are exactly the ADR documents under
docs/adr/, which carry MIF type: adr (conceptType: semantic), so the
skip set is identifiable by the description: key, the docs/adr/ path, or
the type: adr frontmatter value alike. Skip them in bulk ingests and say
that they were skipped and why. This sits alongside the suite's existing rule
that the adr genre is validated by the structured-madr Action, not
mif-validate.
First-run cost
The first ingest or search downloads the sentence-embedding model into the local hf-hub cache — it needs network access once and takes noticeably longer than subsequent runs. Vectors are 384-dimensional. Warn about this before a first bulk ingest; after the model is cached, runs are local and fast.
Reading failures
Every failure renders as an RFC 9457 application/problem+json envelope with
type, status, detail, and often suggested_fix + code_actions[].
Honor the applicability marker: apply a machine_applicable fix, surface a
maybe_incorrect one to the user instead of auto-applying. A 404
document-not-found from find-similar means the anchor was never ingested —
ingest it first.
How the suite uses this
doc-set-planner's corpus-aware Plan and Reconcile steps (shipped as their
own change, stacked on this skill) consume it in two places: at Plan time,
search the corpus for existing coverage of each proposed member (surface
strong hits as "extend instead of create?" decisions); at Reconcile time,
offer find-similar results as candidate relationships[] targets. In both
cases the recipe contract and the deterministic planner-check gate stay
authoritative.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

