This project uses a solo developer + AI agent workflow optimized for velocity. Branch protection is enforced conventionally through CI checks and Claude Code review rather than GitHub branch protection rules (which require paid plans for private repos).
All PRs merge via squash merge only. This is enforced at the GitHub repo level.
- Why squash: Clean linear history on main. Feature branch commits (WIP, fixups, checkpoint commits from agents) get collapsed into one meaningful commit.
- Squash message source: PR title becomes the commit message, PR body becomes the extended description.
- Branch cleanup: Feature branches auto-delete after merge (GitHub repo setting).
feature branch → push → CI runs → Claude reviews → auto-merge (squash)
All status checks must pass:
test— Full test suitevalidate-documentation— Markdown validationsecurity-scan— Secret detectionagent-tests— Agent definition validationall-checks-pass— Summary gate
Triggered on pull_request: [opened, synchronize]:
- Reviews code quality, security, shell best practices
- Pushes fix commits directly if issues are auto-fixable
- Comments "LGTM — ready to merge" if clean
After Claude review passes, the auto-merge job runs:
gh pr merge ${{ github.event.pull_request.number }} --auto --squashNo manual approval needed. CI + Claude review are the quality gates.
Since GitHub branch protection requires paid plans for private repos, these rules are enforced by convention:
| Rule | Enforcement |
|---|---|
| No direct commits to main | git-safe-commit.sh pre-commit hook |
| Feature branches required | CLAUDE.md rules + hook |
| CI must pass | Required status checks (when configured) |
| Squash-only merge | GitHub repo setting (merge commit/rebase disabled) |
| No force pushes to main | CLAUDE.md rules (agents obey) |
| Code review | Claude Code Action (automated) |
- Feature branches: Rebase onto main before merge to keep history clean. The squash merge makes this less critical since commits get collapsed anyway.
- Stacked PRs (Graphite): Graphite manages the rebase chain automatically.
- Conflict resolution: Rebase feature branch onto main, resolve conflicts, force-push the feature branch (never force-push main).
# Create a revert commit (never force-push main)
git revert HEAD
git push origin maingit checkout -b fix/broken-main
# Fix the issue
git push origin fix/broken-main
# Create PR — CI + Claude will reviewConfigured via gh api:
- Squash merge only (merge commit and rebase disabled)
- Squash commit message: PR title + body
- Auto-delete head branches after merge
- Wiki and projects disabled (not needed)
ssh -T git@github.comgh auth login
gh auth status