| name | git-pr-creator |
| description | Create Git PRs with semantic versioning labels (major/minor/patch), JIRA ticket updates, and image attachments using git-semantic-commits formatting Use when this capability is needed. |
| metadata | {"author":"darellchua2"} |
What I do
I implement a complete Git PR creation workflow with optional JIRA integration:
- Check JIRA Integration: Ask user if JIRA is used for the project
- Create Pull Request: Create a GitHub/GitLab PR with comprehensive description
- Use git-semantic-commits: Format PR title following Conventional Commits specification
- Apply Semantic Versioning Label: Auto-apply major/minor/patch label based on PR title
- Scan for Diagrams/Images: Search for workflow-related images and diagrams
- Attach Images to JIRA: Upload local/temporary images directly to JIRA (not just links)
- Add JIRA Comments: Use
git-issue-updater to create comments with PR details and attachments
- Update JIRA Status (Optional): Delegate to
jira-status-updater to transition ticket status after manual merge
When to use me
Use this workflow when:
- You've completed work on a feature or fix and need to create a PR
- You want to update JIRA tickets with PR information
- You have diagrams or images that need to be attached to JIRA (not just linked)
- You need to ensure JIRA tickets are updated with actual image files for visibility
- You want to maintain traceability between PRs and JIRA tickets
Prerequisites
- Git repository with commits to push
- GitHub CLI (
gh) or GitLab CLI (glab) installed and authenticated
- If using JIRA: Atlassian account with appropriate permissions
- JIRA cloud ID and project key
- Existing JIRA ticket(s) to update
Steps
Step 1: Check Git Status
- Verify current git status:
git status
- Ensure all changes are committed
- Check for uncommitted changes that need attention
Step 2: Ask About JIRA Integration
- Prompt the user: "Is JIRA used for this project? (yes/no)"
- If yes, proceed with JIRA integration steps
- If no, skip JIRA-related steps and only create the PR
Step 3: Get JIRA Ticket Information (if JIRA is used)
- Ask the user for the JIRA ticket ID (e.g., "IBIS-101")
- Verify the ticket exists using Atlassian MCP tools
- Get the cloud ID if not provided
Step 4: Create Pull Request
Step 5: Apply Semantic Versioning Label
After PR creation, automatically apply version label based on PR title:
PR_NUMBER=$(gh pr list --head "$(git branch --show-current)" --json number --jq '.[0].number')
PR_TITLE="<PR Title>"
if [[ "$PR_TITLE" =~ ^[^:]+\! ]]; then
VERSION_LABEL="major"
elif [[ "$PR_TITLE" =~ ^feat ]]; then
VERSION_LABEL="minor"
elif [[ "$PR_TITLE" =~ ^fix ]]; then
VERSION_LABEL="patch"
else
VERSION_LABEL="patch"
fi
gh pr edit "$PR_NUMBER" --add-label "$VERSION_LABEL"
echo "Applied '$VERSION_LABEL' label to PR #$PR_NUMBER"
Label mapping:
feat! or feat(scope)! → major (breaking changes)
feat → minor (new features)
fix, docs, refactor, style, test, chore → patch (bug fixes/improvements)
Step 6: Scan for Diagrams and Images
Step 7: Categorize Images
- For each image found, determine:
- Accessible images: Hosted on public URLs or cloud storage (can be linked)
- Local/temporary images: Files in
/tmp/, local directories, or private servers (must be attached)
Step 8: Upload Local Images to JIRA (if JIRA is used)
For each local/temporary image that needs to be shared on JIRA:
-
Upload the image to JIRA:
Use Atlassian MCP tool atlassian_addAttachmentToJiraIssue with:
- cloudId: The Atlassian cloud ID
- issueIdOrKey: The JIRA ticket key
- attachment: Path to the local image file
-
Get the attachment URL:
- The response will include the attachment URL hosted on JIRA
- This URL is accessible within the JIRA ecosystem
-
Store attachment URLs for use in comments
Step 9: Create JIRA Comments (if JIRA is used)
Create a comprehensive comment on the JIRA ticket with PR details using atlassian_addCommentToJiraIssue.
Comment Template:
## Pull Request Created
**PR**: #<PR_NUMBER> - <PR_TITLE>
**URL**: <PR_URL>
**Branch**: <branch-name>
### Changes Summary
<Brief description of what was implemented>
### Files Modified
<list of key files changed>
### Diagrams/Visuals
<embed uploaded images using JIRA attachment format>
### Testing Performed
<test coverage and results>
### Review Request
@reviewer1 @reviewer2
Step 10: Verify and Report
Step 11: Update JIRA Ticket Status (Optional)
Purpose: Provide option to update JIRA ticket status after manual PR merge
When to use:
- PR was manually merged (not through pr-creation-workflow)
- You want to transition JIRA ticket to "Done" status
- You have merged the PR outside of the automated workflow
Implementation:
For JIRA ticket status updates after PR merge, delegate to the jira-status-updater skill which handles:
- Ticket detection from PR title, commits, and branch name
- Smart target status detection
- Pre-flight checks to avoid unnecessary transitions
- Comprehensive error handling
Image Handling Strategy
Note: For the detailed JIRA image upload workflow (attachment API usage, URL retrieval, error handling), refer to the jira-git-integration skill. The section below provides a brief summary specific to PR creation.
For Accessible Images (Public URLs)
If the image is already hosted on a public URL (e.g., GitHub, S3, cloud storage):
For Local/Temporary Images
If the image is a local file that won't be accessible from JIRA:
- Must upload as attachment to JIRA
- Use the
atlassian_addAttachmentToJiraIssue tool
- Reference the uploaded image in the comment using the attachment URL
Example:
atlassian_addAttachmentToJiraIssue \
--cloudId <CLOUD_ID> \
--issueIdOrKey "IBIS-101" \
--attachment "/tmp/workflow-diagram.png"
Correct JIRA Comment with Attachment:
### Workflow Diagram

