branch-name-ticket

Validates and renames git branches to include a Jira ticket key in the type/KEY-summary format.

1|Updated Aug 6, 2025
One-click install
npx skills add https://github.com/azaidrahman/zaid-sani-dotfiles --skill branch-name-ticket-azaidrahman
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: branch-name-ticket
Source: https://github.com/azaidrahman/zaid-sani-dotfiles/tree/main/dot_claude/skills/branch-name-ticket
Command: npx skills add https://github.com/azaidrahman/zaid-sani-dotfiles --skill branch-name-ticket-azaidrahman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Feature branches often get created without a Jira ticket key, breaking traceability between code, pull requests, and tickets. This Skill detects non-compliant branch names, finds the right ticket automatically, and renames the branch safely before pushing or opening a PR. ## Core Features & Use Cases - Automated branch linting: A bundled shell script classifies the current branch (ok, no-key, needs-type, protected) and performs deterministic fixes like uppercasing a lowercase ticket key, handling macOS case-insensitive filesystem collisions. - Ticket discovery: Finds the Jira key from the tmux window name, commit subjects, or a Jira JQL query of in-progress issues assigned to the user, asking only as a last resort. - Safe renaming: Performs local renames freely, but checks for open PRs and confirms with the user before deleting any remote branch. - Use Case: You are about to push a branch named docs/cloud-run-keyless-auth; the Skill detects the missing key, finds GTI-273 from Jira, and renames it to docs/GTI-273-cloud-run-keyless-auth. ## Quick Start Check my current branch and rename it to include the correct Jira ticket key before I push.

Frequently Asked Questions about branch-name-ticket

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rename a git branch to include a Jira ticket key?▼

Run the branch-name-lint.sh script to classify the current branch, then rename locally with git branch -m to the format type/KEY-summary. If the branch was already pushed, push the new name and delete the old remote ref only after confirming no open PR exists.

How can I find which Jira ticket a git branch belongs to?▼

Check the tmux window name first, then scan commit subjects on the branch for a shared KEY-NUM pattern, then query Jira with JQL for in-progress issues assigned to the current user. Asking the user directly is the last resort.

What is the correct git branch naming convention with Jira tickets?▼

Use type/TICKET-KEY-kebab-summary, where type is one of feat, fix, chore, docs, refactor, test, ci, or build, the key is uppercase like GTI-273, and the summary is 2-4 lowercase tokens capped at 30 characters.

Can I rename a git branch that already has an open pull request?▼

Renaming locally is always safe, but deleting the remote branch with an open PR will close or break it. The Skill stops in that case and tells you to re-open the PR or change its source branch manually in Bitbucket or GitHub.

Why does renaming a branch fail on macOS when only changing letter case?▼

macOS uses a case-insensitive filesystem, so git reports the branch already exists on a case-only rename. The lint script works around this by renaming through a temporary intermediate branch name first.

Which branches should never be renamed for ticket compliance?▼

Protected long-lived branches such as main, master, develop, and release branches must never be renamed. The lint script exits with a protected status code when it detects one of these branches.