用途:把“哪些 issue 现在能做、哪些父 issue 该收尾、哪些 issue 被某次关闭解锁”从模型猜测变为每轮现算的图计算。GitHub 原生图(sub-issues + issue dependencies)是关系数据的唯一真相,图不落盘,唯一持久状态是 GitHub 本身,因此没有索引漂移。
主要能力(scripts/,全部 REST-only + 手动分页):
- graph-scan.ts:只读图计算,输出 ready(open 且无 open blocker,按 hostname 旋转排序)、blocked(含 blocker 列表)、rollupCandidates(open 且有孩子且孩子全关)、kicks(近窗口关闭反查出的 open parent 与被解锁 dependent)。用法:bun <plugin_root>/skills/issue-graph/scripts/graph-scan.ts [--window-hours 2] [--pretty]。
- link.ts:幂等写边。bun <plugin_root>/skills/issue-graph/scripts/link.ts --parent <N> --child <M>;bun <plugin_root>/skills/issue-graph/scripts/link.ts --issue <Y> --blocked-by <X>。开派生 issue 时必须同时挂原生父子边;child 已有不同 parent 会报错停下。
- claim.ts:claim-comment fencing,用于 rollup 等终态动作互斥。bun <plugin_root>/skills/issue-graph/scripts/claim.ts --issue <N> --action rollup(exit 0=赢 / 3=输);完成后 bun <plugin_root>/skills/issue-graph/scripts/claim.ts --release <claimId>。
- backfill.ts:把存量 spinoff-of 标记迁成原生边,默认 dry-run,--execute 真写(1 边/秒限速),冲突、parent 缺失、超 100 孩子上限均跳过并报告。
- producer.ts:定期图计算 + label 对账,只算图不干活。bun <plugin_root>/skills/issue-graph/scripts/producer.ts [--window-hours 2] [--dry-run]。
使用方式:先读 .claude/repo-profile.md,从 git remote 解析 repo_slug;脚本路径以 profile 的 plugin_root 为基准。消费方为 issue-sweep(Step 1 前跑 graph-scan)与 issue-review(开 spin-off 调 link.ts、父级 rollup 用 claim.ts)。
限制:REST-only 是因 cloud routine 出站代理挡 gh GraphQL 且 --paginate 有代理 bug;label 只是索引提示,worker 领任务必须回 GitHub 重验;claim 崩溃靠 TTL 30min 过期兜底;规模扩大后领取计划迁 AFS scheduler claim/lease queue(Phase 5,deferred)。