Docs as Code vs Wiki: Where to Keep Engineering Docs

Should engineering docs stay next to the code or go in a wiki? Get a rule for each document type, from READMEs and runbooks to ADRs and onboarding guides.

TL;DR

  • Keep a doc next to the code when engineers write it, it changes with each release, and the person who reviews the code is the right person to review the doc.
  • Keep a doc in a wiki when people who aren't engineers edit or search it, or when several teams use it.
  • Three questions decide it: who edits it, who needs to find it, and whether it changes when the code changes.
  • Keep each doc in one place and link to it from the other side instead of copying it.

Engineering teams usually keep their docs in one of two places: in a wiki, or next to the code in the repo (the place your team stores its code). Keeping docs in the repo is called docs as code. Neither choice is right for every doc, because each one fixes one problem and creates another.

A wiki page isn't connected to the code. So when engineers ship a new version of the software, nothing reminds anyone to update the page, and it can slowly stop matching what the software does.

A doc kept in the repo is checked and published together with the code, which keeps it accurate. But people on support, product, and operations teams usually can't edit or search it, because they'd need access to the code and a way to suggest a change that an engineer reviews.

So the right place for a doc depends on the document, not on the team. This post tells you where to keep each common type of engineering doc, from READMEs and API references to runbooks (step-by-step guides for handling a problem), ADRs (records of why a technical choice was made), and onboarding guides.

What Does Docs as Code Mean?

Docs as code means you treat a written doc the way you treat code, with the same tools and the same review.

How Docs as Code Works, Step by Step

First, you write the doc as a plain text file, usually in Markdown, which is a simple way to mark up headings and links.

Then you store it in the repo using Git, which tracks every change to your files. From there, a teammate reviews each change in a pull request, which is a proposed change that others read and approve before it's merged, and automatic checks catch problems like broken links. Once the change is merged, the doc is published.

Storing files in Git is only the first step, and the review and publish steps are what separate docs as code from a wiki that happens to use Git.

Docs as Code vs Code as Documentation

The two sound alike, but they mean different things. Docs as code applies the code workflow to written docs, while code as documentation is an older idea: write code so clearly that it explains itself.

This post is about the first one.

What Docs as Code Does Well

  • When engineers change the code, the same person reviews the matching doc, so the two get updated together.
  • Automatic checks find broken links before your readers do.
  • The docs match the version of the software they were released with.
  • Coding assistants, which are AI tools that help developers write code, can read the docs too, because they already read what's in the repo.

These advantages matter most when developers write docs for other developers.

What Does a Wiki Give You?

A wiki gives you a place where anyone on the team can fix a page in a browser, and where everything is searchable together.

  • Editing in the browser with no setup.
  • One place to search every team's docs, instead of searching each repo separately.
  • Permissions by space or page, so the right people see the right docs.
  • Comments, page history, and named owners in the same place.

What a wiki doesn't do is link a page to the software itself, so when the code changes, nothing prompts anyone to update the page.

What About the Wiki Built Into Your Code Host?

Some code hosts, which are websites that store your repos, give each repo its own wiki, and it looks like a middle path. It is one, but it comes with limits.

When a Repo Wiki Works Well

A repo wiki is a wiki for one repo, stored in Git, so each edit is a commit (one saved change) and you can edit in the browser or on your own machine. It suits notes that belong to a single project, especially when the people using them already have access to it.

When a Repo Wiki Stops Working

By default only people with write access to the repo can edit its wiki, so someone in support or product still needs repo access before they can fix a typo. And because each repo has its own wiki, docs that several teams share end up scattered across separate wikis. That makes a repo wiki a good notebook for one project, but a poor fit for docs that many teams depend on.

Three Questions That Decide Where a Doc Belongs

Instead of debating which approach is better, ask three questions about each doc.

The table shows where each answer points, and the sections after it explain each question.

Question

Keep it next to the code

Keep it in a wiki

Who edits it?

Engineers who work in the code every day

People who don't write code, or a mix of teams

Who needs to find it?

Readers already working in the code

Readers across the company, including support, product, and operations

Does it change when the code changes?

