Codebase Documentation
Write a README and a few short notes that let a new person run, check, and safely change your project without calling you.
Content date: October 15, 2026.
Plain English
Good documentation lets someone else run the project, understand a key decision, or do a risky task safely. The README is the starting point. A decision record is a short note on why you chose one approach. A runbook is a step-by-step guide for something you repeat, such as restoring a backup. Debugging notes shouldn't quietly become permanent instructions.
Use this when
Write a note as soon as a setup step or decision would otherwise live only in a chat window, and update it whenever a command or procedure changes.
If you are just starting
In the README, say what the project is for, what to install first, and the commands to install, run, and check it. List required setting names with safe example values, and where to ask for help. Mark commands you haven't tested. Keep it short and link to longer notes. For instructions meant for AI tools, see "Agent Instruction Files."
When your project grows
Give each important procedure an owner. Record the environment you tested it in and when to review it. A runbook says what you need first, how you know it worked, what to do if it fails, and how to recover. Delete old instructions instead of keeping versions that disagree. Keep secrets and private operational output out of documentation.
Worked example
The README says to start the site with `npm run dev`, but the project's scripts now call it `npm start`. A new teammate, Marcus, follows the README and gets an error before anything loads. The maintainer checks package.json, fixes the command, writes down the Node version used, and links the deployment steps instead of pasting them in.
Practice
A fresh-reader setup check
- Open your practice project's README and delete or mark any setup instructions that conflict.
- Write the prerequisites (for example, "Node 24"), the setting names it needs, and the exact commands to run and check it.
- Copy the project to a new folder and have a friend, or a new AI chat with no history, follow only the README.
- Write down each missing step and error message, leaving out any password or key.
- Fix the README and add a dated note with the environment you tested and anything unresolved.
Deliverable: A working README, a link to one decision note or runbook, and a dated verification note from the fresh-reader test.
Common mistakes to watch for
- Setup works only on the author's laptop because of a tool or password nobody wrote down.
- Two sets of commands sit side by side in the README, and nobody knows which still works.
- An AI documents the code it planned, not the code that exists.
- The reason for a big decision is buried in a 200-message chat.
Prompting
A weak prompt
Write complete documentation for my project from its name.
A better prompt
Read the actual files and scripts in this repository, then update the README with a short purpose, what to install first, the commands to run and check the project, and required setting names with safe example values. Link to any decision notes or runbooks. Run each command in a separate folder if you can, and mark steps you couldn't test or that need special access. Then have a new chat with no history follow the README and report where it gets stuck. Include no real secrets or private data.
Notes you've actually tried are the only ones worth trusting when you're away and someone else is stuck.
Check before you move on
- The README says what the project is for and how to start it.
- Every command in the README matches the current scripts.
- Example settings contain only safe, made-up values.
- Long procedures are linked from the README, not pasted in.
- A fresh reader followed the steps and the gaps were fixed.
You are done when
- A new maintainer can run and check the app using only your notes.
- Any untested or access-dependent step is labeled.
Questions to think about
An AI wrote a setup guide but never ran the commands. How should you label it?
As untested. A well-written guide isn't proof, so run it in a clean folder and record the environment before you trust it.
You have a six-step database restore procedure used twice a year. Where does it go?
In its own runbook, linked from the README. The README stays short, and the runbook has room for prerequisites, success checks, and recovery steps.
To help a teammate reproduce a bug, should the note include the real API key?
No. Name the setting and explain how to get a safe test value. A key in a note can leak through backups, screenshots, and shared documents.