Awesome-omni-skill create-pr
Create a pull request or update an existing one following project conventions.
install
source · Clone the upstream repo
git clone https://github.com/diegosouzapw/awesome-omni-skill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/tools/create-pr-ahoym" ~/.claude/skills/diegosouzapw-awesome-omni-skill-create-pr-e67360 && rm -rf "$T"
manifest:
skills/tools/create-pr-ahoym/SKILL.mdsource content
Context
- Current branch: !
git branch --show-current 2>/dev/null - Commits on branch: !
git log origin/main..HEAD --oneline 2>/dev/null | head -20
Create Pull Request
Create a pull request or update an existing one following project conventions.
Usage
- Create PR to main/git:create-pr
- Create PR to specified base branch/git:create-pr <base-branch>
Reference Files (conditional — read when creating PR)
- pr-body-template.md - PR body structure template
Reference Files (conditional — read only when needed)
- @~/.claude/skill-references/platform-detection.md - Platform detection for GitHub/GitLab
Pre-PR Checklist
Before creating the PR, verify these items are complete:
- All tests pass locally
- Code formatted with linter
- No sensitive data in code or logs
- Metrics added for new operations (if applicable)
- Error handling implemented
- Documentation updated (if needed)
Instructions
-
Detect platform — follow
to determine GitHub vs GitLab. Set@~/.claude/skill-references/platform-detection.md
,CLI
, and API command patterns accordingly. All commands below use GitHub (REVIEW_UNIT
) syntax; substitute GitLab equivalents if on GitLab.gh -
Gather context (run in parallel):
- Check for uncommitted changesgit status
- Get current branch namegit branch --show-current
- See commits to include (adjust base as needed)git log origin/main..HEAD --oneline
- See files changedgit diff origin/main..HEAD --stat
-
Check for uncommitted changes:
- If there are uncommitted changes, ask user if they want to commit first
- Do not proceed with PR creation if there are uncommitted changes
-
Run formatter on changed files:
- Detect project formatter: check for
,.prettierrc*
, or formatter config inbiome.jsonpackage.json - Run the formatter in check mode on changed files: e.g.,
npx prettier --check $(git diff --name-only origin/main -- '*.ts' '*.tsx' '*.js' '*.json' '*.css') - If formatting issues found, fix them (
), stage, and commit before proceedingnpx prettier --write <files> - If no formatter config found, skip this step
- Detect project formatter: check for
-
Check for existing PR:
gh pr list --head <current-branch>- If a PR already exists, ask user: "PR #N already exists for this branch. Update its description instead of creating new?"
- If yes, use
instead ofgh pr edit <number> --body "..."gh pr create
-
Infer Jira ticket (if applicable):
- Extract Jira ticket ID from the branch name (common patterns:
,feature/PROJ-123
,bugfix/PROJ-456
)PROJ-789-description - Look for Jira ticket references in commit messages
- If no ticket can be inferred, leave the URL incomplete for the user to fill in
- Extract Jira ticket ID from the branch name (common patterns:
-
Determine base branch:
- If
provided, use that as base$ARGUMENTS - If branch name suggests a parent (e.g.,
might be based onfeature/foo-part2
), ask userfeature/foo - Default to
main
- If
-
Check if push needed:
- If local is ahead of remote, push first:
git push -u origin <branch>
- If local is ahead of remote, push first:
-
Create or update PR using the template from pr-body-template.md
-
Run the gh command:
For new PR:
gh pr create --base <base-branch> --title "<title>" --body "$(cat <<'EOF' <body content> EOF )"
For existing PR:
gh pr edit <number> --body "$(cat <<'EOF' <body content> EOF )"
- Return the PR URL to the user.