Docs and READMEs
Who wrote this, and why?
Six months after building the Garden Defense shop, Kai opens shop.js and finds this:
price = price * 0.85; // change price
Why 0.85? A sale? A bug? Kai wrote it and can't remember. Meanwhile, you just cloned the repo (downloaded your own copy) and can't even find how to start the game.
Documentation, or docs, is the writing that explains a project: how to run it, how it's organised, and why it was built this way. Code tells the computer what to do. Docs tell people, and AI agents, why.
Who reads the docs?
- Future youIn six months you will remember the game, not the details. Docs are notes from you to you.
- TeammatesA new teammate should get the game running on day one without asking five questions.
- AI agentsClaude Code reads the repo before it changes anything, so clear docs mean fewer wrong guesses. Its own notes file, CLAUDE.md, is covered in the Claude helpers lesson.
- ReviewersA pull request that updates the docs tells reviewers what the change is meant to do.
Bolt says: A CLAUDE.md can point to the README by writing @README, so Claude Code loads it at the start of each session. The facts stay in one file instead of two.
Quick check
Kai and Remy talk every day, so docs are only worth writing once the studio gets bigger.
- True
- False
Show the answer
False
Future Kai is a different reader from today's Kai, and every new teammate and AI agent starts from zero. A short README written today saves hours of questions later.
The README: the front door
A README is the first file to read in a project, usually README.md at the top of the repo. GitHub shows it on the repo's front page automatically. Ours answers five questions:
- What it isOne or two sentences: "Hyper Shards, a space shooter PWA built with PixiJS."
- How to run itThe exact commands: npm install, then npm run dev.
- How to test itnpm test for the unit tests, npx playwright test for the robot players.
- How to deploy itHow a new version reaches players, and who is allowed to do it.
- Where things liveA short map: src/ for game code, balance.json for the numbers, tests/ for the tests.
Markdown in two minutes
README.md ends in .md because it's written in Markdown: plain text with a few symbols that turn into formatting. John Gruber created it in 2004, and GitHub, Discord and Claude all use it.
# Titleis a big heading,## Run ita smaller one.- itemmakes a bullet list.**bold**makes bold text, and backticks mark`code`.[deploy guide](docs/deploy.md)makes a link.- A line of three backticks starts and ends a code block.
GitHub shows the formatting. The editor shows the symbols, and it still reads well.
Read the README
1# Hyper Shards2A space shooter PWA, built with PixiJS.3 4## Run it5```6npm install7npm run dev8```9 10## Where things live11- `src/` game code12- `balance.json` all the numbers
You clone Hyper Shards and read this README. Before your first pull request, what is missing that you need?
- How to run the tests
- The name of the game
- How to start the dev server
Show the answer
How to run the tests
Line 1 names the game, and lines 5 to 8 give the dev server commands in a code block. Nothing says how to test, so you can't check your change before the robot does. A ## Test it section with npm test fixes that.
Comments say why, not what
A comment is a note in the code that the computer skips, after // in JavaScript. Kai's // change price only repeats what the code already says. A good comment explains what the code can't: the reason, the trade-off, the warning.
// Weekend sale: 15% off seeds, agreed in #48.// Remove when the sale ends.
When a comment only explains what, try a better name instead. calc2() needs a comment. applyWeekendSale() doesn't.
Comment pick
Which comment above const maxBounces = 3; in lasers.js is worth keeping?
- // set maxBounces to 3
- // More than 3 bounces filled the screen and dropped phones below 60 FPS in playtests (#42)
- // laser stuff
Show the answer
// More than 3 bounces filled the screen and dropped phones below 60 FPS in playtests (#42)
It says why the number is 3 and where the decision was made, which the code can't say. The first only repeats the code, and the last tells nobody anything.
Docs live next to the code
Docs on a forgotten website, or only in someone's head, go out of date. So we keep them in the repo: the README at the top, longer guides in a docs/ folder, all in Markdown.
Then docs change in the same pull request as the code. Renaming npm run dev to npm start? Update the README in that PR, and the reviewer checks it. A README with the wrong command can waste more time than no README at all.
Write each fact in one place, and link to it from everywhere else. Two copies of a fact drift apart.
A changelog for every version
A CHANGELOG.md lists the notable changes in each version, newest first. A popular convention, Keep a Changelog, sorts them under headings like Added, Changed, Fixed and Security, with an Unreleased section at the top that fills up as pull requests merge.
## [1.2.0] - 2026-10-09### Fixed- The ship can shoot again after the pause menu.
It is written for people, not machines. Turning it into patch notes for players is a Stage 9 lesson: Version numbers and patch notes.
Bolt says: Docs say what the code should do. Next lesson: tests, small programs that check it really does.
Fact-checked 9 October 2026
- GitHub: about READMEs docs.github.com
- Keep a Changelog keepachangelog.com
- Daring Fireball: Markdown daringfireball.net
- Claude Code memory and CLAUDE.md code.claude.com