triage

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Triage GitHub Issues

GitHub问题分类处理

Triage issues for this repository by applying appropriate labels.
为当前仓库的问题添加合适的标签进行分类处理。

Repository Context

仓库上下文

  • Current repo: !
    gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || echo "unknown"
  • Open issues: !
    gh issue list --state open --json number --jq 'length' 2>/dev/null || echo "?"
  • Existing labels: !
    gh label list --json name -q '.[].name' 2>/dev/null | head -20 || echo "none found"

  • 当前仓库:!
    gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || echo "unknown"
  • 未关闭问题数量:!
    gh issue list --state open --json number --jq 'length' 2>/dev/null || echo "?"
  • 现有标签:!
    gh label list --json name -q '.[].name' 2>/dev/null | head -20 || echo "none found"

Scope

处理范围

Determine which issues to triage based on the arguments: $ARGUMENTS
ArgumentBehavior
(empty)Only unlabeled issues (default)
unlabeled
Only issues without any labels
all
All open issues
N
Specific issue (e.g.,
67
)
N-M
Range of issues inclusive (e.g.,
60-67
)
根据参数确定需要分类的问题:$ARGUMENTS
参数行为
(空值)仅处理未添加任何标签的问题(默认)
unlabeled
仅处理无标签的问题
all
所有未关闭的问题
N
指定单个问题(例如:
67
N-M
指定问题范围(包含首尾,例如:
60-67

Process

处理流程

  1. Fetch available labels — run
    gh label list --json name,description
    to understand the label taxonomy. Labels are organized into type, effort, priority, and area categories.
  2. Fetch target issues — based on the scope above. For each issue, fetch the full body:
    bash
    gh issue view {number} --json number,title,body,labels
  3. For each issue:
    • Read the title and full body carefully
    • If needed, explore the codebase (
      Glob
      ,
      Grep
      ,
      Read
      ) to understand the affected code
    • Classify: one type, one effort, one priority, one or more areas
    • Track relationships with other issues (duplicates, related, blocking)
    • Apply labels:
      bash
      gh issue edit {number} --add-label "type,effort/level,P#,area.domain"
    • Skip issues that already have complete labeling (type + effort + priority + area)
    • For partially labeled issues, only add missing label categories
  4. Output a triage summary:
    ## Triage Summary
    
    | Issue | Title | Labels Applied | Reasoning |
    |-------|-------|----------------|-----------|
    | #67 | ... | bug, effort/low, P1, core.config | ... |
    
    **Totals:**
    - Issues triaged: X
    - Already labeled (skipped): Y
    - By priority: P0(n), P1(n), P2(n), P3(n)
    
    ## Relationships Discovered
    
    | Issues | Relationship | Notes |
    |--------|--------------|-------|
    | #61, #62 | Related | Both involve config/logging UX |
  1. 获取可用标签 — 执行
    gh label list --json name,description
    以了解标签体系。标签分为类型、工作量、优先级和领域四类。
  2. 获取目标问题 — 根据上述范围确定。针对每个问题,获取完整内容:
    bash
    gh issue view {number} --json number,title,body,labels
  3. 针对每个问题
    • 仔细阅读标题和完整内容
    • 如有需要,查看代码库(使用
      Glob
      Grep
      Read
      工具)以了解受影响的代码
    • 分类:添加一个类型标签、一个工作量标签、一个优先级标签,以及一个或多个领域标签
    • 记录与其他问题的关联关系(重复、相关、阻塞)
    • 添加标签:
      bash
      gh issue edit {number} --add-label "type,effort/level,P#,area.domain"
    • 跳过已包含完整标签(类型+工作量+优先级+领域)的问题
    • 对于标签不完整的问题,仅补充缺失类别的标签
  4. 输出分类处理总结
    ## 分类处理总结
    
    | 问题编号 | 标题 | 添加的标签 | 分类依据 |
    |-------|-------|----------------|-----------|
    | #67 | ... | bug, effort/low, P1, core.config | ... |
    
    **统计信息:**
    - 已分类处理的问题数量:X
    - 已完成标签添加(已跳过):Y
    - 按优先级统计:P0(n), P1(n), P2(n), P3(n)
    
    ## 发现的关联关系
    
    | 问题编号 | 关联类型 | 备注 |
    |--------|--------------|-------|
    | #61, #62 | 相关 | 均涉及配置/日志用户体验 |

Rules

规则

  • Don't hardcode labels — always fetch current labels first, they may change
  • Respect existing labels — don't remove labels, only add missing ones
  • Check issue body — titles alone aren't enough context
  • Use the codebase — if understanding a relationship requires seeing how modules connect, look
  • When uncertain, note it — flag ambiguous issues in the summary rather than guessing
  • 不要硬编码标签 — 始终先获取当前标签,标签可能会变更
  • 尊重现有标签 — 不要移除标签,仅补充缺失的标签
  • 查看问题完整内容 — 仅标题不足以提供足够上下文
  • 参考代码库 — 如果需要了解模块间的关联关系以判断问题联系,请查看代码
  • 不确定时记录 — 在总结中标记模糊的问题,而非猜测