address-github-issue
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRetrieve a GitHub issue and coordinate a team to address it.
Usage:
- — Address issue #42 in the current repo
/address-github-issue 42 - — Address issue #42 in a specific repo
/address-github-issue owner/repo#42 - — Address issue by URL
/address-github-issue https://github.com/owner/repo/issues/42
Instructions:
-
Validate theCLI is available:
gh- Run to confirm it is installed
gh --version - If not found, stop and display:
❌ GitHub CLI (`gh`) is not installed. Install it with: brew install gh Then authenticate with: gh auth login - Run to confirm authentication
gh auth status - If not authenticated, stop and display:
❌ GitHub CLI is not authenticated. Run: gh auth login
- Run
-
Parse the issue reference from:
$ARGUMENTS- If is empty, use
$ARGUMENTSto ask for the issue reference and STOP until provided.AskUserQuestion - Accepted formats:
- A bare number (e.g., ) → use the current repo
42 - → explicit repo and number
owner/repo#42 - A full GitHub URL (e.g., ) → parse repo and number from it
https://github.com/owner/repo/issues/42
- A bare number (e.g.,
- For bare numbers, determine the current repo with . If this fails (not in a GitHub repo), stop:
gh repo view --json nameWithOwner -q .nameWithOwner❌ Could not determine the GitHub repository. Run this skill from inside a GitHub repo, or provide a full issue reference (e.g., owner/repo#42).
- If
-
Fetch the issue:
- Run:
bash
gh issue view <number> --repo <owner/repo> --json number,title,body,labels,assignees,milestone,state,comments,url - If the issue is not found or access is denied, stop with the error message from .
gh - Parse the JSON output to extract:
- ,
title,body,labels,stateurl - array (each has
commentsandauthor.login)body
- Run:
-
Analyze the issue:
- Read the title, body, and all comments thoroughly.
- Identify the issue type:
- Bug — something is broken; labels like ,
bug,defectregression - Feature — new capability; labels like ,
enhancementfeature request - Chore / Maintenance — tech debt, refactor, CI, docs; labels like ,
chore,docsrefactor - Question / Investigation — needs research before coding
- Bug — something is broken; labels like
- Identify the scope and complexity:
- Simple (1 developer) — isolated fix or small addition, touches ≤2 files, no API or schema changes
- Medium (2 developers) — moderate feature or bug with multiple moving parts; may touch frontend and backend separately
- Complex (3 developers) — large feature, architectural change, cross-cutting concern, or multiple independent workstreams
- Note any ambiguities or missing information that the PM should clarify in requirements.
-
Determine team composition:
- Always spawn exactly 1 PM.
- Spawn 1, 2, or 3 developers based on the complexity assessment above.
- No designers or testers are spawned by this skill (developers are expected to include tests in their implementation).
-
Create the team:
- Use with a short kebab-case name derived from the issue title or number (e.g.,
TeamCreate,issue-42,fix-login-crash).add-dark-mode - Use to create one task per role before spawning agents:
TaskCreate- PM task: "Write requirements and acceptance criteria for issue #<number>"
- One developer task per developer: "Implement <area> for issue #<number>"
- Use
-
Spawn the PM ():
subagent_type: general-purpose- Provide:
- The full issue content (title, body, all comments, URL)
- The issue type and complexity assessment
- The team name
- The PM's job:
- Read the issue thoroughly, including all comments
- Write detailed requirements and acceptance criteria to address the issue, resolving any ambiguities using the comments and their knowledge of the codebase
- Structure the requirements as:
## Issue #<number>: <title> **Type:** <Bug / Feature / Chore> | **URL:** <url> ## Context <Brief summary of the issue and why it matters> ## Requirements <Numbered list of concrete, testable requirements> ## Acceptance Criteria <Checklist of conditions that must be true when the issue is resolved> ## Developer Workstreams <If multiple developers: describe each workstream clearly with its scope and any shared interfaces or contracts they need to agree on> ## Out of Scope <Anything explicitly excluded from this issue> - Check for a project lore file (,
LORE.md,docs/lore.md, or similar) and update it with any relevant context this issue introduces.agent/lore.md - Mark their task as completed via
TaskUpdate - Message the team lead when done
- Provide:
-
Wait for the PM to finish and retrieve the requirements from the completed task or PM message.
-
Spawn developers () in parallel, one per workstream:
subagent_type: general-purpose- Provide each developer with:
- The original issue content (title, body, comments, URL)
- The PM's requirements document
- Their specific workstream scope (if multiple developers)
- The issue type for context (bug fix → write a regression test; feature → write unit/integration tests; etc.)
- Each developer's job:
- Explore the relevant parts of the codebase
- Implement the changes required by their workstream
- Write tests covering their changes (unit tests at minimum; integration tests if applicable)
- Mark their task as completed via
TaskUpdate - Message the team lead when done
- Provide each developer with:
-
Wait for all developers to finish.
-
Verify no conflicts:
- If multiple developers were spawned, check whether any two agents modified the same files
- If conflicts exist, resolve them by reading both sets of changes and merging intelligently
- Run a quick sanity check: ensure the codebase compiles and lints cleanly after all changes are applied (use the project's existing lint/build scripts if available)
-
Present a final summary to the user:
## Issue #<number> Addressed **Issue:** <title> **URL:** <url> ### What was done - <Bullet summary of changes made> ### Tests added - <List of test files added or updated> ### Developers - <Developer 1>: <what they implemented> - <Developer 2>: <what they implemented> (if applicable) ### Recommended next steps - Review the changes with `/review-changes` - Create a PR with `/create-pr` - Link the PR to the issue on GitHub: `gh issue develop <number> --repo <owner/repo>` -
Shut down the team gracefully:
- Send a to each teammate via
shutdown_requestSendMessage - Once all have confirmed, call
TeamDelete
- Send a
获取GitHub issue并协调团队进行处理。
用法:
- — 处理当前仓库的#42号issue
/address-github-issue 42 - — 处理指定仓库的#42号issue
/address-github-issue owner/repo#42 - — 通过URL处理对应issue
/address-github-issue https://github.com/owner/repo/issues/42
操作说明:
-
验证CLI可用:
gh- 运行确认已安装该工具
gh --version - 如果未找到,终止流程并展示:
❌ GitHub CLI (`gh`) 未安装。 可通过以下命令安装:brew install gh 安装后执行以下命令完成认证:gh auth login - 运行确认已完成认证
gh auth status - 如果未认证,终止流程并展示:
❌ GitHub CLI 未完成认证。 执行命令:gh auth login
- 运行
-
从中解析issue引用:
$ARGUMENTS- 如果为空,调用
$ARGUMENTS询问用户issue引用,等待用户提供后再继续AskUserQuestion - 支持的格式:
- 纯数字(例如)→ 自动使用当前仓库
42 - → 明确指定仓库和issue编号
owner/repo#42 - GitHub完整URL(例如)→ 从中解析仓库和issue编号
https://github.com/owner/repo/issues/42
- 纯数字(例如
- 如果是纯数字格式,通过获取当前仓库信息。如果运行失败(不在GitHub仓库目录下),终止流程:
gh repo view --json nameWithOwner -q .nameWithOwner❌ 无法识别GitHub仓库。 请在GitHub仓库目录下运行该技能,或者提供完整的issue引用(例如owner/repo#42)。
- 如果
-
拉取issue信息:
- 运行:
bash
gh issue view <number> --repo <owner/repo> --json number,title,body,labels,assignees,milestone,state,comments,url - 如果未找到issue或者无访问权限,终止流程并返回返回的错误信息
gh - 解析JSON输出,提取以下信息:
- 、
title、body、labels、stateurl - 数组(每个评论包含
comments和author.login字段)body
- 运行:
-
分析issue:
- 完整阅读标题、正文和所有评论
- 识别issue类型:
- Bug — 功能故障;对应标签如、
bug、defectregression - Feature — 新增功能;对应标签如、
enhancementfeature request - Chore / Maintenance — 技术债务、重构、CI、文档;对应标签如、
chore、docsrefactor - Question / Investigation — 编码前需要先进行调研
- Bug — 功能故障;对应标签如
- 识别范围和复杂度:
- 简单(1名开发)—— 独立修复或者小功能新增,修改≤2个文件,无API或者schema变更
- 中等(2名开发)—— 复杂度中等的功能或者bug,涉及多个模块;可能分别涉及前端和后端
- 复杂(3名开发)—— 大型功能、架构变更、跨模块需求,或者多个独立工作流
- 记录所有需要PM在需求中澄清的歧义或者缺失信息
-
确定团队组成:
- 固定组建1名PM
- 根据上述复杂度评估,组建1、2或3名开发人员
- 该技能不需要组建设计师或者测试人员(开发人员需要在实现中包含测试)
-
创建团队:
- 调用,团队名使用从issue标题或者编号衍生的短横线分隔命名(例如
TeamCreate、issue-42、fix-login-crash)add-dark-mode - 启动Agent前调用为每个角色创建对应任务:
TaskCreate- PM任务:"为#<number>号issue编写需求和验收标准"
- 每个开发人员对应一个任务:"为#<number>号issue实现<对应模块>"
- 调用
-
启动PM():
subagent_type: general-purpose- 提供以下信息:
- 完整的issue内容(标题、正文、所有评论、URL)
- issue类型和复杂度评估结果
- 团队名称
- PM的职责:
- 完整阅读issue,包括所有评论
- 编写详细的需求和验收标准来处理该issue,结合评论和自身对代码库的了解解决所有歧义
- 按照以下结构编写需求:
## Issue #<number>: <title> **类型:** <Bug / Feature / Chore> | **URL:** <url> ## 背景 <issue的简要概述和重要性说明> ## 需求 <具体可测试的需求编号列表> ## 验收标准 <issue解决后必须满足的检查项清单> ## 开发工作流 <如果有多名开发:清晰描述每个工作流的范围,以及需要达成一致的共享接口或者契约> ## 超出范围 <明确排除在本次issue处理外的所有内容> - 查找项目说明文件(、
LORE.md、docs/lore.md等),将本次issue引入的相关上下文更新到文件中.agent/lore.md - 通过标记自身任务已完成
TaskUpdate - 完成后通知团队负责人
- 提供以下信息:
-
等待PM完成任务,从已完成的任务或者PM的消息中获取需求文档
-
并行启动开发人员(),每个工作流对应一名开发:
subagent_type: general-purpose- 为每位开发人员提供以下信息:
- 原始issue内容(标题、正文、评论、URL)
- PM输出的需求文档
- 对应工作流的范围(如果有多名开发)
- issue类型作为上下文参考(bug修复→编写回归测试;新功能→编写单元/集成测试等)
- 每个开发人员的职责:
- 探索代码库相关部分
- 实现所属工作流要求的变更
- 编写覆盖变更内容的测试(至少包含单元测试;适用场景下需要编写集成测试)
- 通过标记自身任务已完成
TaskUpdate - 完成后通知团队负责人
- 为每位开发人员提供以下信息:
-
等待所有开发人员完成任务
-
验证无冲突:
- 如果启动了多名开发,检查是否有多个Agent修改了同一个文件
- 如果存在冲突,读取两组变更内容并智能合并解决
- 运行快速合理性检查:确保所有变更应用后代码库可以正常编译和通过lint检查(如果项目有现成的lint/构建脚本则调用对应脚本)
-
向用户呈现最终总结:
## Issue #<number> 处理完成 **Issue:** <title> **URL:** <url> ### 完成内容 - <变更内容的要点列表> ### 新增测试 - <新增或者更新的测试文件列表> ### 开发人员 - <开发1>: <实现的内容> - <开发2>: <实现的内容> (如果适用) ### 推荐后续步骤 - 执行`/review-changes` review变更内容 - 执行`/create-pr`创建PR - 在GitHub上将PR关联到issue:`gh issue develop <number> --repo <owner/repo>` -
优雅解散团队:
- 通过向每个团队成员发送
SendMessageshutdown_request - 所有成员确认后,调用
TeamDelete
- 通过