gh-issue-lifecycle

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Issue 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

开放状态

StateLabelMeaning
New
needs-triage
Just created, not reviewed
Clarification
needs-info
Waiting on reporter
Backlog
accepted
Triaged, waiting for work
Active
in-progress
Someone is working on it
Blocked
blocked
Can't proceed
状态标签含义
新建
needs-triage
刚创建,尚未审核
需要澄清
needs-info
等待报告者补充信息
待办
accepted
已分类,等待处理
活跃中
in-progress
有人正在处理
被阻塞
blocked
无法继续推进

Closed States

关闭状态

StateReasonComment
CompletedFixed/implementedVia PR or manual
DuplicateSame as another"Duplicate of #N"
Won't FixOut of scopeExplain why
InvalidNot a real issueCannot reproduce
StaleNo activityAuto-closed after warning
状态原因备注
已完成已修复/已实现通过PR或手动方式完成
重复与其他Issue重复"重复自 #N"
不会修复超出范围说明原因
无效并非真实问题无法复现
已停滞无活动发出警告后自动关闭

Linking Issues to Code

Issue与代码的关联

Branch Naming

分支命名

When starting work on issue
#123
:
feat/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-mode
  • fix/123-login-timeout
  • chore/99-update-deps
  • i18n/zh-CN
    - Chinese (Simplified) translations
  • i18n/42-ja-JP
    - Japanese translations for issue #42
开始处理Issue
#123
时:
feat/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-mode
  • fix/123-login-timeout
  • chore/99-update-deps
  • i18n/zh-CN
    - 简体中文翻译
  • i18n/42-ja-JP
    - 关联Issue #42的日语翻译

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:
KeywordEffect
Closes #123
Auto-closes when merged
Fixes #123
Same as Closes
Resolves #123
Same as Closes
Example PR description:
markdown
undefined
在PR正文中使用关闭关键字:
关键字效果
Closes #123
合并后自动关闭Issue
Fixes #123
与Closes效果相同
Resolves #123
与Closes效果相同
PR描述示例:
markdown
undefined

Summary

摘要

Add dark mode toggle to settings page.
Closes #42
在设置页面添加深色模式切换按钮。
Closes #42

Changes

变更内容

  • Add theme context
  • Create toggle component
  • Update color variables
undefined
  • 添加主题上下文
  • 创建切换组件
  • 更新颜色变量
undefined

Linking 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 #89

Manual 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
undefined

Find stale issues

查找停滞的Issue

gh issue list --search "updated:<$(date -v-90d +%Y-%m-%d)"
undefined
gh issue list --search "updated:<$(date -v-90d +%Y-%m-%d)"
undefined

Warning Process

提醒流程

  1. Add
    stale
    label
  2. 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.
  3. Close after 30 more days if no response
  1. 添加
    stale
    标签
  2. 添加备注:
    该Issue已90天无活动。
    若30天内仍无进一步操作,将自动关闭。
    若该问题仍相关,请留言告知。
  3. 若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
undefined
bash
undefined

Close all issues with label

关闭所有带有指定标签的Issue

gh issue list --label "stale" --json number --jq '.[].number' |
xargs -I {} gh issue close {} --comment "Closing stale issue"
undefined
gh issue list --label "stale" --json number --jq '.[].number' |
xargs -I {} gh issue close {} --comment "Closing stale issue"
undefined

Relabel Issues

批量修改标签

bash
undefined
bash
undefined

Add 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"
undefined
gh issue list --search "is:open label:bug" --json number --jq '.[].number' |
xargs -I {} gh issue edit {} --add-label "needs-review"
undefined

Transfer Issues

转移Issue

bash
undefined
bash
undefined

Move issue to another repo

将Issue转移到另一个仓库

gh issue transfer 123 owner/other-repo
undefined
gh issue transfer 123 owner/other-repo
undefined

Workflow Commands

工作流命令

Start Work on Issue

开始处理Issue

bash
undefined
bash
undefined

Create 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"
undefined
git checkout -b fix/123-description main gh issue edit 123 --add-label "in-progress"
undefined

Complete Issue via PR

通过PR完成Issue

bash
undefined
bash
undefined

Create PR that closes issue

创建可关闭Issue的PR

gh pr create --title "fix: resolve issue (#123)" --body "Closes #123"
undefined
gh pr create --title "fix: resolve issue (#123)" --body "Closes #123"
undefined

Mark 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工作流

  1. Create: Use gh-issue-templates to format issue
  2. Triage: Use gh-issue-triage to add type/priority labels
  3. Start Work: Use this skill's branch naming patterns (feat/123-desc)
  4. Link to Code: Reference issue in PR using
    Closes #123
  5. Close: Use gh-wrangler agent with this skill's close patterns
  6. Cleanup: PR merge auto-closes issue via GitHub
  1. 创建:使用gh-issue-templates格式化Issue
  2. 分类处理:使用gh-issue-triage添加类型/优先级标签
  3. 开始工作:遵循本技能的分支命名规范(feat/123-desc)
  4. 关联代码:在PR中使用
    Closes #123
    引用Issue
  5. 关闭:使用gh-wrangler agent并遵循本技能的关闭模式
  6. 清理:PR合并后,GitHub自动关闭Issue

State Transitions

状态转换

This skill defines how issues move through states:
  • needs-triage
    → Initial state (set by gh-issue-templates)
  • accepted
    → After triage (applied by gh-wrangler using gh-issue-triage)
  • in-progress
    → Work started (manual or via branch creation)
  • blocked
    → Can't proceed (set manually with comment)
  • Closed → Via PR merge or manual close
本技能定义了Issue的状态流转:
  • needs-triage
    → 初始状态(由gh-issue-templates设置)
  • accepted
    → 分类处理后(由gh-wrangler通过gh-issue-triage应用)
  • in-progress
    → 开始工作后(手动或通过创建分支触发)
  • blocked
    → 无法推进时(手动设置并添加备注)
  • 已关闭 → 通过PR合并或手动关闭

Branch and PR Integration

分支与PR集成

When starting work on an issue:
bash
undefined
开始处理Issue时:
bash
undefined

Branch 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"
undefined
gh pr create --title "feat: description (#123)" --body "Closes #123"
undefined

Related

相关资源

  • Skill:
    gh-issue-templates
    - Creating well-formatted issues
  • Skill:
    gh-issue-triage
    - Labeling and prioritization
  • Agent:
    gh-wrangler
    - Interactive lifecycle management
  • Skill:
    gh-issue-templates
    - 创建格式规范的Issue
  • Skill:
    gh-issue-triage
    - 标签添加与优先级划分
  • Agent:
    gh-wrangler
    - 交互式生命周期管理