Loading...
Loading...
Executes the full PR-driven development workflow: create an isolated feature branch from the current work, commit all staged changes, rebase cleanly onto the selected base branch (skipping any ancestor commits already merged), push the branch, and open a GitHub pull request linked to a related issue. Includes guidance for stacked/chained PRs. Invoked when the user says "open a PR", "create a pull request", "push and PR", or "branch, rebase and PR".
npx skill4agent add soulcodex/agentic git-flow-prgit status --short # Are there uncommitted changes?
git log --oneline -10 # What commits exist on this branch?
git branch --show-current # Which branch are we on?
BASE_BRANCH="<base-branch>" # e.g. main, develop, release/*
git fetch origin "$BASE_BRANCH"
git log --oneline "origin/$BASE_BRANCH"..HEAD # Commits unique to this branchmain--ontogit add <files> # Stage relevant files; be specific — don't `git add .` blindly
git commit -m "<type>(<scope>): <summary>
<body explaining why, not just what>
Closes #<issue-number>"featfixdocschorerefactortest(gemini)(tooling)(docs)(skills)Closes #NFixes #NRefs #NCOMMIT=$(git rev-parse HEAD)
git checkout -b feat/<short-description> "$COMMIT"feat/<description>fix/<description>docs/<description>chore/<description>git rebase "origin/$BASE_BRANCH"# Find the oldest commit on this branch not present in the selected base branch
git log --oneline "origin/$BASE_BRANCH"..HEAD
# The last line shows the oldest unique commit — its *parent* is the rebase base
ANCESTOR=$(git log --oneline "origin/$BASE_BRANCH"..HEAD | tail -1 | awk '{print $1}')
PARENT=$(git rev-parse "$ANCESTOR"^)git rebase --onto "origin/$BASE_BRANCH" "$PARENT" HEADgit log --oneline -5 # Should show: new commit(s) on top of origin/<base-branch> HEAD
git status # Should be cleangit add <file> && git rebase --continuegit rebase --skipjust test # All assertions must pass
just lint # Zero findingsgit push origin <branch-name> -u-ugit pushgit pullmaingit push origin <branch-name> --force-with-lease--force-with-lease--forcegh pr create \
--title "<type>(<scope>): <concise summary>" \
--base "$BASE_BRANCH" \
--head <branch-name> \
--body "$(cat <<'EOF'
## Summary
- <bullet 1: what changed and why>
- <bullet 2>
- <bullet 3>
## Changes
| Area | Files |
|------|-------|
| <area> | <files> |
<issue-footer: Refs #<issue-number> | Closes #<issue-number>>
EOF
)"Refs #NCloses #Nfeat/<topic>-base--base "$BASE_BRANCH"feat/<topic>-part-2feat/<topic>-base--base feat/<topic>-baseRefs #NCloses #Ngh pr edit --base <new-base>gh pr view # Confirm PR is open with correct title, base branch, and issue link$BASE_BRANCHRefs #NCloses #Ngh pr checks