]> git.giacomolli.uk - onehouse/blob - .agents/skills/check/SKILL.md
Build typed MQTT publications
[onehouse] / .agents / skills / check / SKILL.md
1 ---
2 name: check
3 description: Format, lint, test, and build. Use before every commit.
4 ---
5
6 # Check
7
8 Run every command in the Nix development shell. Use
9 `nix develop -c COMMAND` when direnv does not load the shell.
10
11 ## Procedure
12
13 1. Format all files with `bin/format`.
14 2. Run the checks with `bin/check`. Its golangci-lint config keeps the
15 standard linters and adds more linters, such as `errorlint`,
16 `gocritic`, `testifylint`, `revive`, `wrapcheck`, `nlreturn`, and
17 `wsl_v5`. The settings in `.golangci.yml` match the Go rules.
18 3. Run `git add` on new files, then run `nix build` and
19 `nix flake check`. The package is Linux-only, so run both on Linux
20 before a change to Go or Nix code is complete.
21 4. Fix every failure and run the steps again. Do not disable a linter or
22 add a `nolint` directive to get a pass, unless the user agrees.
23 5. Review the final diff against the rules. Passing tools do not replace
24 this review.
25 - Read `AGENTS.md` and the `SKILL.md` of each skill of the task again
26 from disk now. Do not work from memory of an earlier read.
27 - Go through the diff one rule at a time, and for each rule look at
28 every changed line that it covers. For Go code, check each section
29 of `go-code`, also for the tests.
30 - Fix each finding, then run steps 1 to 4 again.
31
32 Tell the user about each check that cannot run and each failure that
33 stays.