GitHub README Template: Get the First Command and Failure Case Right

Someone opens your repository, copies the first command and hits an error you never mentioned. Give them the prerequisites, one working use case and the failure they can recover from before asking them to explore the code.

Make the first run reproducible

The example is an original tiny greeting CLI called hello-note. It is a documentation exercise, not a real published repository or package. The page provides the complete hello.mjs source beside a copyable Markdown README. The CLI accepts one nonblank name, prints a greeting and exits with an error when the name is missing.

A repository README review copy with complete example source, usage and a missing-name failure
A repository README review copy with complete example source, usage and a missing-name failure
Open the full example ↗

Show the command, its expected output and what to do when it fails. After saving the supplied source as hello.mjs, run node hello.mjs Sam. The expected output is “Hello, Sam!” Running node hello.mjs writes a usage instruction and exits with status 1. These checks apply to the supplied example source, not to a reader's unrelated repository.

GitHub's README documentation describes a README as a place to explain what a project does, why it is useful and how to get started. GitHub recognizes README files in the .github, root or docs directory. For this simple example, save the finished Markdown as README.md in the repository root.

Replace assumptions with the repository's facts

The exercise uses a Node runtime, no installed dependencies and a local file. It does not need an npm installation command, API key or invented clone URL. The example source and commands were checked together; confirm the actual supported runtime for your own project from its tested configuration.

Repository location, maintainer contact and license remain [TO CONFIRM]. Do not add an MIT badge, build-status badge or support promise without the corresponding repository evidence. If your project has an environment file, document the variable names and how to obtain values without publishing secrets.

Use repository-relative links only after their target files exist. Keep deeper setup, architecture and contribution instructions in appropriate repository files and link to them when they are available. Do not fill a README with links to nonexistent docs because a template includes a section for them.

Draft in Markdown from the actual setup

Write a repository README.md in Markdown, plus a separate HTML review rendering of the same content.
Project purpose, actual repository files and tested runtime: [PASTE]
Verified installation/setup commands and environment variable names: [PASTE]
Working usage command, expected output and failure recovery: [PASTE]
Existing documentation paths, maintainer contact and confirmed license: [PASTE]

Use supplied facts only; mark gaps [TO CONFIRM]. Do not invent clone URLs, package scripts, files, badges, license terms or successful test results. Commands must correspond to supplied source/configuration; keep a failure case and recovery instruction. Never include secret values. Preserve unresolved commands as checks, not runnable guesses. The authoritative README belongs in the repository, not an HTML substitute.
For the HTML review copy use escaped code, semantic headings, pre-wrapped text, inline CSS and at least 16px body type at 360px. No scripts, external assets, network, fake copy controls or editable fields. Return full Markdown and HTML with remaining checks.

Have a newcomer follow the README

Ask a colleague to run the documented setup in the actual repository and report the first unclear step. If the command and failure explanation are hard to compare, read them together in the prepared HTML review copy in NOS, then update README.md in the repository.

Commit the corrected README with the command it documents. Send the repository change through your team's normal review process. A review rendering does not change repository files or notify contributors.

Keep reading