Skip to content

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.

Every MIF document needs three fields. Add them at the top of the file:

---
id: how-to-rotate-credentials
type: procedural
created: 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/security
modified: 2026-06-30T12:00:00Z
temporal:
'@type': TemporalMetadata
validFrom: 2026-06-30T00:00:00Z
recordedAt: 2026-06-30T12:00:00Z
ttl: P1Y

Step 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-code

Step 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-purpose

Validate at the level you climbed to:

Terminal window
node scripts/mif-validate.mjs your-doc.md --level 2

A 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.