关于 issue-fix-flow
issue-fix-flow 是一项开发技能,指导从收集 GitHub Issue 信息到修改代码、验证和推送的完整流程。它以 gh CLI 和 git 组织步骤,并包含变更检查与结果汇报清单。
主要功能
- 01使用 gh CLI 收集 Issue 信息
- 02追踪相关代码路径
- 03实施精简修改并补充测试
- 04构建项目并运行测试
- 05提交并推送修复
- 06汇报结果与后续事项
适用场景
- 01将问题报告转化为经过验证的代码修复
- 02核对预期行为与维护者备注
- 03准备关闭 Issue 的精简提交
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ patrickserrano/ skills --skill issue-fix-flow安装后在 Claude Code 中输入/issue-fix-flow确认已加载。
详细介绍
GitHub 问题修复流程
概述
使用 gh CLI、本地修改和 git,从接收到修复、验证并推送,解决 GitHub 问题。
工作流
1) 接收问题并了解上下文
获取完整的问题上下文:
gh issue view <id> --comments
如果不清楚仓库是哪一个:
gh repo view --json nameWithOwner
从问题中记录:
- 重现步骤
- 预期行为
- 维护者备注或标签
- 相关问题或 PR
2) 定位代码路径
搜索相关代码:
# Find files related to the issue
rg -n "keyword from issue"
# Find function definitions
rg -n "func relevantFunction"
# Find type definitions
rg -n "struct|class|enum RelevantType"
阅读相关代码路径并了解:
- 入口点
- 数据流
- 现有模式和约定
3) 实施修复
指南:
- 只修改必要的文件
- 使更改符合现有架构和风格
- 行为发生变化且切实可行时,添加测试
- 遵循仓库特定的约定(检查 CONTRIBUTING.md、AGENTS.md、CLAUDE.md)
4) 构建和测试
对于 Swift/Xcode 项目:
# Build
swift build
# or
xcodebuild -scheme MyApp -destination 'platform=macOS' build
# Test
swift test
# or
xcodebuild -scheme MyAppTests -destination 'platform=macOS' test
对于其他项目,使用适当的构建和测试命令。
报告警告或失败,不要隐瞒。
5) 提交并推送
检查是否存在无关更改:
git status --short
git diff
仅暂存修复内容:
git add <specific files>
使用包含关闭信息的消息提交:
git commit -m "Fix: <description>
Closes #<issue number>"
推送:
git push
6) 汇报结果
提供摘要:
- 更改内容及位置
- 测试结果(包括任何失败)
- 后续事项或受阻事项
快速参考
| 任务 | 命令 |
|---|---|
| 查看问题 | gh issue view <id> --comments |
| 列出问题 | gh issue list |
| 查看仓库 | gh repo view --json nameWithOwner |
| 创建分支 | git checkout -b fix/issue-<id> |
| 暂存文件 | git add <files> |
| 提交 | git commit -m "Fix: ... Closes #<id>" |
| 推送 | git push -u origin HEAD |
| 创建 PR | gh pr create --fill |
提交消息格式
Fix: Brief description of the fix
More detailed explanation if needed.
- What was the problem
- How it was fixed
- Any notable changes
Closes #123
分支命名
# Feature
git checkout -b feature/issue-123-add-feature
# Bug fix
git checkout -b fix/issue-123-fix-bug
# Refactor
git checkout -b refactor/issue-123-cleanup
PR 工作流(可选)
如果在用于 PR 的分支上工作:
# Create branch
git checkout -b fix/issue-<id>
# Make changes, commit
git add .
git commit -m "Fix: description (closes #<id>)"
# Push and create PR
git push -u origin HEAD
gh pr create --fill
检查清单
- 已记录问题上下文(重现步骤、预期行为)
- 已定位并了解代码路径
- 已以最小改动实施修复
- 已在适用时添加或更新测试
- 构建通过
- 测试通过
- 仅暂存相关文件
- 提交消息包含
Closes #<id> - 已推送更改
- 已提供摘要
评论
支持 Markdown