Yes, in the same release

No, it changes when a process or a team changes

Who Edits It?

If only engineers edit it, keeping it next to the code works well. But if engineers share it with other teams, use a wiki, or put a browser editing layer on top of the repo, which is a web editor that saves changes back into the repo. Either way, keep in mind that a pull request is a normal step for engineers but a barrier for everyone else.

Who Needs to Find It?

Someone in the middle of an incident, or in their first week, searches across everything, so a wiki search that covers every team's docs serves them better than a search of one repo.

Does It Change When the Code Changes?

If a code change makes the doc wrong, keep the doc next to the code, so the person reviewing the change can see both. But if the doc only changes when a process, a team, or a decision changes, it can be kept apart from the code.

Where Each Type of Engineering Doc Should Go

Find your doc type in the table, and the Starting place column shows where it usually belongs. The last column shows what would move it to the other place, if anything.

Document

Starting place

What changes it

README

Repo

Nothing. Keep it short and link out to the wiki for the long version.

Contributing and local setup guide

Repo

Move it to the wiki if it covers many repos.

API and SDK reference (SDK: a toolkit developers use to build on a product)

Repo, generated from code where possible

Nothing, since it has to match the release.

Release notes and changelog

Repo

Nothing. Link to it from the wiki so support can find it, and don't copy it.

Diagrams written as text

Repo

Move them to the wiki if people who aren't engineers need to edit them.

ADR (architecture decision record)

Repo if it affects one service

Wiki if several teams use it or people who aren't engineers review it.

Design doc or RFC (request for comments)

Wiki while people comment on it

Repo if only that service's engineers will ever read it. See how to write a software design document.

Runbook

Wiki, so support and on-call staff can search it fast

Repo if it only covers one service's deploy scripts and only its engineers use it.

Postmortem

Wiki

Nothing. Several teams read it and need to comment on it.

Onboarding guide

Wiki

Nothing. New hires search before they ask.

Engineering handbook and process docs

Wiki

Nothing. Many teams edit them.

On-call schedule, team directory, ownership list

Wiki

Nothing. They change with people, not code.

Product specs and PRDs (product requirements docs)

Wiki

Nothing. Product and design edit them.

Public developer docs

Repo, published as a docs site

Nothing. They need a branded site built from the code.

Docs That Belong Next to the Code

READMEs, API references, setup guides, release notes, and diagrams written as text all go out of date when the code changes, so keeping them in the repo lets the person reviewing the change spot an outdated doc before anyone reads it.

Docs That Belong in a Wiki

Onboarding guides, handbooks, process docs, postmortems, and on-call schedules change with people and decisions, not with commits. The people who edit them often don't work in the code, and the people who need them are searching across the whole company.

Docs That Depend on Who Reviews Them

ADRs, design docs, and runbooks are the ones teams argue about, because the right place for them changes with who reads them.

  • ADR: Keep it in the repo if it affects one service. Use the wiki if several teams use it or people who aren't engineers review it.
  • Design doc or RFC: Use the wiki while people comment on it. Move it to the repo if only that service's engineers will ever read it.
  • Runbook: Start in the wiki, so support and on-call staff can search it fast. Move it to the repo only if it covers one service's deploy scripts and only its engineers use it.

The deciding rule is the same for all three: if people who aren't engineers review or search the doc, use the wiki, and if only the owning team's engineers ever touch it, keep it next to the code. See runbook software for DevOps teams.

What About Docs Sites Built From the Repo?

A docs site built from the repo makes sense for public docs and API docs, but you don't need one for internal docs. A static site generator is a tool that turns the files in your repo into a docs site, and some hosted docs sites also sync with the repo, so people who aren't engineers can edit in the browser while engineers keep using pull requests. Either kind suits docs that your customers or developers outside your company read. See documentation tools for engineering teams.

How to Keep Docs in Both Places Without Copying Them

You can use both, as long as every doc is kept in one place and the other side only links to it.

Keep Every Doc in One Place

Write down where each type of doc is kept so nobody has to guess. When a doc belongs on the other side, link to it instead of copying it, because two copies mean two chances to be wrong.

