mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-28 08:36:17 +08:00
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:
2 files changed
+30
No files matched your search
@@ -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.
|
||||
Reference in new issue
Block a user