Skip to content
chiltepin
chiltepin docs
Write and validate

References (doc#id)

Link blocks together with ids — and let chiltepin check catch broken links.

Give a block an id:, and other blocks can point at it. chiltepin check checks these block references within the documents it loads.

# ```userstory
id: US-142
role: shopper
want: pay in one step
soThat: I can complete my purchase quickly
links:
  - { ref: orders-api#seq-place-order, label: Request flow }

How to write a reference

  • Same file: #id — for example ref: "#seq-place-order". Prefer this form inside a doc; it survives file renames.
  • Another file: doc#id, where doc is the file's path under your docs folder without .md — for example orders-api#seq-place-order, or architecture/overview#c4-context.

IDs must be unique across the documents checked together. Only reference an id that exists (or that you're adding in the same change).

What chiltepin check catches

ProblemCodeWhat you see
Two blocks with the same idE_DUP_IDBoth files and lines are named
A reference to an id that doesn't existE_DANGLING_REFThe file, line, and bad reference

Both are errors, so a broken reference fails CI. The full list of checks is in Validation.

Which blocks can hold references

Today two block types carry ref fields: userstory (links[].ref) and stories (items[].links[].ref).