pr-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePull Request Workflow
Pull Request 工作流
Complete workflow for creating pull requests following project standards.
遵循项目标准的完整拉取请求创建工作流。
Process
流程
-
Verify staged changes exist with
git diff --cached --name-only -
Branch setup
- If on main/master, create feature branch first: or
feature/brief-descriptionfix/brief-description - Use subagent to handle staged changes if needed
github-dev:commit-creator
- If on main/master, create feature branch first:
-
Documentation check
- Update README.md or docs based on changes compared to target branch
- For config/API changes, use to verify info and include sources
mcp__tavily__tavily_search
-
Analyze all commits
- Use to review complete changeset
git diff <base-branch>...HEAD - PR message must describe all commits, not just latest
- Focus on what changed from reviewer perspective
- Use
-
Create PR
- Use agent or
/pr-creatorwith parameters:gh pr create- (title): Start with capital letter, use verb, NO "fix:" or "feat:" prefix
-t - (body): Brief summary + bullet points with inline markdown links
-b - (self-assign)
-a @me - : Find via
-r <reviewer>gh pr list --repo <owner>/<repo> --author @me --limit 5
- Use
-
PR Body Guidelines
- Summary: Few words or 1 sentence describing changes
- Changes: Bullet points with inline links
[src/auth.py:42](src/auth.py#L42) - Examples: For significant changes, include before/after code examples
- No test plans: Never mention test procedures in PR
-
验证暂存更改:使用确认存在暂存更改
git diff --cached --name-only -
分支设置
- 如果当前在main/master分支,先创建功能分支:格式为或
feature/简短描述fix/简短描述 - 如有需要,使用子Agent处理暂存更改
github-dev:commit-creator
- 如果当前在main/master分支,先创建功能分支:格式为
-
文档检查
- 对比目标分支的更改,更新README.md或相关文档
- 对于配置/API更改,使用验证信息并附上来源
mcp__tavily__tavily_search
-
分析所有提交
- 使用查看完整的变更集
git diff <base-branch>...HEAD - PR描述必须涵盖所有提交,而非仅最新提交
- 从审核者的角度描述变更内容
- 使用
-
创建PR
- 使用Agent或
/pr-creator命令,参数说明:gh pr create- (标题):首字母大写,使用动词,不要加“fix:”或“feat:”前缀
-t - (正文):简短摘要 + 带内联Markdown链接的项目符号列表
-b - (自行指派)
-a @me - :可通过
-r <reviewer>查找审核人gh pr list --repo <owner>/<repo> --author @me --limit 5
- 使用
-
PR正文规范
- 摘要:用几个词或一句话描述变更内容
- 变更点:带内联链接的项目符号,格式如
[src/auth.py:42](src/auth.py#L42) - 示例:对于重大变更,包含变更前后的代码示例
- 无需测试计划:PR中不要提及测试流程
Examples
示例
With inline source links:
带内联来源链接的示例:
Update Claude Haiku to version 4.5
- Model ID: claude-3-haiku-20240307 → claude-haiku-4-5-20251001 ([source](https://docs.anthropic.com/en/docs/about-claude/models/overview))
- Pricing: $0.80/$4.00 → $1.00/$5.00 per MTok ([source](https://docs.anthropic.com/en/docs/about-claude/pricing))
- Max output: 4,096 → 64,000 tokens ([source](https://docs.anthropic.com/en/docs/about-claude/models/overview))Update Claude Haiku to version 4.5
- Model ID: claude-3-haiku-20240307 → claude-haiku-4-5-20251001 ([source](https://docs.anthropic.com/en/docs/about-claude/models/overview))
- Pricing: $0.80/$4.00 → $1.00/$5.00 per MTok ([source](https://docs.anthropic.com/en/docs/about-claude/pricing))
- Max output: 4,096 → 64,000 tokens ([source](https://docs.anthropic.com/en/docs/about-claude/models/overview))With code changes:
带代码变更的示例:
Refactor authentication to use async context manager
- Replace synchronous auth flow with async/await pattern in [src/auth.py:15-42](src/auth.py#L15-L42)
- Add context manager support for automatic cleanup
Before:
\`\`\`python
def authenticate(token):
session = create_session(token)
return session
\`\`\`
After:
\`\`\`python
async def authenticate(token):
async with create_session(token) as session:
return session
\`\`\`Refactor authentication to use async context manager
- Replace synchronous auth flow with async/await pattern in [src/auth.py:15-42](src/auth.py#L15-L42)
- Add context manager support for automatic cleanup
Before:
\`\`\`python
def authenticate(token):
session = create_session(token)
return session
\`\`\`
After:
\`\`\`python
async def authenticate(token):
async with create_session(token) as session:
return session
\`\`\`