{"playbook":"Developer tools, SDKs and CLIs","url":"https://agentwranglers.se/playbook/developer-tools","updated":"2026-10-27","license":"https://creativecommons.org/licenses/by/4.0/","credit":"Required by the licence: credit Agent Wranglers with a link to the rule or playbook you used.","ids":"Each rule has an id, such as PAY-14, that never changes. Open a rule by its id at /r/PAY-14. Its revision changes whenever its content changes.","how":"Each rule's How and Measured text is on its own page: add .md to its url.","rules":[{"id":"DEV-1","revision":"1857a95f6c14","updated":"2026-10-27","name":"Exit with zero only when the command did everything it was asked","level":"Recommended","rule":"Exit 0 only when every action succeeded, and exit with a code from 1 to 125 on any failure. Document each code in the help text and keep its meaning fixed.","check":"A test runs each command with a missing file, a wrong flag and a server that answers 500. Each run exits with its documented non-zero code. A successful run exits 0, and the help text lists every code.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/command-line-behaviour/exit-codes","related":["/playbook/api-design/errors/stable-error-types","/playbook/developer-tools/command-line-behaviour/signal-cleanup"],"sources":["https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_08_02"]},{"id":"DEV-2","revision":"714079a94e74","updated":"2026-10-27","name":"Write results to stdout and everything else to stderr","level":"Recommended","rule":"Write only the command's result to standard output. Progress, warnings, prompts and errors go to standard error. Colour and spinners appear only when the stream is a terminal and `NO_COLOR` is unset.","check":"A test runs each command with standard output sent to a file and standard error to another. The output file holds only the result, with no escape codes. With `NO_COLOR=1` set, standard error holds no escape codes either.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/command-line-behaviour/stdout-stderr","related":["/playbook/developer-tools/command-line-behaviour/json-output","/playbook/developer-tools/help-completion-and-updates/version-check"],"sources":["https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap01.html"]},{"id":"DEV-3","revision":"7d4a7b9698a9","updated":"2026-10-27","name":"Offer JSON output with a stable shape","level":"Recommended","rule":"Give every command that prints data a `--json` flag. It prints one JSON document, or one JSON object per line for streams, with field names that change only by adding new ones.","check":"A test runs every data command with `--json` and parses the output with a JSON parser. It validates against the saved schema, or matches the saved field list with no field removed or renamed.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/command-line-behaviour/json-output","related":["/playbook/developer-tools/command-line-behaviour/stdout-stderr","/playbook/api-design/requests-and-responses/dates-and-times","/playbook/api-design/changes-over-time/additive-changes","/playbook/developer-tools/command-line-behaviour/cli-locale"],"sources":[]},{"id":"DEV-4","revision":"09be6b0a739e","updated":"2026-10-27","name":"Never wait for input when no person is there","level":"Recommended","rule":"Prompt only when standard input is a terminal. Otherwise fail at once with a message that names the flag that answers the question, and offer `--yes` and `--no-input` flags.","check":"A test runs every command with standard input closed and a 10 second limit. Each run either finishes or exits non-zero with a message that names a flag. None hits the time limit.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/command-line-behaviour/non-interactive-mode","related":["/playbook/accounts/sign-in-methods/device-sign-in","/playbook/developer-tools/command-line-behaviour/dry-run"],"sources":[]},{"id":"DEV-5","revision":"d5aedd0dc0f6","updated":"2026-10-27","name":"Show a dry run and ask before destructive commands","level":"Recommended","rule":"Give every command that deletes, overwrites or sends something a `--dry-run` flag that lists what it would do. Ask for confirmation before it acts, unless `--yes` is passed.","check":"A test runs each destructive command with `--dry-run` on a test copy, and nothing changes. The list it printed matches what the same command then changes with `--yes`.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/command-line-behaviour/dry-run","related":["/playbook/developer-tools/command-line-behaviour/non-interactive-mode","/playbook/infrastructure/infrastructure-as-code/plan-in-review"],"sources":[]},{"id":"DEV-6","revision":"6c4d40d6e4a5","updated":"2026-10-27","name":"Make command-line tools read the locale or say they do not","level":"Recommended","rule":"A command-line tool that prints translated text picks its language from `LC_ALL`, then `LC_MESSAGES`, then `LANG`. A tool in one language says so in its help. Machine-readable output is the same in every locale.","check":"Run the tool with `LC_ALL=sv_SE.UTF-8` and with `LC_ALL=C`. Human messages change language, or the help says the tool is English only. The `--json` output is byte for byte equal in both runs.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/command-line-behaviour/cli-locale","related":["/playbook/developer-tools/command-line-behaviour/json-output"],"sources":["https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap08.html"]},{"id":"DEV-13","revision":"c3cf6770ee7a","updated":"2026-10-27","name":"Clean up and exit with 128 plus the signal number when stopped","level":"Recommended","rule":"On SIGINT or SIGTERM, start no new work, delete temporary and lock files, restore the terminal and exit with 128 plus the signal number. A second Ctrl+C exits at once.","check":"A test starts a long command and sends SIGINT after 1 second. The tool exits 130, and no temporary file, lock file or partial output file remains. SIGTERM gives 143. Two SIGINT signals 100 ms apart end the process within 1 second.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/command-line-behaviour/signal-cleanup","related":["/playbook/developer-tools/command-line-behaviour/exit-codes","/playbook/operations/running-the-service/graceful-shutdown"],"sources":["https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html"]},{"id":"DEV-7","revision":"11d3cf7a8416","updated":"2026-10-27","name":"Take secrets from the environment or a file instead of a flag","level":"Required","risk":"takeover","rule":"Read tokens, passwords and keys from an environment variable, a file, standard input or the system keychain. The tool never accepts a secret as a command-line argument and never prints one.","check":"The help text lists no flag such as `--token`, `--password` or `--api-key` that takes a value. A test runs every command with `--debug` and a known test token, and the token appears in neither output stream. A saved credentials file has mode 600.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/configuration-and-telemetry/no-secrets-in-flags","related":["/playbook/desktop-apps/web-code-inside-desktop-apps/desktop-keychain","/playbook/application-security/errors-logs-and-vulnerabilities/private-data-out-of-logs","/playbook/developer-tools/configuration-and-telemetry/config-precedence"],"sources":["https://cwe.mitre.org/data/definitions/214.html","https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html"]},{"id":"DEV-14","revision":"99466dad2af9","updated":"2026-10-27","name":"Read settings in one documented order from standard folders","level":"Recommended","rule":"Take each setting from the first source that sets it. The order is flag, environment variable, project file, user file, system file and built-in default. On Linux and BSD, find files through the XDG base directory variables.","check":"A test sets one setting in all six sources, then removes them one at a time from the top. Each time the value comes from the next source in the order. With `XDG_CONFIG_HOME=/tmp/x` the tool reads `/tmp/x/example/config.toml`, and with `XDG_CONFIG_HOME=relative` it reads `~/.config/example/config.toml`. A run with an empty home folder creates no file directly in it.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/configuration-and-telemetry/config-precedence","related":["/playbook/developer-tools/configuration-and-telemetry/no-secrets-in-flags","/playbook/developer-tools/help-completion-and-updates/version-check"],"sources":["https://specifications.freedesktop.org/basedir/latest/","https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid"]},{"id":"DEV-15","revision":"26fead839a64","updated":"2026-10-27","name":"Send no telemetry from CI or when DO_NOT_TRACK is set","level":"Recommended","rule":"Send no usage data when `DO_NOT_TRACK=1`, when the tool's own variable such as `EXAMPLE_TELEMETRY=0` is set, or when `CI` is set. Before the first send, print what the tool collects and how to turn it off.","check":"A test runs a command three times, once with each variable set. A network capture shows no request to the telemetry host. Without them, the first run prints the notice to standard error before any request. With the telemetry host unreachable, the command's run time grows by less than 1 second and its exit code is unchanged.","check_type":"http","url":"https://agentwranglers.se/playbook/developer-tools/configuration-and-telemetry/cli-telemetry-off","related":["/playbook/desktop-apps/crashes-telemetry-and-accessibility/telemetry-opt-in"],"sources":["https://docs.github.com/en/actions/reference/workflows-and-actions/variables"]},{"id":"DEV-8","revision":"6751fbbb220b","updated":"2026-10-27","name":"Give every command help with an example and a version flag","level":"Recommended","rule":"Every command answers `--help` with its purpose, its flags, one example and its exit codes, and exits 0. The tool answers `--version` with its version and build commit.","check":"A test runs `--help` on every command. Each exits 0 and its output contains `Example` and `Exit codes`. `--version` prints a version and a commit hash. `tool rm -- -draft.csv` treats `-draft.csv` as a file name.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/help-completion-and-updates/cli-help","related":["/playbook/engineering/build-test-and-deploy/version-every-release","/playbook/developer-tools/help-completion-and-updates/shell-completion"],"sources":["https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap12.html"]},{"id":"DEV-16","revision":"9ab2c5512c5e","updated":"2026-10-27","name":"Ship shell completion generated from the command definitions","level":"Recommended","rule":"Offer completion scripts for bash, zsh, fish and PowerShell through a command such as `example completion zsh`. Generate them from the same definitions that parse the flags.","check":"A test lists every command and flag from the parser and finds each one in the generated bash and zsh scripts. `bash -n` and `zsh -n` parse the scripts without error. `example completion fish` and `example completion powershell` exit 0 with a non-empty script.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/help-completion-and-updates/shell-completion","related":["/playbook/developer-tools/help-completion-and-updates/cli-help"],"sources":[]},{"id":"DEV-17","revision":"dc670c861715","updated":"2026-10-27","name":"Check for new versions at most once a day and never in scripts","level":"Recommended","rule":"Look for a newer version at most once per 24 hours and cache the answer. Skip the check when `CI` is set, when standard output or standard error is not a terminal, or when the opt-out variable is set. The check never delays or fails the command.","check":"A test runs a command three times within an hour against a fake release server, which gets 1 request. With `CI=true`, with output piped or with `EXAMPLE_NO_UPDATE_CHECK=1`, it gets 0 requests. With a release server that never answers, the command ends within 1 second of its usual time with its usual exit code. The notice never appears on standard output.","check_type":"http","url":"https://agentwranglers.se/playbook/developer-tools/help-completion-and-updates/version-check","related":["/playbook/developer-tools/configuration-and-telemetry/config-precedence","/playbook/developer-tools/command-line-behaviour/stdout-stderr","/playbook/desktop-apps/update-integrity/signed-updates"],"sources":[]},{"id":"DEV-9","revision":"a6be32b1d341","updated":"2026-10-27","name":"Declare the public API and hide the rest","level":"Recommended","rule":"State in code which modules, functions and types of a library are public. Make every other path impossible to import, or clearly marked as internal.","check":"A test in a separate consumer project imports an internal path of the built package and fails. In JavaScript the import throws `ERR_PACKAGE_PATH_NOT_EXPORTED`.","check_type":"manual","url":"https://agentwranglers.se/playbook/developer-tools/libraries-and-sdks/declare-public-api","related":["/playbook/developer-tools/libraries-and-sdks/semver-check"],"sources":["https://semver.org/"]},{"id":"DEV-10","revision":"3a6ecf7bf163","updated":"2026-10-27","name":"Check every release against the public API","level":"Recommended","rule":"In CI, compare the public API of each change with the last published release. Fail when a breaking change comes without a major version bump.","check":"A test change that removes a public function, with only a minor version bump, makes the CI job fail. A change that only adds a function passes.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/libraries-and-sdks/semver-check","related":["/playbook/engineering/build-test-and-deploy/atomic-deploys-with-rollback","/playbook/open-source/releases/release-provenance","/playbook/developer-tools/libraries-and-sdks/declare-public-api","/playbook/open-source/releases/trusted-publishing","/playbook/api-design/changes-over-time/api-changelog"],"sources":["https://semver.org/"]},{"id":"DEV-11","revision":"bf5fd6b84256","updated":"2026-10-27","name":"Deprecate in a minor release before removing in a major one","level":"Recommended","rule":"Publish a deprecation policy. Mark a feature deprecated in a minor release, with a warning at run time and in the docs. Remove it only in a later major release.","check":"Every feature removed in a major release appears as deprecated in the changelog of an earlier minor release. A test calls each deprecated function and asserts that it emits a deprecation warning.","check_type":"manual","url":"https://agentwranglers.se/playbook/developer-tools/libraries-and-sdks/deprecation-policy","related":["/playbook/api-design/changes-over-time/deprecation-headers","/playbook/documentation/reference-and-changelogs/changelog-deprecations-security","/playbook/documentation/keeping-docs-current/deprecation-labels","/playbook/testing/test-quality/deprecations-fail-tests"],"sources":["https://semver.org/#how-should-i-handle-deprecating-functionality"]},{"id":"DEV-12","revision":"c70289365c56","updated":"2026-10-27","name":"Publish a support matrix","level":"Recommended","rule":"Publish which runtime versions, platforms and major versions of the library get fixes, and test every supported runtime in CI. Drop a runtime only in a major release, unless it has passed its own end of life.","check":"A script compares the runtime versions in the published matrix with the CI test matrix and fails on any difference. No listed runtime is past its end-of-life date.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/libraries-and-sdks/support-matrix","related":["/playbook/engineering/major-upgrades/test-both-versions","/playbook/open-source/vulnerabilities-and-advisories/private-fix","/playbook/compliance/security-laws/cra-support-period","/playbook/stack/languages-and-runtimes/end-of-life-runtimes","/playbook/application-security/supply-chain/sbom-and-provenance"],"sources":["https://nodejs.org/en/about/previous-releases","https://devguide.python.org/versions/"]},{"id":"DEV-18","revision":"a813f1506c77","updated":"2026-10-27","name":"Publish a checksum and a signature with every download","level":"Required","risk":"takeover","rule":"For every release file people download, publish a SHA-256 checksum file and a signature over it, both made in CI. Install scripts and update commands verify both and stop on any mismatch.","check":"The latest release lists `SHA256SUMS` and its signature beside every file. A test downloads each file, and both the checksum and the signature verify against the expected CI identity. The install script, given a binary with one changed byte, exits non-zero and installs nothing.","check_type":"static","url":"https://agentwranglers.se/playbook/developer-tools/distribution/checksums-and-signatures","related":["/playbook/open-source/releases/verification-instructions","/playbook/open-source/releases/release-provenance","/playbook/engineering/ci-and-supply-chain/immutable-releases","/playbook/developer-tools/distribution/package-manager-checksums"],"sources":["https://csrc.nist.gov/pubs/sp/800/218/final","https://slsa.dev/spec/v1.2/"]},{"id":"DEV-19","revision":"1e0e06c40501","updated":"2026-10-27","name":"Pin the checksum in every package manager manifest","level":"Recommended","rule":"Generate each package manager manifest, such as a Homebrew formula or a winget manifest, in the release job. Each one names the download by its fixed release URL and its SHA-256.","check":"For the latest release, every manifest's hash equals the matching line in `SHA256SUMS`, and every URL contains the release tag. A test installs the tool in a clean container with each package manager, and `example --version` prints the release version.","check_type":"command","url":"https://agentwranglers.se/playbook/developer-tools/distribution/package-manager-checksums","related":["/playbook/developer-tools/distribution/checksums-and-signatures","/playbook/open-source/releases/trusted-publishing"],"sources":["https://learn.microsoft.com/en-us/windows/package-manager/package/manifest"]}]}