Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 11, 2025

Summary

This PR adds support for both AGENTS.md (standard) and AGENT.md (singular) files to improve user experience and reduce confusion.

Problem

Users were creating AGENT.md files expecting them to work, but the system only recognized AGENTS.md (plural) according to the Agent Rules standard at https://agent-rules.org/.

Solution

  • Modified loadAgentRulesFile() to check for both filenames
  • AGENTS.md is checked first to maintain backward compatibility with the official standard
  • Falls back to AGENT.md if AGENTS.md is not found
  • Added AGENT.md to the list of protected files
  • Added comprehensive test coverage for both scenarios

Testing

  • ✅ All existing tests pass
  • ✅ Added new tests to verify AGENT.md support
  • ✅ Added tests to verify AGENTS.md is preferred when both exist
  • ✅ Linting and type checks pass

Compatibility

This change is fully backward compatible. Existing projects using AGENTS.md will continue to work exactly as before.

Fixes #6912


Important

Add support for AGENT.md alongside AGENTS.md, preferring the latter, and update protection rules accordingly.

  • Behavior:
    • loadAgentRulesFile() in custom-instructions.ts now checks for both AGENTS.md and AGENT.md, preferring AGENTS.md for backward compatibility.
    • AGENT.md added to protected files in RooProtectedController.
  • Testing:
    • Added tests in custom-instructions.spec.ts to verify AGENT.md support and preference for AGENTS.md.
    • Updated RooProtectedController.spec.ts to include AGENT.md in protection tests.
  • Misc:
    • AGENT.md added to PROTECTED_PATTERNS in RooProtectedController.

This description was created by Ellipsis for b27a3b2. You can customize this summary. It will automatically update as commits are pushed.

- Modified loadAgentRulesFile to check for both AGENTS.md and AGENT.md
- AGENTS.md (standard) is checked first for backward compatibility
- Falls back to AGENT.md if AGENTS.md is not found
- Added AGENT.md to protected files list
- Added comprehensive tests for both filenames

Fixes #6912
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 11, 2025 02:10
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Aug 11, 2025
@Brendan-Z
Copy link
Contributor

https://agent-rules.org/
https://ampcode.com/AGENT.md

Different agents are using different configuration files, would be good to be backwards compatible.

Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

I reviewed my own code and found it surprisingly coherent. Must be a bug in the review system.

@roomote roomote bot mentioned this pull request Aug 11, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 11, 2025
Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

LGTM

Context https://xkcd.com/927/

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 13, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Aug 13, 2025
Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

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

Fun times 🙃

@mrubens mrubens merged commit 8bd8f5d into main Aug 13, 2025
25 checks passed
@mrubens mrubens deleted the feature/support-agent-md-singular branch August 13, 2025 01:21
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 13, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Rename AGENTS.md --> AGENT.md

6 participants