Check if branch is pushed and push if needed:
git -C <repo_path> ls-remote --heads origin <branch>
If the branch is not pushed yet, push it:
git -C <repo_path> push -u origin <branch>
If already pushed, check if local is ahead and push any new commits:
git -C <worktree> status -sb
git -C <repo_path> push origin <branch>
Draft the PR title and body, then confirm with the user:
Title: Conventional commit format, under 70 chars, min 10 char description:
<type>(<scope>): <description>
Types: feat, fix, chore, refactor, docs, test, perf
Examples: feat(hooks): add permission prompt tracking, fix(terminal): clean up orphaned tmux sessions
Body: Must include all three sections — What, Why, and Testing:
## What
<Description of what this PR does — summarize the changes>
## Why
<Explanation of why this change is needed — the motivation>
Resolves <link>
## Testing
<How this was tested — commands run, manual verification, etc.>
Linking tickets/issues:
- If the task was created from a Jira ticket, include the Jira link
- If the task was created from a GitHub issue, include:
Resolves #<issue-number>
- Infer the ticket/issue from the branch name. Jira-style keys match
[A-Z][A-Z0-9]+-\d+ (e.g., feat/PROJ-123-... -> PROJ-123); numeric branches resolve to GitHub issues (fix/42-... -> #42).
- If no ticket/issue is associated, omit the
Resolves line
IMPORTANT: Present the title and body to the user and WAIT for their confirmation before creating the PR. Do NOT create the PR without explicit user approval. The user may want to adjust the title, description, or add context.