Keep One Page That Lists Where Each Doc Is Kept

Make a single wiki page that lists each doc type, where it belongs, and who owns it, and put the same link in every README so an engineer who lands in the repo can find the wiki side easily.

Copy the doc to its new location first. Then replace the old copy with one line that says where the doc moved, so anyone with the old link can follow it. Once people have had time to update their links, delete that line.

If you're moving a Markdown file into Docmost, see the import and export guide.

How Repo Docs and Wiki Pages Go Out of Date

Repo docs and wiki pages both go out of date, and neither approach prevents it. Putting a doc in Git doesn't keep it accurate, and a wiki page doesn't update itself. A file in the repo can be wrong for years if nobody reviews it.

  • Repo side: Make automatic checks, like link checks, required, and ask for a doc update in the same change as the code.
  • Wiki side: Give each page an owner and a review date, and see wiki page ownership. Docmost doesn't send review reminders, so pick a regular day to go through the dates.
  • Both sides: Name one person per doc, not "the team," because when a whole team owns a doc, nobody takes responsibility for updating it.

How AI Assistants Reach Docs in a Repo and in a Wiki

Coding assistants read what's in the repo, so docs kept there reach them by default. A wiki can reach them through MCP, a standard way for AI assistants to connect to other tools.

In Docmost, MCP is a paid edition feature. It lets a connected assistant search, read, create, and update pages in Docmost programmatically. See connecting Docmost to an AI assistant with MCP.

How Docmost Works as the Wiki Side

Docmost is the wiki half of the rule: a place for docs that people who aren't engineers edit and search. And this is what it gives those docs:

  • Spaces: One per team or area, and each space has its own permissions.
  • Page tree: Pages nest inside other pages, so an onboarding guide can hold its own subpages.
  • Real-time editing: Several people can edit the same page at once.
  • Inline comments: Reviewers can mark up the exact text.
  • Page history: You can view and restore earlier versions.
  • Search: It covers every space you can access.
  • Paid edition: Page-level permissions and AI Search.

Docmost doesn't replace a docs folder in the repo, so keep READMEs and API references next to the code and use Docmost for the docs that belong in a wiki. And if you want to compare wiki tools you can host yourself, see our guide to self-hosted documentation tools.

Frequently Asked Questions

  1. Where Should Engineering Documentation Be Kept?

It depends on the document, not the team. Keep docs that engineers write and that change with the code next to the code, and keep docs that other teams edit or search in a wiki. To decide, ask who edits it, who needs to find it, and whether it changes when the code does.

  1. Where Do ADRs and Runbooks Go?

Both depend on who reads and reviews them. An ADR that affects one service can stay in the repo, but one that affects several teams belongs in a wiki. A runbook starts in a wiki so support and on-call staff can search it fast, and it moves to the repo only if it covers one service's deploy scripts and only that team's engineers use it.

  1. Is a Repo Wiki the Same as Docs as Code?

No. A repo wiki stores its pages in Git, but docs as code is the whole process of writing, storing, reviewing, checking, and publishing docs the same way you do code.

  1. Should Docs Go in a Docs Folder or a Wiki?

A docs folder is a folder inside the repo, usually named docs, that holds your Markdown files. Use it for docs that engineers write and that change with the code, like API references and setup guides, and use a wiki for docs that other teams edit or search.

  1. Can People Who Aren't Engineers Edit Docs Kept in a Repo?

Yes, but they have to learn the tools first, and pull requests are a barrier for people who don't use Git. A browser editing layer that saves changes into the repo lowers that barrier without removing it, so a doc that people who aren't engineers edit usually belongs in a wiki.

  1. Do I Need a Static Site Generator?

Only for public docs or API docs. A static site generator turns files in the repo into a docs site, and internal docs don't need one if they're kept in a wiki.

Keep Your Engineering Docs Easy to Find and Edit With Docmost

The docs that belong in a wiki need a place that's easy to edit and easy to search, so people on other teams can find what they need without asking an engineer. 

Docmost is built for that, while your repo keeps the docs that belong next to the code.

Get a free trial license or contact sales.