Many source repositories include a docs/ folder for documentation, especially
now that LLMs can help generate and maintain documentation for software
projects. However, traditional docs have been targeted toward users or consumers
of the software application, tool, or package. For developers of the application
itself, instructions have long been scattered amongst wikis, README files, docs,
and other locations (if they’re recorded at all). It’s time to treat developer
documentation as a first-class artifact and store it with the application’s
source code in a folder like devdocs/.
Docs and Audiences
Most software libraries and applications have many more users than developers, and as such there’s much more return on investment in creating and maintaining documentation that helps users of the software. When most people talk about “docs” for software, this is what they’re referring to.
However, even single-maintainer projects benefit from some degree of documentation, if only for “future you.” At a minimum, a README file that explains the purpose of the project and how to build, test, and run it can be very helpful in the future. As the project grows more complex, and after it’s been deployed to production, that README file is often strained by having too much to cover and having to serve both the developer/maintainer audience and the project’s users.
And since even single-developer projects increasingly involve assistants in the form of LLM-based agents, there’s another audience that can benefit from properly segmented documentation on how the project is built and deployed.
Developers and teams are often prone to following the path of least resistance.
So when artifacts like
architecture decision records (ADRs)
are created, which look kind of like documentation files, they’re often placed
in a docs/ folder along with whatever passes for end-user documentation (if
any). But how many end users of a software application or even library are
interested in the historical architectural decisions made by the project’s
development team? They’re not the audience.
I’ve written about
getting started with ADRs.
It’s also worth noting that while many ADR tools default to paths like doc/adr
or docs/adrs, you can generally configure these however you wish, or just
tell your coding agent where they belong.
A Home for Developer Docs: devdocs/
A better place to store ADRs and the increasingly complex set of instructions for building, testing, running, deploying, and publishing software is in a dedicated developer documentation directory. This folder can then be configured to be published automatically (often for free) using Cloudflare Pages or GitHub Pages (with a workflow). The end result is first-class documentation for developers, architects, DevOps engineers, product owners, and agents, without cluttering end-user documentation.
Here’s a sample devdocs/ layout:
devdocs/
βββ architecture/ # ADRs, architectural style, key constraints, and quality attributes
βββ components/ # One page per project, service, or module: purpose, dependencies, how to build and test it
βββ definitions/ # Ubiquitous language glossary: domain terms and what they mean in this codebase
βββ deployment/ # Build and release pipelines, deployment steps, rollback procedures
βββ diagrams/ # Diagram sources (Mermaid, PlantUML, draw.io) and their rendered images
βββ environments/ # Dev, test, staging, and production: URLs, configuration, access, and how they differ
βββ operations/ # Runbooks for incidents and routine tasks, monitoring, alerts, and on-call procedures
βββ README.md # Landing page: what's here, plus local setup to clone, build, test, and run
Of course, if you don’t want to publish them or if you want to keep it strictly internal, you can keep the files local-only as well. Even then, it may be worth supporting publication to a local Hugo (or similar) static site just to improve the developer experience.
Agents benefit from this structure, too. Point your AGENTS.md or CLAUDE.md
file at devdocs/README.md and your coding agent knows where to find build, test, and
deployment instructions, along with the ADRs that explain why things are the way
they are. Even better, the agent can update those docs in the same PR as the
code changes that affect them.
Why not just use the root README.md file?
We’ve all seen README.md files that have grown so large they’ve needed a table
of contents, and in many cases the TOC itself has grown so long that it scrolls
across multiple pages. The whole point of the README.md file is that everyone
looking at the project for the first time should read it, but that’s not going
to happen if it’s a book! Instead, keep your README.md lean and have it point
to the things a reader might need, depending on who they are and what they’re
trying to accomplish. This use of
progressive disclosure
is better for humans and better for agents.
Why not use a wiki?
The problem with wikis is they tend to get out of date and out of sync with the
project to which they’re attached. Sure, that’s also possible with documents
located within source control, but it’s much easier to include checks to ensure
the docs are up to date right alongside changes being made, and to include
reviews and other gates that help confirm these updates are taking place. The PR
with the changes either includes the updates needed in devdocs/ or it doesn’t,
so it’s a straightforward gate.
Why not just use a subfolder of docs/?
In most repositories, docs/ is the folder that gets built and published as the
user documentation site. Anything nested under it, like docs/dev/, ends up in
the same site, navigation, and search as the user docs. Keeping developer docs
in a sibling folder avoids that.
It’s also a different audience. A typical application or library’s docs target
the user of that application or library, not its developers or maintainers.
Sure, you might have a CONTRIBUTING.md file targeting contributors, but that’s
hardly sufficient once you start tracking ADRs and deeper instructions and
documentation around the application’s ubiquitous language glossary, deployment
environments, security considerations, and many other potential subjects of
interest to developers and other stakeholders, but not directly relevant to
users.
Many projects already maintain all of their user-facing documentation in a
completely separate repository, in which case if there is a docs/ directory,
it already is developer documentation. For example,
dotnet/runtime’s docs/ folder
is entirely for contributors, covering build and test workflows, design docs,
coding guidelines, and infrastructure. The user-facing .NET documentation lives
in the separate dotnet/docs repository. This
supports the separation, and perhaps you’ll agree it also argues for a clearer
naming convention, since just docs/ doesn’t indicate the intended audience.
Maybe at some point we’ll adopt a convention of having user-docs/ and
dev-docs/ or similar, but in the interest of not changing too much too fast,
I’m sticking with devdocs/ for now.
Supporting Evidence
DiΓ‘taxis is “a way of thinking about and doing documentation” that prescribes a systematic approach to understanding the needs of different documentation users. It shows that different reader needs call for differently structured documentation, which applies just as much to the different needs of users and developers.
Write the Docs: Docs as Code makes the case that you should be writing your documentation with the same tools as code, and following the same workflows as the development team. It outlines a number of benefits of adopting this approach.
Software Engineering at Google, Chapter 10: Documentation speaks to how Google dealt with engineering docs that drifted out of sync with the code, and also argues that “Documentation is often so tightly coupled to code that it should, as much as possible, be treated as code.” Regarding the Google Wiki: “But as Google scaled, problems with a wiki-style approach became apparent. Because there were no true owners for documents, many became obsolete. Because no process was put in place for adding new documents, duplicate documents and document sets began appearing.”
Michael Nygard’s original ADR article (2011) makes the case that the audience for ADRs is developers, saying “We will write each ADR as if it is a conversation with a future developer.”
Conclusion
I’ve been using a devdocs/ folder in most of my projects for the past year or
so and it’s been a big help. Would this benefit your team or project? How are
you dealing with documenting all of the knowledge needed to build, test, deploy,
and run your projects? Many non-trivial projects benefit from having a
dedicated, well-organized home for their development team’s documentation.
Resources
- Getting Started with Cloudflare Pages Git Integration
- GitHub Pages Quickstart
- Configuring a Publishing Source for GitHub Pages
(branch publishing only supports the repo root or
/docs; use a GitHub Actions workflow to publishdevdocs/) - Architecture Decision Records