关于 issue-management
用于通过受支持的 `gh issue` 命令管理 GitHub issue 的父子关系和阻塞关系,适合需要维护任务层级与依赖的贡献者,并包含验证步骤。
主要功能
- 01创建和更改父级关联
- 02管理子 issue 关系
- 03添加或移除阻塞关联
- 04查看关系元数据
- 05通过 JSON 输出验证更改
适用场景
- 01将工作归入父 issue
- 02记录被其他工作阻塞的 issue
- 03编辑前检查 issue 依赖
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ remotion-dev/ remotion --skill issue-management安装后在 Claude Code 中输入/issue-management确认已加载。
详细介绍
在创建、编辑、查看或移除 GitHub issue 之间的关系时使用此技能。
这些命令使用 GitHub CLI PR cli/cli#13057 中新增的 Issues 2.0 gh issue 支持。由于此功能较新,请先确认已安装的 gh 支持该功能:
gh issue create --help | grep -E -- '--parent|--blocked-by|--blocking'
gh issue edit --help | grep -E -- '--parent|--add-sub-issue|--add-blocked-by|--add-blocking'
如果缺少这些标志,请先更新 gh,再尝试管理 issue 关系。不要臆造旧命令。
Issue 引用格式
关系标志接受 issue 编号或 issue URL。
对于当前仓库中的 issue,请使用编号:
gh issue edit 123 --parent 100
对于跨仓库关系,请使用完整的 issue URL:
gh issue edit 123 --blocked-by https://github.com/remotion-dev/remotion/issues/456
可以传入以逗号分隔的多个相关 issue:
gh issue edit 123 --add-blocked-by 200,201
父项和子 issue 关系
一个子 issue 只能有一个父 issue。
要在父 issue 下直接创建新 issue:
gh issue create \
--title 'Docs: Add issue management skill' \
--body-file /tmp/remotion-issue-body.md \
--parent 100
要设置或更改现有子 issue 的父项:
gh issue edit <child-number> --parent <parent-number-or-url>
要移除子 issue 的父项:
gh issue edit <child-number> --remove-parent
要从父 issue 管理子 issue:
gh issue edit <parent-number> --add-sub-issue <child-number-or-url>
gh issue edit <parent-number> --remove-sub-issue <child-number-or-url>
如果子 issue 已有其他父项,--add-sub-issue 会将其移至新的父项。不要在一条命令中编辑多个父 issue 时使用 --add-sub-issue;不能将一个子 issue 模糊地添加到多个父项。
被阻塞和阻塞关系
当正在编辑的 issue 需要等待另一个 issue 时,使用 blocked-by。
# Issue 123 is blocked by issue 200.
gh issue edit 123 --add-blocked-by 200
# Remove that relationship.
gh issue edit 123 --remove-blocked-by 200
当正在编辑的 issue 阻塞另一个 issue 时,使用 blocking。
# Issue 123 is blocking issues 300 and 301.
gh issue edit 123 --add-blocking 300,301
# Remove one blocking relationship.
gh issue edit 123 --remove-blocking 300
等效的理解方式:
gh issue edit A --add-blocking B
表示相同的关系:
gh issue edit B --add-blocked-by A
根据当前正在编辑的是哪个 issue 来选择命令。
创建 issue 时,立即设置关系:
gh issue create \
--title 'Studio: Add timeline validation' \
--body-file /tmp/remotion-issue-body.md \
--blocked-by 200,201 \
--blocking 300
查看关系
人类可读视图会在存在相关元数据时显示父项、子 issue、被阻塞和阻塞信息:
gh issue view <number>
原始的非 TTY 输出包含稳定的关系行:
gh issue view <number> | grep -E '^(parent|sub-issues|sub-issues-completed|blocked-by|blocking):'
对于脚本,请显式请求 JSON 字段:
gh issue view <number> \
--json parent,subIssues,subIssuesSummary,blockedBy,blocking
subIssues、blockedBy 和 blocking 是包含 nodes 和 totalCount 的连接对象。subIssuesSummary 包含完成情况计数。
安全工作流
- 使用
--body-file创建任何新的 issue 正文,不要在 shell 字符串中内联多行内容。 - 使用适当的
gh issue create或gh issue edit标志链接关系。 - 使用
gh issue view <number>或gh issue view <number> --json parent,subIssues,subIssuesSummary,blockedBy,blocking验证。 - 如果之后编辑 PR 或父 issue 正文,请将含糊的清单文本替换为具体的 issue 编号。