Incorrect JIRA Comment (local file path):
### Workflow Diagram

Examples
Example 1: PR with JIRA Integration and Local Image
User: "Create a PR for the login feature. Yes, JIRA is used. Ticket is IBIS-101."
Execution:
- Push branch
feature/login to remote
- Create PR #42 with title "Implement login feature"
- Scan for images:
- Found:
/tmp/login-flow.png (local, not accessible)
- Found:
diagrams/architecture.png (local, not accessible)
- Upload images to JIRA:
- Upload
/tmp/login-flow.png → Gets attachment URL
- Upload
diagrams/architecture.png → Gets attachment URL
- Create JIRA comment with embedded images
JIRA Comment Created:
## Pull Request Created
**PR**: #42 - Implement login feature
**URL**: https://github.com/org/repo/pull/42
**Branch**: feature/login
### Changes Summary
Implemented user authentication with email/password login, session management, and password reset functionality.
### Files Modified
- src/auth/login.ts
- src/auth/session.ts
- src/components/LoginForm.tsx
- src/api/auth.ts
### Workflow Diagram

### Architecture

### Testing Performed
- Unit tests: 100% coverage
- Integration tests: All passing
- Manual testing: Verified login flow end-to-end
### Review Request
@tech-lead @senior-dev
Example 2: PR with Public URL Image
User: "Create a PR for the dashboard. Yes, JIRA is used. Ticket is IBIS-102."
Execution:
- Push branch
feature/dashboard to remote
- Create PR #43
- Scan for images:
- Found:
https://cdn.example.com/dashboard-mockup.png (public URL)
- Found:
/tmp/notes.png (local, not accessible)
- Upload only local image to JIRA
- Create JIRA comment with both public URL and embedded attachment
JIRA Comment Created:
## Pull Request Created
**PR**: #43 - Implement dashboard
**URL**: https://github.com/org/repo/pull/43
### Changes Summary
Built responsive dashboard with data visualization and analytics.
### UI Mockup (Design Spec)

### Technical Implementation Notes

