gh-issue-lifecycle
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseIssue Lifecycle
Issue生命周期
State machine for GitHub issues and how they connect to code.
GitHub Issue的状态机及其与代码的关联方式。
State Diagram
状态图
┌─────────────────┐
│ needs-triage │ ← New issue created
└────────┬────────┘
│ triage
┌────────▼────────┐
┌───────────│ accepted │ ← In backlog
│ └────────┬────────┘
│ │ start work
│ ┌────────▼────────┐
│ ┌──────│ in-progress │ ← Active development
│ │ └────────┬────────┘
│ │ │ PR merged
│ │ ┌────────▼────────┐
│ │ │ completed │ ← Issue resolved
│ │ └─────────────────┘
│ │
│ │ blocked
│ │ ┌─────────────────┐
│ └─────►│ blocked │ ← Waiting on dependency
│ └─────────────────┘
│
│ needs-info
│ ┌─────────────────┐
└──────────►│ needs-info │ ← Waiting for clarification
└─────────────────┘ ┌─────────────────┐
│ needs-triage │ ← 新Issue创建
└────────┬────────┘
│ triage(分类处理)
┌────────▼────────┐
┌───────────│ accepted │ ← 待处理(在产品待办列表中)
│ └────────┬────────┘
│ │ 开始工作
│ ┌────────▼────────┐
│ ┌──────│ in-progress │ ← 开发中
│ │ └────────┬────────┘
│ │ │ PR合并
│ │ ┌────────▼────────┐
│ │ │ completed │ ← Issue已解决
│ │ └─────────────────┘
│ │
│ │ 被阻塞
│ │ ┌─────────────────┐
│ └─────►│ blocked │ ← 等待依赖项
│ └─────────────────┘
│
│ 需要补充信息
│ ┌─────────────────┐
└──────────►│ needs-info │ ← 等待澄清
└─────────────────┘State Definitions
状态定义
Open States
开放状态
| State | Label | Meaning |
|---|---|---|
| New | | Just created, not reviewed |
| Clarification | | Waiting on reporter |
| Backlog | | Triaged, waiting for work |
| Active | | Someone is working on it |
| Blocked | | Can't proceed |
| 状态 | 标签 | 含义 |
|---|---|---|
| 新建 | | 刚创建,尚未审核 |
| 需要澄清 | | 等待报告者补充信息 |
| 待办 | | 已分类,等待处理 |
| 活跃中 | | 有人正在处理 |
| 被阻塞 | | 无法继续推进 |
Closed States
关闭状态
| State | Reason | Comment |
|---|---|---|
| Completed | Fixed/implemented | Via PR or manual |
| Duplicate | Same as another | "Duplicate of #N" |
| Won't Fix | Out of scope | Explain why |
| Invalid | Not a real issue | Cannot reproduce |
| Stale | No activity | Auto-closed after warning |
| 状态 | 原因 | 备注 |
|---|---|---|
| 已完成 | 已修复/已实现 | 通过PR或手动方式完成 |
| 重复 | 与其他Issue重复 | "重复自 #N" |
| 不会修复 | 超出范围 | 说明原因 |
| 无效 | 并非真实问题 | 无法复现 |
| 已停滞 | 无活动 | 发出警告后自动关闭 |
Linking Issues to Code
Issue与代码的关联
Branch Naming
分支命名
When starting work on issue :
#123feat/123-short-description # feature
fix/123-short-description # bug fix
chore/123-short-description # maintenance
docs/123-short-description # documentation
i18n/locale-code # internationalization (e.g., i18n/zh-CN, i18n/ja-JP)
i18n/123-locale-code # i18n with issue (e.g., i18n/42-es-MX)Examples:
feat/42-add-dark-modefix/123-login-timeoutchore/99-update-deps- - Chinese (Simplified) translations
i18n/zh-CN - - Japanese translations for issue #42
i18n/42-ja-JP
开始处理Issue 时:
#123feat/123-short-description # 功能特性
fix/123-short-description # Bug修复
chore/123-short-description # 维护工作
docs/123-short-description # 文档更新
i18n/locale-code # 国际化(例如:i18n/zh-CN, i18n/ja-JP)
i18n/123-locale-code # 关联Issue的国际化工作(例如:i18n/42-es-MX)示例:
feat/42-add-dark-modefix/123-login-timeoutchore/99-update-deps- - 简体中文翻译
i18n/zh-CN - - 关联Issue #42的日语翻译
i18n/42-ja-JP
PR Title
PR标题
Include issue number in PR title:
feat: add dark mode (#42)
fix: resolve login timeout (#123)
chore: update dependencies (#99)在PR标题中包含Issue编号:
feat: add dark mode (#42)
fix: resolve login timeout (#123)
chore: update dependencies (#99)PR Description
PR描述
Use closing keywords in PR body:
| Keyword | Effect |
|---|---|
| Auto-closes when merged |
| Same as Closes |
| Same as Closes |
Example PR description:
markdown
undefined在PR正文中使用关闭关键字:
| 关键字 | 效果 |
|---|---|
| 合并后自动关闭Issue |
| 与Closes效果相同 |
| 与Closes效果相同 |
PR描述示例:
markdown
undefinedSummary
摘要
Add dark mode toggle to settings page.
Closes #42
在设置页面添加深色模式切换按钮。
Closes #42
Changes
变更内容
- Add theme context
- Create toggle component
- Update color variables
undefined- 添加主题上下文
- 创建切换组件
- 更新颜色变量
undefinedLinking Without Closing
仅关联不自动关闭
Reference issues without auto-close:
Related to #45
See also #67
Depends on #89引用Issue但不自动关闭:
Related to #45
See also #67
Depends on #89Manual Close Reasons
手动关闭原因
When closing without PR, always comment:
无需PR即可关闭Issue时,务必添加备注:
Duplicate
重复
bash
gh issue close 123 --comment "Duplicate of #456"bash
gh issue close 123 --comment "Duplicate of #456"Won't Fix
不会修复
bash
gh issue close 123 --comment "Closing as won't fix: [reason]"bash
gh issue close 123 --comment "Closing as won't fix: [reason]"Invalid / Cannot Reproduce
无效/无法复现
bash
gh issue close 123 --comment "Cannot reproduce with provided steps. Please reopen with more details if issue persists."bash
gh issue close 123 --comment "Cannot reproduce with provided steps. Please reopen with more details if issue persists."Stale
已停滞
bash
gh issue close 123 --comment "Closing due to inactivity. Please reopen if still relevant."bash
gh issue close 123 --comment "Closing due to inactivity. Please reopen if still relevant."Stale Issue Handling
停滞Issue处理
Detection
检测
Issues with no activity for N days (typically 90):
bash
undefined超过N天(通常为90天)无活动的Issue:
bash
undefinedFind stale issues
查找停滞的Issue
gh issue list --search "updated:<$(date -v-90d +%Y-%m-%d)"
undefinedgh issue list --search "updated:<$(date -v-90d +%Y-%m-%d)"
undefinedWarning Process
提醒流程
- Add label
stale - Comment:
This issue has been inactive for 90 days. It will be closed in 30 days if there's no further activity. Please comment if this is still relevant. - Close after 30 more days if no response
- 添加标签
stale - 添加备注:
该Issue已90天无活动。 若30天内仍无进一步操作,将自动关闭。 若该问题仍相关,请留言告知。 - 若30天后仍无响应,则关闭Issue
Automation (GitHub Action)
自动化(GitHub Action)
yaml
name: Stale Issues
on:
schedule:
- cron: '0 0 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-issue-message: 'This issue has been inactive for 90 days.'
days-before-stale: 90
days-before-close: 30
stale-issue-label: 'stale'yaml
name: Stale Issues
on:
schedule:
- cron: '0 0 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-issue-message: 'This issue has been inactive for 90 days.'
days-before-stale: 90
days-before-close: 30
stale-issue-label: 'stale'Bulk Operations
批量操作
Close Multiple Issues
关闭多个Issue
bash
undefinedbash
undefinedClose all issues with label
关闭所有带有指定标签的Issue
gh issue list --label "stale" --json number --jq '.[].number' |
xargs -I {} gh issue close {} --comment "Closing stale issue"
xargs -I {} gh issue close {} --comment "Closing stale issue"
undefinedgh issue list --label "stale" --json number --jq '.[].number' |
xargs -I {} gh issue close {} --comment "Closing stale issue"
xargs -I {} gh issue close {} --comment "Closing stale issue"
undefinedRelabel Issues
批量修改标签
bash
undefinedbash
undefinedAdd label to all issues matching query
为符合查询条件的所有Issue添加标签
gh issue list --search "is:open label:bug" --json number --jq '.[].number' |
xargs -I {} gh issue edit {} --add-label "needs-review"
xargs -I {} gh issue edit {} --add-label "needs-review"
undefinedgh issue list --search "is:open label:bug" --json number --jq '.[].number' |
xargs -I {} gh issue edit {} --add-label "needs-review"
xargs -I {} gh issue edit {} --add-label "needs-review"
undefinedTransfer Issues
转移Issue
bash
undefinedbash
undefinedMove issue to another repo
将Issue转移到另一个仓库
gh issue transfer 123 owner/other-repo
undefinedgh issue transfer 123 owner/other-repo
undefinedWorkflow Commands
工作流命令
Start Work on Issue
开始处理Issue
bash
undefinedbash
undefinedCreate branch from issue
从Issue创建分支并切换
gh issue develop 123 --checkout
gh issue develop 123 --checkout
Or manually
或手动操作
git checkout -b fix/123-description main
gh issue edit 123 --add-label "in-progress"
undefinedgit checkout -b fix/123-description main
gh issue edit 123 --add-label "in-progress"
undefinedComplete Issue via PR
通过PR完成Issue
bash
undefinedbash
undefinedCreate PR that closes issue
创建可关闭Issue的PR
gh pr create --title "fix: resolve issue (#123)" --body "Closes #123"
undefinedgh pr create --title "fix: resolve issue (#123)" --body "Closes #123"
undefinedMark as Blocked
标记为阻塞状态
bash
gh issue edit 123 \
--remove-label "in-progress" \
--add-label "blocked"
gh issue comment 123 --body "Blocked on #456"bash
gh issue edit 123 \
--remove-label "in-progress" \
--add-label "blocked"
gh issue comment 123 --body "Blocked on #456"Integration with Other Components
与其他组件的集成
Full Issue Workflow
完整Issue工作流
- Create: Use gh-issue-templates to format issue
- Triage: Use gh-issue-triage to add type/priority labels
- Start Work: Use this skill's branch naming patterns (feat/123-desc)
- Link to Code: Reference issue in PR using
Closes #123 - Close: Use gh-wrangler agent with this skill's close patterns
- Cleanup: PR merge auto-closes issue via GitHub
- 创建:使用gh-issue-templates格式化Issue
- 分类处理:使用gh-issue-triage添加类型/优先级标签
- 开始工作:遵循本技能的分支命名规范(feat/123-desc)
- 关联代码:在PR中使用引用Issue
Closes #123 - 关闭:使用gh-wrangler agent并遵循本技能的关闭模式
- 清理:PR合并后,GitHub自动关闭Issue
State Transitions
状态转换
This skill defines how issues move through states:
- → Initial state (set by gh-issue-templates)
needs-triage - → After triage (applied by gh-wrangler using gh-issue-triage)
accepted - → Work started (manual or via branch creation)
in-progress - → Can't proceed (set manually with comment)
blocked - Closed → Via PR merge or manual close
本技能定义了Issue的状态流转:
- → 初始状态(由gh-issue-templates设置)
needs-triage - → 分类处理后(由gh-wrangler通过gh-issue-triage应用)
accepted - → 开始工作后(手动或通过创建分支触发)
in-progress - → 无法推进时(手动设置并添加备注)
blocked - 已关闭 → 通过PR合并或手动关闭
Branch and PR Integration
分支与PR集成
When starting work on an issue:
bash
undefined开始处理Issue时:
bash
undefinedBranch naming from this skill
遵循本技能的分支命名规范
git checkout -b feat/123-description
git checkout -b feat/123-description
PR creation with linking
创建带关联的PR
gh pr create --title "feat: description (#123)" --body "Closes #123"
undefinedgh pr create --title "feat: description (#123)" --body "Closes #123"
undefinedRelated
相关资源
- Skill: - Creating well-formatted issues
gh-issue-templates - Skill: - Labeling and prioritization
gh-issue-triage - Agent: - Interactive lifecycle management
gh-wrangler
- Skill: - 创建格式规范的Issue
gh-issue-templates - Skill: - 标签添加与优先级划分
gh-issue-triage - Agent: - 交互式生命周期管理
gh-wrangler