From workbranch
Run checks, push the branch, and open a GitHub PR linked to the Linear ticket
How this skill is triggered — by the user, by Claude, or both
Slash command
/workbranch:work-prThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
When this skill is invoked, follow these steps:
When this skill is invoked, follow these steps:
Get the current branch:
git branch --show-current
If on main or master, tell the user there's nothing to push. Stop.
Check for uncommitted changes:
git status --short
If there are uncommitted changes, ask whether to commit them first or abort.
Read .workbranch.json for:
team prefixreviewers array (GitHub usernames)test command (optional)lint command (optional)typecheck command (optional)bootstrap command (for the PR body)Run each configured check command in order. Stop on first failure.
If lint is defined:
LINT_CMD
If typecheck is defined:
TYPECHECK_CMD
If test is defined:
TEST_CMD
If any check fails, show the output and ask the user how to proceed (fix and retry, or skip and push anyway).
Parse the branch name to extract the ticket ID by matching TEAM-\d+.
If a ticket ID was found, fetch the ticket details:
linear issue view TICKET_ID --json --no-pager
Extract the title and URL for the PR body.
git push -u origin BRANCH_NAME
If push fails: report the error. Common causes: no remote access, branch already exists with divergent history. Do not force-push.
Construct the PR body using a heredoc for correct formatting:
## Summary
<1-3 bullet points derived from the Linear ticket description and recent commits>
## Linear
Closes TICKET_ID
## Test locally
\```
cd WORKTREE_PATH && BOOTSTRAP_CMD && TEST_CMD
\```
Where:
TICKET_ID is from the branch nameWORKTREE_PATH is $(pwd) (the actual current directory)BOOTSTRAP_CMD is from config (omit if not defined)TEST_CMD is from config (omit if not defined)If no test or bootstrap commands are defined, omit the "Test locally" section.
Derive the PR title from the ticket: TICKET_ID: Ticket Title
gh pr create --title "PR_TITLE" --body "$(cat <<'EOF'
PR_BODY_HERE
EOF
)"
If PR creation fails but push succeeded: report the error. The user can retry gh pr create manually. The branch is already pushed.
Read the reviewers array from .workbranch.json.
If reviewers are configured:
gh pr edit --add-reviewer "user1,user2"
If no reviewers are configured, ask the user:
No reviewers configured in
.workbranch.json. Enter a GitHub username to request review, or press enter to skip.
Important: Do NOT attempt to add the current user as a reviewer — GitHub does not allow self-review requests.
Present:
Closes TICKET_ID in the PR body will auto-transition the Linear ticketPR opened: https://github.com/org/repo/pull/42
Linear: https://linear.app/team/issue/ENGG-456
Reviewers: ghuser1, ghuser2
Waiting for review.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub pdodds/workbranch --plugin workbranch