Agent skill
branch-and-pr
Creates git branches from Jira tickets and opens Pull Requests to the main branch. Use when users want to create a branch for a Jira task, open a PR, or mention "create branch", "open PR", "pull request", or "merge to main".
Install this agent skill to your Project
npx add-skill https://github.com/IHKREDDY/agent-skills-ts/tree/main/skills/branch-and-pr
Metadata
Additional technical details for this skill
- author
- IHKREDDY
- version
- 1.0
- category
- development
SKILL.md
Branch and PR Skill
When to Use This Skill
Use this skill when:
- Creating a git branch from a Jira ticket
- Opening a Pull Request to main/master branch
- Users mention "create branch for FB-1", "open PR", "submit for review"
- Automating the full workflow: branch → code → PR
Prerequisites
1. GitHub CLI
brew install gh
gh auth login
2. Atlassian MCP Server
Ensure .vscode/mcp.json is configured with Atlassian MCP.
Workflow Commands
Create Branch from Jira Ticket
# Creates a properly named branch from Jira ticket
node --loader ts-node/esm .github/skills/skills/branch-and-pr/scripts/create-branch.ts --ticket FB-1
What it does:
- ✅ Fetches ticket details from Jira
- ✅ Creates branch with naming convention:
feature/{ticket-key}-{short-description} - ✅ Pushes branch to origin
- ✅ Transitions ticket to "In Progress" (optional)
Create Pull Request
# Creates a draft PR from current branch to main
node --loader ts-node/esm .github/skills/skills/branch-and-pr/scripts/create-pr.ts --ticket FB-1
What it does:
- ✅ Gets ticket summary from Jira
- ✅ Creates PR with title:
[FB-1] Ticket summary - ✅ Adds Jira link and description to PR body
- ✅ Opens as draft PR for review
Full Workflow (Branch + PR)
# Creates branch, then PR when ready
node --loader ts-node/esm .github/skills/skills/branch-and-pr/scripts/full-workflow.ts --ticket FB-1
Branch Naming Conventions
| Issue Type | Branch Prefix | Example |
|---|---|---|
| Task/Story | feature/ |
feature/fb-1-add-meal-selection |
| Bug | bugfix/ |
bugfix/fb-2-fix-booking-error |
| Hotfix | hotfix/ |
hotfix/fb-3-critical-payment-fix |
PR Template
The generated PR includes:
- Link to Jira ticket
- Description from ticket
- Checklist for review
- Auto-draft status
Agent Instructions
When the user asks to create a branch or PR:
- Extract ticket ID from the request (e.g., "FB-1", "SAM1-123")
- Fetch ticket details using Atlassian MCP:
mcp_atlassian_atl_getJiraIssue - Create branch with proper naming convention
- Push to origin to make it available
- Create PR when user is ready for review
Example Prompts
User: "Create a branch for FB-1"
→ Run create-branch.ts --ticket FB-1
User: "Open a PR for this ticket to main"
→ Run create-pr.ts --ticket FB-1
User: "I'm done with FB-1, create a PR"
→ Commit changes, then run create-pr.ts --ticket FB-1
Script Options
create-branch.ts
| Option | Description | Default |
|---|---|---|
--ticket |
Jira ticket key (required) | - |
--no-push |
Create branch without pushing | false |
--no-transition |
Don't update Jira status | false |
create-pr.ts
| Option | Description | Default |
|---|---|---|
--ticket |
Jira ticket key (required) | - |
--base |
Target branch | main |
--draft |
Create as draft PR | true |
--no-draft |
Create as ready for review | false |
Error Handling
- If branch already exists: Switch to existing branch
- If PR already exists: Show existing PR URL
- If GitHub CLI not installed: Show installation instructions
- If ticket not found: Show error with suggestions
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
tech-debt-report
Find TODOs, deprecated APIs, and outdated patterns in codebase
sprint-summary
Generate sprint review summary from completed Jira tickets
api-integration
Design and implement REST API integrations with proper error handling, authentication, rate limiting, and testing. Use when building API clients, integrating third-party services, or when users mention API, REST, webhooks, HTTP requests, or service integration.
work-on-ticket
Pulls ticket details from Jira, creates feature branches with proper naming conventions, and handles planning steps. Use when starting work on a Jira ticket, creating branches for tickets, or when users mention "work on ticket", "start ticket", "create branch for", or Jira ticket IDs.
hotfix-workflow
Rapid hotfix branch creation, fix application, and PR to main
create-ticket
Creates Jira tickets with proper formatting, acceptance criteria, and optionally sets up git branches and pull requests. Use when users want to create a new ticket, log a bug, request a feature, or when they mention "create ticket", "new ticket", "log issue", "file bug", or "create Jira".
Didn't find tool you were looking for?