name: create-pull-request description: Create pull request. Use when the user asks to create a pull request after some refactor. disable-model-invocation: true
Create Pull Request
Create a pull request for the current changes.
Authentication Blockers
The agent cannot perform operations requiring user credentials:
- GPG-signed commits: Requires user's passphrase
- Git push: May require GitHub authentication
- GitHub PR creation (upstream): MCP token may lack permissions
For these operations, provide ready-to-use commands for the user to copy-paste.
Steps
- Check git status to see staged and unstaged changes
- Run
make validate-allto ensure code quality checks pass. Fix any issues before proceeding. - Stage all relevant files with
git add -A - Write a commit message following the format below.
- Provide commit command to user (do not attempt to execute)
- Wait for user to confirm commit is done
- Provide push command to user
- Wait for user to confirm push is done
- Provide PR creation command to user
- Ask user to share the PR URL when created
- Update Jira issue with PR URL and transition to Code Review (see Jira Integration below)
Commit Message Format
Title: <ticket-id> | <type>: <description>
<ticket-id>: matches patternECOPROJECT-\d+<type>: one of:build,chore,ci,docs,feat,fix,perf,refactor,style,test- If no JIRA ticket:
NO-JIRA | <type>: <description>
Body: bullet-list summarizing the changes (use - prefix)
Important: Do NOT use conventional commit format like
fix(scope):. Always useTICKET-ID | type:format.
Commit command template
git add -A && git commit -s -m '<ticket-id> | <type>: <description>
- Change 1
- Change 2
- Change 3'
Note: The
-sflag adds a Signed-off-by line (required).
Push command template
git push -u origin <branch-name>
PR creation command template
Use heredoc syntax to avoid shell escaping issues:
gh pr create --repo kubev2v/migration-planner-ui-app \
--title "<ticket-id> | <type>: <description>" \
--body "$(cat <<'EOF'
## Summary
- Change 1
- Change 2
Fixes [<TICKET-ID>](https://issues.redhat.com/browse/<TICKET-ID>)
## Test Plan
- [ ] Test step 1
- [ ] Test step 2
EOF
)"
Jira Integration
After the PR is created, update the Jira issue:
1. Update the Jira issue with the PR URL
The "Git Pull Request" custom field ID is: customfield_12310220
Use jira_update_issue tool:
{
"issue_key": "<TICKET-ID>",
"fields": {
"customfield_12310220": "<PR-URL>"
}
}
2. Fallback: Add as Web Link
If the custom field update fails (field removed or changed), add the PR as a remote issue link:
{
"issue_key": "<TICKET-ID>",
"url": "<PR-URL>",
"title": "Pull Request #<PR-NUMBER>",
"summary": "<PR-TITLE>",
"relationship": "pull request",
"icon_url": "https://github.githubassets.com/favicons/favicon.svg"
}
3. Transition the issue to "Code Review"
The "Code Review" transition ID is: 61
Use jira_transition_issue tool:
{
"issue_key": "<TICKET-ID>",
"transition_id": "61",
"comment": "PR created: <PR-URL>"
}
4. Fallback: Find transition ID dynamically
If the transition fails (ID changed or not available for current status), use jira_get_transitions to find the correct ID:
{
"issue_key": "<TICKET-ID>"
}
Then look for the transition named "Code Review" in the response and use that ID.
Example Jira Update Flow
1. jira_update_issue(
issue_key="ECOPROJECT-1234",
fields={"customfield_12310220": "https://github.com/kubev2v/migration-planner-ui-app/pull/371"}
)
If this fails, fallback to:
jira_create_remote_issue_link(
issue_key="ECOPROJECT-1234",
url="https://github.com/kubev2v/migration-planner-ui-app/pull/371",
title="Pull Request #371",
summary="ECOPROJECT-1234 | fix: Default report view to first cluster",
relationship="pull request",
icon_url="https://github.githubassets.com/favicons/favicon.svg"
)
2. jira_transition_issue(
issue_key="ECOPROJECT-1234",
transition_id="61",
comment="PR created: https://github.com/kubev2v/migration-planner-ui-app/pull/371"
)
If this fails, fallback to:
jira_get_transitions(issue_key="ECOPROJECT-1234")
→ Find "Code Review" in response, then retry with correct ID