issue-triage

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Issue Triage

Issue Triage(问题分类处理)

Quand utiliser

适用场景

SkillUsageOutput
/issue-triage
Trier, analyser, commenter les issuesTableaux d'action + deep analysis + commentaires postés
/repo-recap
Récap général pour partager avec l'équipeRésumé Markdown (PRs + issues + releases)
Déclencheurs :
  • Manuellement :
    /issue-triage
    ou
    /issue-triage all
    ou
    /issue-triage 42 57
  • Proactivement : quand >10 issues ouvertes sans triage, ou issue stale >30j détectée

Skill使用方式输出内容
/issue-triage
分类、分析、评论问题行动表格 + 深度分析内容 + 已发布评论
/repo-recap
生成团队共享的项目概览Markdown格式总结(包含PR、问题、版本发布)
触发方式 :
  • 手动触发:
    /issue-triage
    /issue-triage all
    /issue-triage 42 57
  • 自动触发:当未分类的未结问题超过10个,或检测到超过30天未更新的问题时

Langue

语言设置

  • Vérifier l'argument passé au skill
  • Si
    en
    ou
    english
    → tableaux et résumé en anglais
  • Si
    fr
    ,
    french
    , ou pas d'argument → français (défaut)
  • Note : les commentaires GitHub (Phase 3) restent TOUJOURS en anglais (audience internationale)

Workflow en 3 phases : audit automatique → deep analysis opt-in → commentaires avec validation obligatoire.
  • 检查传入Skill的参数
  • 若为
    en
    english
    → 表格和总结内容为英文
  • 若为
    fr
    french
    或无参数 → 默认使用法语
  • 注意:GitHub评论(第三阶段)始终使用英文(面向国际用户群体)

工作流分为3个阶段:自动审核 → 可选深度分析 → 需确认的评论操作。

Préconditions

前置条件

bash
git rev-parse --is-inside-work-tree
gh auth status
Si l'un échoue, stop et expliquer ce qui manque.

bash
git rev-parse --is-inside-work-tree
gh auth status
若其中任意命令执行失败,终止流程并说明缺失的条件。

Phase 1 — Audit (toujours exécutée)

第一阶段 — 审核(始终执行)

Data Gathering (commandes en parallèle)

数据收集(并行执行命令)

bash
undefined
bash
undefined

Identité du repo

获取仓库信息

gh repo view --json nameWithOwner -q .nameWithOwner
gh repo view --json nameWithOwner -q .nameWithOwner

Issues ouvertes avec métadonnées complètes

获取带完整元数据的未结问题

gh issue list --state open --limit 100
--json number,title,author,createdAt,updatedAt,labels,assignees,body,comments
gh issue list --state open --limit 100
--json number,title,author,createdAt,updatedAt,labels,assignees,body,comments

PRs ouvertes (pour cross-référence)

获取未结PR(用于关联)

gh pr list --state open --limit 50 --json number,title,body
gh pr list --state open --limit 50 --json number,title,body

Issues fermées récemment (pour détection doublons)

获取近期已关闭的问题(用于检测重复项)

gh issue list --state closed --limit 20
--json number,title,labels,closedAt
gh issue list --state closed --limit 20
--json number,title,labels,closedAt

Collaborateurs (pour protéger les issues des mainteneurs)

获取协作人员(用于保护维护者的问题)

gh api "repos/{owner}/{repo}/collaborators" --jq '.[].login'

**Fallback collaborateurs** : si `gh api .../collaborators` échoue (403/404) :
```bash
gh pr list --state merged --limit 10 --json author --jq '.[].author.login' | sort -u
Si toujours ambigu, demander à l'utilisateur via
AskUserQuestion
.
Note :
author
est un objet
{login: "..."}
— toujours extraire
.author.login
.
gh api "repos/{owner}/{repo}/collaborators" --jq '.[].login'

**协作人员获取备选方案**:若 `gh api .../collaborators` 执行失败(403/404错误):
```bash
gh pr list --state merged --limit 10 --json author --jq '.[].author.login' | sort -u
若仍无法确定,通过
AskUserQuestion
询问用户。
注意
author
是一个
{login: "..."}
对象 — 需始终提取
.author.login
字段。

