cj-ways/arcana/create-pr
Claude Code and agent skill by cj-ways/arcana
- community
Checking that the SKILL.md file is still in the repository.
Creates a pull request or merge request with auto-generated title, description, and affected-area summary. Auto-detects GitHub vs GitLab. Use when the user says "create a PR," "open a pull request," "submit for review," or "push and create PR." Manual via /create-pr.
Install
npx vskill@latest install cj-ways/arcana/create-prSKILL.md
The same SKILL.md was published earlier as cj-ways/arcana/create-pr.
/create-pr — Create Pull/Merge Request with Change Summary
Creates a pull request (GitHub) or merge request (GitLab) from the current branch with:
- Auto-generated semantic title and description based on commit history
- Summary of changes grouped by affected area
- Pre-merge checklist with context-aware items
Arguments
target-branch: Branch to merge into. If omitted, auto-detected (see Step 1).
If $ARGUMENTS is provided, treat it as the target branch.
Gotchas
- Targeting the wrong base branch. Not all projects use
main. Checkgit symbolic-ref refs/remotes/origin/HEADfirst — many projects usedevelop,staging, or custom branch names. Do not assumemain. - Pushing to a protected branch. If the current branch is
mainormaster, do NOT push or create a PR from it. Warn the user they need to be on a feature branch. - Leaking sensitive info in auto-generated descriptions. Commit messages may contain internal ticket IDs, customer names, or debug notes. Review the generated description before submitting — strip anything that shouldn't be public.
- Creating a duplicate PR. Always check
gh pr list --head <branch>(or GitLab equivalent) before creating. If a PR already exists for this branch, inform the user instead of creating another. - Failing silently when no remote is configured. If
git remote -vreturns empty, abort with a clear message instead of lettinggit pushfail cryptically.
Steps
Step 1: Gather branch context and detect platform
- Get the current branch name:
git branch --show-current - Detect platform from
.git/configremote URL:
- If remote URL contains
github.com→ GitHub - If remote URL contains
gitlab→ GitLab - Otherwise → ask user or default to GitHub conventions
- Detect default target branch (if no target argument given):
- Try:
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||' - If that fails, check which of
mainormasterexists:git rev-parse --verify origin/main 2>/dev/null || git rev-parse --verify origin/master 2>/dev/null - If argument was provided, use that instead
- Fetch latest:
git fetch origin - Verify current branch is ahead of target:
git log --oneline origin/<target>..HEAD - If no commits ahead, abort with message: "No commits ahead of
<target>. Nothing to merge." - Ensure the branch is pushed:
git log --oneline HEAD --not --remotes— if there are local-only commits, push withgit push -u origin <current-branch>
Step 2: Analyze changes
- Get the full diff stats:
git diff origin/<target>...HEAD --stat - Get changed files:
git diff origin/<target>...HEAD --name-only - Get commit log:
git log --oneline origin/<target>..HEAD - Read the full diff for understanding:
git diff origin/<target>...HEAD
From the commits and diff, determine:
- What was done: Group changes by feature/fix/refactor area
- Which areas were touched: Map changed files to top-level directories and logical modules
- Which components are affected: Identify deployable units, packages, or services impacted
Step 3: Detect affected areas
Goal: Determine which parts of the codebase are affected by the changes.
Direct changes:
- Group changed files by their top-level directory or logical module
- Identify entry points, services, packages, or apps that were directly modified
Dependency tracing (one level deep): For each changed module/package:
- Check if other parts of the codebase import or depend on the changed files
- Use grep to find import references:
grep -rl "<changed-module>" <source-dirs> - Map those references back to their parent component/service/package
Shared code changes:
- If files in common/shared/utils/lib directories were changed, note which consumers actually import the affected files rather than flagging everything
Migration/schema changes:
- If new migration files exist (any framework), note that migrations need to be run before/during deployment
Step 4: Generate PR title
- Use semantic format:
<type>(<scope>): <description> - If single-purpose (all commits relate to one feature/fix): derive from commits
- If multi-purpose: use the most significant change as the title
- Keep under 72 characters
- Examples:
feat(auth): add OAuth2 login flow with PKCEfix(api): handle null response from payment providerrefactor(db): extract query builder helpers
Step 5: Generate PR description
Use this template:
Step 6: Present for review
IMPORTANT: Present the generated title and full description to the user for review BEFORE creating the PR/MR. Wait for confirmation or edits.
Step 7: Create the pull/merge request
GitHub (detected in Step 1):
Check if gh CLI is available:
If gh is available:
If gh is not available, provide manual instructions:
TheghCLI is not installed. You can create the PR manually:1. Go to:<repo-url>/compare/<target>...<current-branch>2. Use the title and description generated aboveTo installgh: https://cli.github.com/
GitLab (detected in Step 1):
Primary method — GitLab API via curl (requires $GITLAB_TOKEN):
Parse the JSON response to extract the web_url. Handle errors:
"has already been taken"— MR already exists, inform the user"401 Unauthorized"—GITLAB_TOKENenv var is missing or invalid
Fallback method — git push with MR options:
Note: git push -o does not support multiline descriptions. Direct the user to edit the description in the GitLab UI.
If all methods fail, present the title and description to the user with the web URL for manual creation.
Step 8: Report
Output:
- PR/MR URL (or manual link if automated creation failed)
- Title
- Target branch
- Number of commits
- Affected areas (quick summary list)
Rules
- NEVER force push or modify commit history
- ALWAYS present the PR description to the user for review BEFORE creating the PR/MR
- If the branch is already pushed and up-to-date, skip the push step
- If a PR/MR already exists for this branch, inform the user instead of creating a duplicate
- When tracing dependencies, go only one level deep (don't trace the full transitive graph)
- For shared/utils code changes, use grep to find which components actually import the changed files rather than flagging everything
- If a build command is detected in the project (package.json scripts, Makefile, etc.), run the build before creating the PR to verify the code compiles
- Respect any project-specific commit conventions found in CLAUDE.md or CONTRIBUTING.md
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/create-pr/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cj-ways/arcana/create-pr)