markdown-for-agent (@markdown-ai/cli)

repository·main·Indexed 20 days ago

https://github.com/sno-ai/mda

A toolset for managing Markdown AI (MDA) artifacts, enabling developers and AI agents to create, validate, compile, sign, and release structured Markdown files such as SKILL.md, AGENTS.md, and MCP-SERVER.md. The mda CLI supports source scaffolding, integrity verification, and secure release workflows for the LLMix registry, with compatibility layers for Claude Code, Codex CLI, and Hermes Agent.

Tokens
80K
Snippets
171
Records
328
Agent score
69%

What's inside markdown-for-agent

  1. Understand MDA v1.0 scope and limitations

    main

    MDA v1.0 (specifically v1.0.0-rc.3) focuses on the core specification, target schemas, integrity rules, signature envelopes, and the TypeScript reference CLI (@markdown-ai/cli).

    Key architectural boundaries to note:

    • No Central Registry: MDA does not host or mandate a registry for .mda artifacts; resolution is operator-defined.
    • Conditional Sigstore Signatures: Signature claims depend on Fulcio and Rekor reachability. Operators must implement air-gap fallbacks to did:web and mda-keys.json if Sigstore is unreachable.
    • Strict Schema Validation: The v1.0 SKILL.md schema uses unevaluatedProperties: false. This means runtime-specific top-level fields (like those used by Claude Code) are rejected by the MDA compiler. To include these, authors must hand-edit the compiled output, which subsequently exits MDA validation.
    • Target Ecosystems: v1.0 targets the agentskills.io v1 ecosystem (SKILL.md) and the AAIF-aligned ecosystem (AGENTS.md, MCP-SERVER.md). It does not currently cover Cursor MDC, Windsurf rules, Continue, Aider, or *.instructions.md.
  2. Understand the MDA Open Spec and its core components

    main

    The MDA (Markdown for Agent) Open Spec defines a system for authoring AI-agent artifacts. It consists of four primary pillars:

    1. MDA source format (.mda): A Markdown superset used for authoring.
    2. Compile contract: The rules for transforming .mda sources into standard .md output files (e.g., SKILL.md, AGENTS.md, MCP-SERVER.md, CLAUDE.md).
    3. Integrity and Capability primitives: Mechanisms for making compiled outputs verifiable (via integrity and signatures) and dependency-aware (via relationships).
    4. Conformance rules: JSON Schemas and rules used to build validators, compilers, or consumers.

    Note: MDA is not a runtime; it does not specify how an agent loads or executes the compiled files. That responsibility lies with the consumer (e.g., Claude Code, Cursor, Windsurf).

  3. Use the @markdown-ai/cli for MDA workflows

    main

    The @markdown-ai/cli is the reference implementation for managing Markdown for Agents (MDA) files. It allows you to scaffold, validate, compile, canonicalize, sign, and verify .mda source files and their corresponding .md outputs.

    Core Capabilities:

    • Scaffolding: Create new .mda files.
    • Validation: Check .mda sources against frontmatter schemas or .md outputs against target schemas (SKILL.md, AGENTS.md, MCP-SERVER.md).
    • Compilation: Transform .mda sources into conformant .md files.
    • Integrity & Security: Compute/verify integrity, canonicalize artifacts, and sign/verify signatures using did:web or other supported methods.
    • Conformance: Run the official MDA conformance suite to ensure compliance.
  4. MDA Specification Document Map

    main

    The MDA Open Spec is organized into several normative and informative sections. Use this map to locate specific technical requirements:

    FileTitleStatus
    01-source-and-output.md.mda source vs .md output; compile directionStable
    02-frontmatter.mdFrontmatter floor, MDA-extended fields, integrity, signaturesStable
    03-relationships.mdFootnote relationship JSON, depends-on with version-range/digest pinningStable
    04-platform-namespaces.mdReserved vendor namespaces under metadata.<vendor>Stable
    05-progressive-disclosure.mdThree-tier loading model and directory contracts (scripts/, references/, assets/)Stable
    06-targets/skill-md.mdSKILL.md target schema (embeds agentskills.io v1)Stable (Tier 1)
    06-targets/agents-md.mdAGENTS.md target schema (AAIF-aligned)Stable (Tier 1)
    06-targets/mcp-server-md.mdMCP-SERVER.md target schema (AAIF-aligned)Stable (Tier 2)
    06-targets/claude-md.mdCLAUDE.md target schemaStub (Tier 2)
    07-conformance.mdConformance levels and the test suiteStable
    08-integrity.mdintegrity field (sha256 combined hash)Stable
    09-signatures.mdsignatures[] field (DSSE PAE, Sigstore OIDC, etc.)Stable
    10-capabilities.mdmetadata.mda.requires capability declarationsStable
    11-implementer-guide.mdRecommended loader algorithm and error vocabularyInformative
    12-sigstore-tooling.mdSigstore SDK ↔ MDA signatures[] mappingInformative
    13-trusted-runtime.mdProduction verification profile and fail-closed behaviorStable

    Note: The REGISTRY.md file at the repository root governs vendor namespace assignment, standard requires keys, and reserved Sigstore/DSSE values. It is referenced by sections §04, §08, §09, §10, and §13.

  5. What is MDA and how does it work?

    main

    MDA (Markdown for Agent) is a portable, structured metadata format designed for AI-agent artifacts. It allows a single .mda source file to be compiled into byte-equivalent .md outputs compatible with major agent ecosystems, including:

    • SKILL.md (Tier 1, agentskills.io v1)
    • AGENTS.md (Tier 1, AAIF-aligned)
    • MCP-SERVER.md (Tier 2, includes sidecar mcp-server.json)
    • CLAUDE.md (Tier 2 stub)

    The format provides cross-runtime portability, a machine-readable dependency graph, and open-extensible capability declarations, all secured via Sigstore-anchored signatures.

  6. What is MDA (Metadata for Agent Artifacts)?

    main

    MDA is a portable, structured metadata format designed for AI-agent artifacts. It allows a single .mda source file to be compiled into multiple byte-equivalent .md outputs tailored for different agent ecosystems.

    Key features include:

    • Cross-runtime portability: Works across major agent ecosystems.
    • Machine-readable dependency graphs: Uses depends-on and version/digest pinning to manage relationships.
    • Open-extensible capability declarations: Uses metadata.mda.requires to declare necessary capabilities.
    • Cryptographic identity: Supports Sigstore-anchored signatures for enterprise-grade integrity.

    Common target outputs include SKILL.md, AGENTS.md, CLAUDE.md, and MCP-SERVER.md.

  7. What is MDA (Markdown for Agent)?

    main

    MDA (Markdown for Agent) is a superset of Markdown designed specifically for AI Agents. It follows a "one source, multiple outputs" philosophy: you write a single .mda source file, and a compiler generates multiple .md files compatible with various agent runtimes (such as SKILL.md, AGENTS.md, MCP-SERVER.md, and CLAUDE.md).

    Key features include:

    1. Rich YAML Frontmatter: Beyond standard name and description, it supports doc-id, version, requires, depends-on, relationships, and tags for routing and dependency resolution.
    2. Typed Footnote Relationships: Uses standard Markdown footnotes with JSON payloads to define relationships like parent, child, related, cites, supports, contradicts, and extends.
    3. Cryptographic Identity: Includes a JCS-normalized integrity.digest and signatures[] (using DSSE and anchored to Sigstore) to allow agents and humans to verify the content's authenticity and detect tampering.
  8. What is MDA (Markdown para Agentes)

    main

    MDA is a superset of Markdown designed for agent-oriented documents. It follows a "one source, multiple destinations" philosophy, allowing you to write a single .mda file that compiles into standard .md files compatible with various agent runtimes (e.g., SKILL.md, AGENTS.md, CLAUDE.md).

    MDA adds three key capabilities to standard Markdown:

    1. Rich YAML Frontmatter: Includes doc-id, version, requires, depends-on, relationships, and tags for routing and dependency resolution.
    2. Typed Footnote Relationships: Uses standard Markdown footnotes with JSON payloads to define typed relationships like parent, child, related, cites, supports, contradicts, and extends.
    3. Cryptographic Identity: Provides tamper detection via a JCS-canonicalized integrity.digest and signed identities using signatures[] wrapped in DSSE and anchored in Sigstore.
    ---
    name: pdf-tools
    description: Extract PDF text, fill forms, merge files. Use when handling PDFs.
    metadata:
      mda:
        doc-id: 38f5a922-81b2-4f1a-8d8c-3a5be4ea7511
        title: PDF Tools
        version: "1.2.0"
        tags: [pdf, extraction]
    ---
    
    # PDF Tools
    
    …
  9. What is MDA (Markdown for Agents)

    main

    MDA (Markdown for Agents) is a superset of Markdown designed for agent-oriented documents. It follows a "one source, many targets" philosophy: you write a single .mda file, and a compiler generates multiple drop-in compatible .md files for different agent runtimes (such as SKILL.md, AGENTS.md, MCP-SERVER.md, and CLAUDE.md).

    MDA adds three optional, machine-readable layers to standard Markdown:

    1. Extended YAML frontmatter: Includes metadata like doc-id, version, requires, depends-on, relationships, and tags for dependency resolution and routing.
    2. Typed relationships via footnotes: Uses standard Markdown footnotes with JSON payloads to define semantic links like parent, child, related, cites, supports, contradicts, or extends.
    3. Cryptographic identity: Provides content integrity via integrity.digest (JCS-canonicalized) and signatures[] (DSSE-envelope anchored in Sigstore) within the frontmatter to prevent tampering and verify authors.
                    ┌─────────────────────────┐
                    │   <name>.mda  (source)  │   ← MDA superset
                    └────────────┬────────────┘
                                 │  mda compile
                                 ▼
       ┌─────────────────────────────────────────────────────────┐
       │ <name>/SKILL.md     (+ scripts/, references/, assets/)  │
       │ AGENTS.md                                               │
       │ <name>/MCP-SERVER.md  (+ mcp-server.json sidecar)       │
       │ CLAUDE.md                                               │
       └─────────────────────────────────────────────────────────┘
                           drop-in compatible
  10. What is MDA and why use it?

    main

    MDA (Markdown for Agent) is a specification designed to solve the problem of unstructured metadata in AI agent skills. Instead of relying on inconsistent frontmatter or prose to describe dependencies, identities, and relationships, MDA uses structured fields in the frontmatter and footnotes that can be verified by a JSON Schema (2020-12).

    Key benefits for AI Agents:

    • Typed Dispatch: Structured requires fields for reliable dependency resolution.
    • Verifiable Trust: Load-time verification of document integrity.
    • Machine-Readable Graphs: Explicitly defined relationships (e.g., supports, cites) between documents.
    • Standardized Validation: A single validation contract for both agent-written and compiler-generated outputs.
  11. How MDA layers structured data onto Markdown

    main

    MDA (Markdown for Agent) uses a progressive enhancement architecture. It adds three optional, parseable layers to standard Markdown files (.mda). Because the base is standard Markdown, files remain readable by any tool, while MDA-aware processors can extract structured metadata, relationships, and cryptographic identities.

    The Three Layers:

    1. YAML Frontmatter: Document-level metadata for classification and dependencies.
    2. Markdown Footnotes: JSON payloads within footnotes to define typed relationships (knowledge graphs).
    3. Cryptographic Identity: Integrity digests and DSSE-enveloped signatures for trust and verification.
    ![MDA: Three Major Components](/images/three-parts.svg)
  12. Use MDA-extended frontmatter in AGENTS.md files

    main

    When creating AGENTS.md files, you can include optional frontmatter to provide metadata for the MDA system. The MDA-specific fields must be nested under the metadata.mda key. Supported fields include:

    • doc-id: A unique identifier for the document.
    • version: The version of the instructions.
    • tags: An array of tags for categorization (e.g., [agents, conventions]).
    ---
    description: Repository-wide agent instructions...
    metadata:
      mda:
        doc-id: 99999999-9999-9999-9999-999999999999
        version: "1.0.0"
        tags: [agents, conventions]
    ---
    
    # Agent instructions
    
    This `AGENTS.md` carries optional frontmatter.