All articles
169 articles · updated weekly See our Tools
All articles
Tips

How to document projects on GitHub: the README that matters

The README is the front door and almost the only doc anyone reads. See the structure that works, the supporting files, and how to document the why.

How to document projects on GitHub: the README that matters
COVER · Tips

You open a promising repository, read the name, read a vague sentence, and... close the tab. The basics were missing: what does this do, who is it for, and how do I run it. The README is the project's front door and, in practice, almost always the only documentation anyone will actually read. If it doesn't answer those three questions in the first few seconds, all the effort you poured into the code stays invisible. This piece is about how to document projects on GitHub in a way that respects the time of whoever shows up later — including you, six months from now.

The focus here is the minimum that matters: a well-structured README, the supporting files (CONTRIBUTING, LICENSE, issue and PR templates, changelog), when to move to a wiki or docs site, and why recording the "why" behind decisions is worth as much as explaining the "how".

What a good README answers in the first seconds

Before any pretty section, the reader needs three immediate answers: what the project does, who it's for, and how to run it. If someone has to scroll or clone the repo to figure out the purpose, the README has already failed. The first line right below the title should be a single, concrete sentence — not "a modern, robust solution", but "CLI that converts CSV spreadsheets into PDF reports".

The audience matters too. A library for other developers to integrate is different from a command-line tool for end users, and the README needs to make clear up front which of the two it is. When the "who" is implicit, half the readers misjudge their expectations and walk away.

The structure that works

After years of reading and writing READMEs, the structure that survives contact with reality is almost always the same:

  • Title + one line of what the project is.
  • Badges for build, version, coverage, and license — quick signals of project health.
  • Installation with the exact command, assuming nothing about the environment.
  • Usage with at least one real example that runs.
  • Configuration of the main variables and options.
  • Contributing pointing to CONTRIBUTING.
  • License, stated explicitly.

Assembling that structure by hand, with badges in the right format and sections in the order readers expect, eats up silly amounts of time. For a consistent starting skeleton, a README generator handles the mechanical part and frees you to focus on the content only you can write.

The usage example is the most neglected and the most important section. A snippet someone copies, pastes, and sees working is worth more than three paragraphs describing what the project "lets you do". Something like this already changes the game:

# install
npm install csv-to-pdf

# convert a file
csv-to-pdf report.csv -o report.pdf --template invoice

Notice the example has real input, a real flag, and an expected output. It's not pseudocode. Whoever read it already knows the tool works and what it looks like in use.

Beyond the README: the supporting files

The README carries the weight, but a few complementary files shift the project's posture from "code thrown over the wall" to "project that welcomes people". The CONTRIBUTING.md explains how to run the tests, the commit convention, and what you expect from a PR — without it, every contribution arrives in a different shape. The LICENSE isn't a bureaucratic detail: with no explicit license, legally no one can safely use your code.

Issue and PR templates save round trips. A bug template that asks for version, steps to reproduce, and expected behavior avoids the contextless "it doesn't work". The changelog (ideally following Keep a Changelog) makes clear what changed between versions, which is gold for anyone updating a dependency.

The rule of thumb: start with the README and LICENSE. Add CONTRIBUTING and templates once the project starts getting outside contributors. Don't create empty files just to have them — a CONTRIBUTING with one generic line is worse than none.

When to move to a wiki or docs site

As long as the documentation fits on one scrollable page, it should stay in the README. The temptation to scatter everything into a wiki too early usually ends in dead pages no one updates. The sign that the time has come is concrete: the README outgrew a few screens, has several long sections competing for attention, or you need step-by-step tutorials, API reference, and separate guides.

That's when a docs site (MkDocs, Docusaurus, VitePress) makes sense, with the README becoming a lean landing page pointing to it. The GitHub wiki works for small projects with loose notes, but it lives outside the code's version control — so doc changes don't show up in the same PR that changes behavior. For a serious project, prefer docs versioned alongside the code.

Document the "why", not just the "how"

The documentation that ages best is the kind that records decisions. Six months later, no one remembers why you chose a queue over a synchronous call, or why that odd dependency is there. ADRs (Architecture Decision Records) — short files in docs/adr/ describing context, decision, and consequences — solve this. No ceremony needed: one paragraph per decision already saves months of Git archaeology.

The "how" changes constantly; the "why" is what gives the project continuity. When someone understands the reasoning behind a choice, they can revisit it with judgment instead of breaking everything out of ignorance. Documenting intent is what separates a project people can maintain from one only the original author understands — the same logic applies when you put together a developer portfolio: telling the decision matters as much as showing the result.

Frequently asked questions

What's the ideal length for a README?

Big enough to answer what it does, who it's for, and how to run it, with one real example — and nothing more. For most projects, that fits in one to three scroll-screens. When it goes well beyond that, it's a sign some parts should become separate pages on a docs site.

Do I need badges in the README?

Build, version, and license badges help because they signal project health at a glance, before you even read text. But a decorative badge that says nothing just clutters the top. Keep the ones carrying real information and drop the rest.

README or wiki: which should I use?

Always start with the README. Move to a wiki or docs site when the content grows enough to need navigation, tutorials, and separate reference. Prefer docs versioned alongside the code over wikis that live outside version control.

How do I keep documentation up to date?

Treat docs as part of the PR: if behavior changed, change the docs in the same commit. Stale documentation is worse than no documentation, because it lies to whoever trusts it. Short periodic reviews, each release, prevent the silent accumulation of lies.

What to take away

Write the README for yourself six months from now, without the fresh context you have today. Start with the three questions — what it does, who it's for, how to run it — guarantee a usage example that actually runs, and only then add the supporting files as the project grows. Record the "why" behind the important decisions and keep everything in sync with the code. Documentation isn't the boring part after the real work: it's what makes your real work exist for others.

RD
Author
Rafael Duarte
Backend developer with a background in fintech and B2B SaaS — worked on teams that scaled APIs from zero to millions of requests. Carries enough production scars to hold strong opinions on tools, patterns and architecture decisions. Not an academic: he read the UUID RFC when he had to choose between v4 and v7 for a write-heavy table.
View profile