git-branch

GitHub

辅助创建符合规范的 Git 开发分支,自动处理命名规则、基础分支选择及安全校验,防止覆盖或误操作。

.agents/skills/git-branch/SKILL.md Terry-Mao/AICodingFlow

Trigger Scenarios

需要创建新的功能或修复分支 根据 Issue ID 生成规范分支名 检查当前工作区状态并安全切换分支

Install

npx skills add Terry-Mao/AICodingFlow --skill git-branch -g -y
More Options

Non-standard path

npx skills add https://github.com/Terry-Mao/AICodingFlow/tree/main/.agents/skills/git-branch -g -y

Use without installing

npx skills use Terry-Mao/AICodingFlow@git-branch

指定 Agent (Claude Code)

npx skills add Terry-Mao/AICodingFlow --skill git-branch -a claude-code -g -y

安装 repo 全部 skill

npx skills add Terry-Mao/AICodingFlow --all -g -y

预览 repo 内 skill

npx skills add Terry-Mao/AICodingFlow --list

SKILL.md

Frontmatter
{
    "name": "git-branch",
    "description": "Create repository-compliant development branches with minimal safety checks."
}

git-branch

Create a new branch without overwriting work or choosing an unsafe base.

Naming

  • Issue-backed work: <type>/<short-desc>-<issueID>.
  • Other work: <type>/<user-provided-name>; never invent an issue ID.
  • Valid types are feat, fix, refactor, docs, test, perf, and chore. Preserve a valid user type, otherwise infer one and default to chore.
  • Keep the description short, lowercase, English, hyphen-separated, and valid for Git. Remove punctuation, filler, and repeated separators.

When an issue ID is provided, use one gh issue view <issueID> --json title,body,number call for naming context. If it fails, continue only when the request is enough and report that the issue was not verified.

Create

Check the current worktree, branch, and target branch first. Stop if the worktree intent is ambiguous, the target already exists, or the current/base branch is unsafe. Validate the name with:

git check-ref-format --branch <branch-name>

Use the repository's documented base, otherwise main. In the same repository prefer origin/<base> over upstream/<base>; use upstream only for a fork or explicit guidance. Fetch or compare freshness only when it can change the choice of base. If creating from a stale local base, confirm before updating or use a freshly fetched remote base and report that the local base was unchanged.

git switch -c <branch-name> <base>
git switch --no-track -c <branch-name> origin/<base>

Verify the resulting branch. Do not switch to an existing branch, overwrite, reset, stash, delete, or force anything without explicit user intent. Do not create protected/shared base branches.

Version History

  • d3fef11 Current 2026-09-03 03:51

    精简本地开发与 spec 工作流指引

  • e53c5ac 2026-07-24 11:35

Same Skill Collection

.agents/skills/bootstrap-issue-config/SKILL.md
.agents/skills/create-issue/SKILL.md
.agents/skills/create-pr/SKILL.md
.agents/skills/diagnose-ci-failures/SKILL.md
.agents/skills/git-commit/SKILL.md
.agents/skills/git-push/SKILL.md
.agents/skills/git-worktree/SKILL.md
.agents/skills/pr-walkthrough/SKILL.md
.agents/skills/resolve-merge-conflicts/SKILL.md
.agents/skills/review-pr-local/SKILL.md
.agents/skills/review-spec-local/SKILL.md
.agents/skills/spec-driven-implementation/SKILL.md
.agents/skills/write-product-spec/SKILL.md
.agents/skills/write-tech-spec/SKILL.md
.github/skills/check-impl-against-spec/SKILL.md
.github/skills/create-product-spec/SKILL.md
.github/skills/create-tech-spec/SKILL.md
.github/skills/dedupe-issue-repo/SKILL.md
.github/skills/dedupe-issue/SKILL.md
.github/skills/implement-issue/SKILL.md
.github/skills/implement-specs/SKILL.md
.github/skills/product-change-report/SKILL.md
.github/skills/product-docs-sync/SKILL.md
.github/skills/product-wiki/SKILL.md
.github/skills/review-pr-repo/SKILL.md
.github/skills/review-pr/SKILL.md
.github/skills/review-spec-repo/SKILL.md
.github/skills/review-spec/SKILL.md
.github/skills/security-review-pr/SKILL.md
.github/skills/security-review-spec/SKILL.md
.github/skills/triage-issue-repo/SKILL.md
.github/skills/triage-issue/SKILL.md
.github/skills/update-dedupe/SKILL.md
.github/skills/update-pr-review/SKILL.md
.github/skills/update-triage/SKILL.md

Metadata

Files
0
Version
e767f58
Hash
219ac68a
Indexed
2026-07-24 11:35

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-21 22:05
浙ICP备14020137号-1