Files
neoirc/AGENTS.md
T
clawbot bb7bcb31ea
check / check (push) Waiting to run
Re-vendor the canonical files from sneak/prompts at dd4027b (closes #112)
The shared files are fetched from sneak/prompts dd4027b, with this
repository's own entries after the shared content in .gitignore,
.editorconfig and .dockerignore.

Lint and tests are Dockerfile phases (golangci-lint v2.14.0, Debian Go
1.24.13) that the build stage depends on, and the Makefile targets call
the script/ entrypoints. make fmt also formats Markdown with prettier.

Fixes for the new lint findings: the auth cookie is always Secure, an
IRC connection's relay goroutine stops when the connection closes, and
repeated strings are constants. neoirc-cli treats a plain-HTTP server on
localhost or a loopback address as secure, so local use keeps its session.

Whether the 60-second test cap covers building the test phase is open
on sneak/prompts issue 113.

Model: opus-5-5
2026-10-06 21:01:46 +02:00

2.0 KiB

AGENTS.md — Rules for AI Agents

Before Every Commit

  1. Format: make fmt
  2. Check: make check — the tests and the linter, which run in Docker, and the format check: all passing, zero issues

Never run go test, golangci-lint or gofmt directly; use the make targets.

No commit lands on main with lint errors, test failures, or formatting issues.

Code Style

  • Follow CONVENTIONS.md exactly — it defines the architecture
  • All exported types, functions, methods, and vars must have doc comments
  • All packages must have a package doc comment
  • JSON tags use camelCase (not snake_case)
  • No magic numbers — use named constants
  • No inline error handling (if err := ...; err != nil) — use plain assignment
  • Blank line before every return statement
  • Blank line separating embedded fields from regular fields in structs
  • Blank imports must have a justification comment

Git Workflow

  • Never commit directly to main — all changes go on feature branches
  • Merge to main only when ready and passing all checks
  • PR titles: Description (closes #N) when closing an issue
  • One logical change per commit
  • Commit messages: imperative mood, concise

Architecture

  • Dependency injection via Uber fx — all components are fx providers
  • internal/ for all application packages — one package per concern
  • Handlers return http.HandlerFunc using the closure pattern
  • Request/response structs defined inside handler closures
  • Models embed models.Base for database access to relation methods
  • Database migrations in internal/db/schema/ — embedded via go:embed
  • SQLite by default (pure Go driver: modernc.org/sqlite)

Testing

  • Table-driven tests preferred
  • Use testing.T helpers, not assertion libraries
  • Test files live next to the code they test
  • _test.go suffix, same package for white-box testing

Dependencies

  • Required libraries are listed in CONVENTIONS.md §1
  • No new dependencies without justification
  • Pure Go preferred (no CGO)