create-pr
Push the current branch and create a GitHub pull request. When the branch name contains a JIRA ID and the ticket can be loaded, the PR title and description follow the ticket. When there is no JIRA ID or the ticket cannot be fetched, still push the branch, propose several PR title options for the developer to choose from (or a custom title), then create the PR.
Usage:
/create-pr- Push and create a draft PR/create-pr --no-draft- Push and create a ready-for-review PR
Instructions:
-
Check prerequisites (GitHub — always):
- GitHub CLI (
gh): Rungh --version. If not found, display the following message and STOP:## Missing Prerequisite: GitHub CLI The `gh` command is not installed. This skill requires the GitHub CLI for repository operations. Install it from: https://cli.github.com/ - GitHub CLI authentication: Run
gh auth status. If not authenticated, display the following message and STOP:## Missing Prerequisite: GitHub CLI Authentication The GitHub CLI is not authenticated. Please run `gh auth login` to authenticate before using this skill.
- GitHub CLI (
-
Parse options:
- If
$1is--no-draft, the PR will be created as ready for review - Otherwise (default, no arguments), the PR will be created as a draft
- If
-
Get the current branch and extract the JIRA ID:
- Run
git branch --show-currentto get the current branch name - Extract the JIRA ID by matching the pattern
[A-Z][A-Z0-9]+-[0-9]+(e.g.,PROJ-123,AB-1,MYAPP-4567) - The JIRA ID can appear anywhere in the branch name (e.g.,
fix/proj-123,feat/PROJ-123,PROJ-123-some-description) - The match should be case-insensitive — normalize the extracted ID to uppercase for the JIRA API lookup
- If no JIRA ID is found, continue without stopping — you will use the no-JIRA-ticket path after pushing (see step 7)
- Run
-
Fetch JIRA ticket details (only if a JIRA ID was found in step 3):
- Atlassian CLI (
acli): Runacli auth statusto check if the CLI is installed and authenticated.- If the command is not found, display the following message and STOP:
## Missing Prerequisite: Atlassian CLI The `acli` command is not installed. A JIRA ID was found in the branch name; install the CLI to load the ticket, or rename the branch to remove the JIRA ID if you want a PR without JIRA. Install it with: brew tap atlassian/acli && brew install acli - If the command fails with an authentication error, display the following message and STOP:
## Missing Prerequisite: Atlassian CLI Authentication The Atlassian CLI is not authenticated. Please run `acli auth login` to authenticate, or fix the branch/ticket access before continuing.
- If the command is not found, display the following message and STOP:
- Use the Atlassian CLI to retrieve the issue by its JIRA ID:
acli jira workitem view <JIRA-ID> --fields summary,description,issuetype --json - If the command succeeds, extract summary, description, issue type (Bug, Story, Task, etc.) — you have JIRA context for step 7
- If the command fails (ticket missing, permission, network, etc.), inform the developer briefly and continue on the no-JIRA-ticket path in step 7 (do not stop). You may still know the raw
JIRA-IDstring for an optional link in the description if you can form a correct browse URL; otherwise omit it
- Atlassian CLI (
-
Determine the base branch:
- Check if a
.agentfile exists in the current directory - If it exists, read it and look for a
baseBranch=<value>line to extract the base branch - Use
AskUserQuestionto let the developer choose the base branch:- If a base branch was found in
.agent: first option is that branch with "(from .agent)" suffix, second option ismain(if different) - If no
.agentfile or nobaseBranchkey: first option ismain - The developer can type a different branch name via the "Other" option if the PR targets a different base branch
- If a base branch was found in
- Check if a
-
Push the branch:
The push strategy depends on whether the PR is a draft or ready for review:
If creating a draft PR (no
--no-draftoption):- Run
git push -u origin <branch-name> --no-verify - Since this is a draft PR, pre-push checks can be skipped — they will run in CI and the developer will address any issues before marking the PR as ready
- If the push fails, show the error and STOP
If creating a ready-for-review PR (
--no-draftwas passed):-
Run
git push -u origin <branch-name> -
If the branch is already up to date on the remote, that's fine — continue to the next step
-
If the push fails due to a pre-push hook (look for signs like
husky,pre-push, hook script output, or interactive prompts in the error output):a) Offer to bypass with
--no-verify:- Use
AskUserQuestionto ask the developer:The push was blocked by a pre-push hook. Would you like to bypass it with
--no-verify? - Options: Yes — push with --no-verify and No — resolve the pre-push hook
b) If the developer chooses
--no-verify:- Run
git push -u origin <branch-name> --no-verify - IMPORTANT: Force the PR to be created as a draft regardless of
--no-draft. Since pre-push checks were skipped, the PR should not be marked as ready for review. - If this push also fails, show the error and STOP
c) If the developer chooses to resolve the hook:
- Show the full pre-push hook output to the developer so they can see what is being asked or what failed
- If the hook output contains a prompt or question (e.g., "Do you want to continue? [y/n]"), present the options to the developer using
AskUserQuestionand use their answer to interact with the hook - Re-run
git push -u origin <branch-name>after resolving - If the push still fails, show the error and STOP
- Use
-
If the push fails for any other reason (not a pre-push hook), show the error and STOP
- Run
-
Create the pull request:
If you have JIRA context from step 4 (successful fetch):
- Build the PR title using the commit prefix convention based on issue type, followed by a concise summary derived from the JIRA ticket summary:
- Bug →
fix: <summary>(e.g.,fix: resolve null pointer in user lookup) - All other types →
feat: <summary>(e.g.,feat: add bulk export for reports) - The summary part should be lowercase, imperative mood, and concise
- Bug →
- Build the PR description from the JIRA ticket details:
- Start with a
## Summarysection with a brief description based on the JIRA ticket description - Add a
## JIRAsection with a link to the ticket:[PROJ-123](https://<site>.atlassian.net/browse/PROJ-123)
- Start with a
- Run
gh pr createwith that title and body (see below for shared flags)
If you do not have JIRA context (no JIRA ID in branch, or fetch failed in step 4):
- Gather hints: branch name (without remote prefixes), and the latest commit subject (e.g.
git log -1 --pretty=%s); optionally the first line of the commit body - Use
AskUserQuestionso the developer chooses a PR title beforegh pr create. Present at least three distinct options, for example:- A conventional title derived from the branch slug (imperative, lowercase phrase after
feat:,fix:, orchore:— pickfix:if the branch suggests a bugfix, else preferfeat:unless the change is clearly chore/docs-only, thenchore:) - A title based on the latest commit subject (adjust to conventional form if needed)
- A shorter or alternative wording
- Plus an option for the developer to enter a custom title (free text), if your tool supports it
- A conventional title derived from the branch slug (imperative, lowercase phrase after
- After the developer selects a title, build the PR description:
## Summary— brief explanation from the branch name and recent commit message(s); if a JIRA ID was known but the ticket could not be loaded, you may add a sentence noting the intended ticket key- Omit the
## JIRAsection unless you have a reliable browse URL for a known key
- Run
gh pr createwith the chosen title and that body
Shared
gh pr createbehavior:- Use
--draftflag unless--no-draftwas passed. Exception: if the push in step 6 used--no-verify, always use--draftregardless of the--no-draftoption, and inform the developer:⚠️ PR created as draft because pre-push checks were skipped (--no-verify). Mark it as ready for review after ensuring all checks pass. - Use
--base <base-branch>with the branch determined in step 5 - Use a HEREDOC to pass the body
- If PR creation fails, show the error and STOP
- Build the PR title using the commit prefix convention based on issue type, followed by a concise summary derived from the JIRA ticket summary:
-
Show success message:
Display a summary with all relevant information. When JIRA context was used, include the ticket key and link. When it was not, state that no JIRA ticket was attached (or list the key only if you referenced it in the description without a full ticket load):
## PR Created - JIRA: PROJ-123 (or "none" / key only if applicable) - Branch: my-branch → main - PR: https://github.com/org/repo/pull/42 (draft) - Title: <chosen title>
More from morphet81/cheat-sheets
localise
Generate an HTML translation helper page for Lokalise. Use when the user provides English text (singular/plural) and wants translations across all 23 supported languages, rendered as an interactive HTML page with copy buttons. Triggers on phrases like "translate for Lokalise", "generate translations", "translation table", or when the user provides English strings and mentions languages/i18n/localization.
67translate-pdf
Translate a PDF document from one language to another. Extracts text to structured Markdown, translates it, and builds a new translated PDF. Requires a Python environment with pymupdf, markdown, and weasyprint.
67create-jira-ticket
Create a JIRA ticket from user instructions via acli. Uses project from the current branch when possible, lists project epics, recommends the best epic, asks confirmation before creating, uses ADF descriptions, and can attach Figma designs via the Jira integration.
67adb
Use ADB to interact with an Android device or emulator. Takes a screenshot, understands the screen, performs actions (tap, swipe, type, navigate), and loops until the mission is complete.
66pre-push
Run pre-push checks including tests and linting to ensure code is clean and ready to push. Automatically detects project type and available scripts. Runs independent checks in parallel using agents.
66update-jira-ticket
Compare the JIRA ticket description to changes made in the current branch and propose description edits and/or comments to keep the ticket accurate and well-documented.
66