Skip to content

docs: document the Nix dev shell and lint rule gotchas for agents - #886

Merged
psteinroe merged 1 commit into
mainfrom
docs/agents-dev-environment
Oct 22, 2026
Merged

psteinroe merged 1 commit into
mainfrom
docs/agents-dev-environment

Conversation

@psteinroe

Copy link
Copy Markdown
Collaborator

Makes the repo easier for coding agents to work with, based on the friction from porting the Squawk rules in #885.

AGENTS.md

  • Running commands as an agent: builds fail with Unable to find libclang outside the Nix shell, and in a non-interactive shell nix develop alone just opens a subshell. The new section shows how to wrap commands with nix develop -c ..., warns that the first run takes minutes, says to run bun install before just format/just gen-lint (otherwise oxfmt is missing and the generated TS stays unformatted), and notes that sqlx::test tests need the docker database.
  • Lint rules: scaffolding several rules without running the whole of gen-lint for each one, version: "next", how spec expectations are counted, the one-diagnostic rule for doc examples, the Postgres 17 libpg_query bindings, identifiers truncated to 63 bytes in the AST, ctx.stmt().iter() for nested nodes, and how to dump an AST.
  • Snapshot testing: INSTA_UPDATE=always to accept snapshots without the interactive review.

CONTRIBUTING.md

The spec example still used -- expect_lint/<group>/<ruleName>, which no longer matches since the flat rule ids (#815). It now uses -- expect_lint/<ruleName> and explains that only the number of diagnostics per rule is checked.

AGENTS.md now explains how to run builds and codegen through
`nix develop -c` in a non-interactive shell, that `just format` needs
`bun install` first, and a few things that are easy to miss when writing
lint rules. CONTRIBUTING.md still showed the spec expectation syntax from
before the flat rule ids.
@psteinroe
psteinroe merged commit 26b6bde into main Oct 22, 2026
11 checks passed
@psteinroe
psteinroe deleted the docs/agents-dev-environment branch October 22, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant