This gist has been migrated to: https://github.com/nicksteffens/claude-config/blob/main/commands/github-workflow.md
Please use the repository version for the most up-to-date content.
Gist ID: 9296d3dc6a59e106e2dcac24c193c234
Gist URL: https://gist.github.com/nicksteffens/9296d3dc6a59e106e2dcac24c193c234
Update Command: gh gist edit 9296d3dc6a59e106e2dcac24c193c234
Optimized GitHub operations using CLI-first approach, MCP as fallback.
- PRIMARY: GitHub CLI (
gh
) - Fast, direct, well-established - FALLBACK: GitHub MCP - When CLI doesn't support the operation
- LAST RESORT: WebFetch - Only when both above fail
# View issue details
gh issue view <number>
# List issues
gh issue list --assignee @me
gh issue list --state open --label bug
# Create issue
gh issue create --title "Title" --body "Description"
# Comment on issue
gh issue comment <number> --body "Comment text"
# Create PR
gh pr create --title "Title" --body "Description"
# View PR details
gh pr view <number>
# List PRs
gh pr list --author @me
gh pr list --state open
# Review PR
gh pr review <number> --approve
gh pr review <number> --request-changes --body "Comments"
# Merge PR - SAFETY CHECK REQUIRED
gh pr merge <number> --squash
# View repo details
gh repo view
# Clone repo
gh repo clone owner/repo
# Fork repo
gh repo fork owner/repo
NEVER merge a PR that you and I didn't author without explicit permission
- Check PR author:
gh pr view <number> --json author
- If author is NOT you (nicksteffens) or Claude: STOP and ask for permission
- Only merge PRs we created together unless explicitly told otherwise
- Always confirm merge action before executing
- Always use
gh issue view <number>
instead of web scraping - Create PRs with
gh pr create
using repository templates - Link issues automatically with "Fixes #123" in PR body
- Use
gh
for all GitHub operations before considering alternatives - Safety check all destructive operations (merge, close, delete)
- Complex API operations not supported by CLI
- Bulk operations requiring programmatic access
- When CLI authentication fails
Default approach: Try gh
command first, explain what you're doing, then proceed with safety checks.