Three slash commands and a skill that give Claude Code a professional PR workflow — branch protection, AI code review, and automated pull requests. Works for solo builders, vibe coders, and AI-assisted dev teams.
You're building fast with Claude Code. Features are shipping, ideas are moving. But your GitHub is a graveyard of direct pushes to main, no PR history, no code review, and no record of what you built or why.
When something breaks — or when someone looks at your repo — there's no story.
This fixes that. In one setup command.
| Command | What it does |
|---|---|
/project-init |
Scaffolds all config files for a new or existing project in one shot |
/pr |
Creates a branch, commits your work, generates a PR description from your actual diff, and opens the PR |
/protect |
Sets GitHub branch protection rules entirely from the terminal — no browser needed |
pr-workflow skill |
Gives Claude context about your PR process across all conversations |
All three commands are global — install once, use in every project.
# 1. Install GitHub CLI (required)
brew install gh
gh auth login
# 2. Install the commands globally
mkdir -p ~/.claude/commands
cp commands/pr.md ~/.claude/commands/pr.md
cp commands/project-init.md ~/.claude/commands/project-init.md
cp commands/protect.md ~/.claude/commands/protect.md
# 3. Install the skill
mkdir -p ~/.claude/skills/pr-workflow
cp skills/pr-workflow/SKILL.md ~/.claude/skills/pr-workflow/SKILL.mdThen go to coderabbit.ai → sign in with GitHub → connect your repos. That's the only browser step.
Existing project:
# Inside a Claude Code session
/project-init existing
Brand new project:
/project-init new
Audit what's missing:
/project-init check
/project-init creates:
CLAUDE.md— Claude Code reads this automatically every session (your project context, stack, commands).coderabbit.yaml— AI code review config tailored to your project type.pr-template.md— reusable PR description template.env.example— documents all env vars by scanning your codebase.gitignore— updated to never commit.envor Claude local settings- Branch protection — applied automatically via
gh api, no browser needed
/pr
Claude Code will:
- Read your git status
- Create a properly named branch (
feat/,fix/,chore/, etc.) - Stage and commit your work
- Generate a PR description from your actual code diff
- Open the PR via
gh pr create - Print a checklist for CodeRabbit review
Other modes:
/pr branch → just create and push a feature branch
/pr open → open a PR for the current branch
/pr status → check branch and open PRs
/pr cleanup → delete merged branches
Use it whenever you finish building something and want to get it into GitHub properly.
Use /pr when:
- You finished a feature, bug fix, or any meaningful chunk of work
- You've been building with Claude Code and want to review what it produced before merging
- You're about to demo something or share your repo publicly
- Anything touching auth, payments, or real user data — always
Skip /pr and push direct when:
- Fixing a typo in a README
- Updating a comment or a config value
- A one-line change you're 100% certain about
If you're unsure — use /pr. It takes 30 seconds and gives you CodeRabbit's eyes on the code before it hits main.
/protect → standard (PR required, admin can override)
/protect --strict → locked down (no bypass, good for production apps)
/protect --check → audit current rules without changing anything
/protect --remove → remove protection (confirms first)
Claude Code builds the feature
↓
/pr — branch, commit, open PR
↓
CodeRabbit reviews the AI-generated code
↓
Fix issues, squash merge, ship
Why this matters for AI-assisted development: Claude Code is fast but not perfect. CodeRabbit catches what Claude misses — null checks, security issues, incorrect API usage, missing error handling. Running AI output through an AI reviewer before it hits main is the move.
Reply to any CodeRabbit comment in a PR:
@coderabbitai ignore → dismiss a false positive
@coderabbitai explain → get more detail on a suggestion
@coderabbitai generate tests → generate unit tests for flagged code
@coderabbitai review → re-run full review
@coderabbitai summary → regenerate the PR summary
/pr uses these conventions automatically:
| Type | Prefix | Example |
|---|---|---|
| New feature | feat/ |
feat/stripe-webhooks |
| Bug fix | fix/ |
fix/auth-redirect |
| Config/deps | chore/ |
chore/update-env |
| Experiment | spike/ |
spike/gemini-vs-claude |
| Urgent fix | hotfix/ |
hotfix/cors-header |
~/.claude/
├── commands/
│ ├── pr.md ← /pr command
│ ├── project-init.md ← /project-init command
│ └── protect.md ← /protect command
└── skills/
└── pr-workflow/
└── SKILL.md ← PR + CodeRabbit skill
Per-project files (created by /project-init):
your-project/
├── CLAUDE.md
├── .coderabbit.yaml
├── .pr-template.md
├── .env.example
└── .gitignore
- Claude Code — Claude's agentic coding CLI
- GitHub CLI —
brew install gh - CodeRabbit — free for public repos
Ready-to-use config files are in the /templates folder:
templates/.coderabbit.yaml— copy into any project manuallytemplates/.pr-template.md— copy into any project manually
Full guide with step-by-step instructions for every command: docs/claude-code-workflow-guide.md
Got a Claude Code command that improved your workflow? PRs welcome.
The most useful contributions:
- New slash commands (issues, deploys, changelogs, release notes)
- Stack-specific
CLAUDE.mdtemplates (Next.js, Python, CLI tools, mobile) - CodeRabbit config presets for different project types
See CONTRIBUTING.md for guidelines.
MIT — use it, fork it, build on it.
Built by Tarik Moody — Director of Strategy & Innovation, Radio Milwaukee. Building in public with Claude Code.