Skip to content

Commit c9ce023

Browse files
harrismcursoragent
andauthored
Add AGENTS.md for AI agent guidance (#455)
## Summary - Adds a new `AGENTS.md` file to the repository root providing persistent instructions for AI coding agents (Cursor, Copilot, Codex, etc.) - Covers git commit conventions (DCO sign-off, SSH signing), Python code style (black with project-specific flags), C++ code style (clang-format 18), license headers (Apache-2.0 SPDX), whitespace rules, testing, and PR/issue workflows - All instructions are derived from existing CI configuration (`.github/workflows/codestyle.yml`) and project conventions (`CONTRIBUTING.md`, `pyproject.toml`) Fixes #453 ## Test plan - [x] Verify `AGENTS.md` renders correctly on GitHub - [x] Confirm black flags match `.github/workflows/codestyle.yml` (`--target-version=py311 --line-length=120 --extend-exclude='wip/'`) - [x] Confirm clang-format version and extensions match CI config (v18, `h,cpp,cc,cu,cuh`) - [x] Confirm pytest command aligns with `pyproject.toml` `[tool.pytest.ini_options]` - [x] Confirm SPDX header examples match existing source files --------- Signed-off-by: Mark Harris <mharris@nvidia.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 9b0b69d commit c9ce023

1 file changed

Lines changed: 93 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# AGENTS.md — AI Agent Guidelines for fVDB
2+
3+
This file provides persistent instructions for AI coding agents (Cursor, Copilot,
4+
Codex, etc.) working on this codebase. Human contributors should also refer to
5+
[CONTRIBUTING.md](CONTRIBUTING.md).
6+
7+
## Git Commits
8+
9+
- All commits **must** include a DCO sign-off (`git commit --signoff` / `-s`).
10+
- All commits **must** be SSH-signed (`git commit --gpg-sign` / `-S`).
11+
- **Never** skip hooks or signing: do not use `--no-verify` or `--no-gpg-sign`.
12+
13+
## General Style
14+
15+
- Avoid excessive use of emoji and non-ascii characters in code and documentation except
16+
where it is helpful to user experience or user interfaces.
17+
18+
## Python Code Style
19+
20+
- Format Python code with **black** using the exact flags from CI:
21+
22+
```
23+
black --target-version=py311 --line-length=120 --extend-exclude='wip/' .
24+
```
25+
26+
- **Do not** run `black` with default settings — the default line-length (88) does
27+
not match this project's setting (120).
28+
- There is currently no `[tool.black]` section in `pyproject.toml`; a future PR may
29+
add one so that plain `black .` picks up the correct settings automatically.
30+
31+
## C++ Code Style
32+
33+
- Format C++ source files under `src/` with **clang-format 18** using the
34+
repository's `.clang-format` style file:
35+
36+
```
37+
clang-format -i --style=file src/**/*.{h,cpp,cc,cu,cuh}
38+
```
39+
40+
- Applicable extensions: `.h`, `.cpp`, `.cc`, `.cu`, `.cuh`.
41+
42+
## License Headers
43+
44+
Every source file **must** include the Apache-2.0 SPDX identifier.
45+
46+
Python files:
47+
48+
```python
49+
# Copyright Contributors to the OpenVDB Project
50+
# SPDX-License-Identifier: Apache-2.0
51+
```
52+
53+
C++ files:
54+
55+
```cpp
56+
// Copyright Contributors to the OpenVDB Project
57+
// SPDX-License-Identifier: Apache-2.0
58+
```
59+
60+
## Whitespace
61+
62+
- No trailing whitespace (CI enforces this; `.wlt` files and `wip/` are excluded).
63+
- Use spaces, not tabs (binary and a few config files are excluded from this check).
64+
65+
## Testing
66+
67+
- Run relevant tests before pushing:
68+
69+
```
70+
python -m pytest tests/ -v
71+
```
72+
73+
- The `wip/` directory is excluded from test collection (see `norecursedirs` in
74+
`pyproject.toml`).
75+
76+
## Opening Issues
77+
78+
- Set appropriate labels (e.g. `bug`, `enhancement`, `documentation`).
79+
- Reference any related issues or PRs.
80+
- For bugs: provide clear reproduction steps, expected vs actual behavior, and
81+
environment details.
82+
83+
## Opening Pull Requests
84+
85+
- Reference the issue being fixed (e.g. "Fixes #NNN").
86+
- Include a test plan with specific commands to verify the change.
87+
- Ensure all CI checks pass before requesting review (DCO, codestyle, tests).
88+
- Keep PRs focused on a single concern.
89+
90+
**Do not commit unless directed:**
91+
- `.vscode/settings.json` - local IDE settings
92+
- `.cursor/` - local Cursor config
93+
- Test-specific matrices or configs with hardcoded paths

0 commit comments

Comments
 (0)