| name | tools-github-workflow |
| description | Full GitHub workflow orchestration via CLI - branch management, commit quality, issue triage, PR lifecycle, and worktree operations on macOS and Windows. |
GitHub Workflow Orchestration
Overview
Manage the complete GitHub development workflow from the terminal using gh and git. Covers branch hygiene, commit crafting, issue triage, PR lifecycle, and parallel worktree operations.
Branch Management
Sync & Create
gh repo sync --force
git fetch origin main && git rebase origin/main
git switch -c feature/payments-123 origin/main
gh pr checkout <number>
gh repo set-default org/repo
Naming Convention
feature/<area>-<ticket> # New features
bugfix/<ticket> # Bug fixes
hotfix/<ticket> # Production fixes
release/<version> # Release branches
Daily Hygiene
git fetch origin main && git rebase origin/main
git push -u origin feature/payments-123
git rebase --abort
Audit & Cleanup
gh api repos/:owner/:repo/git/refs/heads --jq '.[].ref'
git branch -d <branch>
git push origin --delete <branch>
gh alias set stale-branches '!git branch -r --merged main | grep -v main'
Cross-Platform Tips
- Use
.gitconfig alias: sync = !gh repo sync && git fetch -p
- Windows:
git config --global core.autocrlf false for team consistency
Commit Quality
Configure
git config --global user.signingkey <GPG_KEY>
git config --global commit.gpgsign true
git config commit.template ~/.gitmessage
Craft Commits
git add -p
git commit -m "feat(auth): add biometric fallback
Resolves #123. Adds TouchID/FaceID fallback for password-less login."
Commit Conventions
| Prefix | Meaning |
|---|
feat: | New feature |
fix: | Bug fix |
refactor: | Code refactoring |
perf: | Performance improvement |
docs: | Documentation |
test: | Tests |
chore: | Maintenance |
breaking: | Breaking change |
Link Issues
- Body:
Fixes #123 or Refs #123 (auto-closes on merge)
- Verify context:
gh issue view <id> before referencing
Amend Safely
git commit --amend
git commit --amend --no-edit
git push --force-with-lease
Verify
git log --show-signature -1
gh pr status
Issue Triage
List & Filter
gh issue list --label bug --state open --limit 50
gh issue list --state open --search "updated:<-30d"
gh issue list --assignee @me --state open
Create Issues
gh issue create --title "Crash on resume" \
--body-file templates/bug.md \
--label bug \
--assignee @me \
--project "Product Roadmap"
Triage Existing
gh issue view 123 --json title,body,labels,comments
gh issue edit 123 --add-label priority/high --remove-label triage
gh issue edit 123 --assignee user1
gh issue comment 123 --body "Tracking in PR #456"
Export for Reporting
gh issue list --json number,title,state,assignees --jq \
'.[] | [.number,.title,.state,(.assignees[].login? // "")] | @csv'
Automation Aliases
gh alias set stale '!gh issue list --state open --search "updated:<-30d"'
gh alias set my-issues '!gh issue list --assignee @me --state open'
gh alias set triage '!gh issue list --label triage --state open --limit 20'
PR Lifecycle
Create PR
gh pr create --base main \
--title "feat: add biometric login" \
--body-file .github/pull_request_template.md \
--reviewer user1,user2 \
--label "area:core" \
--project "Roadmap"
Monitor & Update
gh pr diff
gh pr checks --watch
gh run rerun <run-id>
gh pr comment --body "Updated screenshots for iOS"
Review & Merge
gh pr checkout <number>
gh pr review <number> --approve
gh pr review <number> --request-changes --body "See inline comments"
gh pr merge <number> --rebase --delete-branch
Triage Open PRs
gh pr list --state open --label "needs-review"
gh pr list --state open --search "review:required"
Automation Aliases
gh alias set pim '!gh pr status && gh pr checks'
gh alias set my-prs '!gh pr list --author @me --state open'
Worktree Operations
Setup
gh repo clone org/repo ~/code/repo
cd ~/code/repo && gh repo set-default
mkdir -p ~/code/worktrees
Create Worktrees
git worktree add ../worktrees/feature-login feature/login-form
git worktree add ../worktrees/bugfix-123 -b bugfix/123
git worktree list
Sync & Cleanup
gh repo sync
git fetch --all --prune
git worktree remove ../worktrees/bugfix-123
git branch -d bugfix/123
git worktree prune
Cross-Platform Paths
git worktree add ~/code/worktrees/feature feature/branch
git worktree add $env:USERPROFILE\code\worktrees\feature feature/branch
Tips
- Run CI from worktree:
gh workflow run validates branch-specific tests
- Each worktree should track upstream:
git rev-parse --abbrev-ref @{u}
- Audit weekly: remove stale worktrees, reclaim disk
Verification
git status clean before switching branches
- All new issues tagged with priority + area within SLA
- Every PR includes template, reviewers, and passing CI
- Branch list free of stale branches older than 30 days
git worktree list shows only active tasks