帮助你创建、切换并检查代码分支,确保实现前遵循正确分支策略。
这是一个开源的 prompt-only Git 分支管理技能,材料未显示其需要密钥或连接外部服务,整体风险较低。其说明包含本地 git 命令与读取仓库内配置文件的建议,属于开发辅助技能的常规能力,需注意仅在预期仓库上下文中使用。
材料明确标注无需密钥或环境变量,README 也未要求输入 token、账号或其他敏感凭证,未见明显凭证泄露或滥用路径。
未声明任何远程端点;文档虽提到 `git fetch origin` 与检查 `origin/<branch>`,但这是 Git 仓库既有远程的常规同步语义,不是额外接入未知服务。未见把数据发送到无关第三方端点的迹象。
系统检查项为 prompt-only,说明其本身不是可执行工具。README 中出现的 `git`/`cat` 命令属于给模型或用户的操作指引,而非该技能自带可直接执行的本机代码能力。
材料仅涉及读取当前仓库状态与仓库内 `.memory/git-config.md`,以及分支切换/创建这类 Git 元数据操作;未显示可广泛读取系统文件、访问跨项目数据或申请过度权限。
来源为 GitHub 上的微软相关开源仓库,源码可审计,这些都是正面因素;但许可证未声明、star 为 0、维护状态未知,社区验证与持续维护证据偏弱,建议在采纳前自行复核仓库内容。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "git-branch" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/devsquad-copilot/main/.github/plugins/devsquad/skills/git-branch/SKILL.md 2. 保存为 ~/.claude/skills/git-branch/SKILL.md 3. 装好后重载技能,告诉我可以用了
请基于 main 创建一个名为 feature/login-page 的新分支,并切换到该分支。
返回创建并切换分支所需的 Git 命令或操作步骤。
请告诉我如何查看当前所在分支,并列出本地所有分支。
返回查看当前分支及本地分支列表的命令。
我要修复一个线上紧急 bug,请先帮我确认应该从哪个分支切出新分支,并说明原因。
给出建议的起始分支、分支命名方式,以及简要策略说明。
cat .memory/git-config.md 2>/dev/null
If Branching Strategy is filled in, use the configured strategy. The detect-branching-strategy.sh hook automatically seeds on sessionStart.
If the config has Confidence: medium, confirm with the dev before using (see Detect Branching Strategy section).
Before starting implementation:
git branch --show-current
git status
git fetch origin
If on main/master/develop, check synchronization:
git rev-list HEAD..origin/<branch> --count
| Situation | Action |
|---|---|
| Branch behind (commits behind remote) | Alert and suggest pull |
| Branch with uncommitted local changes | Alert about pending changes |
| Branch up to date and clean | Proceed normally |
If the main branch is behind:
Your branch [main] is [N] commits behind the remote.
I recommend updating before creating a new branch:
[P] Pull and continue
[I] Ignore and continue anyway (not recommended)
[A] Abort implementation
| Situation | Action |
|---|---|
| Already on a feature branch (not main/master/develop) | Use current branch |
| On main/master/develop without changes with work item | Create branch automatically (see below) |
| On main/master/develop without changes without work item | Ask if they want to create a branch |
| On main/master/develop with changes | Alert and ask how to proceed |
When the source of work is a GitHub issue or Azure DevOps work item, create the branch automatically.
Naming convention:
feature/<id>-<short-description>
Rules for <short-description>:
Examples:
| Work Item | Branch |
|---|---|
| #42 "Implement user authentication" | feature/42-user-authentication |
| #108 "Add rate limiting to API endpoints" | feature/108-rate-limiting-api |
| WI 5678 "Create financial reports endpoint" | feature/5678-financial-reports-endpoint |
Action: Create branch and inform the user:
Branch created: feature/<id>-<short-description>
[C] Continue with this branch
[R] Rename branch: _
The user can rename, but the flow does not block waiting for confirmation to create.
When the source is tasks.md (without issue/work item), ask the user:
You are on the main branch. Do you want me to create a branch for this implementation?
Suggestion: feature/<short-description>
[S] Yes, create suggested branch
[N] No, continue on current branch
[C] Create with another name: _
If the user is already on a feature branch, use the current branch without additional questions.
When .memory/git-config.md does not exist or does not have Branching Strategy, detect automatically:
# 1. Default branch
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
# 2. Does develop branch exist?
HAS_DEVELOP=$(git ls-remote --heads origin develop 2>/dev/null | grep -q develop && echo "yes" || echo "no")
# 3. Do release/* or hotfix/* branches exist? (GitFlow pattern)
HAS_GITFLOW_BRANCHES=$(git branch -r 2>/dev/null | grep -qE '(release|hotfix)/' && echo "yes" || echo "no")
develop | release/* or hotfix/* | Strategy | Confidence | Action |
|---|---|---|---|---|
| Yes | Yes | GitFlow | High | Save and inform |
| Yes | No | GitFlow | Medium | Ask to confirm |
| No | No | Trunk-Based | High | Save and inform |
High confidence — save automatically and inform:
…
为软件架构图提供设计与审查建议,提升文档中的图示清晰度与规范性
系统化排查测试失败、构建中断与异常运行问题,帮助快速恢复开发进度
用于初始化项目时检查并创建社区治理所需的标准仓库文件。
在开始处理 GitHub 或 Azure 工作项前,核对负责人、依赖、优先级与产能。
用于初始化项目或校验并生成 SDD 文档模板,确保规范齐全且为最新版本。
在初始功能规划阶段,引导团队梳理工程实践选型问题与关键权衡。
在实现完成后协助提交代码、推送分支并发起拉取请求与自动审查。
在 AI 客户端中直接检索 Branch 官方 API 文档,快速定位集成与实现信息。
在开发分支完成并通过测试后,帮助选择合并、提 PR 或清理收尾方案。
帮助开发者规范完成开发分支收尾,支持合并、提 PR 或清理流程。
基于代码差异生成规范化 Git 提交信息,并支持按逻辑分组提交
帮助你同步当前分支与上游分支,完成拉取、变基、推送或发布操作