new-branch
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNew Branch
新建分支
Quick Start
快速开始
Given an issue reference, follow workflows/issue-branch.md.
Example: issue titled
becomes local branch .
#42Let agents use GitHub more ergonomically42-let-agents-use-github-more-ergonomicallyThe skill creates or switches to the local issue branch only. It does not
install dependencies, push, commit, create a pull request, or start
implementation work.
给定一个Issue引用,请遵循workflows/issue-branch.md。
示例:编号为、标题为的Issue,会生成本地分支。
#42Let agents use GitHub more ergonomically42-let-agents-use-github-more-ergonomically该技能仅创建或切换到本地Issue分支,不会安装依赖、推送、提交、创建拉取请求(Pull Request)或启动实现工作。
Workflow
工作流程
- Read the repository guidance first, especially branch and GitHub rules.
- Resolve the issue in the current working directory's default repository.
gh - Compute the branch name as , matching GitHub's issue branch suggestion.
<issue-number>-<kebab-title> - Refuse to switch branches when the worktree has uncommitted changes.
- Fetch the repository default branch from .
origin - Create the branch from , switch to it, or warn before leaving a different issue branch.
origin/<default-branch> - Report the branch and base SHA.
- 首先阅读仓库指南,尤其是分支和GitHub规则。
- 在当前工作目录的默认仓库中解析该Issue。
gh - 按照的格式生成分支名称,与GitHub的Issue分支建议格式匹配。
<issue-number>-<kebab-title> - 当工作区存在未提交的更改时,拒绝切换分支。
- 从拉取仓库默认分支。
origin - 基于创建分支并切换到该分支;若当前处于其他Issue分支,会先发出警告再切换。
origin/<default-branch> - 报告分支名称和基准SHA值。
Guardrails
防护规则
- Stay in the current repository; do not accept cross-repo flags.
gh - Never hardcode ; resolve the default branch through
main.gh repo view - Keep empty issue branches local.
- Ask before switching away from a different issue branch.
- Stop on rebase conflicts and surface the manual resolution steps.
- 仅在当前仓库内操作,不接受跨仓库参数。
gh - 绝不硬编码分支,通过
main命令解析默认分支。gh repo view - 空的Issue分支仅保留在本地。
- 切换离开其他Issue分支前需询问用户。
- 遇到变基冲突时停止操作,并提示手动解决步骤。