Skill Learning

triage

1. Bilingual SKILL.md

左右滑动可直接切换英文版与中文版;两种语言按段落自动对齐。英文中的蓝色虚线词语可点击查看解释。共标记 16 处。

入口 skill:triage左右滑动切换语言 · 段落位置自动对齐
# Triage
Move issues on the project issue tracker through a small state machine of triage roles.
If this repo treats external pull requests as a (see the issue-tracker config), triage covers them too: ****, using the same roles, same states, and same machine, with a few deltas marked "for a PR" below. Resolve a bare `#42` to an issue or PR per the tracker config.
Every comment or issue posted to the issue tracker during triage **must** start with this disclaimer:
``` > *This was generated by AI during triage.* ```
## Reference docs
- [AGENT-BRIEF.md](AGENT-BRIEF.md): how to write - [OUT-OF-SCOPE.md](OUT-OF-SCOPE.md): how the `.out-of-scope/` knowledge base works
## Roles
Two **category** roles:
- `bug`: something is broken - `enhancement`: new feature or improvement
Five **state** roles:
- `needs-triage`: maintainer needs to evaluate - `needs-info`: waiting on reporter for more information - `ready-for-agent`: fully specified, ready for an AFK agent - `ready-for-human`: needs human implementation - `wontfix`: will not be actioned
For a PR, the same states read against the attached code: `ready-for-agent` means a brief is attached and an agent should take the next step on the diff; `ready-for-human` means it's ready for a human to merge.
Every triaged issue should . If state roles conflict, flag it and ask the maintainer before doing anything else.
These are . The actual label strings used in the issue tracker may differ. The mapping should have been provided to you. If not, tell the user to run `/setup-matt-pocock-skills`.
State transitions: an unlabeled issue normally goes to `needs-triage` first; from there it moves to `needs-info`, `ready-for-agent`, `ready-for-human`, or `wontfix`. `needs-info` returns to `needs-triage` once the reporter replies. The maintainer can override at any time; and ask before proceeding.
## Invocation
The maintainer invokes `/triage` and describes what they want in natural language. Interpret the request and act. Examples:
- "Show me anything that needs my attention" - "Let's look at #42" (issue or PR) - "Move #42 to ready-for-agent" - "What's ready for agents to pick up?"
## Show what needs attention
Query the issue tracker and present three buckets, :
1. **Unlabeled**: never triaged. 2. **`needs-triage`**: evaluation in progress. 3. **`needs-info` with reporter activity since the last triage notes**: needs re-evaluation.
When PRs are in scope, include external PRs in these buckets and tag each line `[PR]` or `[issue]`. Discovery surfaces only *external* PRs (the tracker config defines who counts as external), so a collaborator's in-flight PR is not triage work. ; an explicitly named PR is always triaged regardless of author.
Show counts and a one-line summary per item. Let the maintainer pick.
## Triage a specific issue or PR
1. **Gather context.** Read the full issue or PR (body, comments, labels, author, dates; for a PR, the diff too). Parse any so you don't re-ask resolved questions. Explore the codebase using the project's domain glossary, respecting ADRs in the area. Run two checks against the codebase: (a) **redundancy**: search for an existing implementation of the requested behavior (not just the request's wording), and report where you looked. If found, it's an already-implemented `wontfix` (step 5). (b) **prior rejection**: read `.out-of-scope/*.md` and surface any that resembles this request.
2. **Recommend.** Tell the maintainer your category and state recommendation with reasoning, plus a brief codebase summary relevant to the request (including whether it's already implemented). Wait for direction.
3. **Verify the claim.** Before any grilling, check that . For a bug, reproduce it from the reporter's steps. For a PR, confirm the diff does what it claims: check it out, run the relevant tests or commands. Report what happened: confirmed (with code path), failed, or insufficient detail (a strong `needs-info` signal). A confirmed verification makes a much stronger agent brief.
4. **Grill (if needed).** If the request , call the Skill tool twice, for "grilling" and "domain-modeling", and grill it into shape a round of questions at a time, sharpening domain terms and updating `CONTEXT.md`/ADRs inline .
5. **Apply the outcome:** - `ready-for-agent`: post an agent brief comment ([AGENT-BRIEF.md](AGENT-BRIEF.md)). - `ready-for-human`: same structure as an agent brief, but note why it can't be delegated (judgment calls, external access, design decisions, manual testing). - `needs-info`: post triage notes (template below). - For `wontfix`, close the issue, with the comment depending on *why*: - **Already implemented**: the change already exists in the codebase. Point to where it lives; do **not** write to `.out-of-scope/` (that KB is for *rejected* requests, not built ones). - **Rejected (bug)**: give a polite explanation, then close. - **Rejected (enhancement)**: write to `.out-of-scope/`, link to it from a comment, then close ([OUT-OF-SCOPE.md](OUT-OF-SCOPE.md)). - `needs-triage`: apply the role. Optional comment if there's partial progress.
## Quick state override
If the maintainer says "move #42 to ready-for-agent", trust them and apply the role directly. Confirm what you're about to do (role changes, comment, close), then act. Skip grilling. If moving to `ready-for-agent` without a grilling session, ask whether they want to write an agent brief.
## Needs-info template
```markdown ## Triage Notes **What we've established so far:** - point 1 - point 2 **What we still need from you (@reporter):** - question 1 - question 2 ```
Capture everything resolved during grilling under "established so far" so the work isn't lost. Questions must be , not "please provide more info".
## Resuming a previous session
If exist on the issue or PR, read them, check whether the reporter has answered any , and present an updated picture before continuing. Don't re-ask resolved questions.
# Triage(分诊)
让项目 issue tracker 上的 issue 通过一套由 triage 角色构成的小型状态机流转。
如果该仓库把外部 pull request 也视作一种请求入口(参见 issue-tracker 配置),triage 同样覆盖它们:**PR 就是附带代码的 issue**。它使用相同的角色、状态和状态机,只有少数差异会在下文标注“for a PR”。裸写的 `#42` 应根据 tracker 配置解析为 issue 或 PR。
triage 期间发布到 issue tracker 的每条评论或每个 issue,**必须**以这段免责声明开头:
``` > *This was generated by AI during triage.* ```
## 参考文档
- [AGENT-BRIEF.md](AGENT-BRIEF.md):如何编写经得住时间变化的 agent 简报 - [OUT-OF-SCOPE.md](OUT-OF-SCOPE.md):`.out-of-scope/` 知识库如何运作
## 角色
两个**类别(category)**角色:
- `bug`:某些东西坏了 - `enhancement`:新功能或改进
五个**状态(state)**角色:
- `needs-triage`:维护者需要评估 - `needs-info`:等待报告者提供更多信息 - `ready-for-agent`:已完整定义,可交给 AFK agent - `ready-for-human`:需要人类实现 - `wontfix`:不会采取行动
对于 PR,同一组状态要结合其附带代码来理解:`ready-for-agent` 表示已经附有简报,agent 应对该 diff 执行下一步;`ready-for-human` 表示已经可以由人类合并。
每个完成 triage 的 issue 都应恰好带有一个类别角色和一个状态角色。若状态角色冲突,应先标出冲突并询问维护者,在此之前不要做其他事情。
这些是规范角色名。issue tracker 实际使用的 label 字符串可能不同。你本应已获得对应映射;若没有,请让用户运行 `/setup-matt-pocock-skills`。
状态转换:无标签 issue 通常先进入 `needs-triage`;之后再流转到 `needs-info`、`ready-for-agent`、`ready-for-human` 或 `wontfix`。报告者回复后,`needs-info` 返回 `needs-triage`。维护者随时可以覆盖状态;遇到看起来异常的转换,应先标出并询问,再继续。
## 调用方式
维护者调用 `/triage`,并用自然语言描述自己的目标。理解请求后执行。示例:
- “把所有需要我关注的内容列出来” - “我们看看 #42”(issue 或 PR) - “把 #42 移到 ready-for-agent” - “哪些内容已经可以让 agent 接手?”
## 展示需要关注的内容
查询 issue tracker,并按从旧到新的顺序呈现三个分组:
1. **无标签(Unlabeled)**:从未做过 triage。 2. **`needs-triage`**:正在评估。 3. **`needs-info`,且报告者在上次 triage notes 后有新活动**:需要重新评估。
如果 PR 在范围内,把外部 PR 也纳入这些分组,并在每行标注 `[PR]` 或 `[issue]`。发现阶段只展示*外部* PR(由 tracker 配置定义谁算外部人员),因此协作者正在进行的 PR 不属于 triage 工作。这个筛选只作用于发现阶段;无论作者是谁,显式点名的 PR 都必须接受 triage。
展示数量以及每项的一行摘要,让维护者选择。
## 对某个具体 issue 或 PR 做 triage
1. **收集上下文。** 阅读完整 issue 或 PR(正文、评论、标签、作者、日期;对于 PR 还要读 diff)。解析此前的 triage notes,避免重复询问已经解决的问题。使用项目领域词汇表探索代码库,并遵守相关区域的 ADR。对代码库执行两项检查:(a) **冗余检查(redundancy)**:按领域概念搜索请求行为是否已经实现,而不只是搜索请求中的原始措辞,并报告搜索位置。若已实现,就进入“already implemented”的 `wontfix`(第 5 步)。(b) **此前拒绝(prior rejection)**:阅读 `.out-of-scope/*.md`,找出与当前请求相似的记录。
2. **提出建议。** 告诉维护者你建议的类别和状态、理由,以及与该请求有关的简短代码库摘要(包括它是否已经实现)。然后等待指示。
3. **核验主张。** 在任何深入追问之前,先检查该主张是否成立。对于 bug,按报告者的步骤复现。对于 PR,验证 diff 是否实现了它声称的行为:检出代码并运行相关测试或命令。报告结果:已确认(附代码路径)、失败,或细节不足(这是很强的 `needs-info` 信号)。经过确认的核验能显著增强 agent 简报。
4. **深入追问(如有需要)。** 如果请求还需充实,调用 Skill 工具两次,分别加载 “grilling” 和 “domain-modeling”;每轮提出一组问题,把请求打磨成形,同时锐化领域术语,并随着决策落地就地更新 `CONTEXT.md`/ADR。
5. **应用结果:** - `ready-for-agent`:发布一条 agent 简报评论([AGENT-BRIEF.md](AGENT-BRIEF.md))。 - `ready-for-human`:使用与 agent 简报相同的结构,但注明为何无法委派(判断取舍、外部访问、设计决策、手工测试)。 - `needs-info`:发布 triage notes(模板见下文)。 - 对于 `wontfix`,关闭 issue,并根据*原因*选择评论内容: - **已经实现(Already implemented)**:代码库中已存在该变更。指出它所在的位置;**不要**写入 `.out-of-scope/`(该知识库记录的是*被拒绝*的请求,而不是已构建的功能)。 - **拒绝(bug)**:礼貌说明原因,然后关闭。 - **拒绝(enhancement)**:写入 `.out-of-scope/`,在评论中链接该记录,然后关闭([OUT-OF-SCOPE.md](OUT-OF-SCOPE.md))。 - `needs-triage`:应用该角色。如果已有部分进展,可选发评论。
## 快速覆盖状态
如果维护者说“把 #42 移到 ready-for-agent”,就信任他们并直接应用该角色。先确认你将要执行的操作(更改角色、发表评论、关闭),然后行动。跳过深入追问。如果没有经过 grilling session 就移到 `ready-for-agent`,询问他们是否希望编写 agent 简报。
## Needs-info 模板
```markdown ## Triage 记录 **目前已经确认的内容:** - 要点 1 - 要点 2 **我们仍需要你(@reporter)提供的内容:** - 问题 1 - 问题 2 ```
把深入追问期间已经解决的所有内容都记在“目前已经确认的内容”下,以免工作成果丢失。问题必须具体、可操作,不能只写“请提供更多信息”。
## 恢复此前的会话
如果 issue 或 PR 中已经存在先前的 triage notes,先阅读它们,检查报告者是否回答了尚未解决的问题,并在继续前呈现更新后的现状。不要重复询问已经解决的问题。

Entry SHA-256: 623a2ed692bdc77d2090e2a3dea3b627dd722ad3bbaca0be83aada75292c8fc4

2. Why This Skill Is Clever

一句话核心机制

把外部进入的 issue 与 PR 统一投射到“一个类别角色 + 一个状态角色”的小型状态机中,先做代码与证据核验,再由维护者确认,最后产出可执行简报、具体追问或有依据的关闭记录。

触发与调用边界

直接来源: frontmatter 的 disable-model-invocation: true 说明 /triage 必须由维护者显式调用。调用请求可以是浏览待办、查看某个 #42、直接覆盖状态,或寻找 agent 可领取的工作。

直接来源: 它处理 tracker 上的 issue;只有仓库的 issue-tracker 配置把外部 PR 设为 request surface 时,发现列表才纳入外部 PR。显式点名的 PR 不受“仅发现外部 PR”过滤器限制。

直接来源: label 映射是硬前置条件。技能只规定 canonical role names,实际 tracker 字符串应由 /setup-matt-pocock-skills 提供,缺失时不得猜测。

支持性上下文: docs/engineering/triage.md 进一步把边界说清:triage 是外部来件的 on-ramp,不应该重复处理 /to-tickets 已经生成并标为 agent-ready 的自建工单。这个说明有助于理解定位,但不属于所选 SKILL.md 原文。

信息架构 / 执行顺序

  1. 建立统一词汇: 两个 category roles 与五个 state roles 形成 tracker 无关的规范模型。
  2. 发现待关注项: 按最旧优先列出无标签、needs-triage、以及报告者有新活动的 needs-info。
  3. 收集完整事实: 读取正文、评论、标签、作者、日期;PR 还要读 diff,并继承 prior triage notes。
  4. 执行两项便宜的否证检查: 按领域概念查重,并读取 .out-of-scope/ 查找此前拒绝。
  5. 先建议、后等待: 向维护者给出类别、状态、理由及相关代码库摘要,不直接改 tracker。
  6. 核验主张: bug 按步骤复现,PR 检出后运行相关测试,结果限定为 confirmed、failed 或 insufficient detail。
  7. 按需补全: 只有信息不足时才调用 grilling 与 domain-modeling,边问边更新 CONTEXT.md/ADR。
  8. 应用终态动作: 写 agent brief、写 needs-info notes、写人类实现理由,或根据不同原因关闭。
  9. 恢复连续性: 后续会话读取旧 notes,剔除已回答问题,不重复提问。

最巧妙的设计点

1. 用两个正交维度压缩 tracker 混乱

“exactly one category role and one state role”

直接来源: 每个 triage 项必须恰好有一个类别角色和一个状态角色;状态冲突时先停止并问维护者。

解释: bug/enhancement 回答“它是什么”,五种 state 回答“下一步由谁做什么”。把分类与进度拆成正交轴,比堆叠含义混杂的标签更容易查询,也产生了可自动检查的不变量。

2. 把 PR 重新建模为附带代码的 issue

“a PR is an issue with attached code”

直接来源: PR 与 issue 共用角色、状态和状态机,仅在核验时多读 diff、检出代码并运行测试;ready-for-human 则解释为可由人合并。

解释: 这是一种强力的统一模型:大部分工作流只写一次,差异作为窄 delta 标注。它避免维护两套易漂移的 triage 算法,同时保留代码型请求所需的验证步骤。

3. 建议与副作用之间有明确的人类门

“Wait for direction.”

直接来源: agent 先呈现类别与状态建议、理由和代码摘要,然后等待维护者指示。即使是 quick override,也要先确认将执行的 role change、comment 与 close。

解释: 它把可逆的分析自动化,把不可逆或外部可见的 tracker 写入留给人类确认。维护者不必亲自做检索,却仍保留产品取舍与关闭请求的控制权。

4. 在“完善需求”之前先验证请求是否真实

“Before any grilling, check that the claim holds up.”

直接来源: bug 要复现,PR 要检出并运行相关测试;核验结果必须报告为已确认、失败或细节不足。与此同时还要检查已实现和此前拒绝。

解释: 这是执行顺序上的关键优化。若功能早已存在、主张无法复现或此前已拒绝,继续 grilling 只会精炼一个不该进入实现队列的请求。先做便宜的事实检查,减少无效访谈和错误简报。

5. wontfix 不是一个模糊垃圾桶

“with the comment depending on why”

直接来源: 已实现、拒绝 bug、拒绝 enhancement 三种关闭原因有不同动作。只有被拒绝的 enhancement 写入 .out-of-scope/;已构建功能绝不能写入该知识库。

解释: 这保护了负面知识库的语义纯度。若把“已经实现”也写成 out-of-scope,未来的概念匹配会把真实能力误判为产品拒绝,污染后续查重和决策。

6. 会话连续性被编码进公开记录

“Don't re-ask resolved questions.”

直接来源: needs-info 模板把“已确认内容”与“仍需回答”分开;恢复会话时必须读取旧 notes、检查新回复,并只呈现更新后的未决问题。

解释: issue comment 不只是沟通文本,也是跨会话状态。把事实和 frontier 明确写入 tracker,让新的 agent 或维护者无需依赖旧上下文窗口即可继续推进。

防失败机制与显式不变量

直接来源:

取舍、可移植风险与宿主假设

解释: 五状态模型简单易查,却可能缺少 blocked、deferred 或“已实现待验证”等本地状态;严格保持一个状态角色需要仓库把额外维度放到其他标签。按领域概念查重与匹配 prior rejection 依赖模型理解质量,误匹配会造成错误 wontfix。对 PR 的“同一状态机”抽象也依赖 tracker 能读取 diff、检出分支并运行测试。

支持性上下文: companion docs 记录了目前尚未加入 blocked/deferred/implemented 状态,也指出批量 triage 时若只看廉价列表而不逐项读评论,会生成错误简报;GitHub 外部 PR 查询与自动创建标签也存在已知适配问题。这些是现实实现风险,不是所选源文件声称已经解决的能力。

解释: 技能还假设宿主提供 Skill tool、项目 domain glossary、相关 ADR、CONTEXT.md、issue-tracker 配置,以及 grilling 和 domain-modeling 两个支持技能。迁移到不支持这些原语的 harness 时,需要显式适配,而不能把名称原样照搬。

可迁移原则

  1. 把分类与流程状态拆成正交维度,并为每个维度定义基数不变量。
  2. 先做廉价否证,再投入高成本访谈。 查已实现、查旧决策、复现主张应早于需求完善。
  3. 统一领域模型,只把真正差异写成窄 delta。 PR 可以复用 issue 的机器,但核验步骤不同。
  4. 把外部副作用放在人类确认门之后。 自动推荐不等于自动关闭或改标签。
  5. 让公开工作记录承载跨会话状态。 分离已确认事实与未决问题,新的执行者就能无损恢复。
  6. 保护知识库语义。 不同关闭原因写入不同存储,避免未来检索被错误历史污染。

今日实践题

如果一个外部 PR 声称“修复了登录偶发失败”,但代码库里似乎已有相同修复,且 .out-of-scope/ 记录过一个措辞不同的登录增强请求:你会按什么顺序检查、建议哪种状态,并在哪一步要求维护者确认?

Evidence note

本文关于角色、状态转换、PR 处理、发现分组、完整上下文读取、查重、此前拒绝、建议等待、主张核验、按需 grilling、结果动作、quick override、needs-info 模板和恢复规则的结论均来自所选 skills/engineering/triage/SKILL.md。关于 triage 只服务外部来件、主工作流汇合点、已知状态缺口、批量处理与 tracker 适配问题的信息来自 docs/engineering/triage.md 和 ask-matt,仅作支持性上下文。关于正交状态模型、先否证后访谈、外部副作用门、知识库语义纯度和跨会话状态的判断属于设计解释。

Source & provenance
Repository path
skills/engineering/triage/SKILL.md
Generated
2026-08-25 08:23 Asia/Shanghai
Upstream commit
6654f6b60cd9d5be8b54c6fafe44346dabeb3b76
Source
View on GitHub