GitHub issue 跟踪
Issue 跟踪:GitHub
Section titled “Issue 跟踪:GitHub”这个仓库的 issue 和规格都记录在 GitHub issue 中。所有操作都使用 gh CLI。
- 创建 issue:
gh issue create --title "..." --body "..."。多行正文请用 heredoc。 - 读取 issue:
gh issue view <number> --json number,title,body,labels,comments。 - 列出 issue:
gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]',并按需添加--label和--state筛选条件。 - 将 issue 设为父 issue 的子 issue:
gh issue create --parent <parent> ...,或之后运行gh issue edit <parent> --add-sub-issue <child>(gh2.94+)。旧版gh:gh api --method POST repos/<owner>/<repo>/issues/<parent>/sub_issues -F sub_issue_id=<child-db-id>(数据库 ID,见下方 阻塞)。如果没有启用子 issue,就在子 issue 正文顶部写上Part of #<parent>。 - 阻塞:GitHub 的原生 issue 依赖关系是规范且可在界面中查看的表示方式。使用
gh issue create --blocked-by <n>,<n> ...或gh issue edit <child> --add-blocked-by <blocker>(gh2.94+)添加依赖边。旧版gh:gh api --method POST repos/<owner>/<repo>/issues/<child>/dependencies/blocked_by -F issue_id=<blocker-db-id>,其中<blocker-db-id>是阻塞方的数字数据库 ID(运行gh api repos/<owner>/<repo>/issues/<n> --jq .id获取,不能用#number或node_id)。如果无法使用依赖关系,就在子 issue 正文顶部添加一行Blocked by: #<n>, #<n>。所有阻塞项都关闭后,工单即解除阻塞。 - 统计未关闭的阻塞项:
gh api repos/<owner>/<repo>/issues/<n> --jq .issue_dependencies_summary.blocked_by(只统计未关闭的阻塞项;结果为 0 表示可以开始)。gh issue view <n> --json blockedBy也会列出已关闭的阻塞项,所以要过滤:--jq '[.blockedBy.nodes[] | select(.state == "OPEN")] | length'。 - 评论 issue:
gh issue comment <number> --body "..." - 添加 / 移除标签:
gh issue edit <number> --add-label "..."/--remove-label "..." - 关闭:先用
gh issue comment <number> --body "..."说明原因,再运行gh issue close <number>。issue 已关闭时,gh issue close --comment会丢弃评论,但仍以 0 退出。
从 git remote -v 推断仓库;在克隆目录中运行时,gh 会自动识别。
只在用户自己的仓库中创建 issue。除非用户拥有 mattpocock/skills,否则绝不要在那里创建 issue。在 fork 中,gh 可能默认指向父仓库,因此每个会话首次运行 gh issue create 前,先用 gh repo view --json nameWithOwner 检查目标仓库;如果不是用户自己的仓库,就向用户确认。
将 PR 作为分流入口
Section titled “将 PR 作为分流入口”将 PR 作为需求入口:否。 (如果这个仓库把外部 PR 视为功能请求,就设为 yes;/triage 会读取此标记。)
设为 yes 后,PR 会像 issue 一样使用相同的标签和状态,并使用对应的 gh pr 命令:
- 读取 PR:先运行
gh pr view <number>,再运行gh pr view <number> --comments(非 TTY 环境下,--comments只输出评论,不包含正文),然后用gh pr diff <number>查看 diff。 - 列出待分流的外部 PR:
gh api --paginate 'repos/{owner}/{repo}/pulls?state=open' --jq '.[] | select(.author_association | IN("OWNER","MEMBER","COLLABORATOR") | not) | {number, title, author: .user.login, author_association, labels: [.labels[].name]}'。 - 评论 / 添加标签 / 关闭:
gh pr comment、gh pr edit --add-label/--remove-label、gh pr close。
GitHub 的 issue 和 PR 共用同一组编号,因此单独的 #42 可能指 issue,也可能指 PR:先运行 gh pr view 42,如果找不到再运行 gh issue view 42。
skill 说“发布到 issue 跟踪器”时
Section titled “skill 说“发布到 issue 跟踪器”时”创建一个 GitHub issue。
skill 说“获取相关工单”时
Section titled “skill 说“获取相关工单”时”按上文 读取 issue 的方式读取。
路径查找操作
Section titled “路径查找操作”供 /wayfinder 使用。地图是一个 issue,子项是作为工单的 issue。
- 地图:一个标有
wayfinder:map的 issue,正文包含 Notes / Decisions-so-far / Fog。使用gh issue create --label wayfinder:map创建。 - 子工单:一个关联为 GitHub 子 issue 的 issue(见 将 issue 设为父 issue 的子 issue)。如果没有启用子 issue,就把子工单添加到地图正文的任务列表中,并在子工单正文顶部写上
Part of #<map>。标签:wayfinder:<type>(research/prototype/grilling/task)。认领后,将工单分配给负责推进的开发者。 - 阻塞:见「约定」中的 阻塞。
- 前沿查询:列出地图下所有未关闭的子项(运行
gh issue list --state open,并限定为地图的子 issue 或任务列表),排除存在未关闭阻塞项的子项(见「统计未关闭的阻塞项」,或Blocked by行中仍有未关闭的 issue),以及已分配负责人的子项。按地图中的顺序,选择第一个符合条件的子项。 - 认领:
gh issue edit <n> --add-assignee @me,这是该会话的第一次写入操作。 - 解决:运行
gh issue comment <n> --body "<answer>",然后运行gh issue close <n>,最后将上下文指针(gist + 链接)追加到地图的 Decisions-so-far。
原文链接和 commit
Section titled “原文链接和 commit”- 技能页 setup-matt-pocock-skills
- 文件
skills/engineering/setup-matt-pocock-skills/issue-tracker-github.md - 提交
d81f3a1
英文 issue-tracker-github.md
# Issue tracker: GitHub
Issues and specs for this repo live as GitHub issues. Use the `gh` CLI for all operations.
## Conventions
- **Create an issue**: `gh issue create --title "..." --body "..."`. Use a heredoc for multi-line bodies.- **Read an issue**: `gh issue view <number> --comments`, filtering comments by `jq` and also fetching labels.- **List issues**: `gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'` with appropriate `--label` and `--state` filters.- **Comment on an issue**: `gh issue comment <number> --body "..."`- **Apply / remove labels**: `gh issue edit <number> --add-label "..."` / `--remove-label "..."`- **Close**: `gh issue close <number> --comment "..."`
Infer the repo from `git remote -v`; `gh` does this automatically when run inside a clone.
## Pull requests as a triage surface
**PRs as a request surface: no.** _(Set to `yes` if this repo treats external PRs as feature requests; `/triage` reads this flag.)_
When set to `yes`, PRs run through the same labels and states as issues, using the `gh pr` equivalents:
- **Read a PR**: `gh pr view <number> --comments` and `gh pr diff <number>` for the diff.- **List external PRs for triage**: `gh pr list --state open --json number,title,body,labels,author,authorAssociation,comments` then keep only `authorAssociation` of `CONTRIBUTOR`, `FIRST_TIME_CONTRIBUTOR`, or `NONE` (drop `OWNER`/`MEMBER`/`COLLABORATOR`).- **Comment / label / close**: `gh pr comment`, `gh pr edit --add-label`/`--remove-label`, `gh pr close`.
GitHub shares one number space across issues and PRs, so a bare `#42` may be either: resolve with `gh pr view 42` and fall back to `gh issue view 42`.
## When a skill says "publish to the issue tracker"
Create a GitHub issue.
## When a skill says "fetch the relevant ticket"
Run `gh issue view <number> --comments`.
## Wayfinding operations
Used by `/wayfinder`. The **map** is a single issue with **child** issues as tickets.
- **Map**: a single issue labelled `wayfinder:map`, holding the Notes / Decisions-so-far / Fog body. `gh issue create --label wayfinder:map`.- **Child ticket**: an issue linked to the map as a GitHub sub-issue (`gh api` on the sub-issues endpoint). Where sub-issues aren't enabled, add the child to a task list in the map body and put `Part of #<map>` at the top of the child body. Labels: `wayfinder:<type>` (`research`/`prototype`/`grilling`/`task`). Once claimed, the ticket is assigned to the driving dev.- **Blocking**: GitHub's **native issue dependencies**, the canonical, UI-visible representation. Add an edge with `gh api --method POST repos/<owner>/<repo>/issues/<child>/dependencies/blocked_by -F issue_id=<blocker-db-id>`, where `<blocker-db-id>` is the blocker's numeric **database id** (`gh api repos/<owner>/<repo>/issues/<n> --jq .id`, _not_ the `#number` or `node_id`). GitHub reports `issue_dependencies_summary.blocked_by` (open blockers only, the live gate). Where dependencies aren't available, fall back to a `Blocked by: #<n>, #<n>` line at the top of the child body. A ticket is unblocked when every blocker is closed.- **Frontier query**: list the map's open children (`gh issue list --state open`, scoped to the map's sub-issues / task list), drop any with an open blocker (`issue_dependencies_summary.blocked_by > 0`, or an open issue in the `Blocked by` line) or an assignee; first in map order wins.- **Claim**: `gh issue edit <n> --add-assignee @me`, the session's first write.- **Resolve**: `gh issue comment <n> --body "<answer>"`, then `gh issue close <n>`, then append a context pointer (gist + link) to the map's Decisions-so-far.非官方学习站,与 Matt Pocock 和 AI Hero 没有隶属关系。本站不提供可安装的中文技能包。
技能原文采用 MIT 许可。Copyright (c) 2026 Matt Pocock