docs(agents): Consolidate critical instructions into main AGENTS.md#106515
docs(agents): Consolidate critical instructions into main AGENTS.md#106515
Conversation
…ENTS.md Critical command execution instructions were scattered across subdirectory AGENTS.md files, leading to AI agents making common mistakes like: - Running pytest without activating virtualenv - Missing required pytest flags (-svv --reuse-db) - Forgetting CI=true flag for frontend tests - Not using proper pre-commit commands This consolidation ensures agents always see these critical instructions since the main AGENTS.md is always loaded, regardless of which file is being edited. Changes: - Added "Command Execution Guide" section to main AGENTS.md with: * Python virtualenv requirements for AI agents vs humans * Backend commands (setup, linting, testing, database) * Frontend commands (dev, typechecking, linting, testing) - Removed duplicate command sections from src/AGENTS.md, tests/AGENTS.md, and static/AGENTS.md - Updated all references to point to the consolidated guide - Subdirectory files now focus on domain-specific patterns only Benefits: - Single source of truth for command execution - Prevents common command execution errors - Always visible to AI agents - Better separation: commands in main file, patterns in domain files
| devenv sync | ||
|
|
||
| # Activate the Python virtual environment (required for running tests and Python commands) | ||
| direnv allow |
There was a problem hiding this comment.
so this still instructs the agent to run direnv allow, but i don't think direnv works within cursor properly. Further down there's a bare pytest. can we get rid of this and use uv run pytest further down?
There was a problem hiding this comment.
Right! Let me get rid of it.
Do we install uv by default?
There was a problem hiding this comment.
uv is used to manage python deps, so yeah
There was a problem hiding this comment.
I have removed the note about the commands for humans but I would like to leave switching to uv outside of this PR.
Please propose it in #discuss-backend
There was a problem hiding this comment.
I may have figured out switching to uv locally. I will open a different PR for it.
There was a problem hiding this comment.
Also direnv allow is a command that is run once when setting up the repo and should be run by a human (as it has security implications) so IMO doesn't really belong in agents.md
Critical command execution instructions were scattered across subdirectory AGENTS.md files, leading to AI agents making common mistakes like:
pytestwithout activating virtualenvEven though #105426 helped, if you are not viewing a file that matches and load the sub-directory AGENTS.md, you will not benefit from that change.
This consolidation ensures agents always see these critical instructions since the main AGENTS.md is always loaded, regardless of which file is being edited.
Changes:
src/AGENTS.md,tests/AGENTS.md, andstatic/AGENTS.mdBenefits: