Skip to content

docs: add PR sizing and description guidelines to AGENTS.md#6915

Merged
ajpallares merged 9 commits into
mainfrom
pallares/agents-md-pr-guidelines
Jun 5, 2026
Merged

docs: add PR sizing and description guidelines to AGENTS.md#6915
ajpallares merged 9 commits into
mainfrom
pallares/agents-md-pr-guidelines

Conversation

@ajpallares

@ajpallares ajpallares commented Jun 5, 2026

Copy link
Copy Markdown
Member

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-android and hybrids

Motivation

Give AI coding agents concrete, less subjective guidance so PRs stay small and easy to review.

Description

Adds a dedicated Pull Requests section to AGENTS.md (with Labels as a subsection) covering:

  • Smaller, self-contained, stacked PRs, with a soft ~500-line target on hand-written source and up-front planning of the PR breakdown for larger tasks.
  • Concise descriptions: short motivation, no diff restatement, no commits section, and testing notes only for what the diff doesn't show.

The PR template now points AI agents to that section, keeping the existing detailed hints for human contributors.


Note

Low Risk
Documentation-only changes with no runtime or SDK behavior impact.

Overview
Documents how to open PRs for AI agents and contributors by expanding AGENTS.md with a Pull Requests section (size/stacking, concise descriptions, label rules) and retitling the former labels block as a subsection.

The PR template now tells AI agents to follow that section in addition to filling out the template.

Reviewed by Cursor Bugbot for commit 8098b3f. Bugbot is set up for automated code reviews on this repo. Configure here.

Add Guardrails guidance for AI agents to prefer smaller, self-contained
stacked PRs (soft ~500-line target on hand-written source) and to keep PR
descriptions concise.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ajpallares ajpallares marked this pull request as ready for review June 5, 2026 08:11
@ajpallares ajpallares requested a review from a team as a code owner June 5, 2026 08:11

@AlvaroBrey AlvaroBrey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🙌 Looks great, just one minor suggestion:

Should we tell the agent to respect the MR template, as well? Not sure if it's doing that already or if we enforce it somehow

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking nice!

Comment thread AGENTS.md Outdated
Comment on lines +231 to +232
- **Don't restate the diff** — no file-by-file or change-by-change enumeration. If a bullet just describes a code change visible in the diff, cut it.
- **No "Commits" section** — the commit list is already on the PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if this is already part of "be concise". Just slightly concerned about increasing the size of this file too much since that's basically tokens that need to go on every loop.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Very good point. I also wondered about this. The problem with "be concise" is subjectivity IMO. And these instructions do add some concrete restrictions to the AI. But it's true that adds more and more info the context. Will simplify :)

Comment thread AGENTS.md Outdated
- **Check Android SDK** when unsure about cross-platform implementation details — new features should follow existing patterns across SDKs
- **Never commit Claude-related files** — do not stage or commit `.claude/` directory, `settings.local.json`, or any AI tool configuration files
- **Never commit API keys or secrets** — do not stage or commit API keys, tokens, credentials, or any sensitive data
- **Prefer smaller, self-contained stacked PRs** when possible. "Self-contained" means the PR compiles, passes tests, and is reviewable on its own. As a rule of thumb, aim to keep the diff under ~500 lines of hand-written source — excluding generated, serialized, or non-reviewed files (e.g. JSON, snapshots, lockfiles, `api/*.swiftinterface`). When changes depend on each other, stack them instead of bundling everything into one large PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could be good to ask it to start bigger tasks by planning how the could could be split into different PRs... I think that might help it organize itself? Just an idea but FFTI!

@tonidero

tonidero commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Should we tell the agent to respect the MR template, as well? Not sure if it's doing that already or if we enforce it somehow

I don't think it is... And might be something we could do indeed.

@facumenzella

Copy link
Copy Markdown
Member

PULL_REQUEST_TEMPLATE.md says:

<!-- Describe your changes in detail -->
<!-- Please describe in detail how you tested your changes -->

And we've added:

Don't restate the diff — no file-by-file or change-by-change enumeration.
Testing: only mention what the diff doesn't show ... Don't enumerate added test cases — the test files are in the diff.

What if we just point Agents.md to the template? Or the opposite

@facumenzella facumenzella left a comment

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.

Awesome! Just a nit for a contradiction, but we can refine this later

@ajpallares

Copy link
Copy Markdown
Member Author

Great catch @facumenzella! I see the contradiction, but I think the hints in PULL_REQUEST_TEMPLATE.md are meant for humans (who often tend to under-explain) while what this PR adds to AGENTS.md is meant for AI (which tend to over-explain). Honestly, the message in PULL_REQUEST_TEMPLATE.md could explain why we get such big PR descriptions by AI agents... 🤔

Maybe we can point AI agents to AGENTS.md in PULL_REQUEST_TEMPLATE.md while keeping the existing messages for humans?

@facumenzella

Copy link
Copy Markdown
Member

sounds good @ajpallares !

ajpallares and others added 3 commits June 5, 2026 17:12
Move PR sizing/description guidance into a dedicated "Pull Requests"
section (with Labels as a subsection), point the PR template at it for
AI agents, and trim the description sub-bullets.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ajpallares

Copy link
Copy Markdown
Member Author

@tonidero @AlvaroBrey @facumenzella Sorry to ask for your reviews again, but I've changed it a bit trying to address all the feedback 🙏

@AlvaroBrey AlvaroBrey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks nice! Hope it helps

@@ -1,4 +1,5 @@
<!-- Thank you for contributing to Purchases! Before pressing the "Create Pull Request" button, please provide the following: -->
<!-- AI agents: fill in this template, and also follow the "Pull Requests" section in AGENTS.md. -->

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.

🍬 awesome

@ajpallares ajpallares merged commit 9a34dec into main Jun 5, 2026
18 of 20 checks passed
@ajpallares ajpallares deleted the pallares/agents-md-pr-guidelines branch June 5, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants