Developer Docs Deserve Their Own Folder

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 it’s 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 increasingly even single-developer projects also 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 configure your coding agent as needed.

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 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

Of course, if you don’t want to publish it 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/ 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/?

Why have a separate folder for developer docs? Why not just put them in a subfolder of the already-established docs/ directory?

It’s a different audience. A typical application or library’s docs are targeting the user of that application or library, not its developers or maintainers. Sure, you might have a CONTRIBUTING.md file targeting maintainers, but that’s hardly sufficient once you start tracking architecture decisions (or 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 argues for the need for 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 docs/users and docs/dev 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 makes it clear that different documentation audiences exist, and we should build our documentation accordingly.

WriteTheDocs - 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. They outline a number of benefits of adopting this approach.

Docs at Google and the Google Wiki speaks to how Google dealt with this issue, 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 for building, testing, deploying, running, etc. your projects? Many non-trivial projects benefit from having a properly organized dedicated site for all of their development team’s documentation needs.

Resources

If you liked this post, consider subscribing to email updates about my new posts, or sharing it on Hacker News.

Keyboard shortcuts

?
Show this help
Esc
Close this help or an open menu
n
Next (newer) post: Developer Docs Deserve Their Own Folder
p
Previous (older) post: Clean Architecture with .NET - My New Book with Casey Crouse
Tab
Move between links and buttons (Shift+Tab to go back)