docs: add PR sizing and description guidelines to AGENTS.md#6915
Conversation
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>
AlvaroBrey
left a comment
There was a problem hiding this comment.
🙌 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
| - **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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
| - **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. |
There was a problem hiding this comment.
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!
I don't think it is... And might be something we could do indeed. |
|
And we've added: What if we just point Agents.md to the template? Or the opposite |
facumenzella
left a comment
There was a problem hiding this comment.
Awesome! Just a nit for a contradiction, but we can refine this later
|
Great catch @facumenzella! I see the contradiction, but I think the hints in Maybe we can point AI agents to |
|
sounds good @ajpallares ! |
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>
…/RevenueCat/purchases-ios into pallares/agents-md-pr-guidelines
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…/RevenueCat/purchases-ios into pallares/agents-md-pr-guidelines
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@tonidero @AlvaroBrey @facumenzella Sorry to ask for your reviews again, but I've changed it a bit trying to address all the feedback 🙏 |
AlvaroBrey
left a comment
There was a problem hiding this comment.
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. --> | |||
Checklist
purchases-androidand hybridsMotivation
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: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.mdwith 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.