Skip to content

Commit 5eed7c7

Browse files
potiukclaude
andauthored
Add PR creation instructions for AI agents to AGENTS.md (#62575)
* Add PR creation instructions for AI agents to AGENTS.md Agents must create PRs via `gh pr create --web` to open the browser with the repository's PR template pre-filled. Includes instructions to disclose generative AI usage with the Generated-by line. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Apply suggestion from @potiuk --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e4de653 commit 5eed7c7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

AGENTS.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,51 @@ Write commit messages focused on user impact, not implementation details.
8181
Add a newsfragment for user-visible changes:
8282
`echo "Brief description" > airflow-core/newsfragments/{PR_NUMBER}.{bugfix|feature|improvement|doc|misc|significant}.rst`
8383

84+
### Creating Pull Requests
85+
86+
**Always push to the user's fork**, not to the upstream `apache/airflow` repo. Never push
87+
directly to `main`.
88+
89+
Before pushing, determine the GitHub username with `gh api user -q .login` and identify the
90+
user's fork remote from the existing remotes. Run `git remote -v` and look for a remote
91+
pointing to `github.com:<GITHUB_USER>/airflow.git` where `<GITHUB_USER>` is **not** `apache`.
92+
That is the user's fork remote. If no such remote exists, create the fork and add it:
93+
94+
```bash
95+
gh repo fork apache/airflow --remote --remote-name <GITHUB_USER>
96+
```
97+
98+
Then push the branch to the user's fork remote and open the PR creation page in the browser
99+
with the body pre-filled (including the generative AI disclosure already checked):
100+
101+
```bash
102+
git push -u <GITHUB_USER> <branch-name>
103+
gh pr create --web --title "Short title (under 70 chars)" --body "$(cat <<'EOF'
104+
Brief description of the changes.
105+
106+
closes: #ISSUE (if applicable)
107+
108+
---
109+
110+
##### Was generative AI tooling used to co-author this PR?
111+
112+
- [X] Yes — <Agent Name and Version>
113+
114+
Generated-by: <Agent Name and Version> following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
115+
116+
EOF
117+
)"
118+
```
119+
120+
The `--web` flag opens the browser so the user can review and submit. The `--body` flag
121+
pre-fills the PR template with the generative AI disclosure already completed.
122+
123+
Remind the user to:
124+
125+
1. Review the PR title — keep it short (under 70 chars) and focused on user impact.
126+
2. Add a brief description of the changes at the top of the body.
127+
3. Reference related issues when applicable (`closes: #ISSUE` or `related: #ISSUE`).
128+
84129
## Boundaries
85130

86131
- **Ask first**

0 commit comments

Comments
 (0)