gh-issue-fix-flow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGh Issue Fix Flow
Gh 问题修复工作流
Overview
概述
Resolve a GitHub issue from intake through fix, validation, and push using gh, local edits, XcodeBuildMCP, and git.
使用gh、本地编辑、XcodeBuildMCP和git完成从接收问题到修复、验证再到推送的全流程GitHub问题处理。
Workflow
工作流
1) Intake and issue context
1) 问题接收与上下文获取
- Use to get the full issue context.
gh issue view <id> --repo <owner/repo> --comments - If the repo is unclear, run to confirm.
gh repo view --json nameWithOwner - Capture reproduction steps, expected behavior, and any maintainer notes.
- 使用获取完整的问题上下文。
gh issue view <id> --repo <owner/repo> --comments - 如果仓库信息不明确,运行进行确认。
gh repo view --json nameWithOwner - 记录复现步骤、预期行为以及维护人员的任何备注。
2) Locate the code path
2) 定位代码路径
- Use to locate likely files and entry points.
rg -n - Read the relevant code paths with or
sed -ncontext.rg -n - Follow repo-specific conventions (AGENTS/CLAUDE instructions).
- 使用定位可能的文件和入口点。
rg -n - 使用或带上下文的
sed -n查看相关代码路径。rg -n - 遵循仓库特定的规范(AGENTS/CLAUDE 说明)。
3) Implement the fix
3) 实施修复
- Edit the minimal set of files.
- Keep changes aligned with existing architecture and style.
- Add tests when behavior changes and test coverage is practical.
- 仅编辑必要的文件。
- 确保修改与现有架构和代码风格保持一致。
- 当行为发生变更且测试覆盖可行时,添加测试用例。
4) Build and test
4) 构建与测试
- Use XcodeBuildMCP for required builds/tests:
- Set defaults once: .
mcp__XcodeBuildMCP__session-set-defaults - Build: or
mcp__XcodeBuildMCP__build_macos.mcp__XcodeBuildMCP__build_sim - Tests: prefer targeted schemes (e.g., ).
mcp__XcodeBuildMCP__test_sim
- Set defaults once:
- If macOS tests fail due to deployment target mismatches, run the equivalent iOS simulator tests.
- Report warnings or failures; do not hide them.
- 使用XcodeBuildMCP执行所需的构建/测试:
- 一次性设置默认值:。
mcp__XcodeBuildMCP__session-set-defaults - 构建:或
mcp__XcodeBuildMCP__build_macos。mcp__XcodeBuildMCP__build_sim - 测试:优先使用针对性的方案(例如)。
mcp__XcodeBuildMCP__test_sim
- 一次性设置默认值:
- 如果macOS测试因部署目标不匹配而失败,运行对应的iOS模拟器测试。
- 报告警告或失败情况;不要隐瞒。
5) Commit and push
5) 提交与推送
- Check for unrelated changes with .
git status --short - Stage only the fix (exclude unrelated files).
- Commit with a closing message: .
Fix … (closes #<issue>) - Push with .
git push
- 使用检查是否有无关修改。
git status --short - 仅暂存修复相关的修改(排除无关文件)。
- 附带关闭信息提交:。
Fix … (closes #<issue>) - 使用推送代码。
git push
6) Report back
6) 反馈结果
- Summarize what changed and where.
- Provide test results (including failures).
- Note any follow-ups or blocked items.
- 总结修改内容和位置。
- 提供测试结果(包括失败情况)。
- 记录任何后续工作或阻塞项。