Guides developers through standardized pull request creation workflow: auto-detects JIRA issue key(s) from the branch name, commits any uncommitted changes with the issue key(s) in the message, generates a descriptive PR title and body from the diff, and creates the pull request to a chosen target branch. Supports one or multiple JIRA keys (e.g. MBL-1327, POS-1123) and two modes — streamlined (auto-creates PR, default) and review (shows draft before creating). USE FOR: create PR, open pull request, make PR, submit PR, raise PR, create pull request, standardize PR workflow, PR with JIRA, commit and PR, push and create PR, create PR detailed, create PR full, create PR with review. DO NOT USE FOR: general git operations, branch creation, hotfix procedures unrelated to PR creation.
90
88%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Invoke this skill when the user wants to:
[JIRA-XXXX] prefix convention.Supports two modes. See Invocation Modes below.
Do not invoke this skill for:
Detect the mode from the user's invocation message before running any steps.
| Keywords in message | Mode | Behaviour |
|---|---|---|
(none) / create PR / standard invocation | Streamlined (default) | Auto-creates PR immediately — no draft review stop. |
detailed / full / review / with review | Review | Shows generated title + body, waits for approval/edits, then creates. |
Store as {MODE} = streamlined or review.
Examples:
/viv-commit-and-pr -> streamlinedcreate PR detailed -> reviewmake a PR full -> reviewpush and create PR with review -> reviewExecute these steps in order. Do not skip steps or proceed past a step that requires user input without receiving it.
Performs all detection silently and presents a single prompt to the user — combining JIRA key detection and target branch selection.
Inspect the user's message for the keywords detailed, full, review, or with review.
{MODE} = review{MODE} = streamlinedRun:
git rev-parse --is-inside-work-treeRun:
git branch --show-currentStore the result as {BRANCH_NAME}.
Scan {BRANCH_NAME} for substrings matching the pattern [A-Z]+-\d+.
Common patterns to recognise:
feature/MBL-1327-description -> MBL-1327MBL-1327/some-feature -> MBL-1327bugfix/vivIT-99-fix-thing -> vivIT-99feature/vivIT-2345 -> vivIT-2345If one or more JIRA key(s) were found, present:
"I found
{EXTRACTED_KEY(S)}from branch{BRANCH_NAME}. Target:main(default). Replygoto proceed, or customize: — Different JIRA:POS-1123— Multiple JIRA:MBL-1327, POS-1123— Different target:MBL-1327 > developorMBL-1327 to develop— Both:MBL-1327, POS-1123 > develop"
If no JIRA key was found (or git branch --show-current returned empty):
"What JIRA issue(s) and target branch? Examples:
MBL-1327·MBL-1327, POS-1123·MBL-1327 > develop·MBL-1327, POS-1123 > develop(Target defaults tomainif not specified)"
go or any affirmative with no overrides -> keep the extracted JIRA key(s) and set {TARGET_BRANCH} = main.> or to separator — split on commas, trim whitespace, validate each against [A-Z]+-\d+.> or to, trimmed. Default to main if absent.Store the validated, comma-separated JIRA key string as {JIRA_ISSUES} (e.g. MBL-1327, POS-1123).
Store the target branch as {TARGET_BRANCH}.
If any JIRA key fails validation, explain the expected format (PROJ-1234) and ask the user to correct only the invalid entries.
Verify the target branch exists on the remote:
git ls-remote --heads origin {TARGET_BRANCH}If not found: "Branch {TARGET_BRANCH} was not found on the remote. Please confirm the target branch name." and re-ask for just the target.
Run:
git status --shortParse the git status --short output from Step 2 and present it to the user grouped by status, using plain labels. Use the two-character git status codes to assign each file to a group:
M, MM -> ModifiedA, AM -> Added (staged)D -> DeletedR -> Renamed?? -> New / untracked (not yet staged — will be included unless excluded)Present the list like this:
Here's what will be committed:
Modified
src/OrderService.cssrc/CustomerService.csNew / untracked
scratch.txtsrc/NewFeature.csReply
goto commit all, or exclude files with:exclude scratch.txtorexclude scratch.txt, temp/
If there are no untracked (??) files, skip the prompt entirely — proceed directly to Step 3b without waiting for a reply.
go or any affirmative -> {EXCLUDED_FILES} = (empty).{EXCLUDED_FILES}.If {EXCLUDED_FILES} is empty, run:
git add --allIf {EXCLUDED_FILES} is non-empty, stage everything individually except the excluded paths:
git add --all
git restore --staged {EXCLUDED_FILES}This keeps the excluded files in the working tree — they remain as untracked or unstaged local files and are not removed.
Run:
git diff --cachedRead the full staged diff — which now accurately reflects exactly what will be committed, including any new files — and compose a concise, imperative-mood summary. Keep it under 72 characters. Examples:
Add order validation logic and update DTO mappingsFix null reference in CustomerService and add unit testsRefactor PaymentProcessor to use strategy patternStore this as {COMMIT_SUMMARY}.
Run:
git commit -m "[{JIRA_ISSUES}] {COMMIT_SUMMARY}"Confirm to the user:
"Committed:
[{JIRA_ISSUES}] {COMMIT_SUMMARY}"
If the commit fails, show the error output and stop — do not push or create a PR until the commit succeeds.
Run:
git branch --show-currentStore the result as {CURRENT_BRANCH}.
If the result is empty (detached HEAD state), inform the user: "You are in a detached HEAD state. Please check out a named branch before creating a PR." and stop.
Run:
git push --set-upstream origin {CURRENT_BRANCH}If this fails because the upstream is already set, run:
git pushgh auth login or configure their git credentials, then retry.{CURRENT_BRANCH} pushed to origin."Run:
git log origin/{TARGET_BRANCH}..{CURRENT_BRANCH} --onelineIf there are no commits between the branches, inform the user:
"No commits found between {TARGET_BRANCH} and {CURRENT_BRANCH} — branches appear to be identical. Nothing to PR." and stop.
Run:
git diff origin/{TARGET_BRANCH}...{CURRENT_BRANCH} --statThe entire title — including the [{JIRA_ISSUES}] prefix — MUST be ≤ 72 characters total.
Format: [{JIRA_ISSUES}] <imperative-mood summary>
When multiple JIRA keys make the prefix longer, shorten the summary accordingly.
Character budget: 72 − length of [{JIRA_ISSUES}] = remaining characters for the summary.
Example (single key): [FNLIT-1234] Add customer address validation and update checkout flow
Example (multi-key): [MBL-1327, POS-1123] Add address validation and fix mobile checkout
Use the following fixed Markdown template, filling in each section from the commit log and diff stat:
## Summary
<2–4 sentences describing what this PR does, the problem it solves, and any important design decisions. Derived from the commit log and diff.>
## Changes
- <Bullet per logical change group, derived from the commit log and diff stat>
## JIRA
<One bullet per key in {JIRA_ISSUES}. If a JIRA base URL is configured in the agent environment table, render as a Markdown link; otherwise render the key as plain text.>
**If JIRA base URL is configured** (e.g. `https://vivek.atlassian.net/browse/`):
- [MBL-1327](https://vivek.atlassian.net/browse/MBL-1327)
- [POS-1123](https://vivek.atlassian.net/browse/POS-1123)
**If JIRA base URL is not configured:**
- MBL-1327
- POS-1123{MODE}Streamlined mode ({MODE} = streamlined):
Skip this gate. Proceed directly to Step 7.
Review mode ({MODE} = review):
Present the generated title and body and ask:
"Does this PR description look good? Reply yes to create it, or tell me what to change."
Use the GitHub pull request tool to create a PR with:
{CURRENT_BRANCH}{TARGET_BRANCH}On success, report the PR URL to the user:
"Pull request created: <PR_URL>"
If the PR creation tool fails, show the error and suggest opening the PR manually via the GitHub web UI.
| Situation | Response |
|---|---|
| Not a git repository | Inform user and stop (Step 1b). |
| Invalid JIRA key format | Explain PROJ-1234 format and re-ask for only the invalid keys (Step 1e). |
| Target branch not found on remote | Ask user to confirm the branch name (Step 1e). |
| Commit fails | Show error, do not continue to push/PR. |
| Excluded files left unstaged | Files remain as untracked/modified local files — not lost. |
| Detached HEAD | Ask user to check out a named branch before proceeding. |
| Push — auth failure | Guide user to authenticate (gh auth login). |
| Push — protected branch | Suggest creating a feature branch. |
| No commits between branches | Inform user branches are identical — nothing to PR. |
| PR creation tool fails | Show the error; suggest opening the PR manually via the GitHub web UI. |
[JIRA-XXXX] Imperative mood summary under 72 chars[MBL-1327, POS-1123] Imperative mood summary under 72 charsJIRA base URL row); if not configured, list JIRA keys as plain text — do not fabricate a URLmain> or the word to (e.g. MBL-1327 > develop or MBL-1327 to develop)streamlined — PR auto-created with no draft review stopdetailed, full, review, or with review in the invocation message2e44fab
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.