Jonatan Matajonmatum.com
conceptsnotesexperimentsessays
© 2026 Jonatan Mata. All rights reserved.v2.1.1
Concepts

Documentation as Code

Practice of treating documentation with the same tools and processes as code: versioned in Git, reviewed in PRs, and automatically generated when possible.

seed#documentation#docs-as-code#markdown#automation#dx

What it is

Documentation as Code is the practice of treating documentation like code: it lives in the same repository, is versioned with Git, reviewed in pull requests, and automatically generated/validated in CI.

Principles

PrincipleWhat it meansExample
ColocationDocs near the code they documentREADME per package, JSDoc on functions
VersioningDocumentation evolves with codeDocs in same repo, same PRs
AutomationGenerate docs from code when possibleTypeDoc, Swagger/OpenAPI, Storybook
ValidationVerify links, examples, format in CIMarkdown lint, link checker in CI

Tools

ToolUse
MarkdownUniversal format
MDXMarkdown + React components
DocusaurusDocumentation sites
StorybookComponent documentation
TypeDoc/JSDocDocs generated from code
OpenAPIGenerated API docs

Connection with llms.txt

The llms.txt standard is documentation as code optimized for AI agents — a Markdown file describing the project for LLM consumption.

Why it matters

Documentation that lives separately from code inevitably becomes outdated. Treating it as code — versioned in Git, reviewed in PRs, generated from authoritative sources — is the only way to keep it synchronized with the system's reality.

References

  • Docs as Code — Write the Docs.
  • MkDocs — MkDocs, 2024. Documentation site generator from Markdown.
  • Docusaurus — Meta, 2024. Documentation framework with versioning and i18n.

Related content

  • Spec-Driven Development

    Development methodology where the specification is written before the code, serving as a contract between teams and as the source of truth for implementation.

  • llms.txt

    Proposed standard for publishing a Markdown file at a website's root that enables language models to efficiently understand and use the site's content at inference time.

  • DraftMK Copier Templates

    Copier templates for project scaffolding with Docker Compose, MkDocs documentation, and automated configuration.

  • Developer Onboarding

    Structured process for new developers to become productive quickly, from environment setup to understanding team architecture and processes.

Concepts