git-branch

GitHub

该技能用于安全地创建符合规范的 Git 开发分支。它根据 Issue ID 或用户输入生成命名,验证基础分支安全性,并执行创建操作,防止覆盖工作或选择不安全的基础分支。

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

Trigger Scenarios

需要创建新的功能或修复分支时 询问如何规范命名 Git 分支时

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-existing-code/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
93c4bdd
Hash
219ac68a
Indexed
2026-07-24 11:35

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-03 07:49
浙ICP备14020137号-1