You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+13-15Lines changed: 13 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,26 +38,22 @@ This document provides comprehensive guidelines for AI coding agents contributin
38
38
39
39
This project uses the following tools to maintain consistent code quality:
40
40
41
-
-**Black**: Automatic code formatter with a 100-character line length (configured in `pyproject.toml`)
42
-
-**isort**: Import statement organizer with Black-compatible profile
43
-
-**flake8**: Style guide enforcement (configured in `pyproject.toml` to ignore `E501` and `W503`)
41
+
-**ruff**: Automatic code formatter with options configured in `pyproject.toml`
44
42
45
43
### Formatting Workflow
46
44
47
45
Before committing code changes:
48
46
49
47
```bash
50
-
./.venv/bin/black <file_or_directory>
51
-
./.venv/bin/isort <file_or_directory>
52
-
./.venv/bin/flake8 <file_or_directory>
48
+
./.venv/bin/ruff check --fix <file_or_directory>
49
+
./.venv/bin/ruff format <file_or_directory>
53
50
```
54
51
55
52
Alternatively, format the entire project:
56
53
57
54
```bash
58
-
./.venv/bin/black app/ tests/
59
-
./.venv/bin/isort app/ tests/
60
-
./.venv/bin/flake8 app/ tests/
55
+
./.venv/bin/ruff check --fix app/ tests/
56
+
./.venv/bin/ruff format app/ tests/
61
57
```
62
58
63
59
---
@@ -68,6 +64,7 @@ Alternatively, format the entire project:
68
64
69
65
-**Mandatory typing**: Add type annotations to all function signatures, method signatures, and class attributes.
70
66
-**Return types**: Always specify return types, including `None` when applicable.
67
+
-**Minimize `Any`**: Do not just use `Any` for typing to make the error go away. Use appropriate type annotations and only use `Any` when applicable (ex. if there are > 3 different return types possible).
71
68
-**Forward references**: Use `from __future__ import annotations` to defer evaluation of type annotations, allowing forward references without string literals.
72
69
-**Python 3.11+ type hints**: Use built-in generic types instead of typing module equivalents (e.g., `dict[str, Any]` instead of `Dict[str, Any]`, `list[str]` instead of `List[str]`).
73
70
@@ -179,7 +176,9 @@ except json.JSONDecodeError as e:
179
176
180
177
### Logging Practices
181
178
182
-
-**Use loguru**: The project uses `loguru` for logging. Import it as `from loguru import logger`.
179
+
-**Use loguru**:
180
+
- The project uses `loguru` for logging. Import it as `from loguru import logger`.
181
+
- Use f-string format for logging strings.
183
182
-**Appropriate log levels**:
184
183
-`logger.debug()`: Detailed diagnostic information
185
184
-`logger.info()`: General informational messages (startup, shutdown, major operations)
@@ -209,7 +208,7 @@ except ModelLoadError as e:
209
208
210
209
-**Explicit user request required**: Only create new branches or open pull requests when the user explicitly asks for it **or** when the user includes the hashtag `#github-pull-request-agent` in their request.
211
210
-**Asynchronous agent handoff**: The `#github-pull-request-agent` hashtag signals that the task should be handed off to the asynchronous GitHub Copilot coding agent after all planning, analysis, and preparation are complete.
212
-
-**Default behavior**: By default, work directly on the current branch and commit changes locally without creating PRs.
211
+
-**No staging or committing without permission**: Agents must **not** stage (`git add`) or commit changes unless the user explicitly requests it. Only make code changes to files - leave git operations to the user.
213
212
214
213
### Commit Messages
215
214
@@ -271,7 +270,7 @@ When an agent cannot or chooses not to follow one or more guidelines in this doc
271
270
**Example disclosure:**
272
271
273
272
> **⚠️ Deviation Notice:**
274
-
> The code was not formatted with Black/isort because the dev dependencies are not installed in the current environment. Run `./.venv/bin/pip install -e '.[dev]'` to enable linting/formatting tools.
273
+
> The code was not formatted with ruff because the dev dependencies are not installed in the current environment. Run `./.venv/bin/pip install -e '.[dev]'` to enable linting/formatting tools.
275
274
276
275
### Communication Principles
277
276
@@ -309,10 +308,9 @@ When an agent cannot or chooses not to follow one or more guidelines in this doc
309
308
Before finalizing any code contribution, verify:
310
309
311
310
- ✅ Virtual environment (`./.venv`) is used for all operations
312
-
- ✅ Code is formatted with Black and isort
313
-
- ✅ Code passes flake8 linting
311
+
- ✅ Code passes ruff linting and formatting
314
312
- ✅ Type annotations are present on all functions/methods
315
-
- ✅ Docstrings follow PEP 257 conventions
313
+
- ✅ Docstrings follow NumPy style conventions
316
314
- ✅ Specific exceptions are caught (not bare `Exception`)
0 commit comments