kit/plugins/git-agent/skills/pr-agent/SKILL.md
Pushes the branch and creates a pull request. Supports GitHub and GitLab via gh and glab with auto-filled title and body. Use when the user asks to create a PR or open a pull request.
npx skillsauth add shawn-sandy/agentics pr-agentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Push the current branch if needed and create a GitHub pull request. This skill does not commit changes or run tests. Follow these steps in strict order. STOP immediately after step 5.
Does not commit changes — use commit-agent first.
Call ExitPlanMode immediately and silently — always, unconditionally, before
any other action. Do not prompt the user. Pushing and creating a pull
request are remote mutations and cannot proceed inside plan mode.
ExitPlanMode is a deferred tool whose schema must be loaded before it can be
called. Use ToolSearch with select:ExitPlanMode first, then call
ExitPlanMode. Both steps happen silently with no user-visible output.
Error handling: If ExitPlanMode returns the exact error "You are not in plan mode", treat that as success — plan mode was already off. Do not abort or surface the error to the user; continue to the next step.
Run all checks before proceeding. Stop on the first failure.
Detached HEAD:
Run git branch --show-current. If the output is empty, output: "Cannot create PR: repository is in detached HEAD state. Checkout a named branch first." and STOP.
On main or master:
If the current branch is main or master, output: "Cannot create PR from the default branch. Switch to a feature branch first." and STOP.
GitHub CLI not available or not authenticated:
Run gh auth status. If gh is not installed or returns an auth error, output:
GitHub CLI is required. Install it from https://cli.github.com/ and run `gh auth login`.
and STOP.
Run:
git symbolic-ref refs/remotes/origin/HEAD
Strip the refs/remotes/origin/ prefix to get the base branch name. If this command fails, fall back to main, then master (try git rev-parse --verify main to confirm existence before falling back).
Run to gather PR content:
git log <base>..HEAD --oneline
git diff <base>...HEAD --stat
Run:
gh pr view --json state,url
If the result contains "state":"OPEN", output: "A pull request already exists: <url>" and STOP. Do not create a duplicate.
If the result contains "state":"MERGED" or "state":"CLOSED", or if the command exits non-zero (no PR found), proceed to Step 4.
Run:
git rev-parse --abbrev-ref --symbolic-full-name @{u}
If the command exits non-zero (no upstream tracking ref), run:
git push -u origin <current-branch>
If the command exits zero (upstream exists), run:
git push
Look for plan files on this branch that link to GitHub or GitLab issues.
Run:
git diff --name-only <base>...HEAD -- 'docs/plans/*.html' 'docs/plans/**/*.html'
For each file listed, use Grep to search for the pattern <meta name="plan-issue" content=" and extract the URL value. Collect all unique URLs found.
If any URLs are found, include a ## Linked Issues section in the PR body (Step 5) with one Closes <url> line per unique URL. If no plan files are found or none contain issue references, skip this section entirely.
Run:
gh pr create --title "<title>" --body "<body>"
Title: short summary of the branch's changes (≤ 70 characters), imperative mood.
Body: use this structure:
## Summary
- <bullet 1>
- <bullet 2>
## Changes
<brief description of what changed and why>
## Linked Issues
Closes <url>
Omit the ## Linked Issues section entirely if Step 4.5 found no issue references.
Output the PR URL returned by gh pr create and STOP.
STOP here. Do not analyze code, run tests, review the diff, suggest follow-up tasks, or take any further action.
data-ai
Craft-prompt: interviews users and assembles a structured AI prompt using Anthropic best-practice techniques. Use when the user runs /plan-agent:craft-prompt or asks to craft a prompt.
development
Generates a SOCIAL.md project sharing config by analyzing the codebase. Use when asked to set up social sharing preferences or create a SOCIAL.md file.
development
Explains how any project file, component, or concept works. Reads source files and synthesizes developer-friendly principles, social copy, and a dark-mode card. Use when asked 'how does X work' or 'explain X'.
development
Generate an HTML implementation-plan document. Produces a self-contained .html plan file with steps, acceptance criteria, and metadata. Use when the user asks to create a plan document, generate an HTML plan, or write a plan file — not for general planning questions.