From open-pr
Open a pull request end-to-end: audits staged files for sensitive/confidential data, formats code, commits uncommitted changes with a conventional commit message, generates a structured PR description, and creates the PR on GitHub. Use when the user asks to open, create, submit, or push a pull request.
How this skill is triggered — by the user, by Claude, or both
Slash command
/open-pr:open-prThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are running the `open-pr` skill. Your job is to guide the user through a safe, complete pull request opening flow.
You are running the open-pr skill. Your job is to guide the user through a safe, complete pull request opening flow.
Current branch: !git branch --show-current
Staged files: !git diff --cached --name-only 2>/dev/null || echo "(none)"
Unstaged changes: !git diff --name-only 2>/dev/null || echo "(none)"
Follow the steps below in order. Pause and ask the user only when a step requires explicit confirmation (security risks, destructive actions). For routine steps, proceed automatically and report what you did.
Check if the current branch is main or master.
git checkout -b <branch-name>. Do not proceed until they switch.Read ${CLAUDE_SKILL_DIR}/security-patterns.md to load the patterns.
2a. Filename audit
Check all staged and unstaged files against the sensitive filename patterns. For each match, verify whether the file is covered by .gitignore.
.gitignore: flag it as Medium risk. Show the filename and ask the user if they want to add it to .gitignore before continuing.2b. Content audit
For each text file in the staged changes, scan its content against the sensitive content patterns. Apply the false positive heuristics to avoid noise.
If no findings: state "No sensitive data detected." and continue.
Detect the project stack by checking for config files in the repo root:
| Config file | Stack | Formatter command |
|---|---|---|
go.mod | Go | go fmt ./... |
Cargo.toml | Rust | cargo fmt |
pyproject.toml / setup.py | Python | uv run ruff format . (prefer ruff; fall back to uv run black .) |
package.json with prettier | JS/TS | npx prettier --write . |
package.json with biome | JS/TS | npx biome format --write . |
.swift-format or Package.swift | Swift | swift-format -r -i . |
Run the appropriate formatter. If the formatter is not installed or fails, skip and mention it to the user.
After formatting, stage any new changes produced by the formatter: git add -u.
Check for uncommitted changes: git status --short.
If there are staged or unstaged changes:
git diff HEAD to understand all pending changes.feat, fix, refactor, docs, chore, test, style, perfgit add -Agit commit -m "<generated message>"If there is nothing to commit: note it and continue.
Determine the base branch:
git remote show origin 2>/dev/null | grep "HEAD branch" | awk '{print $NF}'
Fall back to main if the command fails.
Run git diff <base>...HEAD and git log <base>...HEAD --oneline to understand all changes between the current branch and the base.
Summarize internally (do not print the full diff to the user):
Extract a ticket identifier from the branch name using these patterns:
| Pattern | Tracker |
|---|---|
[A-Z]+-\d+ (e.g., SUP-123, PROJ-42) | Linear or Jira |
#\d+ or gh-\d+ | GitHub Issues |
| No match | None detected |
If an identifier is found:
mcp__claude_ai_Linear__get_issue if the Linear MCP is connected. If not connected, note it and skip.gh issue view <number> to fetch title and description.If a card is found, extract: title, description, and acceptance criteria. Check that the diff aligns with the acceptance criteria. If there is a meaningful divergence, flag it to the user before continuing.
Using the diff summary from Step 5 and the card context from Step 6 (if available), generate a PR description with this structure:
## Why
<Explain the motivation. Why does this change need to go to production? What problem does it solve?>
## What
<Describe the changes and their impact. Be concrete — mention key files, new behaviors, removed code, updated APIs.>
## Validation
<If tests were added or modified: name them and describe what they cover.>
<If no tests: describe the manual validation performed or how to test this change.>
If a Linear/Jira/GitHub card was found, append a reference line:
Closes <tracker-url-or-identifier>
Show the generated title and description to the user for review. Allow them to edit or approve.
After the user approves the description:
git push -u origin HEADgh pr create --title "<title>" --body "<description>"
gh pr view --webIf gh is not installed or not authenticated, show the user the title and body so they can open the PR manually, and explain how to install/authenticate gh.
npx claudepluginhub gyovana-prado/claude-skills --plugin open-prGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.