github-rulesets

Enforce GitHub branch-protection rulesets and merge settings via gh CLI.

4|1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/boettiger-lab/agent-skills --skill github-rulesets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-rulesets
Source: https://github.com/boettiger-lab/agent-skills/tree/main/github-rulesets
Command: npx skills add https://github.com/boettiger-lab/agent-skills --skill github-rulesets

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GitHub organization admins spend time configuring and enforcing repository protection rules; this skill automates the deployment and maintenance of branch-protection and merge settings across repos.

Core Features & Use Cases

  • Apply standard (no approvals) or strict (1 approval, dismiss stale) branch-protection rules to repositories.
  • Update existing rulesets or create new ones idempotently to avoid duplicates.
  • Enforce squash-merge-only and delete-branch-on-merge across repos; supports admin-level governance.

Quick Start

Run the apply-ruleset.sh OWNER/REPO with standard or strict to configure the repository governance.

Frequently Asked Questions about github-rulesets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate GitHub branch-protection rulesets across multiple repositories?

You can automate GitHub branch-protection rulesets by applying standard or strict profiles to repositories using a shell script. This updates existing rulesets or creates new ones idempotently to avoid duplicates and enforce merge settings.

Do I need admin access to enforce branch-protection rulesets on a GitHub repository?

Yes, you need admin access to enforce branch-protection rulesets. The skill requires admin-level governance permissions to configure repository policies, using the gh CLI and JSON payloads to apply the standard or strict profiles.

What is the difference between standard and strict branch-protection profiles?

The standard profile enforces branch-protection without requiring approvals, while the strict profile requires at least one approval and dismisses stale reviews. Both profiles enforce squash-merge-only and delete-branch-on-merge settings.

How do I prevent duplicate rulesets when updating GitHub branch policies?

To prevent duplicate rulesets when updating GitHub branch policies, the skill updates existing rulesets in place rather than creating new ones. This idempotent approach ensures governance configurations remain clean and avoids redundant rules.

Can I enforce merge settings like squash-merge-only across all my GitHub repos?

Yes, you can enforce squash-merge-only and delete-branch-on-merge settings across repositories. The skill applies these merge settings alongside branch-protection rulesets to maintain consistent admin-level governance policies.

What's the best way to update governance settings when provisioning new GitHub repos?

The best way to update governance settings when provisioning new repos is to apply preset ruleset profiles via the gh CLI. This automates branch-protection and merge configurations idempotently, suitable for different team sizes.