/mif-docs:mif-corpus <ingest <path>|search <query>|find-similar <id>|corpus-stats> [--db-path <path>]from mif-docs
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.
Ships in mif-docs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
mif-mcp server is connected in the session, use
its tools: ingest_mif_document, search_documents,
find_similar_documents, corpus_stats (and validate_mif_document,
resolve_ontology_reference for the non-corpus operations).mif-cli binary is on PATH, use the
matching subcommands: ingest, search, find-similar, corpus-stats.modeled-information-format/mif-rs, or
cargo install mif-cli mif-mcp), and stop. Do not simulate scores, invent
matches, or substitute grep output labeled as semantic search..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 / the db_path parameter 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.@id (urn:mif:<id> from the frontmatter id).| 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 against the query (see "Reading search scores") |
| 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, best first. Treat results
as candidates for a human or a genre skill to act on — never as a
validation verdict.
What score means depends on the mif-rs release and the search mode. Check
before comparing a score with a threshold.
find-similar, and search on mif-rs 0.12.0 and earlier: score is
cosine similarity. On this suite's own corpus, useful matches typically
land in the ~0.55-0.78 range.search on mif-rs 0.13.0 and later: the default mode is hybrid, which
also ranks by exact terms so an identifier is found by the text that holds
it. score is then a rank-fusion value that never exceeds about 0.033. It
orders the results and says nothing about how similar a match is.To judge similarity on 0.13.0 and later:
cosine field. When a match has no cosine
field, the server predates hybrid search and score is the cosine.mif-cli --version. On 0.13.0 or later pass --mode semantic,
which prints cosine scores, or pass --format json and read cosine.Never compare a hybrid score with the 0.55-0.78 range. A match on 0.13.0
and later also carries the passage that matched (heading, text, span);
get_passage / mif-cli get-passage <id> --heading <heading> returns that
section alone, so there is no need to read the whole document.
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).
search/find-similar — not grouped or root-ordered — with each match
additionally tagged with the root it came from. find-similar, and
search in semantic mode, merge by cosine similarity; hybrid search
ranks cosine similarities together and keeps each document's exact-term
rank from its own root. Single-root behavior (no
--extra-db-path/extra_db_paths given) is unchanged.corpus-stats/corpus_stats is not a ranked search — with extra roots it
returns the primary root's count/dim plus a total_count and a
per-root breakdown (extra_roots); nothing is merge-ranked, since there is
no query vector in a stats call.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.
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.
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.
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.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub modeled-information-format/mif-docs-plugin --plugin mif-docs47 skills in this plugin
/academicWrite a formal academic research report — Abstract, Background, Method, Findings, Discussion, References — with a selectable citation style (author-date/APA or numbered/Vancouver-IMRaD) and optional APA Method sub-sections. Use when the deliverable is a scholarly write-up for a research or technical-expert audience that demands traceable evidence and explicit method. Anti-trigger; for an informal trade-off narrative use google-design-doc, for a practitioner decision report built around a mandatory comparison table use engineering./adrWrite an Architectural Decision Record (ADR) in the Structured MADR format — one decision, its drivers, the options weighed with risk, the chosen outcome, the consequences accepted, and an audit trail — validated by the structured-madr Action in both smadr and MIF modes. Use when a team is making or capturing a consequential, hard-to-reverse technical choice and needs it documented with rationale. Anti-trigger; for a how-to use diataxis-how-to, for requirements use prd or feature-spec, not an ADR./ai-architecture-docWrite a composite AI-spec architecture document that embeds an arc42/C4-style structure plus testable non-functional requirements and an ADR-style decision log in one spec-channel artifact. Use for an architecture spec a coding agent can consume. Anti-trigger; for a pure narrative use arc42-arch-doc, for diagrams alone use c4-model-diagram./arc42-arch-docAuthor an arc42 architecture document — the 12-section industry template (introduction & goals, constraints, context, solution strategy, building blocks, runtime, deployment, cross-cutting concepts, decisions, quality requirements, risks & tech debt, glossary) that captures a system's architecture as durable declarative knowledge. Use when the user needs a system/software architecture description, an arc42 doc, a software architecture document (SAD), or to record how a system is structured and why. Anti-trigger; for a single decision use an ADR (structured-madr/Nygard), and for task steps use a runbook/how-to./audit-docsAudit MIF documents under one or more paths for accuracy, taxonomy alignment, editorial consistency, and frontmatter/provenance/temporal/relationship/citation conformance. Deterministic script checks run first at zero Agent cost; cross-document checks are guaranteed (three bounded Agent calls); per-file judgment runs as batched, schema-validated Agent calls over only the files that changed since the last audit. Use when the user asks to audit, review, or check a set of MIF documents for conformance/quality./briefingWrite a one-page briefing or standup update — Headline, What's New, Why It Matters, What's Next / Asks — for a recurring audience that already holds context and needs the delta fast. Use for a terse status or situational update, not a narrative summary. Anti-trigger; for a longer standalone summary of a larger document written for a first-time reader use exec-summary, for a released-version history use changelog.