Add AGENTS.md template#476
Conversation
pjbull
left a comment
There was a problem hiding this comment.
Great place to start! A few small comments.
jdcc
left a comment
There was a problem hiding this comment.
A couple small things, but I don't feel like I know enough to weigh in otherwise. Do we want to flag to folks setting up a project that they can/should fill in project-specific context in here?
There was a problem hiding this comment.
Pull request overview
Adds an AGENTS.md file to the generated Cookiecutter project and documents it, with tests to validate the rendered content across configuration combinations.
Changes:
- Add
{{ cookiecutter.repo_name }}/AGENTS.mdtemplate describing agent-oriented project conventions and workflow. - Extend generation tests to expect
AGENTS.mdand validate key conditional sections render correctly. - Update user-facing docs/README directory-structure listings and add guidance on editing
AGENTS.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_creation.py |
Adds verify_agents_md and includes AGENTS.md in expected generated files. |
README.md |
Documents AGENTS.md in the example project directory tree. |
docs/docs/using-the-template.md |
Adds a section explaining how/why to update AGENTS.md. |
docs/docs/index.md |
Documents AGENTS.md in the directory tree (contains a typo to fix). |
{{ cookiecutter.repo_name }}/README.md |
Documents AGENTS.md in the generated project’s directory tree. |
{{ cookiecutter.repo_name }}/AGENTS.md |
New template file containing agent instructions with conditional sections. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def verify_agents_md(root, config): | ||
| """Test that AGENTS.md is correctly rendered for the given config.""" | ||
| agents_md = (root / "AGENTS.md").read_text() | ||
|
|
There was a problem hiding this comment.
AGENTS.md includes non-ASCII characters (e.g., the arrow and em dashes in the new template). Reading it via Path.read_text() without an explicit encoding makes this test locale-dependent and can fail/garble under non-UTF-8 locales. Use read_text(encoding='utf-8') here (and consider doing the same in no_curlies, which also reads files without specifying encoding).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Closes #474
This PR adds an AGENTS.md file that concisely encodes desired agent interaction with the codebase. We incorporate the opinions from the opinions page and dynamically add sections based on the user's selected tooling.