From b7aeda6e7f77b2d4359a590d3463d0309871d488 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 2 Aug 2026 20:29:08 +0000 Subject: [PATCH] docs: sync `AGENTS.md` with gitea/gitea (#1134) Carries over the applicable rules from https://gitea.com/gitea/gitea `AGENTS.md`, including the Conventional Commits and `make lint-go-windows` requirements this repo already enforces but never documented for agents. Swaps `Co-Authored-By` for the `Assisted-by` trailer. Reviewed-on: https://gitea.com/gitea/runner/pulls/1134 Reviewed-by: Lunny Xiao Co-authored-by: silverwind --- AGENTS.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 97d1e0c0..f3b7a99a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,10 +1,18 @@ +- Never assume, verify before claiming - Use `make help` to find available development targets -- Run `make fmt` to format `.go` files, and run `make lint-go` to lint them -- Run `make tidy` after any `go.mod` changes -- Run single go unit tests with `go test -run '^TestName$' ./modulepath/` +- PR descriptions: minimal, only what and why, no task lists or file listings +- Reference issues and PRs by full URL, not by number +- Use Conventional Commits for commit messages and PR titles, plus the `enhance` type for user-facing enhancements +- Add an `Assisted-by: AGENT_NAME:MODEL_VERSION` trailer to commit messages, never `Co-Authored-By` or `Signed-off-by` +- Attribute agent authorship on one trailing line in issue and pull request comments, never as a PR description section +- Never force-push, amend, or squash unless asked. Use new commits and normal push for pull request updates +- Comments: write almost none, short and preferably same-line, explaining why for a future reader. Never narrate code, the change or the prompt. Preserve existing ones that still apply - Add the current year into the copyright header of new `.go` files - Ensure no trailing whitespace in edited files -- Never force-push, amend, or squash unless asked. Use new commits and normal push for pull request updates -- Preserve existing code comments, do not remove or rewrite comments that are still relevant -- Include authorship attribution in issue and pull request comments -- Add `Co-Authored-By` lines to all commits, indicating name and model used +- Run `make fmt` after `.go` edits, `make tidy` after `go.mod` edits, and `make checks` for the non-lint source checks +- Lint what changed with `make lint-go`, and `make lint-go-windows` for Windows and platform-split files +- Fix the cause rather than disabling a linter or weakening a test. Where unavoidable, use the narrowest scope with a trailing comment giving the reason +- Run single go tests with `go test -run '^TestName$' ./modulepath/`. `make test` self-skips the integration tests without docker or network, `make test-dind` runs the daemon-facing tests against the built dind image +- Write the fewest, fastest tests covering the behavior, extending an existing one where possible. Prefer unit tests where logic is testable in isolation +- Wait on a deterministic condition rather than `sleep` +- Update the files under `docs/` when behavior documented there changes