Bashunit pr
Push branch and create a GitHub PR with concise, issue-linked description
install
source · Clone the upstream repo
git clone https://github.com/TypedDevs/bashunit
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/TypedDevs/bashunit "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/pr" ~/.claude/skills/typeddevs-bashunit-pr && rm -rf "$T"
manifest:
.claude/skills/pr/SKILL.mdsource content
Create Pull Request
Push branch and create a PR with a concise, issue-linked description.
IMPORTANT: This skill MUST be used for ALL pull request creation — even when the user says "create pr" without
. Never create a PR without following these steps./pr
Current Branch Context
- Branch: !
git branch --show-current - Commits: !
git log main..HEAD --oneline 2>/dev/null - Changed files: !
git diff main..HEAD --stat 2>/dev/null
Arguments
- Issue reference (optional, e.g.,$ARGUMENTS
or#42
). If provided, the PR will be linked to this issue.42
Instructions
-
Review the branch context above — the commits and changed files are already loaded.
-
MANDATORY: Update CHANGELOG.md — Read
and check theCHANGELOG.md
section. If the changes from this branch are NOT already listed there, you MUST update it before proceeding. Do NOT skip this step. Do NOT proceed to push without verifying.## Unreleased
- Add entries under the appropriate subsection (
,### Added
,### Changed
, etc.)### Fixed - Reference issue numbers where applicable (e.g.,
)(Issue #123) - Commit the update:
git add CHANGELOG.md && git commit -m "docs: update changelog"
- Push branch:
git push -u origin HEAD
- The
hook runs tests, shellcheck, and linting automatically on commit. Ensure all checks passed before pushing.pre-commit - If push fails, read the output, fix the issue, commit the fix, and retry. Do NOT use
to bypass.--no-verify
- Generate PR title:
- If
contains an issue number, fetch the issue title:$ARGUMENTSgh issue view <number> --json title -q '.title' - PR title format:
(conventional commit style, under 70 chars)<type>(<scope>): <short description> - Derive the type from the branch prefix (
→ feat,feat/
→ fix,fix/
→ docs)docs/
- Create PR using the template from
:.github/PULL_REQUEST_TEMPLATE.md
gh pr create --title "<title>" --assignee @me --label "<label>" --body "$(cat <<'EOF' ## 🤔 Background Related #<issue-number> <1-2 sentences: motivation and context for the changes> ## 💡 Changes - <bullet 1: what changed and why> - <bullet 2> - <bullet 3> (optional) - <bullet 4> (optional) EOF )"
MANDATORY: Always follow the PR template structure (
## 🤔 Background + ## 💡 Changes). Never use a different format.
Assignee: Always assign to
@me (the PR creator).
Labels: Add the single most relevant label based on the branch prefix and change context:
— branch starts withbug
and addresses a defectfix/
— branch starts withenhancement
or adds new functionalityfeat/
— branch starts withdocumentation
or only changes docsdocs/
— code restructuring with no behavior changerefactor
— visual/frontend-only changesui
— spikes, research, or exploratory workinvestigation
Body guidelines:
- Background: Link the issue with
, then 1-2 sentences of context. NEVER useRelated #<number>
orCloses
.Fixes - Changes: 2-4 short bullet points. Focus on what and why, not implementation details.
- No file lists, no class names, no code snippets in the body.
- Keep the entire body under 15 lines.
- Move issue to "In Review" in GitHub Project (if issue number provided):
# Read project config from .claude/github-project.json ITEM_ID=$(gh project item-list PROJECT_NUMBER --owner OWNER --format json \ | jq -r '.items[] | select(.content.number == ISSUE_NUMBER) | .id') gh project item-edit \ --id "$ITEM_ID" \ --project-id "PROJECT_ID" \ --field-id "STATUS_FIELD_ID" \ --single-select-option-id "IN_REVIEW_OPTION_ID"
Note: Requires
project scope. Run gh auth refresh -s project if needed.
- Report the PR URL to the user.
Example Usage
/pr /pr #42 /pr 15