Skip to content

Add a simple AGENTS.md file - #16124

Open
srittau wants to merge 4 commits into
python:mainfrom
srittau:agents
Open

Add a simple AGENTS.md file#16124
srittau wants to merge 4 commits into
python:mainfrom
srittau:agents

Conversation

@srittau

@srittau srittau commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

We get more and more agent-generated PRs. This will hopefully help a bit with agent anti-patterns. Any improvements welcome.

@Akuli Akuli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a full review, just a few thoughts.

Comment thread AGENTS.md
To run all tests, run:

```bash
python3 -m venv .venv

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work on Windows, and also linux distros that only ship a python executable.

I don't know whether these commands are more automagical than what users expect their agents to do. For example, what happens if a user has already created a venv with a different name? Will the agent blindly create another one? Maybe someone who uses agents more than I do can comment on that.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's better to just describe what to do ("create a venv", "install requirements using ...", "run runtests") The agents should be able to figure out the correct command for their environment.

Comment thread AGENTS.md
- Follow the guidance from `CONTRIBUTING.md`.
- Run the tests as described above before submitting.
- Don't include tests for .pyi files, unless the situation is complex. See
`tests/REGRESSION.md`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this file, "See some_file" is prone to get outdated if documentation is refactored. Maybe it's better to leave them out? In my (somewhat little) experience, agents are quite good at finding the thing they are looking for.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too concerned about that. The structure hasn't changed that much, and personally I always run a simple search when renaming or moving files to find all occurrences. And I've seen agents miss other instruction files unless given concrete instructions to read them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants