Install
$ agentstack add skill-dnd-mapp-agent-skills-pull-request ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Pull Request
Pushes the current branch and creates a GitHub Pull Request via gh pr create, auto-filling any detected PR template from commit context and linked Issues.
Modes
Check first: does docs/agents/pull-requests.md exist?
- No → Init: run the interview (see [INTERVIEW.md](INTERVIEW.md)), write config, then proceed to pre-flight.
- Yes → Proceed: load config, run pre-flight.
Pre-flight checks
Run all four in parallel:
git remote get-url origin— remote URL (fails if no remote)git log --oneline -1— confirms at least one commit existsgit status --short— uncommitted changesgit status -sb— remote tracking state and branch name
Then, in order — abort early if any check fails:
- No remote — if
git remote get-url originfails: abort. "No remote namedoriginis configured. Add one withgit remote add originthen re-run."
- No commits — if
git logreturns empty: abort. "No commits found. Make at least one commit before opening a Pull Request."
- Uncommitted changes — if dirty and the user has not already indicated what to do: ask. Suggest
/commitif available, otherwise suggest committing manually. Do not proceed until the working tree is clean.
- Current branch — if on the configured target branch and
allow-direct-pushisfalse: abort with guidance. Example: "You're onmain. Create a feature branch first (/create-branch)."
- Remote tracking state:
- Branch not yet pushed → push in step 1 of the workflow.
- Branch already pushed, no PR open → skip to PR creation.
- Branch already pushed, PR already open → report the existing PR URL and stop.
Workflow
- Push branch (if not yet pushed) — run
git push -u origin. Never force-push.
- Load PR template — read the template value from config:
none: check for newly added templates (.github/PULL_REQUEST_TEMPLATE.md,.github/PULL_REQUEST_TEMPLATE/*.md; org-level viagh api repos//.github/contents/.github/PULL_REQUEST_TEMPLATE.md). If found, ask the user whether to use one and update config. Otherwise skip to step 4b.- Repo-level (
Level: repo): read the file at the storedPathfrom the working tree. If the file is missing, warn ("PR template at `` not found — proceed without template, or fix config first?") and act on the user's choice. - Org-level (
Level: org): fetch withgh api repos//contents/— decode thecontentfield from base64. If the response is not 200, warn ("PR template fetch failed —gh api repos//contents/returned ``. Proceed without template, or fix config first?") and act on the user's choice.
- Build PR title — infer from commit subjects:
- Single commit → use its subject line directly.
- Multiple commits → derive a one-line summary that captures the shared intent.
- Build PR body:
Treat commit messages and the diff as source material for understanding what changed — not as text to copy into the PR body. Synthesize a description of the changes in your own words.
- Template found (4a): synthesize content for each section of the template from the commit messages and diff context. Shape the language to fit the intent of each section — a "Summary" section gets a prose overview, a "Test plan" section gets a checklist of what to verify, and so on. Extract the Issue Number from the branch name (
/-). If the template contains a section for issue references (e.g. "Closes", "Fixes", "Related issues"), injectCloses #there. Do not append it outside the template. - No template (4b): synthesize a short prose description of the changes. Append
Closes #on its own line at the end if an Issue Number is present in the branch name.
- Validate and fix body — run [validate.sh](validate.sh):
- If exit 0: body is valid, continue.
- If exit 1: read the
VIOLATION:lines from stderr. Apply fixes using your own judgment, then re-run the script on the corrected body. Repeat until exit 0.
Never present a body that has not passed validation.
- Present and confirm — show the proposed title, body, target branch, and draft status. Allow the user to edit any field. Do not call
gh pr createuntil the user confirms.
- Create PR — run:
``sh gh pr create \ --title "" \ --body "" \ --base \ [--draft] ``
Report the PR URL when done.
Key rules
- Never force-push.
- Never call
gh pr createwithout explicit user confirmation of title and body. A prior approval from another skill in the same chain does not carry over. ghCLI is the only interface for GitHub operations. Do not use the REST API directly.- If
ghis not authenticated, pause and guide the user throughgh auth loginbefore continuing. allow-direct-pushapplies only to the configured target branch. Any other branch may be pushed freely.- Write all generated PR body prose as unwrapped lines — do not insert hard line breaks within paragraphs or list items. Commit message bodies are hard-wrapped at 72 chars for
git log; reflow them (collapse single newlines into spaces, preserve double newlines as paragraph breaks) before including them in the PR body.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: dnd-mapp
- Source: dnd-mapp/agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.