The structure that works
- Project name as the single # heading
- One or two sentences saying what the project does and who it is for
- Badges on the next line (build status, version, license)
- Installation section with the exact command
- Usage section with a minimal, copy-pasteable example
- Configuration, contributing and license sections further down
Badges in Markdown
Badges are just image links. The pattern is a linked image: [](link-url). Services such as shields.io generate them from a URL, so a version badge can update automatically. Keep badges to a single row — a wall of them pushes the useful content below the fold.
Code blocks that render correctly
Fence every command and code sample with three backticks and add the language so GitHub highlights it. Always close the fence. An unclosed fence is the single most common README bug: everything after it — headings, links, prose — gets swallowed into one giant code block and the page looks broken.
Tables and task lists
GitHub-flavoured Markdown supports pipe tables and task lists, which are common in READMEs for compatibility matrices and roadmap checklists. Keep tables narrow and column counts consistent, since a row with the wrong number of cells will not render as a table.
Relative links and images
Links to files in the repository can be relative, such as [docs](./docs/README.md), because GitHub resolves them against the repo. Images stored in the repo work the same way. Anything the reader might open outside GitHub should use an absolute URL instead.
Preview before you push
The fastest way to catch README problems is to render it before committing. GitHub-flavoured Markdown previewing works offline in the browser, so you can paste the file, check tables, fences and links, fix anything broken, and only then commit. It saves the cleanup commit that a broken README always costs.