chore: rework agent rules and skills to use standard .agents directory
This commit is contained in:
parent
466e4de872
commit
ea05ea9367
6 changed files with 123 additions and 0 deletions
24
.agents/skills/lint/SKILL.md
Normal file
24
.agents/skills/lint/SKILL.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
name: Lint and Format Code
|
||||
description: Instructions for checking code style and formatting using Ruff.
|
||||
---
|
||||
|
||||
# Skill: Lint and Format Code
|
||||
|
||||
The goal of this skill is to enforce the project's adherence to the Google style standard and to maintain high code quality across the python source files.
|
||||
|
||||
## Instructions
|
||||
|
||||
1. **Format Code**: To automatically format all Python files according to the `ruff.toml` specifications:
|
||||
```bash
|
||||
uv run ruff format .
|
||||
```
|
||||
|
||||
2. **Check for Lints / Auto-fix**: To check the repository for style violations and automatically fix safe corrections:
|
||||
```bash
|
||||
uv run ruff check --fix .
|
||||
```
|
||||
|
||||
## Important Considerations
|
||||
- The `ruff.toml` file at the root handles all lint and format configuration. Do not ignore configurations when applying fixes.
|
||||
- If Ruff points out complex errors that cannot be auto-fixed, analyze the code and manually address the violations, prioritizing descriptive naming and adherence to the single-responsibility principle.
|
||||
25
.agents/skills/test/SKILL.md
Normal file
25
.agents/skills/test/SKILL.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
name: Run Tests
|
||||
description: Instructions for executing the project test suite to verify code correctness.
|
||||
---
|
||||
|
||||
# Skill: Run Tests
|
||||
|
||||
The goal of this skill is to verify that the project is functioning correctly after development changes.
|
||||
|
||||
## Instructions
|
||||
|
||||
1. **Verify Environment**: The project operates dynamically with hardware acceleration (GPU via JAX) and uses `uv` for dependency/execution management.
|
||||
2. **Execute Tests**:
|
||||
- To run basic verification (e.g., checking JAX initialization and hardware detection), run the test script:
|
||||
```bash
|
||||
uv run python -m tests.test_jax_init
|
||||
```
|
||||
- If a broader suite of modular tests is added (e.g., `pytest`), execute tests in the `tests/` directory with:
|
||||
```bash
|
||||
uv run pytest tests/
|
||||
```
|
||||
|
||||
## Important Considerations
|
||||
- If you are running tests inside the local environment without a Devcontainer, verify whether `uv sync --frozen` (for CPU) or `uv sync --frozen --extra cuda` (for GPU) has been executed to avoid import errors.
|
||||
- Do not run bare `python ...` without `uv run` locally, unless you are strictly operating inside a pre-activated `.venv` inside a Devcontainer.
|
||||
Reference in a new issue