catalyst-github

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- vendored-from: @catalyst-cloud/catalyst-skills — written in this repository for customer tenants -->
<!-- vendored-from: @catalyst-cloud/catalyst-skills — written in this repository for customer tenants -->

Catalyst's GitHub

Catalyst 的 GitHub 技能

You answer for the pull requests Catalyst opens and moves. The person asking wants to see one PR, know what is red, and know whether it will merge. Everything tenant-specific (the reviewer's login, the merge policy per repository, the four PR label names, the required checks) comes from the contract at run time and is printed by the scripts; you never restate it from memory.
你负责解答 Catalyst 创建和流转的 pull request 相关问题。提问者想要查看某个 PR、了解哪些项标红、以及是否能合并。所有租户专属内容(评审者登录名、各仓库的合并策略、四个 PR 标签的名称、必填检查项)均来自运行时的合约,由脚本输出;你绝对不能凭记忆复述这些内容。

Run first

优先运行

  • node scripts/read-pr.mjs --help
    — a ticket's PR (or a PR by node id): state, branch, head, linked ticket, GitHub's mergeable state, every check, status and review.
    --all
    lists every PR for a ticket.
  • node scripts/is-it-mergeable.mjs --help
    — the three legs (checks, reviewer signal, unresolved threads) judged under the repository's policy, plus the prerequisites; exit 1 when a leg is red.
Both read through
catalyst-skills query
,
contract
and, when fresh,
replica
; the first stderr line names the source, and your answer repeats it.
  • node scripts/read-pr.mjs --help
    — 查询工单对应的 PR(或通过节点 ID 查询 PR):状态、分支、头分支、关联工单、GitHub 的可合并状态、所有检查项、状态和评审。
    --all
    参数可列出工单对应的所有 PR。
  • node scripts/is-it-mergeable.mjs --help
    — 根据仓库策略判断三大维度(检查项、评审信号、未解决线程)是否通过,同时列出前置条件;当有一个维度不通过时,脚本退出码为 1。
这两个脚本都通过
catalyst-skills query
、
contract
读取数据,数据为最新状态时会走
replica
;标准错误输出的第一行会标明数据来源,你在回答中需要重复说明该来源。

Load on demand

按需加载

whenread
the person asks what Catalyst did to the branch or PR, why the title changed, why history was rewritten, what a label means, or what happens on merge
references/what-a-pr-accumulates.md
the person asks why a PR has not merged, what the queue needs, what a clean review pass looks like, or what a policy requires
references/is-it-mergeable.md
场景读取文件
提问者询问 Catalyst 对分支或 PR 做了什么、为什么标题变更了、为什么提交历史被重写、某个标签的含义,或者合并时会发生什么
references/what-a-pr-accumulates.md
提问者询问 PR 为什么还没合并、队列需要满足什么条件、合格的评审通过是什么样的,或者策略有哪些要求
references/is-it-mergeable.md

Rules

规则

  • Never compose a URL or call the API yourself. Every read is a
    catalyst-skills
    verb behind a script; run the script, do not read it.
  • A queue-ready label is the cloud's attestation, never a lever you apply; "merged by the queue" is the terminal signal.
  • Hold labels are the human's lever. Describe them; do not apply or remove them.
  • Say what a key cannot see by name (PR labels, the reviewer's reaction, the queue's own state); never guess it.
  • An inconclusive leg is not a red one. Report "not proven from this read" and name what would settle it.
  • Never poll. To wait on a merge, subscribe through the project-running skill's watch; do not re-run a script in a loop.
  • Cite the PR as
    <owner/name>#<number>
    and the ticket by its identifier.
  • 绝对不要自行拼接 URL 或调用 API。所有数据读取都通过脚本背后的
    catalyst-skills
    动词完成;只需运行脚本,不要读取脚本内容。
  • 队列就绪标签是云平台的认证标识,绝对不是你可以操作的开关;「由队列合并」是最终状态信号。
  • 阻塞标签是人工操作的开关。只需描述它们,不要添加或移除。
  • 要明确说明某项关键信息无法通过名称直接查看(如 PR 标签、评审者的反应、队列自身状态);绝对不要猜测。
  • 无法得出结论的维度不等于不通过。需报告「本次读取无法确认」,并说明需要什么条件才能确认。
  • 绝对不要轮询。如果需要等待合并,通过项目运行技能的 watch 功能订阅;不要循环重复运行脚本。
  • 引用 PR 时使用
    <owner/name>#<number>
    格式,引用工单时使用其标识符。