公开公关
- 作者仓库星标 184,730
- 作者仓库 AutoGPT
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @Significant-Gravitas · 未声明许可证
- 上下文用量评级
- 中等消耗
- 接入复杂程度
- 需手动接入
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- Docker
- 运行环境要求
- Docker
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
第 1 步:飞行前检查
打开 PR 之前: 确保所有更改均已提交 确保分支已推送到远程 (`git push -u origin <branch>`) 在整个存储库(不仅仅是更改的文件)上运行 linter/formatters 并提交所有修复
Step 2: Test coverage
这很关键。在打开 PR 之前,请验证:
步骤 3:使用存储库模板创建 PR
阅读`.github/PULL_REQUEST_TEMPLATE.md`的规范 PR 模板,并逐字使用它作为您的 PR 正文: 阅读模板:`cat .github/PULL_REQUEST_TEMPLATE.md` 保留确切的章节标题和格式,包括:`### Why / What / How` `### Changes 🏗️`
第 5 步:处理审核反馈
一旦审阅机器人或人工审阅者留下评论:运行`/pr-address`以处理审阅评论。它将循环直到 CI 变为绿色并且所有注释都得到解决。未经人类批准,请勿合并。
Step 6: Post-creation
创建 PR 并触发审核后: 与用户共享 PR URL 如果等待审核机器人,请让用户知道预期等待时间(约 30 分钟) 未经人工批准请勿合并
# Open a Pull Request
## Step 1: Pre-flight checks
Before opening the PR:
1. Ensure all changes are committed
2. Ensure the branch is pushed to the remote (`git push -u origin <branch>`)
3. Run linters/formatters across the whole repo (not just changed files) and commit any fixes
## Step 2: Test coverage
**This is critical.** Before opening the PR, verify:
### Existing behavior is not broken
- Identify which modules/components your changes touch
- Run the existing test suites for those areas
- If tests fail, fix them before opening the PR — do not open a PR with known regressions
### New behavior has test coverage
- Every new feature, endpoint, or behavior change needs tests
- If you added a new block, add tests for that block
- If you changed API behavior, add or update API tests
- If you changed frontend behavior, verify it doesn't break existing flows
If you cannot run the full test suite locally, note which tests you ran and which you couldn't in the test plan.
## Step 3: Create the PR using the repo template
Read the canonical PR template at `.github/PULL_REQUEST_TEMPLATE.md` and use it **verbatim** as your PR body:
1. Read the template: `cat .github/PULL_REQUEST_TEMPLATE.md`
2. Preserve the exact section titles and formatting, including:
- `### Why / What / How`
- `### Changes 🏗️`
- `### Checklist 📋`
3. Replace HTML comment prompts (`<!-- ... -->`) with actual content; do not leave them in
4. **Do not pre-check boxes** — leave all checkboxes as `- [ ]` until each step is actually completed
5. Do not alter the template structure, rename sections, or remove any checklist items
**PR title must use conventional commit format** (e.g., `feat(backend): add new block`, `fix(frontend): resolve routing bug`, `dx(skills): update PR workflow`). See CLAUDE.md for the full list of scopes.
Use `gh pr create` with the base branch (defaults to `dev` if no `[base-branch]` was provided). Use `--body-file` to avoid shell interpretation of backticks and special characters:
```bash
BASE_BRANCH="${BASE_BRANCH:-dev}"
PR_BODY=$(mktemp)
cat > "$PR_BODY" << 'PREOF'
<filled-in template from .github/PULL_REQUEST_TEMPLATE.md>
PREOF
gh pr create --base "$BASE_BRANCH" --title "<type>(scope): short description" --body-file "$PR_BODY"
rm "$PR_BODY"
```
## Step 4: Review workflow
### If you have a workspace that allows testing (docker, running backend, etc.)
- Run `/pr-test` to do E2E manual testing of the PR using docker compose, agent-browser, and API calls. This is the most thorough way to validate your changes before review.
- After testing, run `/pr-review` to self-review the PR for correctness, security, code quality, and testing gaps before requesting human review.
### If you do NOT have a workspace that allows testing
This is common for agents running in worktrees without a full stack. In this case:
1. Run `/pr-review` locally to catch obvious issues before pushing
2. **Comment `/review` on the PR** after creating it to trigger the review bot
3. **Poll for the review** rather than blindly waiting — check for new review comments every 30 seconds using `gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/reviews --paginate` and the GraphQL inline threads query. The bot typically responds within 30 minutes, but polling lets the agent react as soon as it arrives.
4. Do NOT proceed or merge until the bot review comes back
5. Address any issues the bot raises — use `/pr-address` which has a full polling loop with CI + comment tracking
```bash
# After creating the PR:
PR_NUMBER=$(gh pr view --json number -q .number)
gh pr comment "$PR_NUMBER" --body "/review"
# Then use /pr-address to poll for and address the review when it arrives
```
## Step 5: Address review feedback
Once the review bot or human reviewers leave comments:
- Run `/pr-address` to address review comments. It will loop until CI is green and all comments are resolved.
- Do not merge without human approval.
## Related skills
| Skill | When to use |
|---|---|
| `/pr-test` | E2E testing with docker compose, agent-browser, API calls — use when you have a running workspace |
| `/pr-review` | Review for correctness, security, code quality — use before requesting human review |
| `/pr-address` | Address reviewer comments and loop until CI green — use after reviews come in |
## Step 6: Post-creation
After the PR is created and review is triggered:
- Share the PR URL with the user
- If waiting on the review bot, let the user know the expected wait time (~30 min)
- Do not merge without human approval
章节与文件索引
按说明文件中的顺序排列。
第 1 步:飞行前检查
Step 2: Test coverage
现有行为并未被打破
新行为具有测试覆盖率
步骤 3:使用存储库模板创建 PR
文件/命令 -> git push -u origin <branch> · .github/PULL_REQUEST_TEMPLATE.md · cat .github/PULL_REQUEST_TEMPLATE.md · ### Why / What / How · ### Changes 🏗️ · ### Checklist 📋 · <!-- ... --> · - [ ]
内容校验值 -> 235a84e7a0b6
当前原文的自动摘译,尚未人工审校。
现有行为并未被打破
确定您的更改涉及哪些模块/组件 运行这些区域的现有测试套件 如果测试失败,请在打开 PR 之前修复它们 - 不要打开具有已知回归的 PR
新行为具有测试覆盖率
每个新功能、端点或行为更改都需要测试 如果您添加了新块,请为该块添加测试 如果您更改了 API 行为,请添加或更新 API 测试 如果您更改了前端行为,请验证它不会破坏现有流程 如果您无法在本地运行完整的测试套件,请记下您在测试计划中运行了哪些测试以及不能运行哪些测试。