Automated PR creation following the project's pull request template, with interactive prompts for checklist items, related links, and Jira validation. TRIGGER when: user asks to create/open a pull request after committing changes; user requests a PR targeting a specific branch (e.g. develop, main); user types phrases like "create pull request", "create the pull request", "create PR", "open PR", "answer yourself the questions", or the equivalent in Portuguese ("criar PR", "abrir pull request", "responda você mesmo as perguntas"). AUTONOMOUS MODE: when user says "answer yourself the questions" or "responda você mesmo as perguntas", invoke this skill and derive all answers from git context (diff, commit messages, branch name) without calling AskUserQuestion. SKIP when: user only wants to commit, push, or review an existing PR without opening a new one.
How this skill is triggered — by the user, by Claude, or both
Slash command
/creating-pull-request:creating-pull-requestThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
When user says "answer yourself the questions", "responda você mesmo as perguntas", or any equivalent instruction to avoid interactive prompts:
When user says "answer yourself the questions", "responda você mesmo as perguntas", or any equivalent instruction to avoid interactive prompts:
AskUserQuestion at any stepfix → Bug fix, feat → New feature, refactor → Refactor, etc.){{company_name}} per the "Inferring company_name" section belowcompany_nameThe Jira URL has the form https://{{company_name}}.atlassian.net/browse/{TICKET}. The company_name is the Atlassian workspace subdomain (e.g. acme for acme.atlassian.net). Resolve it in this order — stop at the first match:
~/.claude/.creating-pr-config (a simple KEY=VALUE file). If JIRA_COMPANY=... is set, use it.grep -rEo '[a-z0-9-]+\.atlassian\.net' \
--include='*.md' --include='*.yml' --include='*.yaml' \
--include='*.json' --include='*.properties' . | head -5
If a single distinct subdomain appears, use it.gh pr list --state all --limit 20 --json body | grep -Eo '[a-z0-9-]+\.atlassian\.net'. If a single subdomain dominates, use it.acme for acme.atlassian.net)". After receiving an answer, persist it:
mkdir -p ~/.claude && echo "JIRA_COMPANY={value}" >> ~/.claude/.creating-pr-config
{{company_name}} literally in the PR body and warn the user in the post-creation summary so they can edit it.This skill uses two base branches:
gh repo view --json defaultBranchRef -q .defaultBranchRef.name, falling back to checking git rev-parse --verify main then master.develop branch — check with git rev-parse --verify develop — in which case target develop).Never hardcode master or develop.
First, detect the diff base (see "Detecting base branches" above). Store it as $BASE.
git branch --show-currentgit diff $BASE...HEAD --statgit log $BASE..HEAD --onelinegit status -sbUse the AskUserQuestion tool to collect information. Ask questions one at a time for better UX.
Question 1: PR Type
Question: "What is the type of change for this PR?"
Options:
- Bug fix - A fix that resolves an issue without breaking existing functionality
- New feature - Functionality that adds a capability to the system
- Breaking change - A change that breaks backward compatibility
- Refactor - Code improvement without changing behavior
- Configuration - Changes to config, properties, Docker, etc.
- Performance - Performance improvement
- Documentation - Documentation-only changes
MultiSelect: false
Question 2: Jira Link Validation
Question: "Is the Jira link correct? https://{{company_name}}.atlassian.net/browse/{BRANCH-NAME}"
Options:
- Yes, it's correct
- No, I'll provide the correct link
MultiSelect: false
If "No", ask follow-up question:
Question: "What is the correct Jira link?"
(Use free text from "Other" option)
Question 3: Additional Links
Question: "Would you like to add related links? (Select all that apply)"
Options:
- Database ticket
- Security ticket
- Technical documentation
- Design/mockup link
- None
MultiSelect: true
For each selected option (except "None"), ask:
Question: "Paste the link for: {link_type}"
(Use free text from "Other" option)
Question 4: Development Checklist
Question: "Check the development checklist items that apply:"
Options:
- Tests run locally (unit, E2E, integration)
- Code reviewed line by line
- Logs are consistent (correct level)
- Sensitive data checked (no exposure)
- External variables created (secrets, feature flags)
- Required tickets executed (database, SQS, security)
MultiSelect: true
Question 5: Impact Sections
Question: "Are there special impacts to document?"
Options:
- Performance - There is a performance impact
- Compatibility - There are breaking changes
- Rollback - Non-standard rollback procedure
- No special impact
MultiSelect: true
For each selected impact, ask for details:
Question: "Describe the {impact_type} impact:"
(Use free text from "Other" option)
Question 6: Reviewer Notes
Question: "Would you like to add attention points for the reviewer?"
Options:
- Yes, I'll add specific points
- No, the PR is self-explanatory
MultiSelect: false
If "Yes", ask:
Question: "Describe the attention points for the reviewer:"
(Use free text from "Other" option)
Based on branch name and changes, generate classification in format:
{type}({scope}): {subject}
Examples:
feat(PROJ-729): add support for store name in payment processingfix(PROJ-814): enhance error handling and observability in webhook processingrefactor(PROJ-901): simplify payment validation logicperf(PROJ-732): optimize database queries in order processingtype options:
feat - New functionalityfix - Bug fixdocs - Documentation onlystyle - Formatting, lintrefactor - Refactor without behavior changeperf - Performance improvementtest - Adding/fixing testschore - Maintenance, build, CI/CD tasksRead assets/pull_request_template.md for the canonical template structure, section format, and a complete filled-out example. The PR body MUST follow this template exactly.
Build the PR body following that template exactly. Fill each section with data collected from Steps 1-4:
{type}({scope}): {subject} from Step 4Append at the end:
## Modified Files
{output of git diff --stat}
### Technical Details
{analyze changed files and provide bullet list of key changes with line numbers}
$PR_BASE.git status -sb shows tracking infogit push -u origin {branch-name}gh pr create --base $PR_BASE --title "{title}" --body "{body}"Provide clear summary:
✅ PR #{number} created successfully!
**URL:** {pr_url}
**Summary:**
- Type: {type}
- Files modified: {count}
- Checklist completed: {marked_items}/{total_items}
**Next steps:**
1. Review the PR on GitHub
2. Request appropriate reviewers
3. Wait for CI/CD to pass
4. Merge after approval
AskUserQuestion toolBranch not pushed:
⚠️ Branch {branch-name} is not on remote.
Push now? (git push -u origin {branch-name})
No changes committed:
❌ No commits to create a PR.
Please commit your changes first.
gh CLI not authenticated:
❌ GitHub CLI is not authenticated.
Run: gh auth login
PR already exists:
ℹ️ A PR already exists for this branch: {existing_pr_url}
Would you like to update its description?
User: /creating-pull-request or "Create a PR for this branch"
Skill Flow:
fix(PROJ-814): enhance error handlingCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub matheuscoimbra/skills --plugin creating-pull-request