Conversation
ValerianRey
left a comment
There was a problem hiding this comment.
Tbh I don't like that so much, because I think it's too exhaustive and thus too long. This will be injected in the context of every single question, so from what I read, it has to be short and apply to most of the requests to claude. I have also read somewhere that auto-generated agents.md generally have a negative effect on the quality of the agent.
I think that we should use hooks whenever it's possible, to avoid bloating agents.md with tokens. So everything that explains formatting, linting, type checking and so on, should almost just be a post-completion hook. I'm not sure how it works on open code, but it seems possible: https://dev.to/einarcesar/does-opencode-support-hooks-a-complete-guide-to-extensibility-k3p
| Run tests on CUDA (requires GPU): | ||
| ```bash | ||
| CUBLAS_WORKSPACE_CONFIG=:4096:8 PYTEST_TORCH_DEVICE=cuda:0 uv run pytest tests/unit | ||
| ``` |
There was a problem hiding this comment.
This will confuse the agent whenever it runs on an environment without gpu access.
| Run tests with coverage: | ||
| ```bash | ||
| uv run pytest tests/unit tests/doc --cov=src | ||
| ``` |
There was a problem hiding this comment.
Not really necessary for the agent to check code coverage every time. Also, it should already know how to use the --cov option from pytest.
| ### Linting and Type Checking | ||
|
|
||
| Run type checking: | ||
| ```bash | ||
| uv run ty check | ||
| ``` | ||
|
|
||
| Run linting: | ||
| ```bash | ||
| uv run ruff check | ||
| ``` | ||
|
|
||
| Run formatting: | ||
| ```bash | ||
| uv run ruff format | ||
| ``` | ||
|
|
||
| Run all checks together: | ||
| ```bash | ||
| uv run ty check && uv run ruff check && uv run ruff format | ||
| ``` |
There was a problem hiding this comment.
We should probably remove all of that and just add that as an agent post-completion hook. Whatever agent provider we use in the future should also support hooks IMO.
| From the `docs` folder: | ||
| ```bash | ||
| uv run make html | ||
| ``` | ||
|
|
||
| Clean build: | ||
| ```bash | ||
| uv run make clean | ||
| ``` |
There was a problem hiding this comment.
We should merge those two to gain tokens.
|
|
||
| - Only generate docstrings for public functions or functions with more than 4 lines of code | ||
| - Use Sphinx style (`:param my_param: Does something`) - never use `:returns:` key | ||
| - Include usage examples in docstrings for public classes |
There was a problem hiding this comment.
I'm not sure we want agents to do the usage examples themselves.
| ### Deprecation | ||
|
|
||
| - Raise `DeprecationWarning` for deprecated public functionality | ||
| - Add test in `tests/unit/test_deprecations.py` to verify warning |
There was a problem hiding this comment.
This is extremely niche IMO. This information is mostly directed to maintainers.
| - Follow SOLID principles | ||
| - Keep code simple and readable | ||
| - Prefer explicit over implicit | ||
| - Add type hints to all public interfaces |
There was a problem hiding this comment.
Already said somewhere.
| - Keep code simple and readable | ||
| - Prefer explicit over implicit | ||
| - Add type hints to all public interfaces | ||
| - Document complex algorithms with comments |
There was a problem hiding this comment.
LLMs tend to already overuse comments, so I don't think that's needed.
| - Prefer explicit over implicit | ||
| - Add type hints to all public interfaces | ||
| - Document complex algorithms with comments | ||
| - Run all checks before submitting: `uv run ty check && uv run ruff check && uv run ruff format` |
| ### Adding New Aggregators | ||
|
|
||
| - Subclass `Aggregator` or `Weighting` base classes | ||
| - Aggregators must be **immutable** (no stateful changes) | ||
| - Implement the mathematical mapping as documented | ||
| - Add corresponding weighting if applicable | ||
| - Update `__init__.py` to export the new class |
There was a problem hiding this comment.
That's directed to individual contributors. I don't think this is worth the tokens in agents.md.
Suggested by OpenCode. @ValerianRey Would be nice to test with this.