Opens a GitHub Pull Request with the standard PR template: Description, Staging Links, and JIRA ticket. Infers the ticket from the branch name and generates staging preview URLs from changed files after the PR is created. TRIGGER when: user asks to open, create, submit, make, update, or edit a PR or pull request, or wants to refresh staging links on an existing PR.
72
88%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Follow these steps in order to create a well-formed PR.
Check $ARGUMENTS for a --base <branch> flag:
--base <branch> is present, use that branch as the PR base and treat the remainder of $ARGUMENTS as extra description context.--base is not present, default the base branch to main.Run these in parallel:
git branch --show-current — get the current branch namegit log --oneline $(git merge-base HEAD origin/HEAD)..HEAD — list commits on this branchgit diff --name-only $(git merge-base HEAD origin/HEAD)..HEAD — list all changed filesFrom the changed files list, check whether any files exist under content/. Set a flag HAS_DOC_FILES to true if at least one such file exists, false otherwise.
Parse the ticket ID from the branch name. Branch names follow the pattern DOCSP-NNNNN-<description>. Extract the DOCSP-NNNNN portion.
DOCSP-NNNNNhttps://jira.mongodb.org/browse/DOCSP-NNNNNIf the branch name does not contain a DOCSP ticket ID, ask the user for the ticket number before continuing.
Use the format: DOCSP-NNNNN <short description of the change> — same pattern as the branch name but human-readable. Example: DOCSP-55497 disambiguate mergeObjects.
Based on the commit messages, changed files, and any extra context provided in $ARGUMENTS, write a clear prose summary of what the PR does. Focus on what changed and why, not just listing files. Follow the tone and style of the example summary in the reference PR: concise bullet points under a short introductory sentence work well for multi-page changes.
Present the following options and ask the user which template to use. Wait for their reply before continuing to Step 5.
.github/PULL_REQUEST_TEMPLATE/content.md.github/PULL_REQUEST_TEMPLATE/drivers.md.github/PULL_REQUEST_TEMPLATE/code.md.github/PULL_REQUEST_TEMPLATE/platform.md.github/PULL_REQUEST_TEMPLATE/cloud.md.github/PULL_REQUEST_TEMPLATE/agent-skill.mdIf the user chooses a template, read the file at the listed path and store its content. If the user chooses no template, proceed to Step 5 with no template content.
First, check whether a PR already exists for the current branch by its exact local branch name:
gh pr list --head <current-branch> --json number,url 2>/dev/nullIf a PR already exists: the list will contain one entry — capture the PR number and URL from it. Inform the user that an existing PR was found and that you will update its description. Skip to Step 6.
If no PR exists: create the PR as a draft with a temporary body:
gh pr create \
--draft \
--title "<title from Step 3>" \
--body "Draft — updating body now..." \
--base <base branch from Step 0>Capture the PR number from the output URL (the integer at the end of the URL).
If HAS_DOC_FILES is false, skip this step and set the staging links content to N/A. Continue to Step 7.
If HAS_DOC_FILES is true, invoke the staging-preview skill, passing PR_NUMBER as the input. The skill will poll for the builder-bot deploy preview comment and construct page-specific staging URLs for all changed files. Use the output as the staging links content for Step 7.
If no template was chosen, use this structure:
## Description
<prose summary from Step 4>
## Staging links
<staging links from Step 6, or "N/A" if none>
## JIRA ticket
[DOCSP-NNNNN](https://jira.mongodb.org/browse/DOCSP-NNNNN)If a template was chosen, use the template content (already read in Step 4b) as the base. Fill in the sections that correspond to description, staging links, and JIRA ticket based on the template's own structure and comment placeholders. Leave checklists and all other sections untouched for the user to complete.
Use the GitHub REST API to update the body (avoid gh pr edit, which fails in this repo due to a Projects classic GraphQL deprecation error):
body=$(cat <<'EOF'
<final body from Step 7>
EOF
)
gh api repos/10gen/docs-mongodb-internal/pulls/<PR_NUMBER> \
--method PATCH \
--field body="$body" \
--jq '.number'Ask the user whether they want the PR marked as ready for review or kept as a draft. If they choose ready for review, run:
gh pr ready <PR_NUMBER>Output:
5985af5
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.