From Dev10x
Create a properly named git branch for a ticket following project conventions (username/TICKET-ID/[worktree/]short-slug). Ensures latest develop is pulled before creating the branch. Automatically detects worktrees and includes worktree name in branch. TRIGGER when: starting work on a ticket and need a feature branch. DO NOT TRIGGER when: branch already exists for this ticket, or creating a worktree (use Dev10x:git-worktree which creates branches internally).
npx claudepluginhub dev10x-guru/dev10x-claude --plugin Dev10xThis skill is limited to using the following tools:
This skill follows `references/task-orchestration.md` patterns.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
This skill follows references/task-orchestration.md patterns.
Create a task at invocation, mark completed when done:
REQUIRED: Create a task at invocation. Execute at startup:
TaskCreate(subject="Create ticket branch", activeForm="Creating branch")Mark completed when done: TaskUpdate(taskId, status="completed")
This skill creates a properly named git branch following the project convention:
username/TICKET-ID/short-slugusername/TICKET-ID/worktree-name/short-slugIt ensures you're on the latest develop branch before creating the new branch and automatically detects if running in a git worktree.
Use this skill when:
This skill requires:
Check the current git status and warn if there are uncommitted changes:
git status --porcelain
If there are uncommitted changes:
Ensure we're working from the latest develop branch:
Standard repo:
git fetch origin develop
git checkout develop
git pull origin develop
Worktree (develop is checked out in the main repo):
git fetch origin develop
# Cannot checkout develop — it's used by the main worktree.
# Branch directly from origin/develop in Step 6 instead:
# git checkout -b <branch> origin/develop
Error handling:
git checkout develop fails because develop is checked out elsewhere
(worktree), skip checkout and branch from origin/develop in Step 6git pull fails (e.g., merge conflicts), inform the user and stopTransform the ticket title into a URL-friendly slug:
Rules:
Examples:
fix-motor-timeoutadd-retry-mechanismupdate-search-indexingremove-deprecated-gatewayrefactor-invoice-generationImplementation approach:
# Pseudo-code for slug generation
title = "Fix MotorTimeoutException in payment processing"
words = title.lower().split()
# Remove common words
significant_words = [w for w in words if w not in ['a', 'the', 'in', 'for', 'with', 'of', 'to', 'and']]
# Take first 3-4 words
slug_words = significant_words[:4]
# Clean and join
slug = '-'.join(slug_words).replace('[^a-z0-9-]', '')
Detect whether we're in a worktree and extract its name.
Primary: CWD-based detection (no subshell, no permission friction):
Split the current working directory on .worktrees/ and take the
first path segment after it. Example: /work/example/.worktrees/app-pos-7/
yields app-pos-7.
pwd | grep -oP '\.worktrees/\K[^/]+'
Fallback: git subshell (only when CWD is not under .worktrees/):
if [ -f .git ]; then
worktree_name=$(basename "$(git rev-parse --show-toplevel)")
fi
Detection rules:
.worktrees/ → extract name from path (primary).git is a file → use git subshell fallback.git is a directory) → main repo, no worktree prefixCombine username, ticket ID, optional worktree name, and slug:
Format:
username/TICKET-ID/slugusername/TICKET-ID/worktree-name/slugGet current username:
git config user.name | tr '[:upper:]' '[:lower:]' | tr ' ' '-'
Or use a default based on the git remote URL if available.
Branch name assembly:
username="janusz"
ticket_id="PAY-133"
slug="fix-motor-timeout"
if [ -n "$worktree_name" ]; then
branch="${username}/${ticket_id}/${worktree_name}/${slug}"
else
branch="${username}/${ticket_id}/${slug}"
fi
Example outputs:
Regular repo:
janusz/PAY-133/fix-motor-timeoutjanusz/ENG-42/add-retry-mechanismWorktree (e.g., in /work/example/.worktrees/app-pos-7):
janusz/PAY-133/app-pos-7/fix-motor-timeoutjanusz/ENG-42/app-pos-7/add-retry-mechanismjanusz/PAY-200/app-pos-7/update-search-indexingCreate and checkout the new branch:
git checkout -b username/TICKET-ID/slug
# or for worktree:
git checkout -b username/TICKET-ID/worktree-name/slug
Error handling:
Display a success message with the branch name:
Created and checked out branch: janusz/PAY-133/app-pos-7/fix-motor-timeout
Branch details:
- Base: develop (commit abc1234)
- Pattern: username/TICKET-ID/worktree-name/slug
- Worktree: app-pos-7
- Ready for work!
For regular repos (no worktree):
Created and checked out branch: janusz/PAY-133/fix-motor-timeout
Branch details:
- Base: develop (commit abc1234)
- Pattern: username/TICKET-ID/slug
- Ready for work!
janusz/PAY-133/app-pos-7/slug)git -C <path> (GH-760 F5): git -C breaks
allow-rule matching in settings.local.json. The CWD is
always set correctly — run git commands without -C.User request:
Create branch for PAY-133: Fix MotorTimeoutException in payment processing
Current state: Working in main repo (not a worktree)
Workflow execution:
fix-motor-timeout.git is a directory → not a worktreejanuszjanusz/PAY-133/fix-motor-timeoutResult:
Created and checked out branch: janusz/PAY-133/fix-motor-timeout
User request:
Create branch for PAY-133: Fix MotorTimeoutException in payment processing
Current state: Working in /work/example/.worktrees/app-pos-7 (a worktree)
Workflow execution:
fix-motor-timeout.git is a file → worktree detectedapp-pos-7januszjanusz/PAY-133/app-pos-7/fix-motor-timeoutResult:
Created and checked out branch: janusz/PAY-133/app-pos-7/fix-motor-timeout
Branch details:
- Base: develop (commit abc1234)
- Pattern: username/TICKET-ID/worktree-name/slug
- Worktree: app-pos-7
- Ready for work!
User request:
Create branch for ENG-42: Add retry mechanism for Square API
Current state: Uncommitted changes in working directory
Workflow execution:
User request:
Create branch for PAY-100: Update customer search
Current state: Branch janusz/PAY-100/app-pos-7/update-customer-search already exists (in worktree)
Workflow execution:
app-pos-7git checkout janusz/PAY-100/app-pos-7/update-customer-searchThis skill is designed to be used standalone or as part of larger workflows:
When integrating, pass the ticket ID and title as parameters.