add AGENTS.md and CLAUDE.md

Cross-vendor agent doc with the project-specific bits not derivable
from README or code: test filter env vars, the leak-detection test
invariant, the exact zig fmt CI command, and a pointer to mirror
neighboring file conventions for @import alias case and struct-init
inference. CLAUDE.md is a one-line @AGENTS.md import shim for Claude
Code, which doesn't read AGENTS.md natively.
This commit is contained in:
Navid EMAD committed 2026-05-08 09:50:09 +02:00
1 parent 6e9156a86f
commit 1bc0ca6b8f
2 files changed
+30

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
# AGENTS.md
## Tests
```bash
make test # Run all tests
make test F="server" # Filter by substring
TEST_FILTER="WebApi: #selector_all" make test # Filter main + subtest (separator: #)
TEST_VERBOSE=true make test
TEST_FAIL_FIRST=true make test
METRICS=true make test # Capture allocation/duration metrics as JSON
```
The custom test runner (`src/test_runner.zig`) detects memory leaks in debug builds. **A test that allocates without freeing fails** — not just lints.
## Formatting
```bash
zig fmt --check ./*.zig ./**/*.zig # Exact command CI runs
```
`zig build` depends on the fmt step, so a local build catches drift too.
## Conventions
Mirror the patterns in neighboring files. In particular:
- `@import` alias case follows the imported file's basename (`const Frame = @import("Frame.zig")`, `const ast = @import("ast.zig")`).
- Prefer struct-init type inference (`.{ ... }`) where the expected type is known from the function signature or variable annotation.
+1
View File
@@ -0,0 +1 @@
@AGENTS.md