Skip to content

Commit 98c9a5a

Browse files
committed
PYTHON-5768 mv .github/copilot-instructions.md AGENTS.md
1 parent ab44a21 commit 98c9a5a

2 files changed

Lines changed: 31 additions & 44 deletions

File tree

.github/copilot-instructions.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

AGENTS.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# PyMongo Development Guide for AI Agents
2+
3+
This file provides instructions for AI coding assistants (Claude Code, GitHub Copilot, Codex, etc.) working in this repository.
4+
5+
## PyMongo-specific Rules
6+
7+
- **Do not edit files in `pymongo/synchronous/` or `test/` files that have a counterpart in `test/asynchronous/`** unless the change includes a `_IS_SYNC` statement. These files are auto-generated from `pymongo/asynchronous/` and `test/asynchronous/` by `tools/synchro.py`. Edit the async source and run `python tools/synchro.py` to regenerate.
8+
- All asynchronous functions must not call any blocking I/O.
9+
- All public classes, modules, and methods must have documentation in Sphinx format.
10+
11+
## Security
12+
13+
- Never introduce hardcoded secrets, API keys, or credentials.
14+
- Avoid method call injection, dynamic code execution, symbol injection, or other code injection vulnerabilities.
15+
16+
## Performance
17+
18+
- Avoid inefficient loops and algorithmic issues.
19+
- Ensure resources are properly cleaned up (connections, cursors, sessions).
20+
21+
## Code Quality
22+
23+
- Methods should be focused and appropriately sized; split methods that do too much.
24+
- Use clear, descriptive naming conventions.
25+
- Avoid encapsulation violations and ensure proper separation of concerns.
26+
27+
## Testing
28+
29+
- Unit tests live in `test/`; async equivalents live in `test/asynchronous/`.
30+
- Run `python tools/synchro.py` after editing async test files to keep sync counterparts up to date.
31+
- Do not add tests to `test/synchronous/` directly.

0 commit comments

Comments
 (0)