mdc

Read, edit, and author Notion-backed MDC files while preserving parser grammar and ref identity.

4|1|Updated Jul 31, 2025
One-click install
npx skills add https://github.com/alvis/.agents --skill mdc-alvis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mdc
Source: https://github.com/alvis/.agents/tree/main/plugins/specification/skills/mdc
Command: npx skills add https://github.com/alvis/.agents --skill mdc-alvis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Editing Notion-backed MDC (Contextual Markdown) files with plain text tools easily corrupts the private parser grammar — broken indentation, detached annotations, mismatched closing markers, or drifted transport metadata like ref and last_edited_time. This Skill enforces the invariants that keep .mdc files parseable and identity-stable during local body edits. ## Core Features & Use Cases - Safe read/edit/author modes: Load mode-specific grammar references before touching content, then apply the smallest coherent operation such as annotation scalar changes, same-type text replacement, or correctly indented child appends. - Invariant enforcement: Verify two-space indentation, annotation adjacency, YAML validity, closing-marker integrity, and escape preservation after every edit, with defined recovery moves for common failures. - Transport metadata protection: Capture ref, parent, and last_edited_time before mutation and validate them afterward via a read-only specification:sync-notion validate-metadata call, rejecting any local drift. - Use Case: A specification workflow needs to update a paragraph inside a Notion-synced .mdc page. The Skill locates the block by ref:, edits only its text, re-verifies markers and indentation, and confirms no transport-owned frontmatter changed. ## Quick Start Ask the agent to edit the paragraph under a specific ref in your Notion-backed .mdc file while preserving all annotations and closing markers.

Frequently Asked Questions about mdc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely edit a Notion-backed MDC file?

Locate the target block by its ref, unique text, or exact line range, then apply the smallest coherent edit such as an annotation scalar change or same-type text replacement. Afterward, re-read the modified region and run the invariant checklist covering indentation, adjacency, markers, and YAML validity.

What is the MDC closing marker syntax?

A closing marker is written as --{ ref: <name> }-- and must match its opening block's ref and indentation exactly. Markers are added when a ref-bearing block gains children and removed only when it loses its last child.

Can I edit last_edited_time or ref in MDC frontmatter?

No. ref, parent, and last_edited_time are transport-owned metadata managed by Notion sync. Local edits must leave them byte-for-byte stable, and last_edited_time is omitted entirely for locally authored unsynced pages until transport returns a value.

Why did my MDC annotation stop applying to its block?

The most common cause is a blank line inserted between the {{ ... }} annotation and its target block, which detaches the annotation. Remove the blank line so the annotation sits immediately above the block.

When should I not use this Skill for MDC changes?

Do not use it for operations requiring the @theriety/mdc parser runtime, converting plain Markdown to MDC, syncing to Notion, or renaming/deriving notion-sync paths. Those belong to the specification sync skills or the parser runtime.