← back

2026

Self-Updating Docs-as-Code Pipeline

How I connected product code changes to automated AI drafting, quality checks, and Docusaurus deployments.

This is a working demonstration of an end-to-end documentation quality pipeline. It exists to show, with running code rather than claims, that I can design, implement, and maintain documentation systems that work for both human readers and AI agents.

How the system works

Every step of the pipeline runs on one of these tools.

  • GitHub Actions

    Runs the workflow when a product change merges and on every docs pull request.

  • OpenCode

    The agent that reads the product diff and drafts the documentation update.

  • Docusaurus

    Builds the site and checks the links between pages.

  • Vale

    Checks wording and product terms.

  • codespell

    Checks spelling.

  • lychee

    Checks external links after the site builds.

  • Netlify

    Builds a preview for every pull request.

System architecture diagram with the product repo, the docs repo, the GitHub Actions jobs, the OpenCode agent, the Netlify preview and the GitHub Pages production site.
Figure 1: High-level system architecture illustrating the product repo, the docs repo, the GitHub Actions jobs, the OpenCode agent, and the two hosts that serve the docs.
Event path diagram with three phases, from a product pull request through the merge to main and the docs pull request, including the failure path.
Figure 2: Event flow showing a product pull request through the docs pipeline to the deployed site.
01

Automated Update Pipeline

When code merges to the product repo, a GitHub Actions job runs the OpenCode agent. The agent reads the git diff and edits only the pages the change makes wrong.

Flow from a product pull request through the impact job and the review to the merge, then the draft job and the OpenCode agent opening a docs pull request.
Figure 3: Event flow showing a product pull request through the impact job and the merge to the drafted docs pull request.
GitHub Actions run of the Docs impact workflow showing the impact and draft jobs, six affected documentation pages, and a link to the drafted pull request.
01 / 02

Figure 4: Screenshot showing the impact job flagging six pages that read src/config.js and the agent updating the two that the version change touches.

Before · Product repo

Pull request 2 in the product repo changing the current and supported API versions in src/config.js.

Figure 6: Developer merges a feature or API change in the product codebase.

After · Docs repo

Pull request 17 in the docs repo showing a changelog entry added for version 2026-04-01.

Figure 7: OpenCode maps the code change to the right Docusaurus file and drafts the documentation update.

02

Information Architecture

Here are the architectural decisions I made, I used:

  • Audience first framing: The overview names four readers, from backend developers to security teams. Anyone going through the docs knows if the tool is for them.

  • 3 max levels of depth: Reference > Events > Create an event is the deepest path. Getting started and Guides stop at two. This follows the information architecture standards, which ensures information is easily reachable and easily retrieved.

  • Navigation organized by user's job: Sending an event sits in the Quickstart, signature checks sit in Guides, and the endpoint sits in Reference. A reader who wants to send an event finds it in the Quickstart, a reader who wants to verify a signature finds it in Guides, and a reader who wants the exact fields finds them in Reference, so nobody has to guess which section holds the page.

Documentation hierarchy with Overview branching into Getting started, API reference, Guides and SDK, and the generated Reference group shaded.
Figure 8: Hierarchical taxonomy of the Hookline documentation illustrating the parent-child relationships from broad product categories down to specific task-based topics.
Hookline docs overview page with top navigation for Getting started, Guides, API reference and SDK.
01 / 05

Figure 9: Screenshot showing the product overview page and who it is for.

03

Code Example Validation

Every curl and CLI example in the Markdown files runs against the product code. An example that returns 404 where the page promises 202 fails the pull request.

Flow from a docs pull request to the code examples job, which starts the product app, runs the curl and CLI checks, and writes a step summary.
Figure 14: Event flow showing a docs pull request through the code examples job to a blocked merge.
Pull request 16 in the docs repo, titled Test broken curl example, with the code examples check failing.
01 / 02

Figure 15: Screenshot showing the test pull request that changes one example on purpose.

04

Automated Quality Gates

Here are the quality gates:

CheckToolWhen it runsWhat it blocks
Style and terminologyValePull requestErrors block the merge
SpellingcodespellPull requestAny known misspelling blocks the merge
Front mattercheck-frontmatter.js (Node)Pull requestMissing or malformed metadata blocks the merge
Internal links and buildDocusaurusPull requestAny broken internal link blocks the merge
Code examplescheck-docs-code-examples.mjs (Node)Pull requestAny curl or CLI example that does not match the product blocks the merge
Agent-file parityvalidate-agent-files.js and Node testsPull requestAny missing or broken agent file blocks the merge
External linksLycheePull requestAny dead URL blocks the merge
Flow from a docs pull request through the prose, spelling, front matter, build, code examples and lychee checks to an unblocked merge.
Figure 17: Event flow showing a docs pull request through the six gates to an unblocked merge.
Pull request 2 checks panel showing four required checks failing.
01 / 05

Figure 18: Screenshot showing the required checks panel with the merge button locked.

05

PR Preview Links

Netlify builds every pull request and posts the preview link as a comment.

Flow from a docs pull request to a Netlify build, a live deploy preview, a maintainer review, and a merge that deploys the site.
Figure 23: Event flow showing a docs pull request through the Netlify preview to a deployed site.
Netlify comment on pull request 2 with a deploy preview link.
01 / 02

Figure 24: Screenshot showing the Netlify comment with a deploy preview link.

06

Agent-Facing Documentation

AI agents read documentation differently to humans. They prefer Markdown rather than rendered HTML, so I prepared these surfaces to serve them.

OutputURLPurpose

Markdown twin of every page

Add .md to any page URL

The page as Markdown, with components resolved

llms.txt

/llms.txt

An index of every page with its description, following the llmstxt.org layout

llms-full.txt

/llms-full.txt

Every page as Markdown in one file

sitemap.xml and robots.txt

/sitemap.xml, /robots.txt

Lists every page for crawlers and tells bots which pages to skip
Agent-facing documentation surface
Figure 26: Screenshot of the agent-facing documentation section