reqmd

module
v0.0.0-...-ebade47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: GPL-3.0

README

ReqMD

ReqMD (pronounced "req-em-dee") is a lightweight CLI tool for writing, validating, and exporting requirement specifications in plain Markdown. Designed for teams that want Git-native, text-first requirements management without a heavy toolchain.

$ reqmd check quickstart/02-trace-your-spec/
=
Schema : software-requirements — Software Requirements
File   : quickstart/02-trace-your-spec/software  (1 requirements)
=
  ✅  SW-001  all attributes valid

=
Schema : stakeholder-goals — Stakeholder Goals
File   : quickstart/02-trace-your-spec/stakeholder  (1 requirements)
=
  ✅  STK-GOAL-001  all attributes valid

=
Schema : system-requirements — System Requirements
File   : quickstart/02-trace-your-spec/system  (1 requirements)
=
  ⚠  SYS-001  attributes valid (see trace checks below)
  ⚠  SYS-001  no upstream trace: no approved requirement from "software" traces to this item (1 draft downstreams ignored)

=
Schema : test-specs — Test Specifications
File   : quickstart/02-trace-your-spec/tests  (2 requirements)
=
  ✅  TEST-001  all attributes valid
  ✅  TEST-002  all attributes valid

Summary: 5 total, 5 valid, 0 invalid, 0 parse errors, 1 warnings

Contents


Installation

Pre-built binaries

Each tagged release publishes pre-built reqmd, reqmd-code, and reqmd-import binaries for Linux (amd64), Windows (amd64), and macOS (arm64) plus a SHA256SUMS.txt file. Download them from the Releases page and verify with:

sha256sum -c SHA256SUMS.txt --ignore-missing

