# Skill: create-worktree Git worktree setup for a PAISY Jira ticket. ## Invoked by 🎫 JiraOps mode (or 🪃 Orchestrator delegating to JiraOps) ## Required Inputs | Input | Source | Example | |-------|--------|---------| | `TICKET_ID` | Jira issue key | `ESIDEPAISY-12081` | | `MODULE` | Ticket context or user input | `eau`, `eubp`, `svmeldungen`, `dabpv`, `rvbea` | | `TYPE` | Ticket issue type (Story → feature, Bug → bugfix) | `feature` or `bugfix` | | `SHORT_DESC` | Kebab-case summary (2-4 words) | `leftover-rueckmeldungen` | ## Steps ### 1. Parse ticket metadata ``` TICKET_KEY = e.g. "ESIDEPAISY-12081" TICKET_NUM = e.g. "12081" (numeric part only) ``` If MODULE or TYPE are not provided, retrieve them from Jira: - `retrieve_ticket_details(TICKET_KEY)` → read `issuetype` and `summary` - Map issue type: `Story` / `Task` → `feature`, `Bug` → `bugfix` - Infer module from summary keywords or ask the user ### 2. Determine branch name ``` BRANCH = current///- ``` Examples: - `current/feature/eau/ESIDEPAISY-12081-leftover-rueckmeldungen` - `current/bugfix/eau/ESIDEPAISY-12261-azvu-package-placeholder` ### 3. Ensure base branch is up to date ```bash cd /Users/pplate/git/paisy git fetch origin current ``` ### 4. Create worktree ```bash git worktree add /Users/pplate/git/paisy- -b origin/current ``` This creates: - Worktree directory: `/Users/pplate/git/paisy-` - New branch: `` tracking `origin/current` ### 5. Verify ```bash cd /Users/pplate/git/paisy- && git branch --show-current ``` Expected output: the branch name from step 2. ### 6. Store in BigMind ```python memory_store_fact( category="codebase", fact=f"{TICKET_KEY}: Worktree at /Users/pplate/git/paisy-{TICKET_KEY}, branch {BRANCH}" ) ``` ### 7. Announce focus ```python memory_announce_focus( session_id=SESSION_ID, description=f"Working on {TICKET_KEY} in worktree", files=[f"/Users/pplate/git/paisy-{TICKET_KEY}"], ide_hint="Roo" ) ``` ## Expected Output - Worktree directory exists at `/Users/pplate/git/paisy-` - Branch `` is checked out - BigMind fact stored with worktree path - Focus announced ## Error Handling | Error | Resolution | |-------|------------| | Worktree already exists | Check if branch matches. If yes, reuse. If no, ask user. | | Branch already exists | `git worktree add /Users/pplate/git/paisy- ` (without `-b`) | | `origin/current` not found | Try `git fetch origin` first, then retry | | Directory already exists (not a worktree) | Ask user to remove or choose different path | ## Cleanup (when ticket is done) ```bash cd /Users/pplate/git/paisy git worktree remove /Users/pplate/git/paisy- git branch -d # only after merge ```