Skip to content

Automatically create git branches from Jira task URLs using Claude Code — no API keys required

Notifications You must be signed in to change notification settings

DenysFizer/Jira-ClaudeCode-branch-naming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

🚀 Jira Auto-Branch

Automatically create git branches from Jira tasks with AI-powered naming

Bash Claude License


Stop manually typing branch names. Let AI do the work.

🔒 No third-party APIs required — Uses Claude Code directly, no API keys or external services needed.

✨ Features

Feature Description
🔗 URL Parsing Extracts task info directly from any Jira URL
🤖 AI-Powered Uses Claude to generate clean, consistent branch names
📦 Auto-Stash Automatically stashes uncommitted changes
🔄 Smart Switch Switches to existing branch if it already exists
🎯 Consistent Naming Enforces branch naming conventions automatically

📋 Requirements

Requirement Description
Claude Code CLI Anthropic's CLI tool
Claude in Chrome Browser extension for page interaction
Chrome Must be running with extension active
jq JSON parsing utility
Git Version control

🚀 Quick Start

# Clone the repository
git clone https://github.com/yourusername/jira-auto-branch.git

# Make the script executable
chmod +x Jira-auto-branch.sh

# Run with a Jira URL
./Jira-auto-branch.sh https://your-domain.atlassian.net/browse/PROJ-123

📖 Usage

./Jira-auto-branch.sh <jira-task-url>

Example

./Jira-auto-branch.sh https://your-domain.atlassian.net/browse/PROJ-123

# Output:
# ✓ Task info retrieved successfully
# ✓ Generated branch name: PROJ-123-add-user-authentication
# ✓ Successfully created/switched to branch: PROJ-123-add-user-authentication

⚙️ How It Works

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   Jira URL      │────▶│  Chrome + Claude│────▶│  Extract Info   │
│                 │     │   Extension     │     │                 │
└─────────────────┘     └─────────────────┘     └────────┬────────┘
                                                         │
                                                         ▼
┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│  Switch Branch  │◀────│ Generate Name   │◀────│  Task ID +      │
│  (stash/unstash)│     │ (AI-powered)    │     │  Title          │
└─────────────────┘     └─────────────────┘     └─────────────────┘
  1. Open - Opens Jira task URL in Chrome via Claude extension
  2. Extract - Pulls task ID, title, and description from the page
  3. Generate - AI creates a clean branch name following conventions
  4. Stash - Saves any uncommitted changes (if present)
  5. Branch - Creates and switches to the new branch
  6. Restore - Brings back your stashed changes

🏷️ Branch Naming Convention

Rule Example
Format TASK-ID-short-description
Case Lowercase description
Separator Hyphens only
Max Length 60 characters

Examples:

  • PROJ-123-add-user-authentication
  • FEAT-456-fix-login-redirect
  • BUG-789-resolve-null-pointer

🔧 Customization

You can customize the output by modifying the JSON schemas in the script:

Task Schema (TASK_SCHEMA)

Controls what information is extracted from the Jira page:

{
  "task_id": "The Jira task ID",
  "title": "Short summary of the task",
  "description": "Brief description"
}

Branch Schema (BRANCH_SCHEMA)

Controls the branch name format:

{
  "branch_name": {
    "pattern": "^[A-Z]+-[0-9]+-[a-z0-9-]+$",
    "maxLength": 60
  }
}

Modify these schemas to fit your team's conventions!

🤝 Contributing

Contributions are welcome! Feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


About

Automatically create git branches from Jira task URLs using Claude Code — no API keys required

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages