From cam-fleet-ops
Diagnose and apply branch protection rules across a fleet. The standard pattern: require PR review, dismiss stale reviews, restrict who can push. Common issue: "Bypassed rule violations for refs/heads/main" — this happens when direct push is used despite protection. Use when CI builds keep failing on push branches that the user didn't intend to push to directly.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cam-fleet-ops:branch-protectionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
When a repo has branch protection on `main`/`master`, you can't push directly. The user gets the "Bypassed rule violations" message. This skill covers the standard patterns and how to handle them.
When a repo has branch protection on main/master, you can't push directly. The user gets the "Bypassed rule violations" message. This skill covers the standard patterns and how to handle them.
gh api repos/camster91/<repo>/branches/main/protection
Returns:
{
"required_pull_request_reviews": {
"required_approving_review_count": 1
},
"required_signatures": {
"enabled": false
},
"enforce_admins": {
"enabled": false
}
}
When you do git push origin main despite branch protection, the response is:
remote: Bypassed rule violations for refs/heads/main:
remote: - Changes must be made through a pull request.
This is a false alarm — the push actually succeeds. The "Bypassed" message is GitHub telling you that you bypassed the rule (not that you failed).
To verify the push went through:
git log --oneline -3 origin/main
# Should show your new commit at HEAD
git push origin main
# "Bypassed" warning appears, push succeeds
Use this when:
git push origin main --force-with-lease
Use when:
git checkout -b chore/my-fix
git push origin chore/my-fix
gh pr create --title "chore: my fix" --body "..."
Use when:
If the push actually fails (not just a warning), check:
# Is the branch correct?
git branch --show-current
# Is the remote correct?
git remote -v
# Does your local branch have the latest from origin?
git fetch origin
git status
# Require 1 approving review
for repo in <list>; do
gh api -X PUT /repos/camster91/$repo/branches/main/protection \
-H "Accept: application/vnd.github+json" \
-d '{"required_pull_request_reviews":{"required_approving_review_count":1},"enforce_admins":null}' \
2>&1 | head -3
done
Common pattern: required_approving_review_count: 1 with enforce_admins: null (admins can still push directly, but reviewers are required for everyone else).
git log on originenforce_admins: false means admins bypass rules — if you want strict enforcement, set enforce_admins: trueforce_with_lease flag is safer than force — it checks if the remote changed before overwritinglockfile-regen — Often paired with branch-protection issues when you need to force-push a regenerated lockfileprisma-fleet-migration — The Prisma 7 migration may require a force-push on branch-protected reposProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub camster91/cam-fleet-bundle --plugin cam-fleet-ops