Example 3: PR without JIRA
User: "Create a PR for the bug fix. No, JIRA is not used."
Execution:
- Push branch
fix/crash-issue to remote
- Create PR #44
- Skip JIRA integration
- Display summary
Output:
✅ Pull request created successfully!
✅ Branch pushed to remote
**PR Details**:
- PR: #44
- URL: https://github.com/org/repo/pull/44
- Title: Fix crash on login page
No JIRA integration requested.
Image Detection and Categorization
Note: The categorization logic below is a summary. For comprehensive image handling including download-and-retry for inaccessible URLs, see jira-git-integration.
Detection Patterns
Search for images in these locations:
./diagrams/**/*.png
./diagrams/**/*.svg
/tmp/*.png
/tmp/*.jpg
./docs/images/**/*.png
./assets/images/**/*.png
**/*workflow*.png
**/*diagram*.png
**/*flow*.png
**/*architecture*.png
**/*sequence*.png
Categorization Logic
if [[ "$image_path" =~ ^https?:// ]]; then
if curl -s -o /dev/null -w "%{http_code}" "$image_path" | grep -q "200"; then
TYPE="accessible_url"
else
TYPE="inaccessible_url"
fi
else
if [[ -f "$image_path" ]]; then
TYPE="local_file"
else
TYPE="not_found"
fi
fi
Handling Each Type
- accessible_url: Embed directly in JIRA comment
- inaccessible_url: Download and upload as JIRA attachment
- local_file: Upload as JIRA attachment
- not_found: Warn user and skip
Atlassian MCP Tools Reference
atlassian_getAccessibleAtlassianResources
atlassian_getAccessibleAtlassianResources
Returns: List of accessible Atlassian resources with cloud IDs
atlassian_addAttachmentToJiraIssue
atlassian_addAttachmentToJiraIssue \
--cloudId <CLOUD_ID> \
--issueIdOrKey <TICKET_KEY> \
--attachment <file-path>
Returns: Attachment metadata including URL
atlassian_addCommentToJiraIssue
atlassian_addCommentToJiraIssue \
--cloudId <CLOUD_ID> \
--issueIdOrKey <TICKET_KEY> \
--commentBody <markdown-content>
Returns: Comment ID and details
atlassian_getJiraIssue
atlassian_getJiraIssue \
--cloudId <CLOUD_ID> \
--issueIdOrKey <TICKET_KEY>
Returns: Issue details including status, assignee, etc.
Best Practices
- Always confirm JIRA usage with the user before proceeding
- Use git-semantic-commits for PR title formatting to ensure consistent semantic versioning
- Follow Conventional Commits specification: feat, fix, docs, style, refactor, test, chore, perf, ci, build, revert
- Include scopes in PR titles to identify affected components (e.g., feat(api):, fix(ui):)
- Use breaking change indicator (!) when appropriate:
feat!: breaking API change
- Upload local/temporary images as JIRA attachments, don't link to local paths
- Use git-issue-updater for consistent JIRA ticket comments with user, date, time, and PR details
- Use descriptive filenames for images before uploading
- Organize images in a
diagrams/ directory for consistency
- Include PR number and brief description in JIRA comments
- Tag relevant team members in JIRA comments using
@username
- Verify image accessibility before embedding URLs
- Clean up temporary images after uploading to JIRA
- Keep JIRA comments concise and well-formatted
- Always verify that the PR was created successfully
- Test JIRA attachments by opening the URL in a browser
Common Issues
Image Upload Fails
Issue: atlassian_addAttachmentToJiraIssue returns an error
Solution:
- Verify file path is correct
- Check file size limits (JIRA typically limits to 10-100MB per attachment)
- Ensure you have permission to add attachments to the issue
- Verify the file is not corrupted
JIRA Comment Not Visible
Issue: Comment added but doesn't display images
Solution:
Too Many Images
Issue: Too many images found in the repository
Solution:
- Ask user which images are relevant
- Filter by timestamp (e.g., images created in last hour)
- Focus on workflow-related images
- Allow user to select specific images to upload
Branch Not Pushed
Issue: PR creation fails because branch isn't on remote
Solution:
git push -u origin $(git branch --show-current)
JIRA Ticket Not Found
Issue: Cannot access the specified JIRA ticket
Solution:
- Verify the ticket ID format (e.g., IBIS-101)
- Check that you have access to the JIRA project
- Use
atlassian_getVisibleJiraProjects to list accessible tickets
- Verify the cloud ID is correct
Troubleshooting Checklist
Before creating PR:
Before JIRA integration (if yes):
Before image handling:
After completion:
Related Commands
git status
git branch --show-current
git push -u origin $(git branch --show-current)
gh pr create --title "Title" --body "Description"
gh pr view
gh pr list
find . -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.svg" \) -mtime -1
find . -name "*workflow*.png" -o -name "*diagram*.png"
file workflow.png
identify workflow.png
Semantic Versioning Labels
Add version bump labels to indicate release impact:
| Label | Color | Description | Version Bump | Examples |
|---|
major | #d73a4a (red) | Breaking changes | X.0.0 | API removal, breaking refactor |
minor | #fbca04 (yellow) | New features | 0.X.0 | New API, new component |
patch | #0e8a16 (green) | Bug fixes | 0.0.X | Bug fix, typo correction |
Label Mapping from Commit Type:
feat! or feat(scope)! → major (breaking change)
feat → minor (new feature)
fix → patch (bug fix)
refactor → patch (code improvement)
docs → patch (documentation)
Usage with JIRA Integration:
gh pr create --title "feat: add user auth [IBIS-123]" --add-label "minor"
gh pr edit <PR_NUMBER> --add-label "minor"
gh pr edit <PR_NUMBER> --remove-label "patch" --add-label "minor"
Automated Labeling:
When creating PRs with semantic commit messages, automatically apply version labels:
- PR title starts with
feat: → suggest minor label
- PR title starts with
fix: → suggest patch label
- PR title contains
! → suggest major label
Converted and distributed by TomeVault — claim your Tome and manage your conversions.