github

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GitHub

GitHub

Work GitHub end to end with the
gh
CLI (REST fallback where noted): auth, issues, the PR lifecycle, issue-to-PR delivery, code review, and repo management. This skill consolidates six former skills; each workflow lives complete in its reference file — ALWAYS read the matching reference before starting that workflow, the body below only routes.
通过
gh
CLI端到端处理GitHub操作(标注处会回退使用REST):认证、议题、PR生命周期、从议题到PR的交付、代码评审以及仓库管理。该技能整合了此前的六项技能;每个工作流程都完整存放在对应的参考文件中——开始任一工作流程前,请务必阅读对应的参考文件,下文仅作为导航指引。

Routing

导航

TaskRead first
Auth broken / new machine / token or SSH setup / gh login
references/auth.md
Create, triage, label, assign, close issues
references/issues.md
Branch, commit, open PR, watch CI, merge
references/pr-workflow.md
Carry an ISSUE to a verified PR (full delivery loop)
references/issue-to-pr.md
Review someone's PR: diffs, inline comments, verdict
references/code-review.md
Clone/create/fork repos, remotes, releases
references/repo-management.md
Supporting assets:
scripts/gh-env.sh
+
scripts/git-credential-token.py
(auth helpers),
templates/
(PR bodies, bug report, feature request),
references/ci-troubleshooting.md
,
references/conventional-commits.md
,
references/github-api-cheatsheet.md
,
references/review-output-template.md
.
任务先阅读
认证失效/新机器配置/令牌或SSH设置/gh登录
references/auth.md
创建、分类、标记、分配、关闭议题
references/issues.md
分支、提交、开启PR、监控CI、合并
references/pr-workflow.md
将议题转化为已验证的PR(完整交付流程)
references/issue-to-pr.md
评审他人的PR:差异对比、行内评论、评审结论
references/code-review.md
克隆/创建/复刻仓库、远程仓库、发布版本
references/repo-management.md
配套资源:
scripts/gh-env.sh
+
scripts/git-credential-token.py
(认证辅助工具)、
templates/
(PR正文、Bug报告、功能请求模板)、
references/ci-troubleshooting.md
、
references/conventional-commits.md
、
references/github-api-cheatsheet.md
、
references/review-output-template.md
。

Core discipline (applies to every workflow)

核心准则(适用于所有工作流程)

  • Preflight once per session:
    gh auth status
    — if it fails, go to
    references/auth.md
    before anything else.
  • Prefer
    gh
    over raw REST; drop to
    gh api
    only for endpoints the porcelain lacks (the cheatsheet lists them).
  • Never report CI green without checking
    gh pr checks
    yourself; never claim merged without verifying
    state,mergedAt
    .
  • Read full context before writing:
    gh issue view --comments
    /
    gh pr view --comments
    — decisions live in threads, not titles.
  • Sweep for duplicates before creating anything:
    gh pr list --search
    /
    gh issue list --search
    .
  • 每次会话前预检:执行
    gh auth status
    ——如果失败,请先查看
    references/auth.md
    ,再进行其他操作。
  • 优先使用
    gh
    而非原生REST;仅当
    gh
    未覆盖对应端点时,才使用
    gh api
    (相关端点列在速查表中)。
  • 未亲自查看
    gh pr checks
    ,切勿报告CI已通过;未验证
    state,mergedAt
    ,切勿声称已合并。
  • 撰写内容前先阅读完整上下文:
    gh issue view --comments
    /
    gh pr view --comments
    ——决策记录在讨论线程中,而非标题里。
  • 创建任何内容前先排查重复项:
    gh pr list --search
    /
    gh issue list --search
    。

Verification

验证

  • The workflow's own reference file defines done for that task.
  • Cross-cutting: every claim about remote state (CI, merge, release, issue state) is backed by a fresh
    gh
    read, never memory.
  • 每个工作流程的完成标准由其对应的参考文件定义。
  • 跨流程要求:所有关于远程状态的声明(CI、合并、发布、议题状态)都必须基于最新的
    gh
    查询结果,而非记忆。