Technical Documentation Template: Specify the Input and the Failure

The command works with your sample key, but the next developer passes a space and gets an error. Document the accepted input and failure output beside the working command so they can tell whether to change the input or investigate the tool.

Put a runnable command beside its contract

This independent example documents an original small Node.js script, asset-key.mjs. It checks one proposed asset key; it does not upload an asset, inspect files or validate another product's naming rules. Save the supplied source as that filename and run it with Node. The execution record identifies the tested Node version; it is not a claim about the latest release.

An original asset-key command reference with full source, accepted input, exact error output and observed boundary cases
An original asset-key command reference with full source, accepted input, exact error output and observed boundary cases
Open the full example ↗

A reference should let the reader predict both success and failure. Supply exactly one argument. It must start with an ASCII lowercase letter and contain only lowercase letters, digits or hyphens, with a total length of one through sixteen characters. This proposed rule allows a trailing hyphen; the example does not silently impose a different rule. There is no trimming, case conversion or Unicode normalization.

Diátaxis describes reference documentation as information about the machinery and its operation. Keep that factual contract separate from a longer learning exercise. Node's process.argv reference explains where command arguments are exposed; the independent script supplies its own validation and error rules.

Show the output a developer can compare

For a valid key, stdout is OK followed by the unchanged key and a newline; exit status is zero. A wrong argument count produces Usage: node asset-key.mjs KEY on stderr and exit status one. A malformed key produces Invalid key on stderr and exit status one. The example includes actual executions for short and maximum-length keys, a permitted trailing hyphen, too-long input, uppercase, a space and wrong argument counts.

Those checks cover this small script's stated behavior, not production readiness or compatibility with an asset service. Keep the source, commands and execution record together when the rule changes. A copied error sentence without the argument count and output stream can leave the reader unable to distinguish a usage error from a rejected value.

Draft from the implemented behavior

Create one offline HTML technical reference review copy.
Complete actual source or authoritative specification: [PASTE]
Exact command, arguments, accepted values and limits: [PASTE]
Actual execution environment and stdout/stderr/exit records: [PASTE]
Known unsupported behavior and open facts: [PASTE]
Document inputs, command, success output and each distinct failure. Preserve output streams and exit codes. Do not invent flags, normalization, file operations, service integrations, version support or successful runs. Mark missing facts [TO CONFIRM]; flag a claim contradicting source or execution with [CHECK CONTRACT]. Include the supplied full source and boundary examples in readable preformatted text. Separate observed results from expectations. No external assets, network requests, executable browser controls or workspace-save claims. End with a request to reproduce a specific command in the actual repository.

Ask someone else to reproduce the edge case

Send the source and command to a developer who did not write the rule. If the contract and output are hard to compare, read them together in the prepared HTML review copy in NOS, then correct the actual repository documentation with the implementation.

Send the corrected reference with the command that demonstrates the change. Tell affected developers what changed through their normal review channel; editing a reading copy does not notify them or update the repository.

Keep reading