From b529adc306cb9973c7ea5ea2bcdbbb9e06b1202c Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Tue, 1 Dec 2026 09:20:04 +0100 Subject: [PATCH] docs: say how changes and automated tools are expected to work here Nothing told contributors what a change to the output has to say, or how to work with automated tools. AGENTS.md and CONTRIBUTING.md now say that a person approves every push and comment and that backend changes are agreed in librespeed/speedtest first. --- AGENTS.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 17 +++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 AGENTS.md create mode 100644 CONTRIBUTING.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..ac7193f --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,49 @@ +# AGENTS.md + +For coding agents and other automated tools, and for the people who run them. +The same rules apply to changes written by hand. + +## What this project is + +`librespeed-cli` is the command line client for LibreSpeed servers. Scripts +and other programs read its output, and +[librespeed/speedtest-cli-rust](https://github.com/librespeed/speedtest-cli-rust) +is a port that follows it. + +- Options, exit codes, messages and the JSON and CSV formats are a contract. A + pull request that changes them says so in its description, with what a user + sees before and after. +- A change that needs something new from the backend, such as a new field in an + answer, is agreed and merged in + [librespeed/speedtest](https://github.com/librespeed/speedtest) first. +- Text from a server or a server list is untrusted. New code passes it + through `output.Sanitize` before it prints it. + +## Before you open or update a pull request + +```sh +gofmt -l . +go vet ./... +go test ./... +``` + +`gofmt -l .` prints nothing when the code is formatted. A fix comes with a +test that fails without it. + +## Pull requests and comments + +- A person reads and approves every push and every comment before it goes out, + and can explain every line of the change. +- A pull request does one thing. Its description says what changes for a user, + such as a new CSV column, JSON key or message. +- Push when the change is ready, not after each finding. Do not ask an + automated reviewer for a new review after every push, and do not change code + only because one asked. A person decides first whether the finding is right. +- Comment to answer a maintainer or to explain a decision. Post no status + updates, no repeated summaries of test runs and no mentions of yourself. The + description and the commits are the record. +- Do not open the same change in several repositories at once. Start where it + has to land first and wait for it to merge. + +Maintainers may close or lock a pull request or an issue that does not follow +this. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..2bfecee --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,17 @@ +# Contributing + +Bug reports and pull requests are welcome. + +- The output of this client is read by scripts and followed by the Rust port. + Say in the pull request what changes for a user. +- A change that needs something new from the backend is agreed in + [librespeed/speedtest](https://github.com/librespeed/speedtest) first. +- Run `gofmt -l .`, `go vet ./...` and `go test ./...` before you push. +- You may use an AI tool to write code or text. You are still the author: read + and approve everything before it is pushed or posted, and be ready to + explain it. +- Keep the discussion short. Comment when there is something to say, and post + no status updates. + +[AGENTS.md](AGENTS.md) has the full rules, for tools and for the people who +run them.