Files
pi_mcps/zoo_backup/work/rules/skills/skill-create-worktree.md
T
2026-06-24 19:27:14 +02:00

2.8 KiB

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 / Taskfeature, Bugbugfix
  • Infer module from summary keywords or ask the user

2. Determine branch name

BRANCH = current/<TYPE>/<MODULE>/<TICKET_KEY>-<SHORT_DESC>

Examples:

  • current/feature/eau/ESIDEPAISY-12081-leftover-rueckmeldungen
  • current/bugfix/eau/ESIDEPAISY-12261-azvu-package-placeholder

3. Ensure base branch is up to date

cd /Users/pplate/git/paisy
git fetch origin current

4. Create worktree

git worktree add /Users/pplate/git/paisy-<TICKET_KEY> -b <BRANCH> origin/current

This creates:

  • Worktree directory: /Users/pplate/git/paisy-<TICKET_KEY>
  • New branch: <BRANCH> tracking origin/current

5. Verify

cd /Users/pplate/git/paisy-<TICKET_KEY> && git branch --show-current

Expected output: the branch name from step 2.

6. Store in BigMind

memory_store_fact(
    category="codebase",
    fact=f"{TICKET_KEY}: Worktree at /Users/pplate/git/paisy-{TICKET_KEY}, branch {BRANCH}"
)

7. Announce focus

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-<TICKET_KEY>
  • Branch <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-<TICKET_KEY> <BRANCH> (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)

cd /Users/pplate/git/paisy
git worktree remove /Users/pplate/git/paisy-<TICKET_KEY>
git branch -d <BRANCH>  # only after merge