Software Documentation: Put a Working Command Before the Reference

The documentation lists input rules, but a new user cannot find a command they can run. Give them one checked result first, then put task instructions, exact rules and the reason behind the output in separate sections.

Start with one command and its result

The example documents an original unpublished teaching program named clock-minutes. Its entry file clock-minutes.mjs accepts one 24-hour clock label in HH:MM form and converts it to an integer number of minutes since midnight. It uses no dependencies, files, network or package scripts. It does not resolve a date, time zone or real elapsed time.

A software documentation review with first run, task guide, exact reference, explanation, original source and checked command cases
A software documentation review with first run, task guide, exact reference, explanation, original source and checked command cases
Open the full example ↗

Keep the first run small enough to verify. Save the supplied entry file in a separate local folder, then run node clock-minutes.mjs 01:30. The expected stdout is 90 minutes, with exit 0 and empty stderr. The example shows the full command with that spacing, the source and the actual execution record.

Diátaxis distinguishes tutorials, how-to guides, reference and explanation by the reader's need. Use those distinctions to keep a beginner's first run from being buried inside every possible input rule. This small review document has four labeled sections; a larger project's authoritative documentation can use separate pages.

Give exact rules their own reference

The task guide uses 00:00 and 23:59 to check the supported boundaries. The reference requires exactly one argument, two digits for hours 00–23, a colon and two digits for minutes 00–59. A missing or extra argument fails with “Provide exactly one HH:MM clock label.” A malformed or out-of-range label fails with “Use HH:MM with hours00-23 and minutes00-59.” Each writes to stderr, exits 1 and produces no stdout.

The explanation shows hours multiplied by 60 plus minutes:01:30 becomes1×60+30=90 and 23:59 becomes23×60+59=1439. These are clock-label offsets. Comparing them does not establish travel duration, daylight-saving behavior or an interval crossing midnight.

The execution record uses Node 24.11.0 and covers three successful inputs and five failures. It proves those local command results, not support for every runtime or a hosted application's behavior. Actual maintainer, support route, license and supported-runtime policy remain [TO CONFIRM].

Draft from source and execution evidence

Create one offline HTML software documentation review copy.
Actual purpose, file tree and complete source/config: [PASTE]
Checked runtime, commands, stdout/stderr and exit codes: [PASTE]
Input/output rules, boundaries, limitations and real task: [PASTE]
Actual support, maintainer, license and documentation location: [PASTE]

Use supplied facts only. Give a smallest checked first-run tutorial, a task-focused how-to, exact input/output/error reference and an explanation of the calculation or design. Keep those reader needs distinct. Preserve source/command contradictions [CHECK COMMAND]; mark gaps [TO CONFIRM]. Recompute numeric examples. Do not invent package scripts, dependencies, compatibility, APIs, deployments, dates/timezones, licenses or performance results. Distinguish observed runtime from supported versions. Include full supplied source or its confirmed repository path, and keep actual repository documentation authoritative.
Use semantic headings and captioned reference/evidence tables with scoped headers and labeled360px rows. Inline CSS, at least16px body text; no network/assets/editable fields, fake copy buttons or application controls. Return full HTML and unresolved documentation checks; do not claim to commit or publish it.

Ask a teammate to run the first example

Send the documentation with the supplied entry file and ask a teammate to run a successful input and an invalid one. If the task guide and input rules are hard to compare, read them together in the prepared HTML review copy in NOS, then revise the actual repository documentation.

Send the corrected instructions with the checked command result. Review the documentation diff and its rendered sections in the real project before adoption; updating a reading copy does not change the repository or notify its readers.

Keep reading