Quickstart
Install mediva, write a contract, validate a file, and fix the first failure — in about five minutes.
LOG ENTRY — SOL 47: Mission Control will not accept a status report that just says "still alive lol." They want a real report. Good news: I can make the habitat's computer reject the bad ones before they burn 12 minutes of light-lag getting to Earth.
You're Mark Watney. Every sol, a status report goes home.
1. Install
npm install -D mediva2. Write a contract
Every sol report must have this shape:
<!-- mdv: section required content.words.min=15 content.none=@placeholders -->
## Crew Status3. Validate a document
## Crew Status
One crew member, nominal and still stubborn. Oxygenator stable, water reclaimer holding at ninety one percent, and the Hab potatoes remain emotionally complicated. Telemetry pulled with `./pull-telemetry.sh --sol 47`.npx mediva check sol47.md --schema status.mdv.md✓ 1 document checkedSilence is the pass. (--schema takes the contract.)
4. Break it, read the failure
A dust storm hits. Tonight's report:
## Crew Status
Still alive. Potatoes fine.sol47.md
State: what the document claims; clear it by doing the work or saying it is not done
3 warning "Crew Status" has 4 words, needs at least 15 too-few-words
help: Add the missing specifics, not filler
✖ 1 problem (0 errors, 1 warning)
mdv explain <rule-id> for detailsSection, rule, line. Word floors warn (exit 0); error=too-few-words blocks.
I'm going to have to science the heck out of this contract. (You won't — it's already done.)
5. Let mdv check find it
npx mdv check pairs contracts and documents by location:
| Contract | Checks |
|---|---|
X. | X. beside it |
_template. | every other *. in its folder |
. | the document at <path> |
. | PR descriptions (--pr body.) |
Ready-made starters are being rebuilt; for now write the contract by hand, then npx mdv check docs/.
Next
Contracts · Recipes · Pre-commit · All rules