gh
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub orientation
GitHub 操作指引
CLI contracts follow AVGVSTVS96/better-github-skill (no upstream license;
reimplemented). Requires authenticated and Node ≥ 23.6.
ghCLI 约定遵循 AVGVSTVS96/better-github-skill(无上游许可证;已重新实现)。需要已认证的 工具以及版本 ≥23.6 的 Node。
ghFlags
参数
| Flag | Default | Effect |
|---|---|---|
| current branch PR | Target PR |
| cwd repo | Target repo; with |
| off | Structured output |
| off | Snapshot/threads: do not truncate bodies. CI: accepted; snippets stay capped |
| off | Threads: include resolved and outdated |
| off | Threads: unresolved including outdated |
| off | Threads: filter by author |
| off | Threads: activity at/after timestamp |
| off | Threads: page leftover comments and reviews |
| off | CI: pin commit; not hunt surface 6 |
| off | CI: recent runs instead of drilldown |
| 10 | CI |
| off | CI |
| PR failing checks | CI: analyze that Actions run |
--all--openBLOCKEDBLOCKED| 参数 | 默认值 | 作用 |
|---|---|---|
| 当前分支对应的PR | 目标PR |
| 当前工作目录仓库 | 目标仓库;使用 |
| 关闭 | 结构化输出 |
| 关闭 | 快照/线程:不截断内容。CI:启用;代码片段仍保持长度限制 |
| 关闭 | 线程:包含已解决和过时的内容 |
| 关闭 | 线程:包含未解决的内容(包括过时的) |
| 关闭 | 线程:按作者筛选 |
| 关闭 | 线程:筛选指定时间戳及之后的活动 |
| 关闭 | 线程:分页加载剩余的评论和评审 |
| 关闭 | CI:固定提交;不触发场景6的检索 |
| 关闭 | CI:显示最近的运行记录而非深入分析 |
| 10 | CI |
| 关闭 | CI |
| PR对应的失败检查 | CI:分析该Actions运行记录 |
--all--openBLOCKEDBLOCKEDIron laws
核心规则
- Scripts for the three inspect loops; raw for everything else. Before any raw
ghcommand, apply the gotchas ingh../REFERENCE.md - Snapshot is PR state; threads is what reviewers wrote. Neither replaces the other.
- Scripts exit 0 when the report succeeds. Red CI and open threads are not
script failures. Never . EPIPE is not failure.
gh | head - Never reply, resolve, push, or merge.
- 三个检查循环使用脚本实现;其他所有操作使用原生 命令。执行任何原生
gh命令前,需遵循gh中的注意事项。./REFERENCE.md - 快照展示PR的当前状态;线程展示评审者的评论内容。两者功能互不替代。
- 脚本生成报告成功时返回0。失败的CI或未关闭的线程不属于脚本执行失败。禁止使用 命令。EPIPE 错误不算执行失败。
gh | head - 禁止回复、解决问题、推送代码或合并PR。
Scripts
脚本
Resolve as the directory containing this . Run with .
Load JSON shapes in before parsing .
<anchor>SKILL.mdnode./REFERENCE.md--json| Script | Covers |
|---|---|
| Meta, mergeability, checks, files, reviews, comments, thread counts |
| Review bodies, issue comments, inline threads with resolution |
| Failing checks → jobs/steps → snippet; logs on disk |
将 解析为包含此 文件的目录。使用 运行脚本。解析 输出前,请先查看 中的JSON结构定义。
<anchor>SKILL.mdnode--json./REFERENCE.md| 脚本 | 涵盖内容 |
|---|---|
| 元信息、可合并性、检查状态、文件变更、评审记录、评论内容、线程数量 |
| 评审内容、议题评论、带解决状态的内联线程 |
| 失败检查 → 任务/步骤 → 代码片段;磁盘上的日志文件 |
1. Resolve the target
1. 确定目标
Confirm is authenticated and Node is ≥ 23.6. Record owner/repo, PR or run
id, SHA if known, and which surface. No PR for a PR-bound request is
. Auth failure or missing is .
ghNO_CHANGESghBLOCKEDRecord: .
target | surface | command | terminalDone when the target is identified or a terminal is set.
确认 已完成认证且 Node 版本 ≥23.6。记录仓库所有者/仓库名、PR或运行记录ID、已知的SHA值,以及对应的场景。如果PR相关请求未指定PR,则标记为 。认证失败或未安装 则标记为 。
ghNO_CHANGESghBLOCKED记录内容:。
target | surface | command | terminal当目标已确定或终端状态已设置时,此步骤完成。
2. Inspect
2. 检查
Pick one covering script. Pass when the head SHA is known. Pass
when the consumer needs every unresolved thread.
If no script covers the request, use raw after applying gotchas in
. Redirect large output to a file; never pipe to .
--sha--json --open --completegh./REFERENCE.mdheadDone when stdout is a complete report or stderr names a real failure.
选择一个对应的脚本。已知HEAD SHA时传入 参数。如果需要获取所有未解决的线程,传入 参数。如果没有脚本能满足需求,则在遵循 中的注意事项后使用原生 命令。将大体积输出重定向到文件;禁止通过管道传递给 命令。
--sha--json --open --complete./REFERENCE.mdghhead当标准输出为完整报告或标准错误输出明确指出真实失败时,此步骤完成。
3. Report
3. 报告
Summarize from the script output. Cite printed log paths; do not paste full
CI logs. A set cap marker in means that list is incomplete. Green CI
or zero threads is .
--jsonSUCCESSTerminal values are , (empty or no PR), and .
SUCCESSNO_CHANGESBLOCKED从脚本输出中提取摘要。引用打印出的日志路径;请勿粘贴完整的CI日志。 输出中的长度限制标记表示列表内容不完整。CI状态正常或线程数量为0时标记为 。
--jsonSUCCESS终端状态包括 、(无内容或无PR)和 。
SUCCESSNO_CHANGESBLOCKED