一键导入
create-feature-branch
Create properly named feature branch from development with remote tracking, following WescoBar naming conventions and git best practices
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create properly named feature branch from development with remote tracking, following WescoBar naming conventions and git best practices
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | create-feature-branch |
| description | Create properly named feature branch from development with remote tracking, following WescoBar naming conventions and git best practices |
Create a feature branch with proper naming convention, sync with remote development branch, and set up remote tracking for WescoBar workflows.
feature/issue-<NUMBER>-<short-description>
Examples:
feature/issue-137-dark-modefeature/issue-42-character-portraitsfeature/issue-89-gemini-cachingRules:
feature/issue-<NUMBER> for GitHub issue linkingISSUE_NUMBER=$1
ISSUE_TITLE=$2 # Optional: for auto-generating description
if [ -z "$ISSUE_NUMBER" ]; then
echo "❌ Error: Issue number required"
exit 1
fi
# Validate issue number is numeric
if ! [[ "$ISSUE_NUMBER" =~ ^[0-9]+$ ]]; then
echo "❌ Error: Issue number must be numeric"
exit 1
fi
# Generate short description from issue title if provided
if [ -n "$ISSUE_TITLE" ]; then
# Convert to lowercase, replace spaces with hyphens, remove special chars
SHORT_DESC=$(echo "$ISSUE_TITLE" | \
tr '[:upper:]' '[:lower:]' | \
sed 's/[^a-z0-9 ]//g' | \
tr -s ' ' '-' | \
cut -d'-' -f1-5) # Keep first 5 words max
else
# Manual description required
echo "Enter short description (kebab-case):"
read SHORT_DESC
fi
BRANCH_NAME="feature/issue-${ISSUE_NUMBER}-${SHORT_DESC}"
echo "Branch name: $BRANCH_NAME"
# Check local branches
if git rev-parse --verify "$BRANCH_NAME" 2>/dev/null; then
echo "⚠️ Branch already exists locally: $BRANCH_NAME"
echo "Options:"
echo " 1. Checkout existing branch"
echo " 2. Create new branch with different name"
echo " 3. Delete and recreate"
read -p "Choose (1/2/3): " CHOICE
case $CHOICE in
1)
git checkout "$BRANCH_NAME"
echo "✅ Checked out existing branch"
exit 0
;;
2)
echo "Enter new description:"
read NEW_DESC
BRANCH_NAME="feature/issue-${ISSUE_NUMBER}-${NEW_DESC}"
;;
3)
git branch -D "$BRANCH_NAME"
echo "Deleted existing branch - will recreate"
;;
esac
fi
# Check remote branches
if git ls-remote --heads origin "$BRANCH_NAME" | grep -q "$BRANCH_NAME"; then
echo "⚠️ Branch exists on remote: $BRANCH_NAME"
echo "Fetching remote branch..."
git fetch origin "$BRANCH_NAME"
git checkout --track "origin/$BRANCH_NAME"
echo "✅ Checked out remote branch"
exit 0
fi
echo "→ Syncing with development branch..."
# Checkout development
git checkout development
# Pull latest changes
if ! git pull origin development; then
echo "❌ Error: Failed to pull latest development"
echo "Resolve conflicts and try again"
exit 1
fi
echo "✅ Development branch up to date"
echo "→ Creating feature branch: $BRANCH_NAME"
# Create and checkout new branch
if ! git checkout -b "$BRANCH_NAME"; then
echo "❌ Error: Failed to create branch"
exit 1
fi
echo "✅ Feature branch created"
echo "→ Pushing to remote with tracking..."
# Push with upstream tracking
if ! git push -u origin "$BRANCH_NAME"; then
echo "❌ Error: Failed to push to remote"
echo "Branch created locally but not on remote"
exit 1
fi
echo "✅ Branch pushed to remote with tracking"
# Verify current branch
CURRENT_BRANCH=$(git branch --show-current)
if [ "$CURRENT_BRANCH" = "$BRANCH_NAME" ]; then
echo ""
echo "✅ Feature Branch Setup Complete"
echo " Branch: $BRANCH_NAME"
echo " Tracking: origin/$BRANCH_NAME"
echo " Base: development"
echo ""
echo "Ready for implementation!"
else
echo "⚠️ Warning: Not on expected branch"
echo " Expected: $BRANCH_NAME"
echo " Actual: $CURRENT_BRANCH"
fi
{
"status": "success",
"branch": {
"name": "feature/issue-137-dark-mode",
"issue": 137,
"base": "development",
"remote": "origin/feature/issue-137-dark-mode",
"tracking": true
},
"message": "Feature branch created and pushed to remote"
}
{
"status": "success",
"branch": {
"name": "feature/issue-137-dark-mode",
"existed": true,
"action": "checked_out"
},
"message": "Existing branch checked out"
}
Used in conductor Phase 2, Step 1:
### Phase 2: Branch Setup and Implementation
**Step 1: Create Feature Branch**
**RESUMPTION CHECK**: If feature branch already exists, SKIP this step.
Use `create-feature-branch` skill:
- Input: issue_number, issue_title (from Phase 1)
- Output: branch_name, tracking status
Expected result:
- Branch created: `feature/issue-137-dark-mode`
- Checked out and ready
- Remote tracking set up
- Base: development (latest)
Record branch name for PR creation in Phase 4.
if ! git pull origin development; then
echo "❌ Merge conflicts in development branch"
echo "Action required:"
echo " 1. Resolve conflicts manually"
echo " 2. Run: git merge --continue"
echo " 3. Re-run create-feature-branch"
exit 1
fi
# Retry with exponential backoff (from CLAUDE.md)
for i in {1..4}; do
if git push -u origin "$BRANCH_NAME"; then
break
else
if [ $i -lt 4 ]; then
DELAY=$((2 ** i))
echo "⏳ Push failed, retrying in ${DELAY}s..."
sleep $DELAY
else
echo "❌ Push failed after 4 attempts"
exit 1
fi
fi
done
if [ ${#BRANCH_NAME} -gt 80 ]; then
echo "⚠️ Branch name too long: ${#BRANCH_NAME} characters"
echo "Truncating description..."
SHORT_DESC=$(echo "$SHORT_DESC" | cut -c1-40)
BRANCH_NAME="feature/issue-${ISSUE_NUMBER}-${SHORT_DESC}"
fi
check-resume-branch - Check if branch exists for resumptionpush-with-retry - Retry logic for network failurescommit-with-validation - Atomic commit before PRgit push without argsgit branch --show-currentDetect project stack, apply architecture patterns, wire quality gates, and scaffold features. Use when bootstrapping a project, adding a vertical slice, wiring CI/CD, adding Docker compose, or setting up quality gates.
Generates structured Handoff Pack prompts for delegating work to Gemini with clear scope, acceptance criteria, and output format requirements.
Incrementally improve type safety by replacing string literals with enums, narrowing `any` types, and using shared types. Works in small verified batches. Preserves functionality while improving code quality.
Cloudflare DNS and infrastructure management. Manage DNS records, tunnels, Access policies, SSL certificates, and CDN caching.
Deploy projects to staging or production environments. Repo-agnostic deployment orchestration using SSH MCP for VPS operations and Cloudflare for DNS/SSL. Reads project configuration from deployments.registry.json.
Direct VPS operations via SSH MCP. Manage Docker containers, check logs, run commands, and troubleshoot services on registered VPS servers.