Skip to content

Examples

Browse all example files on GitHub.

re-anchoring scenarios from §7.4.

Examples at a Glance

DocumentSidecarScenario
architecture.mdarchitecture.md.review.yamlBaseline — simple sidecar with line-only and column-span comments
api-reference.mdapi-reference.md.review.yamlShifted text (§7.4 Step 1) — lines were inserted above the anchored text; line numbers are stale but selected_text still matches exactly at a new position
deployment-guide.mddeployment-guide.md.review.yamlFuzzy / contextual match (§7.4 Step 3) — text was reworded, a typo fixed, and a sentence split; exact match fails but fuzzy similarity is high
security-policy.mdsecurity-policy.md.review.yamlDisambiguation (§7.4 Step 1b) — identical phrases appear at multiple locations; line/column hints resolve ambiguity, or the comment is flagged ambiguous when hints are absent
contributing.mdcontributing.md.review.yamlOrphaned comments + line-only fallback (§7.4 Steps 2 & 4) — sections were deleted; some comments have no selected_text and rely on line numbers alone
data-model.mddata-model.md.review.yamlThreaded replies, mixed states, extensionsreply_to threading, resolved vs open, x_ extension fields, document-level comments, and selected_text_hash

Re-anchoring Strategy Summary

The table below maps each §7.4 step to the example that exercises it:

StepDescriptionExample file
Step 1aExact text match — single hitapi-reference.md.review.yaml
Step 1bExact text match — multiple hits, disambiguate with line/columnsecurity-policy.md.review.yaml
Step 1bExact text match — multiple hits, no line hint → ambiguoussecurity-policy.md.review.yaml (Comment C)
Step 2aLine/column fallback — line valid, content plausiblecontributing.md.review.yaml (Comment A)
Step 2bLine/column fallback — line valid, content unrelatedcontributing.md.review.yaml (Comment D)
Step 2cLine/column fallback — line beyond document lengthcontributing.md.review.yaml (Comment C)
Step 3Contextual / fuzzy re-anchoringdeployment-guide.md.review.yaml
Step 4Orphan — text removed, no match possiblecontributing.md.review.yaml (Comments B, C, E)

Plugin Demos

Two runnable TypeScript demos show the rendering plugins in action. Both read architecture.md and its sidecar, render annotated HTML, and print it to the console.

bash
cd examples
npm install        # one-time — installs plugin dependencies
npx tsx demo-markdown-it.ts   # markdown-it plugin demo
npx tsx demo-rehype.ts        # rehype plugin demo

There is also a browser demo for the Monaco integration:

bash
cd examples
npm install
npm run demo:monaco

Then open the printed local Vite URL and navigate to / to try the interactive Monaco editor demo. The toolbar now includes Reanchor Saved Snapshot, which restores the last host-written sidecar and runs the browser-safe MRSF re-anchoring algorithm against the current document so you can compare persisted anchors with the live revision.

Trying the Examples

If you have the MRSF CLI installed (npm install -g @mrsf/cli or via npx), you can validate and inspect these examples:

bash
# Validate all sidecars
npx @mrsf/cli validate examples/*.review.yaml

# List open comments
npx @mrsf/cli list examples/data-model.md.review.yaml

# Show summary stats
npx @mrsf/cli list --summary examples/security-policy.md.review.yaml

# Dry-run re-anchoring (no writes)
npx @mrsf/cli reanchor --dry-run examples/api-reference.md.review.yaml

# Check anchor health
npx @mrsf/cli status examples/contributing.md.review.yaml

Agent Skill

The mrsf-review/ folder contains a sample Agent Skill that teaches an AI agent to review Markdown documents using the MRSF MCP server. Copy the folder into your project's .agent/skills/ directory (or wherever your agent discovers skills) to give any skills-compatible agent structured document review capabilities.

Released under the MIT License.