用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill git-branch命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | git-branch |
| description | Create new branches with naming conventions Use when this capability is needed. |
| metadata | {"author":"dtsong"} |
.., shell metacharacters, or null bytes.--from): must be a valid existing ref. Reject shell metacharacters and .. traversal.Create a new branch with proper naming conventions, optionally from a specific base.
/git-branch feat/dark-mode # Create feature branch
/git-branch fix/login-bug # Create bugfix branch
/git-branch feat/api-v2 --from main # Create from specific base
/git-branch --suggest "add login" # Suggest branch name from description
| Prefix | Use For | Example |
|---|---|---|
feat/ | New features | feat/dark-mode |
fix/ | Bug fixes | fix/login-validation |
refactor/ | Code refactoring | refactor/auth-module |
docs/ | Documentation | docs/api-reference |
test/ | Test additions/fixes | test/auth-coverage |
chore/ | Maintenance tasks | chore/update-deps |
hotfix/ | Urgent production fixes | hotfix/security-patch |
BRANCH_NAME="$1"
# Check for valid prefix
if [[ ! "$BRANCH_NAME" =~ ^(feat|fix|refactor|docs|test|chore|hotfix)/ ]]; then
echo "Warning: Branch name doesn't follow conventions."
echo "Recommended prefixes: feat/, fix/, refactor/, docs/, test/, chore/, hotfix/"
fi
# Check for invalid characters
if [[ "$BRANCH_NAME" =~ [[:space:]] ]]; then
echo "Error: Branch name cannot contain spaces. Use hyphens instead."
exit 1
fi
# Check length
if [ ${#BRANCH_NAME} -gt 50 ]; then
echo "Warning: Branch name is quite long. Consider shortening."
fi
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "You have uncommitted changes."
echo "Options:"
echo " /git-stash - Stash changes first"
echo " /commit - Commit changes first"
exit 1
fi
# Default to current branch, or use specified base
BASE_BRANCH="${FROM_BRANCH:-$(git branch --show-current)}"
# Fetch to ensure we have latest
git fetch origin "$BASE_BRANCH" 2>/dev/null || true
# Create branch from base
git checkout -b "$BRANCH_NAME" "$BASE_BRANCH"
# Set up tracking if base has remote
if git rev-parse --verify "origin/$BASE_BRANCH" >/dev/null 2>&1; then
echo "Created from origin/$BASE_BRANCH (latest)"
fi
Created branch: feat/dark-mode
Base: main (up to date with origin/main)
Current position: abc1234 Latest commit on main
Branch is local only. To publish:
/git-push -u
Next steps:
- Make your changes
- /commit to commit
- /git-push to publish
- /commit-push-pr to create PR
When using --suggest:
Suggested branch names for "add user login feature":
1. feat/user-login (Recommended)
2. feat/add-user-login
3. feat/login-feature
Enter your choice or provide custom name:
Branch 'feat/dark-mode' already exists.
Options:
/git-switch feat/dark-mode # Switch to existing branch
/git-branch feat/dark-mode-v2 # Create with different name
When --suggest is used, generate names based on description:
# Example: "fix the authentication bug in login form"
# Result: fix/auth-bug-login-form
-, /, _feat/JIRA-123-dark-mode--from main after pulling/git-switch to change between branches/git-branches to see all branches/commit-push-pr when ready to create PR| Path | Load Condition | Content Summary |
|---|---|---|
references/naming-conventions.md | Branch name validation | Branch naming convention rules and prefix definitions |
Converted and distributed by TomeVault — claim your Tome and manage your conversions.