How to add MIF frontmatter to a document
How to add MIF frontmatter to a document
Section titled “How to add MIF frontmatter to a document”This guide adds MIF-conformant frontmatter to a document you are already writing, climbing from the Level-1 floor to Level 2 or 3 only as far as your real detail supports. It assumes you have a document body and want it to project losslessly to canonical JSON-LD. For the full description of the skill, see the mif-frontmatter reference.
Step 1 — Lay the Level-1 floor
Section titled “Step 1 — Lay the Level-1 floor”Every MIF document needs three fields. Add them at the top of the file:
---id: how-to-rotate-credentialstype: proceduralcreated: 2026-06-30T12:00:00Z---id is a stable slug, type is the conceptType (semantic, episodic, or
procedural), and created is an ISO-8601 timestamp. This is L1 — enough to
validate and to round-trip.
Step 2 — Climb to Level 2 when you have temporal context
Section titled “Step 2 — Climb to Level 2 when you have temporal context”Add namespace, modified, and a temporal block when the document has a place
in a corpus and a record time:
namespace: how-to/securitymodified: 2026-06-30T12:00:00Ztemporal: '@type': TemporalMetadata validFrom: 2026-06-30T00:00:00Z recordedAt: 2026-06-30T12:00:00Z ttl: P1YStep 3 — Climb to Level 3 when you can attest provenance
Section titled “Step 3 — Climb to Level 3 when you can attest provenance”Add a provenance block (with temporal.validFrom present) when you can state
where the knowledge came from and who attributed it. Do not fabricate these to
reach a level — only add provenance you can stand behind:
provenance: '@type': Provenance sourceType: agent_inferred trustLevel: high_confidence agent: anthropic/claude-codeStep 4 — Add citations and relationships
Section titled “Step 4 — Add citations and relationships”Record your sources as citations[] and your links to other documents as typed
relationships[] edges. These are what make the document a node in a graph rather
than an island:
relationships: - type: relates-to target: urn:mif:reference-skills-by-purposeStep 5 — Prove it conforms
Section titled “Step 5 — Prove it conforms”Validate at the level you climbed to:
node scripts/mif-validate.mjs your-doc.md --level 2A VALID result with a lossless round-trip confirms the frontmatter projects
cleanly. To author the body and convert it between forms, follow the
validate-and-author how-to.