Skip to content

docs: add AGENTS.md for AI-assisted contributions#1276

Open
turanalmammadov wants to merge 1 commit intoopen-policy-agent:masterfrom
turanalmammadov:docs/add-agents-md
Open

docs: add AGENTS.md for AI-assisted contributions#1276
turanalmammadov wants to merge 1 commit intoopen-policy-agent:masterfrom
turanalmammadov:docs/add-agents-md

Conversation

@turanalmammadov
Copy link
Copy Markdown

Closes #1234

Summary

Adds AGENTS.md as requested in the linked issue. This file guides AI
coding agents (Cursor, GitHub Copilot, Claude, etc.) when contributing to
this repository.

What's included

  • Project overview and links to OPA/Rego documentation
  • Repository layout table with a brief description of each directory
  • Development environment setup (Go, Make, Bats, golangci-lint, optional Nix)
  • Build & test workflowgo test ./..., bats acceptance.bats, make ci
  • Local smoke test against the bundled examples/ directory
  • How to write tests — both Go unit tests and Bats acceptance tests with an example @test block
  • Code conventions — error wrapping, interface patterns, CLI flag location
  • PR submission checklist

Made with Cursor

Add AGENTS.md as requested in open-policy-agent#1234 to guide AI coding agents
(Cursor, Copilot, Claude, etc.) when working in this repository.

The file covers:
- Project overview and links to OPA/Rego docs
- Repository layout with brief description of each directory
- Development environment setup (Go, Make, Bats, golangci-lint, Nix)
- Build & test workflow commands
- How to write unit tests and Bats acceptance tests
- Code conventions
- PR submission checklist

Closes open-policy-agent#1234

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread AGENTS.md
- New parsers implement the `parser.Parser` interface in `parser/`
- New output formatters implement the `output.Outputter` interface in `output/`

## Submitting a PR
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agents should not be submitting PRs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

but it can co-author PRs, right? That's the usual workflow with claude / cursor type of tools
If we don't agree with these, let's explicitly mention

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Personally, I expect all PRs are submitted by humans, after the human has reviewed the code and ensured tests are passing locally.

I do not have an issue with using AI tools, but I am wary of the burden that PRs being sent without care can introduce to the project.

Comment thread AGENTS.md

### Prerequisites

- **Go** ≥ 1.22 – <https://go.dev/doc/install>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please can you verify the LLM output, this version is wrong.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It might be nice to give a ref to go.mod, where we are trying to consolidate the version across all resources like ci / nix dev env etc

Comment thread AGENTS.md
@@ -0,0 +1,124 @@
# AGENTS.md

This file guides AI coding agents (e.g. Cursor, Copilot, Claude) on how to
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude (famously) does not read agents.md. Please see https://github.com/open-policy-agent/opa/blob/main/.claude/settings.json but we have not seen great results with this approach either.

Copy link
Copy Markdown
Member

@jalseth jalseth Mar 26, 2026

Choose a reason for hiding this comment

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

I am in favor of forgoing AGENTS.md. The instruction provided to the agent should include enough information for the agent to do the right thing. It should adapt to the code style, tests, etc. of the repo as a human would.

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.

Add AGENTS.md to guide AI-assisted contributions

4 participants