โ† All specifications

Draft

A language for writing specifications.

Identifier
draft
Repository
https://bitbucket.org/byredev/draft
NPM
@byre/draft
Latest version
1.3.0
Audiences
human, agent, cli

Specification

draft 1.0.0
  status stable
  title Draft Specification
  date 2026-04-28
  license All Rights Reserved

---

spec draft

  section purpose
    title Purpose
    level 1

    prose
      value
        Draft is a tree-based, indentation-sensitive language for
        writing specifications. It is a meta-specification: this
        very file is a Draft document describing the Draft
        language. The language is designed to be both
        human-readable as prose and machine-readable as a typed
        AST, so the same source serves writers, reviewers,
        tooling, and downstream automation.

  section structure
    title Document structure
    level 2

    prose
      value
        Every Draft document opens with a header block declaring
        version, status, title, date, and license. A horizontal
        rule separator divides the header from the body. The body
        is a tree of nodes addressed by node-kind keywords (spec,
        section, requirement, prose, target, ...) and indented
        children.

    requirement D-001
      level MUST
      value
        Documents MUST open with a draft header declaring the
        Draft version they target. Documents authored against an
        earlier version MUST remain parseable by later versions.

  section requirements
    title Requirements
    level 3

    prose
      value
        Requirements carry normative force. Each requirement has a
        unique id, a conformance level (MUST, SHOULD, MAY,
        MUST-NOT, SHOULD-NOT), and a value containing the
        requirement text.

    requirement D-010
      level MUST
      value
        Requirement levels MUST be drawn from the set defined in
        RFC 2119: MUST, MUST NOT, SHOULD, SHOULD NOT, MAY,
        REQUIRED, RECOMMENDED, OPTIONAL.

  section consumers
    title Consumers
    level 4

    prose
      value
        The reference parser at @byre/draft parses Draft documents
        into a typed JSON AST. Downstream tools (validators,
        renderers, conformance suites) consume the AST rather than
        re-parsing the source.