Documentation as the New CI Pipeline
Automated documentation is following the same path as continuous integration.
By git11 Engineering · Mon Jun 01 2026 · 6 min read
Outdated documentation costs engineers 31% of their weekly output. This is not a communication failure. It is a failure of tooling. Documentation is currently in the same state that infrastructure was in 2005. It is manual, fragile, and detached from the actual code it describes.
Twenty years ago, developers built binaries by hand on their laptops. They forgot dependencies and missed build flags. We fixed this with Continuous Integration (CI) tools like Jenkins and later GitHub Actions. We are now entering the same phase for engineering knowledge.
The Entropy of Docs
Code moves faster than prose. Every pull request that changes a function signature but neglects the README.md creates debt. This debt accumulates until the documentation becomes a liability rather than an asset. Most internal docs are currently fiction.
In a standard repo, the distance between the logic in src/auth.ts and the description in /docs/auth-flow.md is too large. Engineers prioritize the logic because the compiler enforces it. Nothing enforces the documentation. We need a compiler for technical context.
Documentation should not be a task performed after the code is written. It must be a side effect of the code being written. If the documentation requires manual maintenance, it will fail. This is the law of software entropy.
Lessons From CI/CD
Before CI, testing was a discrete phase. It happened at the end of a cycle, often by a separate QA team. It was slow and inconsistent. Modern engineering treats tests as part of the commit. If the tests fail, the commit does not exist.
- Move documentation into the development loop. 2. Tie doc health to the status of the
mainbranch.
- Automate the extraction of intent from source code. 4. Treat missing documentation as a build error.
In 2012, setting up a deployment pipeline was a specialized skill. Today, a yaml file in .github/workflows/ is standard for every project. Documenting an architecture will soon follow this pattern. The LLM is our new build agent.
Machine Readable Intent
AI creates a bridge between binary logic and human understanding. We can now map the flow of data through handler.go and generate an accurate sequence diagram. This is not a summary; it is an extraction of truth. We call this Contextual Automation.
- Extract function signatures and side effects.
- Map dependency graphs automatically from
package.jsonandgo.mod. - Identify breaking changes in APIs before they reach production.
- Generate internal architecture diagrams from actual call stacks.
We specify the "what" through our code. The AI should derive the "why" and the "how" by analyzing the diff. A machine can track every reference to a specific variable across 50 files. A human cannot do this reliably over a six-month period.
The Three Tiers
Effective automation operates at three distinct levels of the stack. Each level requires a different approach to data extraction. Most teams try to solve for the top tier while ignoring the foundation.
- Inline Reference: This is the
docstring. It explains the immediate purpose of a class or method. Automation tools can now verify if these comments match the actual implementation. 2. Architectural Flow: This explains how services interact.
It covers the logic in /services/ and how it talks to the /db/. This must be generated by analyzing the routes and types. 3. Domain Context: This is the highest level. It explains why a business decision led to a specific implementation. This requires analyzing PR descriptions and Jira tickets alongside the code.
When these three layers are automated, the README.md is no longer a static file. It becomes a live view of the system. If you delete a module, the corresponding documentation disappears from the site. This is how we eliminate stale information.
Verified Truth
Stale docs are worse than no docs. If a developer follows a setup guide that fails at step three, they lose trust in the entire repository. This trust is hard to rebuild. Automation ensures the setup guide is tested against a fresh container on every commit.
We are moving toward Doc-Tests. These are assertions for your documentation. You can assert that every exported function in a TypeScript project has a corresponding example. You can assert that the architecture diagram includes the new SQS queue you just added to the terraform config.
- Run
doc-linton every pull request. - Fail builds if the internal API docs diverge from the OpenAPI spec.
- Use headless browsers to verify screenshots in tutorials.
- Update version numbers and dependency lists automatically.
The Role of LLMs
Large Language Models are not writers; they are translators. They translate high-dimensional code structures into low-dimensional human language. They are the engine behind this shift. At git11, we use models to parse the AST of a repository and rebuild the mental model for the reader.
Using a model to write a doc from scratch is a mistake. The model should verify against the ground truth of the code. If the code says port: 8080 and the doc says port: 3000, the model should flag the discrepancy. This is deterministic verification aided by probabilistic understanding.
We see teams using git11-bot to comment on PRs where the logic change is significant enough to require a documentation update. It points to the specific lines in the markdown that are now incorrect. This reduces the cognitive load on the reviewer.
Moving Past Wiki Pages
Wiki platforms like Confluence are where documentation goes to die. They are disconnected from the version control system. They require a separate login and a separate workflow. This is why they are always out of date.
Documentation must live in the repository. It must be versioned with the code. When you checkout v1.2.0, you should see the documentation for v1.2.0. This is only possible through automation. Manual syncing between GitHub and an external wiki is a waste of engineering time.
Static site generators like Docusaurus or MkDocs were the first step. They let us write in Markdown. The next step is removing the need to write the Markdown at all. The source of truth is the code. The documentation is a projection of that truth.
Implementation Steps
If you want to automate your documentation today, start with your entry points. Every repository has a few critical paths. Automate the tracking of these paths first. Do not try to document the entire legacy codebase at once.
- Adopt a standardized format for docstrings (e.g., JSDoc, Google Python Style). 2. Integrate a documentation generator into your CI pipeline.
- Use a tool to monitor code drift against your existing tutorials. 4. Require documentation updates as part of your
CODEOWNERSpolicy.
We are reaching a point where manual documentation is an anti-pattern. If you can automate the verification of a feature, you can automate its description. This is not about saving time. It is about maintaining an accurate map of an increasingly complex landscape.
The future of DevOps is the elimination of the manual handoff. We automated the infrastructure. We automated the deployment. Now we are automating the understanding.
Treat your documentation as a compiled asset generated from your source code.