issue-triage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseIssue Triage
Issue Triage(问题分类处理)
Quand utiliser
适用场景
| Skill | Usage | Output |
|---|---|---|
| Trier, analyser, commenter les issues | Tableaux d'action + deep analysis + commentaires postés |
| Récap général pour partager avec l'équipe | Résumé Markdown (PRs + issues + releases) |
Déclencheurs :
- Manuellement : ou
/issue-triageou/issue-triage all/issue-triage 42 57 - Proactivement : quand >10 issues ouvertes sans triage, ou issue stale >30j détectée
| Skill | 使用方式 | 输出内容 |
|---|---|---|
| 分类、分析、评论问题 | 行动表格 + 深度分析内容 + 已发布评论 |
| 生成团队共享的项目概览 | Markdown格式总结(包含PR、问题、版本发布) |
触发方式 :
- 手动触发:或
/issue-triage或/issue-triage all/issue-triage 42 57 - 自动触发:当未分类的未结问题超过10个,或检测到超过30天未更新的问题时
Langue
语言设置
- Vérifier l'argument passé au skill
- Si ou
en→ tableaux et résumé en anglaisenglish - Si ,
fr, ou pas d'argument → français (défaut)french - 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 statusSi 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
undefinedbash
undefinedIdentité 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
--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
--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
--json number,title,labels,closedAt
gh issue list --state closed --limit 20
--json number,title,labels,closedAt
--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 -uSi toujours ambigu, demander à l'utilisateur via .
AskUserQuestionNote : est un objet — toujours extraire .
author{login: "..."}.author.logingh 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.loginAnalyse — 6 dimensions
分析 — 6个维度
1. Catégorisation (labels existants > inférence titre/body) :
- Bug : mots-clés ,
crash,error,fail,broken,regression,wrongunexpected - Feature : ,
add,implement,support,newfeat: - Enhancement : ,
improve,optimize,better,enhancerefactor - Question/Support : ,
how,why,help,unclear,docsdocumentation - Duplicate Candidate : voir dimension 3 ci-dessous
2. Cross-ref PRs :
- Scanner de chaque PR ouverte pour
body,fixes #N,closes #N(case-insensitive, regex)resolves #N - 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], etc.)[feature] - 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,RCEXSS - Jaune : ,
breaking change,migration,deprecation,remove API,breakingincompatible - 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 :
- : issue claire, reproducible, dans scope
Accept & Prioritize - : issue sans label
Label needed - : info manquante, body insuffisant
Comment needed - : une PR ouverte référence cette issue
Linked to PR - : candidat doublon identifié (préciser avec
Duplicate candidate)#N - : stale + aucune activité récente, ou hors scope (jamais si auteur est collaborateur)
Close candidate - : PR liée est mergée, issue encore ouverte
PR merged → close
1. 分类(优先使用现有标签 > 通过标题/内容推断):
- Bug:包含关键词 、
crash、error、fail、broken、regression、wrongunexpected - Feature:包含关键词 、
add、implement、support、newfeat: - Enhancement:包含关键词 、
improve、optimize、better、enhancerefactor - Question/Support:包含关键词 、
how、why、help、unclear、docsdocumentation - 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、RCEXSS - 黄色:包含关键词 、
breaking change、migration、deprecation、remove API、breakingincompatible - 绿色:其余所有情况
5. Stale状态检测:
- 超过30天无更新(updatedAt)→ Stale(陈旧)
- 超过90天无更新 → Very Stale(极度陈旧)
- 从当前日期开始计算
6. 行动建议:
- :问题清晰、可复现、符合项目范围
Accept & Prioritize - :问题未添加标签
Label needed - :信息缺失、内容不充分
Comment needed - :关联了一个未结PR
Linked to PR - :已识别为重复候选(需标注对应问题编号
Duplicate candidate)#N - :陈旧且近期无活动,或超出项目范围(若作者为协作人员则不建议)
Close candidate - :关联的PR已合并,但问题仍处于未结状态
PR merged → close
Output — 5 tableaux
输出 — 5个表格
undefinedundefinedIssues ouvertes ({count})
未结问题 ({count})
Critiques (risque rouge)
高风险(红色风险)
| # | Titre | Auteur | Âge | Labels | Action |
|---|
| # | 标题 | 作者 | 时长 | 标签 | 行动建议 |
|---|
Liées à une PR
关联PR的问题
| # | Titre | Auteur | PR(s) liée(s) | Status PR | Action |
|---|
| # | 标题 | 作者 | 关联PR | PR状态 | 行动建议 |
|---|
Actives
活跃问题
| # | Titre | Auteur | Catégorie | Âge | Labels | Action |
|---|
| # | 标题 | 作者 | 分类 | 时长 | 标签 | 行动建议 |
|---|
Doublons candidats
重复候选问题
| # | Titre | Doublon de | Similarité | Action |
|---|
| # | 标题 | 重复来源 | 相似度 | 行动建议 |
|---|
Stale
陈旧问题
| # | Titre | Auteur | Derniè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
undefinedCross-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é :
- → toutes les issues ouvertes
"all" - Numéros () → uniquement ces issues
"42 57" - 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 : (skip si label déjà présent)
gh issue edit {num} --add-label "{label}" - Fermer : (jamais sans validation)
gh issue close {num} --reason "not planned"
- 评论:
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.mdRè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
undefinedCommenter
评论
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
边界情况处理
| Situation | Comportement |
|---|---|
| 0 issues ouvertes | |
| Issue sans body | Catégoriser par titre, recommander |
| >50 commentaires | Résumer les 5 derniers uniquement |
| Faux positif doublon | Phase 2 confirme/écarte — ne pas agir sur suspicion seule |
| Labels déjà présents | Ne pas re-labeler, signaler "label déjà appliqué" |
| Issue d'un collaborateur | Jamais |
| Rate limit GitHub API | Réduire |
| PR mergée liée à issue ouverte | Recommander fermeture de l'issue |
| Issue sans activité >90j | Very Stale — proposer fermeture avec message bienveillant |
| Duplicate confirmed in Phase 2 | Poster commentaire + fermer en faveur de l'issue originale |
| 场景 | 处理方式 |
|---|---|
| 无未结问题 | 显示 |
| 问题无内容 | 通过标题分类,建议 |
| 评论数>50条 | 仅总结最后5条评论 |
| 重复项假阳性 | 在第二阶段确认/排除 — 绝不仅凭疑似结果执行操作 |
| 标签已存在 | 不重复添加,提示“标签已应用” |
| 协作人员提交的问题 | 绝不自动标记为 |
| GitHub API请求受限 | 减少 |
| 关联的PR已合并但问题未结 | 建议关闭该问题 |
| 超过90天无活动的问题 | 标记为Very Stale — 建议发送友好消息后关闭 |
| 第二阶段确认重复 | 发布评论并关闭该问题,引导至原始问题 |
Notes
注意事项
- Toujours dériver owner/repo via , jamais hardcoder
gh repo view - Utiliser CLI (pas
ghGitHub API) sauf pour la liste des collaborateurscurl - peut être null sur certaines issues → traiter comme
updatedAtcreatedAt - 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)
- 始终通过获取owner/repo信息,绝不硬编码
gh repo view - 优先使用CLI(而非
gh调用GitHub API),仅在获取协作人员列表时例外curl - 部分问题的字段可能为空 → 视为与
updatedAt相同createdAt - 未经用户在聊天中明确确认,绝不发布评论或关闭问题
- 草稿评论必须在执行前显示给用户
gh issue comment - 杰卡德相似度 = |词语交集| / |词语并集|(排除停用词:a, the, is, in, of, for, to, with, on, at, by)