# Git Tools Create Pr

> Create a pull request (GitHub) or merge request (GitLab) from FROM branch to TO branch

- Skill: `getpipher/git-tools-create-pr` (Agent Skill)
- Install (CLI): `npx skillmds@latest add getpipher/git-tools-create-pr`
- Raw SKILL.md: https://api.skillmd.com/api/skills/getpipher/git-tools-create-pr/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: getpipher (https://skillmd.com/u/getpipher)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/getpipher/git-tools-create-pr

---


Bismillah! I'll create a pull request/merge request with the arguments supplied when invoking this skill.

I need to parse the arguments as: FROM_BRANCH TO_BRANCH [--github|--gitlab]

## Platform Selection

**Flags:**
- `--github` - Create PR on GitHub using `gh` CLI (default)
- `--gitlab` - Create MR on GitLab using `glab` CLI

**Default behavior:** GitHub (if no flag specified)

### Platform Detection Logic

```bash
# Parse platform flag from arguments
ARGS="<FROM_BRANCH TO_BRANCH and platform flags supplied when invoking this skill>"
if [[ "$ARGS" == *"--gitlab"* ]]; then
    PLATFORM="gitlab"
    CLI_TOOL="glab"
    PR_TYPE="merge request"
elif [[ "$ARGS" == *"--github"* ]]; then
    PLATFORM="github"
    CLI_TOOL="gh"
    PR_TYPE="pull request"
else
    # Default to GitHub
    PLATFORM="github"
    CLI_TOOL="gh"
    PR_TYPE="pull request"
fi

echo "📌 Platform: $PLATFORM ($PR_TYPE)"
```

## Using with Thinking Mode

If an extended-reasoning mode is available in your environment, use it for this task. When running with extended reasoning, I will:

- Analyze the commit history between FROM_BRANCH and TO_BRANCH for context
- Review all changed files to understand the scope and impact of modifications
- Craft a comprehensive PR title that accurately reflects the changes
- Generate detailed PR description with:
  - Clear summary of what changed and why
  - Impact analysis and potential risks
  - Testing considerations and verification steps
  - Related issues or dependencies
- Consider if the PR scope is appropriate or should be split
- Validate that the target branch choice is optimal

This thoughtful approach ensures high-quality PRs with better documentation and reviewer context.

Let me:

1. **Parse the arguments and validate input**
   - Extract FROM_BRANCH and TO_BRANCH from the arguments
   - Validate that both arguments are provided

2. **Check repository status and prerequisites**
   - Verify we're in a git repository
   - Check if the appropriate CLI is installed and authenticated:
     - GitHub: `gh auth status`
     - GitLab: `glab auth status`
   - Confirm both branches exist (locally or remotely)

3. **Prepare branches for PR creation**
   - Fetch latest changes from remote
   - Switch to FROM_BRANCH and ensure it's up to date
   - Push FROM_BRANCH to remote if needed

4. **Create the pull request / merge request**

   **For GitHub (default):**
   ```bash
   gh pr create --base TO_BRANCH --head FROM_BRANCH --title "..." --body "..."
   ```

   **For GitLab:**
   ```bash
   glab mr create --source-branch FROM_BRANCH --target-branch TO_BRANCH --title "..." --description "..."
   ```

   - Generate meaningful PR/MR title based on recent commits
   - Create comprehensive description with changes summary
   - **IMPORTANT**: If `$REVIEWER_BOT` is set (a GitHub/GitLab user or app that reviews PRs), mention `@$REVIEWER_BOT` in the PR/MR description and request review with specific focus areas:
     - Critical code changes and their impact
     - Architecture decisions and patterns
     - Security considerations
     - Performance implications
     - Testing coverage and edge cases
   - Provide context about the changes and areas of concern
   - **NEVER include AI attribution, credits, or "Generated with assistance" footers**
   - Return the PR/MR URL

## Usage Examples

```bash
# Create PR on GitHub (default)
Invoke with: git-tools-create-pr dev main

# Create PR on GitHub (explicit)
Invoke with: git-tools-create-pr dev main --github

# Create MR on GitLab
Invoke with: git-tools-create-pr dev main --gitlab
```

Let me execute these steps now.