Analyse — 6 dimensions

分析 — 6个维度

1. Catégorisation (labels existants > inférence titre/body) :
  • Bug : mots-clés
    crash
    ,
    error
    ,
    fail
    ,
    broken
    ,
    regression
    ,
    wrong
    ,
    unexpected
  • Feature :
    add
    ,
    implement
    ,
    support
    ,
    new
    ,
    feat:
  • Enhancement :
    improve
    ,
    optimize
    ,
    better
    ,
    enhance
    ,
    refactor
  • Question/Support :
    how
    ,
    why
    ,
    help
    ,
    unclear
    ,
    docs
    ,
    documentation
  • Duplicate Candidate : voir dimension 3 ci-dessous
2. Cross-ref PRs :
  • Scanner
    body
    de chaque PR ouverte pour
    fixes #N
    ,
    closes #N
    ,
    resolves #N
    (case-insensitive, regex)
  • Construire un map :
    issue_number -> [PR numbers]
  • Une issue liée à une PR mergée → recommander fermeture
3. Détection doublons :
  • Normaliser les titres : lowercase, strip préfixes (
    bug:
    ,
    feat:
    ,
    [bug]
    ,
    [feature]
    , etc.)
  • Jaccard sur mots des titres : si score > 60% entre deux issues → candidat doublon
  • Keywords body overlap > 50% → renforcement du signal
  • Comparer aussi avec issues fermées récentes (20 dernières)
  • Un faux positif peut être confirmé/écarté en Phase 2
4. Classification risque :
  • Rouge : mots-clés
    CVE
    ,
    vulnerability
    ,
    injection
    ,
    auth bypass
    ,
    security
    ,
    exploit
    ,
    unsafe
    ,
    credentials
    ,
    leak
    ,
    RCE
    ,
    XSS
  • Jaune :
    breaking change
    ,
    migration
    ,
    deprecation
    ,
    remove API
    ,
    breaking
    ,
    incompatible
  • Vert : tout le reste
5. Staleness :
  • 30j sans activité (updatedAt) → Stale
  • 90j sans activité → Very Stale
  • Calculer depuis la date actuelle
6. Recommandations d'action :
  • Accept & Prioritize
    : issue claire, reproducible, dans scope
  • Label needed
    : issue sans label
  • Comment needed
    : info manquante, body insuffisant
  • Linked to PR
    : une PR ouverte référence cette issue
  • Duplicate candidate
    : candidat doublon identifié (préciser avec
    #N
    )
  • Close candidate
    : stale + aucune activité récente, ou hors scope (jamais si auteur est collaborateur)
  • PR merged → close
    : PR liée est mergée, issue encore ouverte
1. 分类(优先使用现有标签 > 通过标题/内容推断):
  • Bug:包含关键词
    crash
    error
    fail
    broken
    regression
    wrong
    unexpected
  • Feature:包含关键词
    add
    implement
    support
    new
    feat:
  • Enhancement:包含关键词
    improve
    optimize
    better
    enhance
    refactor
  • Question/Support:包含关键词
    how
    why
    help
    unclear
    docs
    documentation
  • Duplicate Candidate:详见下方第3维度
2. PR关联
  • 扫描每个未结PR的内容,查找
    fixes #N
    closes #N
    resolves #N
    (不区分大小写,支持正则匹配)
  • 构建映射关系:
    issue_number -> [PR numbers]
  • 若问题关联的PR已合并 → 建议关闭该问题
3. 重复项检测
  • 标准化标题:转为小写,移除前缀(如
    bug:
    feat:
    [bug]
    [feature]
    等)
  • 标题词杰卡德相似度:若两个问题的相似度得分>60% → 标记为重复候选
  • 内容关键词重叠率>50% → 增强重复信号
  • 同时与近期已关闭的20个问题进行比对
  • 假阳性结果可在第二阶段确认/排除
