skills/miguelez11/skills/git-jira-branch

git-jira-branch

SKILL.md

git-jira-branch

Quick start

Given a ticket like TICKET-1234:

# 1. Look for an existing branch
git branch --list "TICKET-1234-*"

# 2a. Branch found — switch to it
git checkout TICKET-1234-my-feature

# 2b. No branch found — delegate to the helper script
jiraSwitchToBranch TICKET-1234

Workflow

  1. Extract the ticket number from the user's message (e.g. PROJ-42, ABC-1234).
  2. Search local branches for a branch whose name starts with <TICKET>-:
    git branch --list "<TICKET>-*"
    
  3. If exactly one match → check it out:
    git checkout <matched-branch>
    
  4. If multiple matches → list them and ask the user which one to use.
  5. If no match → run the helper:
    jiraSwitchToBranch <TICKET>
    
    The script handles branch creation and checkout automatically; report its output to the user.

Notes

  • Always search local branches first (git branch --list), not remote.
  • The ticket prefix match is case-sensitive; use the ticket number exactly as provided.
  • Do not create branches manually — jiraSwitchToBranch is the authoritative tool for that.
  • jiraSwitchToBranch is not loaded in you environment, so run sh ~/.config/helpers/switchToJiraBranch.sh
Weekly Installs
6
First Seen
11 days ago
Installed on
opencode6
gemini-cli6
claude-code6
github-copilot6
windsurf6
codex6