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 usingghCLI (default)--gitlab- Create MR on GitLab usingglabCLI
Default behavior: GitHub (if no flag specified)
Platform Detection Logic
# 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:
Parse the arguments and validate input
- Extract FROM_BRANCH and TO_BRANCH from the arguments
- Validate that both arguments are provided
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
- GitHub:
- Confirm both branches exist (locally or remotely)
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
Create the pull request / merge request
For GitHub (default):
gh pr create --base TO_BRANCH --head FROM_BRANCH --title "..." --body "..."For GitLab:
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_BOTis set (a GitHub/GitLab user or app that reviews PRs), mention@$REVIEWER_BOTin 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
# 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.