4. 风险分类
  • 红色:包含关键词
    CVE
    vulnerability
    injection
    auth bypass
    security
    exploit
    unsafe
    credentials
    leak
    RCE
    XSS
  • 黄色:包含关键词
    breaking change
    migration
    deprecation
    remove API
    breaking
    incompatible
  • 绿色:其余所有情况
5. Stale状态检测
  • 超过30天无更新(updatedAt)→ Stale(陈旧)
  • 超过90天无更新 → Very Stale(极度陈旧)
  • 从当前日期开始计算
6. 行动建议
  • Accept & Prioritize
    :问题清晰、可复现、符合项目范围
  • Label needed
    :问题未添加标签
  • Comment needed
    :信息缺失、内容不充分
  • Linked to PR
    :关联了一个未结PR
  • Duplicate candidate
    :已识别为重复候选(需标注对应问题编号
    #N
  • Close candidate
    :陈旧且近期无活动,或超出项目范围(若作者为协作人员则不建议)
  • PR merged → close
    :关联的PR已合并,但问题仍处于未结状态

Output — 5 tableaux

输出 — 5个表格

undefined
undefined

Issues ouvertes ({count})

未结问题 ({count})

Critiques (risque rouge)

高风险(红色风险)

#TitreAuteurÂgeLabelsAction
#标题作者时长标签行动建议

Liées à une PR

关联PR的问题

#TitreAuteurPR(s) liée(s)Status PRAction
#标题作者关联PRPR状态行动建议

Actives

活跃问题

#TitreAuteurCatégorieÂgeLabelsAction
#标题作者分类时长标签行动建议

Doublons candidats

重复候选问题

#TitreDoublon deSimilaritéAction
#标题重复来源相似度行动建议

Stale

陈旧问题

#TitreAuteurDernière activitéAction
#标题作者最后更新时间行动建议

Résumé

总结

  • Total : {N} issues ouvertes
  • Critiques : {N} (risque sécurité ou breaking)
  • Liées à PR : {N}
  • Doublons candidats : {N}
  • Stale (>30j) : {N} | Very Stale (>90j) : {N}
  • Sans labels : {N}
  • Quick wins (à fermer ou labeler rapidement) : {liste}

0 issues → afficher `Aucune issue ouverte.` et terminer.

**Note** : `Âge` = jours depuis `createdAt`, format `{N}j`. Si >30j, afficher en **gras**.
  • 总计:{N}个未结问题
  • 高风险:{N}个(安全风险或破坏性变更)
  • 关联PR:{N}个
  • 重复候选:{N}个
  • 陈旧问题(>30天):{N}个 | 极度陈旧问题(>90天):{N}个
  • 未添加标签:{N}个
  • 快速处理项(可快速关闭或添加标签):{列表}

若无未结问题 → 显示`无未结问题。`并终止流程。

**注意**:`时长` = 从`createdAt`到当前的天数,格式为`{N}天`。若超过30天,以**粗体**显示。

Copie automatique

自动复制

Après affichage du tableau de triage, copier dans le presse-papier :
bash
undefined
显示分类表格后,将内容复制到剪贴板:
bash
undefined

Cross-platform clipboard

跨平台剪贴板命令

clip() { if command -v pbcopy &>/dev/null; then pbcopy elif command -v xclip &>/dev/null; then xclip -selection clipboard elif command -v wl-copy &>/dev/null; then wl-copy else cat fi }
clip <<'EOF' {tableau de triage complet} EOF
Confirmer : `Tableau copié dans le presse-papier.` (FR) / `Triage table copied to clipboard.` (EN)

---
clip() { if command -v pbcopy &>/dev/null; then pbcopy elif command -v xclip &>/dev/null; then xclip -selection clipboard elif command -v wl-copy &>/dev/null; then wl-copy else cat fi }
clip <<'EOF' {完整的分类表格} EOF
确认提示:`表格已复制到剪贴板。`(法语)/ `Triage table copied to clipboard.`(英语)

---

Phase 2 — Deep Analysis (opt-in)

第二阶段 — 深度分析(可选)

Sélection des issues

问题选择

Si argument passé :
  • "all"
    → toutes les issues ouvertes
  • Numéros (
    "42 57"
    ) → uniquement ces issues
  • Pas d'argument → proposer via
    AskUserQuestion
Si pas d'argument, afficher :
question: "Quelles issues voulez-vous analyser en profondeur ?"
header: "Deep Analysis"
multiSelect: true
options:
  - label: "Toutes ({N} issues)"
    description: "Analyse approfondie de toutes les issues avec agents en parallèle"
  - label: "Critiques uniquement"
    description: "Focus sur les {M} issues à risque rouge/jaune"
  - label: "Doublons candidats"
    description: "Confirmer ou écarter les {K} doublons détectés"
  - label: "Stale uniquement"
    description: "Décision close/keep sur les {J} issues stale"
  - label: "Passer"
    description: "Terminer ici — juste l'audit"
Si "Passer" → fin du workflow.
若传入参数
  • "all"
    → 所有未结问题
  • 问题编号(如
    "42 57"
    )→ 仅指定问题
  • 无参数 → 通过
    AskUserQuestion
    询问用户
若无参数,显示:
question: "您希望对哪些问题进行深度分析?"
header: "深度分析"
multiSelect: true
options:
  - label: "全部 ({N}个问题)"
    description: "通过并行Agent对所有问题进行深度分析"
  - label: "仅高风险问题"
    description: "聚焦{M}个红色/黄色风险问题"
  - label: "仅重复候选问题"
    description: "确认或排除{K}个检测到的重复项"
  - label: "仅陈旧问题"
    description: "决定关闭/保留{J}个陈旧问题"
  - label: "跳过"
    description: "到此结束 — 仅完成审核"
若选择“跳过” → 终止工作流。

Exécution de l'analyse

执行分析

Pour chaque issue sélectionnée, lancer un agent via Task tool en parallèle :
subagent_type: general-purpose
model: sonnet
prompt: |
  Analyze GitHub issue #{num}: "{title}" by @{author}

  **Metadata**: Created {createdAt}, last updated {updatedAt}, labels: {labels}

  **Body**:
  {body}

  **Existing comments** ({comments_count} total, showing last 5):
  {last_5_comments}

  **Context**:
  - Linked PRs: {linked_prs or "none"}
  - Duplicate candidate of: {duplicate_of or "none"}
  - Risk classification: {risk_color}

  Analyze this issue and return a structured report:
  ### Scope Assessment
  What is this issue actually asking for? Is it clearly defined?

  ### Missing Information
  What's needed to act on this? (reproduction steps, version, environment, etc.)

  ### Risk & Impact
  Security risk? Breaking change? Who's affected?

  ### Effort Estimate
  XS (<1h) / S (1-4h) / M (1-2d) / L (3-5d) / XL (>1 week)

  ### Priority
  P0 (critical, act now) / P1 (high, this sprint) / P2 (medium, backlog) / P3 (low, someday)

  ### Recommended Action
  One of: Accept & Prioritize, Request More Info, Mark Duplicate (#N), Close (Stale), Close (Out of Scope), Link to Existing PR

  ### Draft Comment
  Draft a GitHub comment in English using the appropriate template from templates/issue-comment.md.
  Be specific, helpful, and constructive.
Si issue a >50 commentaires, résumer les 5 derniers uniquement.
Agréger tous les rapports. Afficher un résumé après toutes les analyses.

对每个选中的问题,通过并行Task工具启动一个Agent:
subagent_type: general-purpose
model: sonnet
prompt: |
  Analyze GitHub issue #{num}: "{title}" by @{author}

  **Metadata**: Created {createdAt}, last updated {updatedAt}, labels: {labels}

  **Body**:
  {body}

  **Existing comments** ({comments_count} total, showing last 5):
  {last_5_comments}

  **Context**:
  - Linked PRs: {linked_prs or "none"}
  - Duplicate candidate of: {duplicate_of or "none"}
  - Risk classification: {risk_color}

  Analyze this issue and return a structured report:
  ### Scope Assessment
  What is this issue actually asking for? Is it clearly defined?

  ### Missing Information
  What's needed to act on this? (reproduction steps, version, environment, etc.)

  ### Risk & Impact
  Security risk? Breaking change? Who's affected?

  ### Effort Estimate
  XS (<1h) / S (1-4h) / M (1-2d) / L (3-5d) / XL (>1 week)

  ### Priority
  P0 (critical, act now) / P1 (high, this sprint) / P2 (medium, backlog) / P3 (low, someday)

  ### Recommended Action
  One of: Accept & Prioritize, Request More Info, Mark Duplicate (#N), Close (Stale), Close (Out of Scope), Link to Existing PR

  ### Draft Comment
  Draft a GitHub comment in English using the appropriate template from templates/issue-comment.md.
  Be specific, helpful, and constructive.
若问题的评论数超过50条,仅总结最后5条。
汇总所有分析报告,完成所有分析后显示总结内容。

Phase 3 — Actions (validation obligatoire)

第三阶段 — 操作(需确认)

Types d'actions possibles

可执行的操作类型

  • Commenter :
    gh issue comment {num} --body-file -
  • Labeler :
    gh issue edit {num} --add-label "{label}"
    (skip si label déjà présent)
  • Fermer :
    gh issue close {num} --reason "not planned"
    (jamais sans validation)
  • 评论
    gh issue comment {num} --body-file -
  • 添加标签:
    gh issue edit {num} --add-label "{label}"
    (若标签已存在则跳过)
  • 关闭问题
    gh issue close {num} --reason "not planned"
    (未经确认绝不执行)

Génération des drafts

生成草稿

Pour chaque issue analysée, générer les actions (commentaire + labels + fermeture si applicable) en utilisant
templates/issue-comment.md
.
Règles :
  • Langue des commentaires : anglais (audience internationale)
  • Ton : professionnel, constructif, factuel
  • Ne jamais re-labeler une issue qui a déjà ce label
  • Ne jamais proposer "close" pour une issue d'un collaborateur
  • Toujours afficher le draft AVANT tout
    gh issue comment
对每个分析过的问题,使用
templates/issue-comment.md
生成操作内容(评论 + 标签 + 关闭操作,若适用)。
规则
  • 评论语言:英语(面向国际用户群体)
  • 语气:专业、建设性、客观
  • 绝不重复添加已存在的标签
  • 绝不建议关闭协作人员提交的问题
  • 在执行
    gh issue comment
    前,必须显示草稿内容

Affichage et validation

显示与确认

Afficher TOUS les drafts au format :
---
显示所有草稿,格式如下:
---

Draft — Issue #{num}: {title}

草稿 — Issue #{num}: {title}

Actions proposées : {Commentaire | Label: "bug" | Fermeture}
Commentaire : {commentaire complet}


Puis demander validation via `AskUserQuestion` :
question: "Ces actions sont prêtes. Lesquelles voulez-vous exécuter ?" header: "Exécuter" multiSelect: true options:
  • label: "Toutes ({N} actions)" description: "Commenter + labeler + fermer selon les drafts"
  • label: "Issue #{x} — {title_truncated}" description: "Exécuter uniquement les actions pour cette issue"
  • label: "Aucune" description: "Annuler — ne rien faire"

(Générer une option par issue + "Toutes" + "Aucune")
建议操作 : {评论 | 添加标签: "bug" | 关闭}
评论内容 : {完整评论}


然后通过`AskUserQuestion`请求确认:
question: "这些操作已准备就绪。您希望执行哪些操作?" header: "执行操作" multiSelect: true options:
  • label: "全部 ({N}项操作)" description: "按照草稿执行评论 + 添加标签 + 关闭操作"
  • label: "Issue #{x} — {title_truncated}" description: "仅执行该问题的操作"
  • label: "不执行任何操作" description: "取消 — 不进行任何操作"

(为每个问题生成一个选项 + “全部” + “不执行任何操作”)

Exécution

执行操作

Pour chaque action validée, exécuter dans l'ordre : commenter → labeler → fermer.
bash
undefined
对每个确认的操作,按顺序执行:评论 → 添加标签 → 关闭问题。
bash
undefined

Commenter

评论

gh issue comment {num} --body-file - <<'COMMENT_EOF' {commentaire} COMMENT_EOF
gh issue comment {num} --body-file - <<'COMMENT_EOF' {评论内容} COMMENT_EOF

Labeler (si applicable)

添加标签(若适用)

gh issue edit {num} --add-label "{label}"
gh issue edit {num} --add-label "{label}"

Fermer (si applicable)

关闭问题(若适用)

gh issue close {num} --reason "not planned"

Confirmer chaque action : `Commentaire posté sur issue #{num}: {title}`

Si "Aucune" → `Aucune action exécutée. Workflow terminé.`

---
gh issue close {num} --reason "not planned"

每个操作执行后确认:`已在Issue #{num}: {title}上发布评论`

若选择“不执行任何操作” → `未执行任何操作。工作流已终止。`

---

Gestion des cas limites

边界情况处理

SituationComportement
0 issues ouvertes
Aucune issue ouverte.
+ terminer
Issue sans bodyCatégoriser par titre, recommander
Comment needed
>50 commentairesRésumer les 5 derniers uniquement
Faux positif doublonPhase 2 confirme/écarte — ne pas agir sur suspicion seule
Labels déjà présentsNe pas re-labeler, signaler "label déjà appliqué"
Issue d'un collaborateurJamais
close candidate
automatique
Rate limit GitHub APIRéduire
--limit
, notifier l'utilisateur
PR mergée liée à issue ouverteRecommander fermeture de l'issue
Issue sans activité >90jVery Stale — proposer fermeture avec message bienveillant
Duplicate confirmed in Phase 2Poster commentaire + fermer en faveur de l'issue originale

场景处理方式
无未结问题显示
无未结问题。
并终止流程
问题无内容通过标题分类,建议
Comment needed
评论数>50条仅总结最后5条评论
重复项假阳性在第二阶段确认/排除 — 绝不仅凭疑似结果执行操作
标签已存在不重复添加,提示“标签已应用”
协作人员提交的问题绝不自动标记为
close candidate
GitHub API请求受限减少
--limit
参数值,通知用户
关联的PR已合并但问题未结建议关闭该问题
超过90天无活动的问题标记为Very Stale — 建议发送友好消息后关闭
第二阶段确认重复发布评论并关闭该问题,引导至原始问题

Notes

注意事项

  • Toujours dériver owner/repo via
    gh repo view
    , jamais hardcoder
  • Utiliser
    gh
    CLI (pas
    curl
    GitHub API) sauf pour la liste des collaborateurs
  • updatedAt
    peut être null sur certaines issues → traiter comme
    createdAt
  • Ne jamais poster ou fermer sans validation explicite de l'utilisateur dans le chat
  • Les commentaires draftés doivent être visibles AVANT tout
    gh issue comment
  • Similarité Jaccard = |intersection mots| / |union mots| (exclure stop words : a, the, is, in, of, for, to, with, on, at, by)
  • 始终通过
    gh repo view
    获取owner/repo信息,绝不硬编码
  • 优先使用
    gh
    CLI(而非
    curl
    调用GitHub API),仅在获取协作人员列表时例外
  • 部分问题的
    updatedAt
    字段可能为空 → 视为与
    createdAt
    相同
  • 未经用户在聊天中明确确认,绝不发布评论或关闭问题
  • 草稿评论必须在执行
    gh issue comment
    前显示给用户
  • 杰卡德相似度 = |词语交集| / |词语并集|(排除停用词:a, the, is, in, of, for, to, with, on, at, by)