Note: the released reqmd binaries are built without the ladybug build tag, so reqmd export graph is a stub that prints an error. This keeps the release binaries pure-Go and dependency-free (no liblbug, no OpenSSL, no runtime library setup). To enable export graph, build from source with -tags ladybug (requires liblbug; see go-ladybug's docs).

Build from source

Requires Go 1.26 or newer.

git clone https://github.com/dVoo/reqmd
cd reqmd
go build -o reqmd ./cmd/reqmd
go build -o reqmd-code ./reqmd-code/cmd/reqmd-code     # source-code extractor
# the single renderer for the reqmd-import/v1 exchange format:
go build -o reqmd-import ./reqmd-import/cmd/reqmd-import

To install into $(go env GOPATH)/bin instead of building in place:

go install ./cmd/reqmd
go install ./reqmd-code/cmd/reqmd-code
go install ./reqmd-import/cmd/reqmd-import

# or by module path, from a tagged release:
go install github.com/dVoo/reqmd/cmd/reqmd@latest

The repo is a Go workspace (go.work) linking all three modules. Because ./... stops at the nested module boundary, name the other modules explicitly:

./reqmd-code <source-dir> | ./reqmd-import - -o <target-dir>  # code -> proxy requirements
./reqmd-import bundle.json -o spec/00-doors/                  # exchange bundle -> requirements
go test ./... ./reqmd-code/... ./reqmd-import/...             # tests for all modules

The graph export subcommand requires Cgo support; build with go build -tags ladybug -o reqmd ./cmd/reqmd to include it.


Quick start

Scaffold a project and validate it — no clone required if you installed the binary:

reqmd init demo/
reqmd check demo/
reqmd ls demo/
reqmd stats demo/
reqmd check --json demo/
reqmd export csv demo/ -o /tmp/out/
reqmd export html demo/ -o /tmp/out/

reqmd init supports the generic (default), aspice, and results presets, plus custom preset directories:

reqmd init my-requirements/                            # generic preset (default)
reqmd init my-requirements/ --preset aspice            # automotive SPICE template
reqmd init my-results/ --preset results --id-prefix VR # manual verification results
reqmd init my-project/ --preset ./my-preset/           # custom preset directory

The repo ships a worked tutorial with a complete four-level V-model tree. From a clone, validate it and watch it live:

reqmd check quickstart/02-trace-your-spec/   # 5 requirements, one trace warning
reqmd serve quickstart/02-trace-your-spec/   # opens a live-reloading HTML preview
reqmd serve quickstart/02-trace-your-spec/ --headless   # terminal-only

New here? The 10-minute QUICKSTART.md walks through a three-document trace chain, and the quickstart/ tree has a numbered step for every feature.


Core Concepts

1. Requirement files

Each requirement is a Markdown heading followed by a fenced attr block with YAML attributes, then free-form prose. The heading text is the requirement ID. An optional title can follow the ID after a colon and space:

## IVI-FUN-001: Fast startup
```attr
status: approved
asil: QM
maturity: Production
verify: Test
owner: TierOneSupplierA
trace: [SYS-001, SAFE-003]
version: 1
```
The system shall display the home screen within 5 seconds after ignition on,
provided the head unit is operational.

*Rationale:* Fast startup improves perceived quality.

Demonstrates: trace (upstream refs), version (version pinning), and the ID: Title syntax (optional human-readable title after the ID).

## IVI-FUN-002
```attr
status: draft
asil: B
maturity: Prototype
verify: Test
owner: TierOneSupplierA
trace: [SYS-007]
disposition: deferred
disposition-reason: "Moved to Phase 2 — requires next PCB revision"

The system shall disable manual text entry while vehicle speed is greater than 0 km/h, except for approved passenger-only functions.


Demonstrates: `disposition` + `disposition-reason` (defers traces, suppresses warnings).

```markdown
## IVI-FUN-003
```attr
status: draft
maturity: Concept
verify: Test

The system shall resume the last active audio source after an ignition cycle.


No built-in attrs — triggers untraced, no upstream reference, and any missing
required fields from the schema.

**Rules:**
- Heading must start with a unique requirement ID (e.g. `IVI-FUN-001`, `SYS-001`)
- An optional title can follow the ID after a colon and space: `## IVI-FUN-001: Fast startup`
- The `attr` block must be valid YAML — keys must match the directory's schema
- Requirement IDs use uppercase letters, digits, and hyphens: `^[A-Z][A-Z0-9]*(-[A-Z0-9]+)*$` with a trailing number segment (e.g. `STK-GOAL-001`, `SYS-FMT-002`). Optional version pinning suffix `~N` is allowed for trace references (e.g. `SYS-001~3`). Colons and spaces are not allowed in IDs — they delimit the optional title.
- If `x-reqmd.id-prefix` is set, every ID in that directory must start with the declared prefix

### 1a. Content model — nothing is dropped

reqmd parses the full document content, not just requirements. Every heading
becomes a node in a document tree:

| Node kind | When | Rendered as |
|-----------|------|-------------|
| **requirement** | heading followed by an `attr` block | card (HTML/CSV/ls row) |
| **container** | heading without an `attr` block that contains nested headings | collapsible folder section in HTML, `container` rows in `ls`/CSV |
| **info** | heading without an `attr` block and no children, or prose before the first heading | plain block in HTML, `info` rows in `ls`/CSV |

Prose and other blocks attach to the nearest open heading's body. Leading
prose before any heading is captured as a headingless info item — content
is never dropped. Headings nest folder-like:

```markdown
# System Overview                      ← container (no attr block)

Intro prose.                           ← info item (headingless)

## SYS-001: Platform                   ← requirement
```attr
status: approved
Functional Overview ← info item under SYS-001

SYS-002: Safety ← requirement


Containers and info items have no attributes and participate in no
validation or trace checks (`check` stays requirement-scoped); they exist
to preserve and display document structure in `ls`, `stats`, CSV, and HTML
exports (including the sidebar TOC). `--filter` prunes requirements but
never removes containers or info items.

### 2. Schema files (`schema.yaml`)

Every directory with requirements needs a `schema.yaml` — standard JSON Schema 2020-12
in YAML, defining which attributes are allowed, required, and their types.

```yaml
x-reqmd:
  level: software-requirements    # V-model layer label
  id-prefix: IVI-FUN-             # enforce ID prefix

$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "ivi-requirements"
title: "IVI Requirements"
type: object
required: [asil, maturity, status, verify]
properties:
  status:
    type: string
    enum: [draft, approved]
  asil:
    type: string
    enum: [QM, A, B, C, D]
  maturity:
    type: string
    enum: [Concept, Prototype, Production, Serial]
  verify:
    type: string
    enum: [Test, Analysis, Inspection, Review]
  owner:
    type: string
  priority:
    type: string
    enum: [Low, Medium, High, Critical]
  safety_relevant:
    type: boolean
additionalProperties: false
3. Built-in attributes

These attributes are reserved by reqmd and injected automatically — you must not list them in schema.yaml:

Attribute Type Description
trace ref[] Cross-document upstream references, e.g. [SYS-001, SAFE-003]
disposition enum How intent is addressed: implemented, deferred, or rejected
disposition-reason string Required when disposition ≠ implemented
requires-trace-from string[] Coverage expectations — which downstream levels or document-ids are expected to trace to this requirement. Omitted on a requirement → inherits the document's x-reqmd.requires-trace-from default when one is set.
version int Version number for trace pinning (e.g. SYS-001~3)
status enum Approval lifecycle. Default: approved. Only approved satisfies traceability coverage.

All built-in attributes are optional. Redefining them in schema.yaml is a compile error.

3a. Per-document coverage defaults

When every requirement in a document shares the same downstream expectation, declare it once in x-reqmd.requires-trace-from instead of repeating it on each requirement:

x-reqmd:
  level: system-requirements
  document-id: system
  requires-trace-from: [software-requirements]

Every requirement that does not declare its own requires-trace-from attribute inherits this default. A requirement may override it by declaring the attribute (the declared tokens replace the default entirely — no merging), and requires-trace-from: [] opts that single requirement out of downstream coverage. An empty document default (requires-trace-from: []) opts out every requirement in the document — useful for bottom-of-V layers. The default accepts the same tokens as the attribute (document-ids and levels — a level token matches every document at that layer) and is validated at schema compile time. When neither the requirement nor the document declares a default, reqmd falls back to generic boundary inference.

4. Status lifecycle

Every requirement has an approval status. The built-in enum is [draft, approved]. Omitting status is equivalent to status: approved (silent default).

Coverage rule: only approved requirements count as upstream coverage providers. A draft requirement can be referenced by a trace, but it does not satisfy a requires-trace-from: expectation. This is the only behavioral difference between draft and approved — drafts remain visible, exported, and clickable, they simply do not complete a coverage chain.

## REQ-001: System boot
```attr
status: approved
trace: [STK-001]
## REQ-002: Power management (in progress)
```attr
status: draft
trace: [STK-002]
requires-trace-from: [system]

The requires-trace-from: [system] declaration will emit a warning while REQ-002 is still draft, because no system-level requirement traces here yet. Bump it to status: approved once downstream work is complete.

The coverage-gate message keeps authors informed:

no upstream trace: no approved requirement from "system" traces to this item (3 draft downstreams ignored)

The (N draft downstreams ignored) parenthetical appears only when at least one inbound candidate was filtered by the status gate. When no inbound exists at all, the message is silent on draft counts.

4a. Extending the status enum

When the built-in enum is too narrow, declare extensions in x-reqmd:

x-reqmd:
  additional-status-values: [review, in-progress]

Rules (violations are config errors at compile time):

  • Values must be lowercase, matching ^[a-z][a-z0-9_-]*$.
  • draft and approved cannot be redeclared.
  • Duplicates are rejected.
  • An empty array ([]) is a no-op.

Extensions appear in the status filter and header breakdown alongside the built-ins. Their dot color is hash-derived (DJB2a, 4 collision-free hue regions) so authors don't need to configure colors.

4b. Opting out of the lifecycle

Documents that don't follow the lifecycle (legacy imports, generated specs, one-off documents) can opt out:

x-reqmd:
  ignore-status: true

In an ignore-status document:

  • All requirements count as coverage providers, regardless of their status.
  • The status filter is hidden in the HTML export.
  • The status breakdown row is not rendered.
5. Directory metadata (x-reqmd)

The x-reqmd key in schema.yaml carries directory-level metadata. It's optional — standard JSON Schema validators ignore it because of the x- prefix.

x-reqmd:
  level: software-requirements                 # V-model layer label
  upstream:                          # parent layer config
    level: system-requirements
    sources:
      - ../sys/
  mandatory-disposition: false                 # promote missing disposition to ERROR
  external: false                              # proxy for non-reqmd artefacts
  url: "https://example.com/model-export"      # human link (HTML export)
  source:
    path: ".reqmd/arch/sys/*.md"               # reqmd-scan input glob
    format: archi                               # input format
  id-prefix: IVI-FUN-                          # enforce ID prefix
  requires-trace-from: [test-spec-unit]        # default downstream coverage for every requirement
Field What it does
level Labels the V-model layer. Only functional use: a requires-trace-from token may name a level (instead of a document-id); reqmd resolves it to every directory declaring that level. Not used for HTML chain navigation or boundary inference (those use upstream.sources).
document-id Stable identifier for the document. Used to disambiguate trace: [doc-id/ID] references and as the requires-trace-from: coverage target
upstream.level Names the expected parent layer. Informational only — never read by the tool.
upstream.sources Relative paths to upstream document directories. This drives HTML document-chain navigation and path-based boundary inference.
mandatory-disposition When true, missing disposition becomes an ERROR
external When true, marks as proxy directory; untraced warnings suppressed
url Human-readable link for HTML export (meaningful only when external: true)
source.path Path/glob/URL for the source artefact (future reqmd-scan)
source.format Source format: archi, doxygen, gtest, pytest, junit, reqif
id-prefix Enforces that all requirement IDs start with this prefix; collision is an ERROR
requires-trace-from Document-wide default coverage expectation; inherited by requirements that don't declare their own requires-trace-from (see Per-document coverage defaults)
disjoint-check Names an array-typed attribute (e.g. variant) that trace-linked requirements must share at least one value of. Repeatable as an array. Also settable via --disjoint-check on check and export json. Suppression: reqmd-suppress: [disjoint-attribute].
additional-status-values Lowercase extensions to the built-in status enum (e.g. [review]). See Status lifecycle.
ignore-status When true, the document opts out of the status lifecycle (see Opting out)

Simple rule:

  • No external field or external: false → normal authored requirement directory
  • external: true → proxy/generated directory for external or scanned artefacts
6. Directory layout

Any folder with a schema.yaml is a document directory. ReqMD validates all .md files inside it (non-recursive), then recurses into subdirectories.

requirements/
├── stakeholder/
│   ├── schema.yaml                # level: stakeholder-needs
│   └── needs.md
├── sys/requirements/
│   ├── schema.yaml                # level: system-requirements
│   └── system-functions.md
├── swe/requirements/
│   ├── schema.yaml                # level: software-requirements
│   ├── startup.md
│   └── media.md
├── tests/swe/unit/
│   ├── schema.yaml                # level: test-spec-unit
│   └── ecum-tests.md
├── external/
│   └── autosar-ecum/
│       └── schema.yaml            # external: true — committed config only
└── .github/workflows/
    └── validate.yml               # CI: runs reqmd check on every PR
7. Document frontmatter (YAML)

Each .md file MAY include YAML frontmatter delimited by ---, parsed via goldmark-meta. The description key provides document-level prose rendered in the HTML export below the document header:

---
description: "This document defines the **stakeholder goals** that drive all downstream requirements."
---

Frontmatter keys from multiple .md files in the same document directory are merged with first-file-wins semantics. The description field is processed through goldmark, supporting inline Markdown (bold, code, links, etc.).

8. Goldmark extensions

ReqMD uses goldmark for Markdown rendering in both parsing and HTML export, with these extensions enabled:

Extension Package What it does
GFM github.com/yuin/goldmark/extension Tables, strikethrough, autolinks, task lists
AutoHeadingID github.com/yuin/goldmark/parser Auto-generates id attributes for headings
Mermaid go.abhg.dev/goldmark/mermaid Diagram rendering from ```mermaid blocks
Fenced divs github.com/stefanfritsch/goldmark-fences Pandoc-style ::: {.class} containers
Highlighting github.com/yuin/goldmark-highlighting/v2 Syntax-highlighted code blocks via chroma
Emoji github.com/yuin/goldmark-emoji GitHub-style :joy: → 😊 emoji
KaTeX github.com/FurqanSoftware/goldmark-katex Math rendering: inline $x^2$ and display $$...$$
9. Attribute filtering (--filter)

Every command that reports on requirements (check, ls, stats, export csv|html|json, serve, baseline diff) accepts --filter "<expr>" — an expr-lang expression evaluated against a requirement's attributes plus the built-in id and title variables. A missing attribute evaluates to nil, so variant == nil selects requirements that do not declare it.

By default a referenced name must be declared in some schema.yaml in the tree; anything else is a hard error, which turns typos into failures instead of silently matching nothing:

reqmd check spec/ --filter 'variant == "Premium"'   # ok: declared
reqmd check spec/ --filter 'variantt == "Premium"'  # error: unknown attribute

--relaxed-filter downgrades that check to a warning and additionally allows any attribute present on a requirement, even when no schema declares it (attributes are always parsed, so an undeclared one is filterable as-is). The warning names the attribute and the run continues:

reqmd check spec/ --filter 'owner == "alice"' --relaxed-filter
# reqmd: warning: filter references attribute "owner" not declared in any schema.yaml

Use it when a team keeps informal attributes in the attr blocks, or while introducing a new attribute ahead of its schema change. The HTML export applies the same rule to its toolbar: the filter menus are built from every attribute actually present on a requirement, and undeclared ones are shown in the card grid marked · undeclared.


Commands

Command What it does
reqmd check <root> Validate all .md against their schema.yaml recursively
reqmd check <file> -s <schema> Validate a single file against an explicit schema
reqmd check --json <root> JSON validation report
reqmd check --relaxed-versions <root> Demote outdated version-pin findings from ERROR to WARNING (predated stays ERROR)
reqmd check --results <path> <root> Load ephemeral verification results (CTRF .ctrf.json or manual-results dirs) and run outcome-gated checks (missing-verdict, failing-verdict). --results is repeatable; auto-detects CTRF vs manual by extension + shape. Verdicts roll up over downstream test cases.
reqmd check --ignore-unbound-results <root> Suppress unbound-result warnings for verification entries that declare x-reqmd but bind to nothing.
reqmd check --filter "<expr>" <root> Scope validation to requirements matching an expr-lang expression (e.g. "Premium" in variant). Coverage checking becomes filter-aware: filtered-out requirements cannot cause false coverage failures. --json adds a "filter" field to the summary. --relaxed-filter turns a reference to an attribute declared in no schema.yaml into a warning, and also allows attributes that are present on requirements but undeclared.
reqmd check --disjoint-check <attr> <root> Check that trace-linked requirements have overlapping values for the named array-typed attribute (e.g. variant). Zero intersection → ERROR; empty/absent = "applies to all" (exempt). Repeatable. Also settable via x-reqmd.disjoint-check in schema.yaml.
reqmd init <dir> Scaffold a new requirements directory with schema.yaml and example file. Presets: generic (default), aspice, results (manual verification results), or a custom preset directory path. Flags: --preset, --id-prefix, --id, --title, --level, --force
reqmd ls <root> Table of all content in document order with a leading Type column (req / container / info). Requirements show their attributes; items show their heading text. --filter "<expr>" scopes to matching requirements (items are always shown); --relaxed-filter allows undeclared attributes.
reqmd ls --json <root> JSON list — every node in the rows array with a type discriminator. --filter supported.
reqmd stats <root> Attribute-value breakdown per document, plus requirement/item counts and a type breakdown. --filter "<expr>" scopes to matching requirements; --relaxed-filter allows undeclared attributes.
reqmd stats --json <root> JSON stats. --filter supported.
reqmd export csv <root> -o <dir> CSV export with Type, Body and Rationale columns, emitted in document order for requirements and items alike. --results <path> (repeatable) adds Verdict and Verdict Source columns. --filter "<expr>" exports only matching requirements; --relaxed-filter allows undeclared attributes.
reqmd export html <root> -o <dir> Standalone HTML: a project home (index.html) plus one page per document. The Document view is server-rendered (compact app bar, sidebar outline with scroll-spy, one sticky search/filter toolbar, neutral requirement cards with status/coverage/verdict chips, collapsible attribute/rationale/evidence/trace details) and stays readable without JavaScript. Table (sortable grid with column chooser and expandable rows), Trace (selected-requirement explorer plus a size-bounded matrix), and Coverage (actionable exception lists) render on demand from one shared view model, so no hidden analytical DOM is emitted. Coverage, verification (including no verdict in the denominator), and link health are derived from the same graph analysis reqmd check runs. The export embeds its CSS and client script — no CDN, fully offline. Chrome: ⌘K command palette, keyboard shortcuts (/, g d/g t/g r/g c, t, f, ?), density toggle, and URL-synced state using repeated f=attr:value params (?q=&f=&view=&density=&req=) so a filtered view is shareable. --results renders verdict chips and evidence; --filter exports only matching requirements; --relaxed-filter allows undeclared attributes.
reqmd export json <root> -o <dir> Four flat NDJSON tables for reporting platforms (Databricks, Snowflake, BigQuery): requirements.ndjson (one row per content node; built-ins promoted to top-level keys, remaining attributes in an attrs envelope), traces.ndjson (one row per declared trace ref, with pin and resolved), results.ndjson (one row per measure verdict; requires --results), and findings.ndjson (one row per check finding). A pure function of tree + results, so repeated exports are byte-identical. --filter "<expr>" limits requirements.ndjson (--relaxed-filter allows undeclared attributes); --disjoint-check findings land in findings.ndjson.
reqmd export graph <root> -o <dir> Exports trace graph to ladybugdb for Cypher querying (requires -tags ladybug build). --results <path> (repeatable) includes RESULT: nodes with outcome and source properties, enabling graph traversal from requirements through measures to verification results.
reqmd serve <root> Watch for changes and serve live-reloading HTML preview with SSE auto-reload (flags: --addr, --headless, --no-open, --debounce, --results, --filter, --relaxed-filter)
reqmd baseline diff <tag1> <tag2> Compare requirements and submodule pins between two git tags (flags: --json, --filter "<expr>" to scope both snapshots, --relaxed-filter to allow undeclared attributes)
reqmd baseline diff --filter-a "<expr>" --filter-b "<expr>" [<ref>] Compare two filtered views of the same commit (default HEAD). Useful for "what does Premium add over Base" reports from a single commit.
reqmd repin <root> [-y/--yes] [--json] [--promote-unpinned] Propose or apply ~N version-pin updates so trace refs match the upstream's current version. Dry-run by default; --yes applies. --promote-unpinned also pins refs that have no ~N against a versioned upstream. Predated findings (pin > upstream) are surfaced but never auto-fixed.

Aliases: check = validate or v; ls = list or l.

The examples below use a project scaffolded with reqmd init demo/, so every line is reproducible.

Example: check
=
Schema : demo — demo Requirements
File   : demo  (2 requirements)
=
  ✅  REQ-001  all attributes valid
  ✅  REQ-002  all attributes valid

Summary: 2 total, 2 valid, 0 invalid, 0 parse errors
  • ✅ — every attribute passed schema validation and every trace check
  • ⚠ — trace validation warning (broken reference, untraced, no upstream reference, disposition without reason)
  • ❌ — schema validation error (missing required, wrong type, invalid enum); sets exit code 1
Example: ls
=== demo ===
Type       | ID                       | owner        | trace        | disposition  | disposition-reason | requires-trace-from | version      | status       |
-------------------------------------------------------------------------------------------------------------------------------------------------
info       |                          |              |              |              |              |              |              |              |
req        | REQ-001                  | Team Alpha   |              |              |              |              |              | draft        |
req        | REQ-002                  | Team Beta    | ["REQ-001"]  |              |              |              |              | draft        |

Every node appears in document order with a leading Type column — req for requirements, container/info for headings without attr blocks (headings that group content, shown with their heading text). User-defined attributes first, then built-in attributes. Empty cells mean the requirement didn't set that attribute. Non-string values (arrays, integers, booleans) are formatted automatically.

Example: stats
Requirements: 2
Documents:    1

=== demo (2 reqs, 1 item) ===
  type:
    info                 1
    req                  2
  owner:
    Team Alpha           1
    Team Beta            1
  status:
    draft                2
Example: check --json
{
  "documents": [
    {
      "path": "demo",
      "schema_title": "demo — demo Requirements",
      "requirements": [
        {
          "id": "REQ-001",
          "valid": true
        },
        {
          "id": "REQ-002",
          "valid": true
        }
      ],
      "req_count": 2
    }
  ],
  "parse_errors": [],
  "summary": {
    "total": 2,
    "valid": 2,
    "invalid": 0,
    "parse_errors": 0,
    "warnings": 0
  },
  "version": 1,
  "exit_code": 0
}

Baseline diff

Compare two requirement baselines anchored by git tags without checking either one out. reqmd baseline diff <tag1> <tag2> extracts the repository at each tag via git archive | tar, parses both versions through the standard pipeline, and produces a semantic diff:

  • Requirements: added (green +), removed (red -), and modified (yellow ~) with attribute-level detail.
  • Schemas: new properties, removed properties, and changes to required fields.

Use --json for a structured report suitable for CI or release-note generation. The command always exits 0 — the diff is informational, not validation.

reqmd baseline diff v1.0.0 v1.1.0
Requirements
  + IVI-FUN-004  added in v1.1.0
  - IVI-FUN-002  removed in v1.1.0
  ~ IVI-FUN-001
      asil: QM -> B
      trace: ["SYS-001"] -> ["SYS-001","SAFE-003"]

Schemas
  ~ ivi-requirements
      + property: owner
      - property: safety_relevant
      required: ["asil","maturity","status","verify"] -> ["asil","maturity","status","verify","owner"]

The extraction uses git archive so no working-tree checkout or extra worktree is needed; both baselines are processed in temporary directories.

Submodule changes

When comparing two git tags, reqmd baseline diff also reports submodule changes (pinned commit SHA differences) in a --- Submodule Changes --- section. This is always-on and uses git ls-tree -t <tag> to read the submodule pins. The section is hidden when the repository has no submodules.

Example output:

--- Submodule Changes ---
  vendor/spec-a:  a1b2c3d  →  e4f5g6h  (updated)
  vendor/spec-b:  f7g8h9i  →  (removed)
  vendor/spec-c:  (added)   →  j0k1l2m

Trace validation in detail

The trace attribute links requirements across documents. Each value is a requirement ID (uppercase letters, digits, hyphens) with optional version pinning (e.g. SYS-001~3 means "fulfills SYS-001 version 3").

Version pins

A downstream requirement can pin the upstream version it was last verified against. When the upstream version is bumped, the pin becomes stale and reqmd flags the downstream as needing re-verification (change-impact analysis, ISO 29148).

# Upstream declares its current version
```attr
id: UP-001
version: 3
# Downstream pins the version it was verified against
```attr
id: DN-001
trace: [UP-001~2]   # re-verify against UP-001 v3

Findings:

Condition Meaning Level Demote with
pin < upstream.version Outdated — upstream bumped, downstream needs re-verify ERROR --relaxed-versions
pin > upstream.version Predated — downstream claims a non-existent version ERROR (never — data integrity)
pin == upstream.version Current — —
No pin No version check applies — —
Upstream version: 0 / unset No ground truth to compare — —
Upstream external: true Out of scope — —

Suppression per-requirement: reqmd-suppress: [version-pin].

Bulk-fix all outdated pins in a tree with reqmd repin <root> --yes (prints a dry-run change list by default; safe to re-run after applying).

When multiple documents share the same ID prefix (e.g., two teams both use STK-), use a stable document-id to qualify references:

trace:
  - stakeholder-a/STK-001   # `stakeholder-a` is x-reqmd.document-id, not a directory path
  - STK-002                 # unqualified: works when ID is globally unique

If an unqualified reference matches IDs in multiple documents, reqmd reports an ERROR suggesting the qualified form. Use document-ID-qualified references when integrating independently-authored documents, including git submodules.

ReqMD builds an ephemeral graph of all requirements and their traces, then runs these checks:

Check Level Condition Exit code?
Broken reference WARNING trace references an ID not found in any document No
Circular dependency ERROR Cycle detected via DFS along TRACES edges Yes
requires-trace-from coverage WARNING When a requirement declares requires-trace-from: [..] (or inherits a x-reqmd.requires-trace-from document default), at least one inbound edge must originate from each named document-id or level No
Untraced (generic) WARNING Fallback: no incoming traces, not a top-boundary dir, not a sub-req, no requires-trace-from and no document default No
No upstream reference (generic) WARNING Fallback: no outgoing traces, not a bottom-boundary dir, no requires-trace-from and no document default No
Disposition without reason WARNING disposition is deferred/rejected but reason is missing No
Mandatory disposition ERROR mandatory-disposition: true and disposition is missing Yes
ID prefix mismatch ERROR ID doesn't start with directory's id-prefix Yes
ID prefix collision ERROR Two directories declare the same id-prefix Yes
Duplicate ID ERROR Same requirement ID defined in two different documents Yes
Ambiguous reference ERROR Unqualified trace reference matches IDs in multiple documents Yes
Version pin outdated ERROR trace: [UP-001~2] but UP-001 is at version: 3 — upstream bumped, downstream needs re-verify. Demote to WARNING with --relaxed-versions Yes
Version pin predated ERROR trace: [UP-001~5] but UP-001 is at version: 2 — downstream claims a version that doesn't exist Yes
Disjoint attribute ERROR A --disjoint-check <attr> is active and a trace link's source and target have zero overlapping values for that attribute (empty/absent = "applies to all", exempt) Yes
Missing verdict WARNING An approved verification measure (a requirement with a verify attribute) has no verification result tracing to it. Only fires when --results is supplied. No
Failing verdict ERROR A verification measure's latest result has outcome fail. Only fires when --results is supplied. Yes

Boundary inference: Directories with no upstream.sources are top-boundary (generic untraced suppressed). Directories not referenced by any other directory's upstream.sources are bottom-boundary (generic no-upstream-reference suppressed). For fine-grained control, declare requires-trace-from: [..] on a requirement — or once per document via x-reqmd.requires-trace-from (see Per-document coverage defaults) — to specify exactly which document-ids or levels must trace to it; use requires-trace-from: [] to explicitly opt out of generic boundary coverage.

Per-requirement check suppression is available via the reqmd-suppress attr:

reqmd-suppress:
  - untraced
  - id-prefix

Only ERROR level checks affect the exit code. WARNING and INFO are informational.

Supported suppression names: broken-ref, circular, untraced, no-downstream, disposition-reason, mandatory-disposition, id-prefix, version-pin, requires-trace-from-coverage, missing-verdict, failing-verdict, disjoint-attribute.

FAQ

How do I trace to a parent document when its path is unknown?

Use a stable x-reqmd.document-id and omit x-reqmd.upstream.sources. Paths are not needed to resolve requirement traces. Give each independently maintained document a unique ID:

# system/schema.yaml
x-reqmd:
  document-id: system
  level: system-requirements
  upstream:
    level: stakeholder-needs
    # sources intentionally omitted; the integration repository chooses the path

Reference the parent by document ID in Markdown attributes:

trace:
  - stakeholder/STK-001

Use the same stable IDs in requires-trace-from, for example requires-trace-from: [software]. When the documents are assembled, run reqmd check from a common root containing all submodules. ReqMD discovers all schemas below that root and resolves document-id/requirement-id references.

upstream.sources remains optional but is still used for HTML document-chain navigation and path-based boundary inference. Add it only where the assembled repository has a stable layout. external: true is not a path workaround; it changes the document's validation and boundary semantics.

See quickstart/10-submodule-configuration/ for a complete three-level example.

Disposition workflow

When a stakeholder requirement can't be immediately implemented, use the built-in disposition + disposition-reason attributes instead of leaving silent gaps:

disposition: deferred
disposition-reason: "Deferred to v2.0 — HW SPI interface not available until next PCB revision"
Disposition What it signals Rationale needed?
implemented Actively developed No
deferred Accepted, postponed Yes
rejected Not accepted Yes

Disposition is orthogonal to trace coverage. Use requires-trace-from: [] to explicitly state that no downstream coverage is expected.

Importing requirements

Requirements rarely start inside reqmd. Two import paths share one JSON exchange format (reqmd-import/v1) and one renderer, so no importer can produce invalid Markdown or drift from the schema rules:

DOORS / codeBeamer / CSV ─▶ your script ─▶ reqmd-import/v1 JSON ─▶ reqmd-import ─▶ .md + schema.yaml
source code (tree-sitter) ─▶ reqmd-code ─▶ reqmd-import/v1 JSON ──┘

Source code. reqmd-code extracts functions, types, and methods from C, C++, Go, Python, and Rust via tree-sitter and emits an exchange bundle; reqmd-import renders it as generated proxy documents, so traces from authored requirements resolve down to the code that implements them:

reqmd-code ./internal | reqmd-import - -o spec/03-software/imported
reqmd check spec/

ALM tools. Any tool that can export CSV can feed reqmd. The Python package reqmd-io (pip install reqmd-io) emits the same exchange format from typed dataclasses, and the repo ships a generic DOORS/codeBeamer CSV reader:

python python/examples/csv_import.py doors-export.csv -o /tmp/doors.json --id-prefix DOORS-
reqmd-import /tmp/doors.json -o spec/00-doors/

Rendered documents are generated — review them as diffs, commit them, and trace to them like any other requirement. See quickstart/15-custom-importers/ for a worked example.

Worked example — deferred with rationale (passes)
## STAKE-007
```attr
status: approved
disposition: deferred
disposition-reason: "Deferred to Phase 2 per steering committee 2025-03-14"

The system shall support over-the-air firmware updates for all ECUs.

**Result:** ✅ `disposition: deferred` requires reason. Reason present → no
"disposition without reason" warning. `requires-trace-from: []` → no "no upstream reference" warning.
No `trace` → correct for a postponed need.

### Worked example — rejected without reason (warning)

```markdown
## STAKE-008
```attr
status: approved
disposition: rejected

The system shall support wireless charging.

**Result:** ⚠ WARNING — `disposition: rejected` but no `disposition-reason` provided.

---
## Verification & validation results

reqmd traces the left side of the V-model (stakeholder → system → software →
test specs). The `--results` flag closes the right side by loading ephemeral
verification results and running outcome-gated checks against the
verification measures (requirements with a `verify` attribute).

Results are **ephemeral**: they are loaded per `check` invocation, never
written to the spec repo. This keeps CI run-to-run churn out of git and
out of `baseline diff`.

### Two ingestion paths, one flag

reqmd check --results ./ci-out/ --results ./reviews/


Each `--results` path is auto-detected:

- **Directory** (walked):
  - `.ctrf.json` → parsed as a [CTRF](https://ctrf.io/) report.
  - Plain `.json` with a CTRF top-level `results` object → parsed as CTRF.
  - Other `.json` (coverage.json, junit exports) → skipped silently.
  - Subdirectories with a `schema.yaml` → loaded as **manual results**
    (markdown `attr` blocks with `x-reqmd.outcome`, `x-reqmd.verifier`,
    `x-reqmd.evidence`, `x-reqmd.verified-at`, `trace: [MEASURE-ID]`).
- **File**: parsed as CTRF (`.ctrf.json` or CTRF-shaped `.json`).

### CTRF mapping (automated tests)

Each CTRF `results.tests[]` entry carries an `extra.x-reqmd` block that
binds the run to the spec. All fields are optional:

| Field | What it does |
|---|---|
| `id` | Binds the result directly to a measure requirement ID (optional `~N` pin). The requirement itself is the verification measure. |
| `case` | A stable test-case identity for this run. With `id`, it keys the result (several cases may attach to one measure); without `id` it names a synthesized test case. |
| `verifies` | Upstream requirement IDs the test exercises (optional `~N` pins). With `case` it synthesizes a test case that traces to these requirements. |
| `description` | Markdown body for a synthesized test case (used only when the result binds to a case, never to an authored node). |

A test with neither `id` nor `verifies` is uninstrumented and skipped
silently, so suites can adopt reqmd incrementally. A test that declares
`x-reqmd` but binds nothing (e.g. `case` only) yields an `unbound-result`
WARNING (suppressible with `--ignore-unbound-results`).

CTRF `status` → reqmd `outcome`:

| CTRF status | reqmd outcome |
|---|---|
| `passed` | `pass` |
| `failed` | `fail` |
| `skipped` | `skipped` |
| `pending` / `other` / unknown | `inconclusive` |
| any status + `flaky: true` | `inconclusive` |

The CTRF file itself (duration, logs, extra fields) is the "corresponding
verification measure data" every ASPICE record BP requires; it is linked
from the result's `x-reqmd.evidence` field.

### Manual results (review / inspection / analysis)

For non-test methods, author results as markdown with a user-supplied
`schema.yaml` in a directory outside the spec root:

```yaml
# example manual-results schema.yaml
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "verify-results"
title: "Verification Results"
type: object
required: [x-reqmd.outcome, x-reqmd.verifier, x-reqmd.verified-at]
properties:
  x-reqmd.outcome: { enum: [pass, fail, skipped, inconclusive] }
  x-reqmd.verifier: { type: string }
  x-reqmd.evidence: { type: string, description: "URI/path to minutes, record, or CTRF file" }
  x-reqmd.verified-at: { type: string, format: date }
additionalProperties: false
x-reqmd:
  level: verify-results
## VR-001: Parser review result
```attr
x-reqmd.outcome: pass
x-reqmd.verifier: "D. Author"
x-reqmd.verified-at: 2026-07-15
trace: [TST-FIX-001]

Parser review passed.


### Outcome-gated checks

When `--results` is supplied, checks run against each measure's rolled-up
**evidence set**: its own attached results plus the results of approved
downstream test cases (authored or synthesized) in its inbound trace
closure. Aggregation is strict — any `fail` → fail, else inconclusive →
inconclusive, else skipped → skipped, else pass. Draft measures and
deferred/rejected dispositions are skipped.

| Check | Level | Condition | Suppression |
|---|---|---|---|
| **missing-verdict** | WARNING | An approved measure's evidence set is empty. Draft downstream cases are reported as ignored. | `reqmd-suppress: [missing-verdict]` |
| **failing-verdict** | ERROR | A measure's rolled-up verdict is `fail`; the message names the failing case(s). | `reqmd-suppress: [failing-verdict]` |

Result-attributed findings (stale version pins on result edges,
`unbound-result`) are reported in a dedicated **Verification results**
section of `check` output and in the JSON `results` array.

The existing **version-pin** check also applies to result→measure and
case→requirement traces: pin a result with `MEASURE-ID~3` against a measure
now at `version: 4` and the `outdated` finding fires (demotable via
`--relaxed-versions`). This is how stale-verdict is detected — no new check,
just the existing one on a new edge type.

### History

Result history is not stored in-file. Each run loads the latest CTRF /
manual results; the previous run's results are discarded. Across all
`--results` inputs, the latest result per (measure, case) wins by CTRF
`tests[].stop` (ms-epoch) or manual `x-reqmd.verified-at`. Run-to-run history lives
in CI artifacts, not in reqmd.

### Exporting results

All export formats support `--results`:

| Format | What `--results` adds |
|--------|----------------------|
| **CSV** | Two extra columns: `Verdict` (rolled-up pass/fail/skipped/inconclusive) and `Verdict Source` (result file) |
| **HTML** | Color-coded verdict chips on measure cards — green (pass), red (fail), orange (inconclusive), gray (skipped), plus an explicit **no verdict** chip for eligible measures without a result. The rolled-up evidence list shows the contributing case, outcome, and source file. |
| **JSON** | `results.ndjson` — one row per measure verdict (rolled-up outcome, contributing cases, source). Only with `--results`; otherwise the file is written empty. |
| **Graph** | `RESULT:` pseudo-nodes with `outcome` and `source` properties, connected via `TracesTo` edges to their measures. Enables Cypher traversal from requirements through measures to verification results. |

```sh
reqmd export csv requirements/ --results ci-out/ -o docs/
reqmd export html requirements/ --results ci-out/ -o docs/
reqmd export graph requirements/ --results ci-out/ -o graph/

Without --results, all export formats are unchanged — no verdict columns, badges, or result nodes.

Scaffolding a results directory

Use reqmd init with the results preset to scaffold a manual verification results directory (review, inspection, analysis, demonstration):

reqmd init my-results/ --preset results
reqmd init my-results/ --preset results --id-prefix REV

This creates schema.yaml (with level: verify-results, required x-reqmd.outcome/x-reqmd.verifier/x-reqmd.verified-at attributes) and results.md (one example result). See the Commands table for all init flags.

Custom presets

reqmd init accepts a directory path for --preset in addition to the built-in names. A custom preset is a directory containing:

  • schema.yaml.tmpl + example.md.tmpl (Go template files, preferred), or
  • schema.yaml + any .md file (plain files, used verbatim)

Templates support Go text/template syntax with four variables: {{ .ID }}, {{ .Title }}, {{ .Level }}, {{ .IDPrefix }}.

reqmd init my-project/ --preset ./my-preset/ --id-prefix MY

Exit codes

Code Meaning
0 All valid
1 Validation errors or ERROR-level trace check triggered
2 Schema or file parse error

Real-world workflow

# Scaffold a new requirements project
reqmd init my-project/ --preset generic

# Validate your entire requirements tree
reqmd check requirements/

# List all requirements with all attributes
reqmd ls requirements/

# Check attribute coverage
reqmd stats requirements/

# Export for stakeholder review
reqmd export html requirements/ -o docs/

# Generate CSV for spreadsheet import
reqmd export csv requirements/ -o docs/

# Flat NDJSON tables for a warehouse (Databricks, Snowflake, BigQuery)
reqmd export json requirements/ -o json-out/ --results ci-out/

# JSON for CI scripting
reqmd check --json requirements/

# Load ephemeral V&V results and run outcome-gated checks
reqmd check requirements/ --results ci-out/ --results reviews/

# Export with verification verdicts (badges in HTML, columns in CSV)
reqmd export html requirements/ --results ci-out/ -o docs/
reqmd export csv requirements/ --results ci-out/ -o docs/

# Scaffold a manual verification results directory
reqmd init reviews/ --preset results --id-prefix VR

# Live preview while editing
reqmd serve requirements/          # browser auto-opens
reqmd serve requirements/ --headless  # terminal-only
reqmd serve requirements/ --results tests/  # with verdict badges

Wire reqmd check requirements/ into CI (GitHub Actions, GitLab CI, etc.) to catch missing attributes and broken trace links on every PR. Use --json output for programmatic parsing.


Design principles

  • No lock-in. Your data is plain Markdown and YAML — openable in any editor, renderable on GitHub/GitLab, diffable with standard Git tools.
  • No database. The trace graph is ephemeral, built in a temp directory on each invocation and discarded when done. The *.md files are the single source of truth — nothing is committed except text files.
  • Per-directory schemas. Different subsystems (IVI, safety, system) can have different required fields and validation rules, all validated in one pass.
  • Scale. Parses thousands of files in parallel using a runtime.NumCPU() worker pool.
  • Dogfooding. The reqmd tool's own requirements are defined in spec/ using the reqmd format and validate with reqmd check spec/. This ensures the format is always production-ready for the team's own use.

Self-hosted requirements

ReqMD dogfoods its own format. The spec/ directory contains a complete 6-level V-model tree defining the tool itself:

Level Directory Reqs Description
External spec/00-aspice/ 191 Automotive SPICE v4.0 base practices (external: true)
Stakeholder spec/01-stakeholder/ 7 Stakeholder goals (top boundary, no upstream)
ASPICE SR spec/01a-aspice-stakeholder/ 19 ASPICE stakeholder requirements mapped to base practices
System spec/02-system/ 23 Feature specifications
Software spec/03-software/ 33 Component-level design
Tests spec/04-tests/ 20 Test specifications (mandatory-disposition)

All 293 hand-authored requirements validate cleanly (each document also carries one container item — its # Title heading). The tree also contains the generated spec/03-software/imported/ proxy documents, which reqmd-code regenerates from the tool's own source — 1337 requirements across 22 documents in total:

$ reqmd check spec/
# ... 1337 total, 1337 valid, 0 invalid, 0 parse errors, 944 warnings

$ reqmd serve spec/          # live-reloading HTML preview
$ reqmd export html spec/ -o /tmp/out/
Wrote /tmp/out/00-aspice-requirements.html
Wrote /tmp/out/01-stakeholder-requirements.html
Wrote /tmp/out/01a-aspice-stakeholder-requirements.html
Wrote /tmp/out/02-system-requirements.html
Wrote /tmp/out/03-software-requirements.html
Wrote /tmp/out/04-tests-requirements.html
... plus one page per imported component directory (22 pages total)
Wrote /tmp/out/index.html

index.html is the project home: a document catalog, project-wide coverage and verification summaries, actionable queues (missing coverage, missing verdicts, failing verification, broken/stale traces), and cross-document requirement search.

The 23 warnings are expected — external base practices (00-aspice) and stakeholder goals (01-stakeholder) have no upstream traces (untraced warnings suppressed by boundary inference and external: true). The ASPICE proxy layer (01a-aspice-stakeholder) is the first fully-traced tier.

Documentation website

The site/ directory is a self-contained Hugo project (no external theme) hosting the public docs at https://reqmd.dev. On every push to main that touches site/**, the .github/workflows/hugo.yml workflow installs Hugo extended, builds with hugo --minify -s site, and deploys site/public/ to GitHub Pages via actions/deploy-pages.

Build locally to preview:

hugo server -s site --buildDrafts --disableFastRender

The AI docs at reqmd.dev/ai link two downloadable Agent Skills served as static files: site/static/skills/reqmd-usage/SKILL.md (operating an existing tree) and site/static/skills/reqmd-authoring/SKILL.md (creating and maintaining documents). Both are published at /skills/<name>/SKILL.md and indexed in llms.txt.

One-time repo setup (web UI): Settings → Pages → Build and deployment → Source = "GitHub Actions", and set the custom domain to reqmd.dev (a CNAME file is committed at site/static/CNAME). Point the apex domain's DNS A records at the GitHub Pages IPs.

Directories

Path Synopsis
cmd
reqmd command
Command reqmd validates and exports requirement specifications stored in Markdown files with embedded attr blocks.
Command reqmd validates and exports requirement specifications stored in Markdown files with embedded attr blocks.
reqmd-bench-gen command
Synthetic reqmd benchmark generator.
Synthetic reqmd benchmark generator.
reqmd-bench-run command
Synthetic benchmark runner for reqmd.
Synthetic benchmark runner for reqmd.
internal
cli
Package cli implements the reqmd cobra command tree.
Package cli implements the reqmd cobra command tree.
cli/export
Package export implements the reqmd `export` subcommands (CSV, HTML, NDJSON tables, and LadybugDB graph output).
Package export implements the reqmd `export` subcommands (CSV, HTML, NDJSON tables, and LadybugDB graph output).
diff
Package diff compares two parsed spec snapshots (requirements and schemas) and produces a structured, attribute-level diff result.
Package diff compares two parsed spec snapshots (requirements and schemas) and produces a structured, attribute-level diff result.
exporter
Package exporter renders parsed reqmd documents into portable formats: standalone HTML, CSV, and the LadybugDB graph export.
Package exporter renders parsed reqmd documents into portable formats: standalone HTML, CSV, and the LadybugDB graph export.
filter
Package filter provides generic attribute-based filtering of requirements using expr-lang/expr as the evaluation engine.
Package filter provides generic attribute-based filtering of requirements using expr-lang/expr as the evaluation engine.
graph
Package graph builds a pure Go in-memory adjacency graph from parsed requirement documents and runs Pass 2 trace validation checks: broken references, circular dependencies, requires-trace-from coverage, disposition, ID prefix, version-pin staleness, and outcome-gated checks (missing-verdict, failing-verdict) per the reqmd validation pipeline.
Package graph builds a pure Go in-memory adjacency graph from parsed requirement documents and runs Pass 2 trace validation checks: broken references, circular dependencies, requires-trace-from coverage, disposition, ID prefix, version-pin staleness, and outcome-gated checks (missing-verdict, failing-verdict) per the reqmd validation pipeline.
model
Package model defines the content tree for a parsed reqmd document (requirements, containers, and info nodes), the built-in attribute keys, and the shared helpers that graph checks and exporters operate on.
Package model defines the content tree for a parsed reqmd document (requirements, containers, and info nodes), the built-in attribute keys, and the shared helpers that graph checks and exporters operate on.
parser
Package parser discovers reqmd document directories, parses the Markdown content tree (requirements, containers, and info items), and loads document trees from git tags.
Package parser discovers reqmd document directories, parses the Markdown content tree (requirements, containers, and info items), and loads document trees from git tags.
repin
Package repin implements the `reqmd repin` command: it computes version-pin changes (proposed or applied) for a reqmd spec tree.
Package repin implements the `reqmd repin` command: it computes version-pin changes (proposed or applied) for a reqmd spec tree.
reporter
Package reporter formats reqmd validation results, per-document listings, and statistics as human-readable text or JSON.
Package reporter formats reqmd validation results, per-document listings, and statistics as human-readable text or JSON.
schema
Package schema — built-in attribute definitions.
Package schema — built-in attribute definitions.
verify
Package verify loads ephemeral verification results (CTRF reports and manual markdown results) and synthesizes them into model.Document instances so the existing graph pipeline can run outcome-gated checks.
Package verify loads ephemeral verification results (CTRF reports and manual markdown results) and synthesizes them into model.Document instances so the existing graph pipeline can run outcome-gated checks.
reqmd-import module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL