pr-workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Pull Request Workflow

Pull Request 工作流

Complete workflow for creating pull requests following project standards.
遵循项目标准的完整拉取请求创建工作流。

Process

流程

  1. Verify staged changes exist with
    git diff --cached --name-only
  2. Branch setup
    • If on main/master, create feature branch first:
      feature/brief-description
      or
      fix/brief-description
    • Use
      github-dev:commit-creator
      subagent to handle staged changes if needed
  3. Documentation check
    • Update README.md or docs based on changes compared to target branch
    • For config/API changes, use
      mcp__tavily__tavily_search
      to verify info and include sources
  4. Analyze all commits
    • Use
      git diff <base-branch>...HEAD
      to review complete changeset
    • PR message must describe all commits, not just latest
    • Focus on what changed from reviewer perspective
  5. Create PR
    • Use
      /pr-creator
      agent or
      gh pr create
      with parameters:
      • -t
        (title): Start with capital letter, use verb, NO "fix:" or "feat:" prefix
      • -b
        (body): Brief summary + bullet points with inline markdown links
      • -a @me
        (self-assign)
      • -r <reviewer>
        : Find via
        gh pr list --repo <owner>/<repo> --author @me --limit 5
  6. 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
  1. 验证暂存更改:使用
    git diff --cached --name-only
    确认存在暂存更改
  2. 分支设置
    • 如果当前在main/master分支,先创建功能分支:格式为
      feature/简短描述
      fix/简短描述
    • 如有需要,使用
      github-dev:commit-creator
      子Agent处理暂存更改
  3. 文档检查
    • 对比目标分支的更改,更新README.md或相关文档
    • 对于配置/API更改,使用
      mcp__tavily__tavily_search
      验证信息并附上来源
  4. 分析所有提交
    • 使用
      git diff <base-branch>...HEAD
      查看完整的变更集
    • PR描述必须涵盖所有提交,而非仅最新提交
    • 从审核者的角度描述变更内容
  5. 创建PR
    • 使用
      /pr-creator
      Agent或
      gh pr create
      命令,参数说明:
      • -t
        (标题):首字母大写,使用动词,不要加“fix:”或“feat:”前缀
      • -b
        (正文):简短摘要 + 带内联Markdown链接的项目符号列表
      • -a @me
        (自行指派)
      • -r <reviewer>
        :可通过
        gh pr list --repo <owner>/<repo> --author @me --limit 5
        查找审核人
  6. 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
\`\`\`