name: sjv-pr-and-merge-gh description: Use when finalizing a System Journey Viewer task with the repository's tmp/ai branch workflow, validations, GitHub CLI pull request creation, check monitoring, and rebase merge with branch deletion.
SJV PR And Merge (gh)
Use this skill when the user asks to open a PR and merge it using gh.
Workflow (repository policy aligned)
- Confirm work is on a
tmp/ai/*branch. - Run validations relevant to touched files (see root
AGENTS.mdvalidation matrix). - Update
docs/WORKLOG.mdanddocs/AI_STATE.mdwhen required by repo policy. - Commit with a focused message.
- Push the temporary branch.
- Create PR with
gh pr create:- include summary bullets,
- include validation commands actually run,
- prefer
--body-filefor multiline bodies (avoids shell quoting issues).
- Monitor checks:
gh pr checks <number>- poll until required checks pass
- Merge with:
gh pr merge <number> --rebase --delete-branch
- Confirm:
- PR state is
MERGED - merge commit hash
- local branch is back on target branch (usually
main)
- PR state is
Commands template
git status --short --branch
git push -u origin <tmp-branch>
gh pr create --base main --head <tmp-branch> --title "<title>" --body-file <file>
gh pr checks <pr-number>
gh pr merge <pr-number> --rebase --delete-branch
gh pr view <pr-number> --json number,state,mergedAt,mergeCommit,url
Common pitfalls
- Quoting/backticks in
gh pr create --bodycausing shell expansion. - Merging before all required checks pass.
- Forgetting docs updates required by this repo's
AGENTS.md. - Using merge-commit strategy instead of
--rebase.
Final response checklist
- Mention PR URL.
- Mention merge commit hash.
- Mention validations run.
- Mention anything not validated (if applicable).