github-rulesets
Skill4 starsChanged 7 months agoBSD-3-ClauseView on GitHub
Apply preferred branch-protection rulesets and squash-merge-only settings to GitHub repos. Two profiles: 'standard' (no approval required) for smaller projects and 'strict' (1 approval, dismiss stale reviews) for larger ones. TRIGGER when: setting up a new repo, applying branch protection, configuring merge settings, or the user mentions rulesets.
In this repository12 other files it gives its agents.
- boettiger-lab-stackSkill
- cng-datasetsSkill
- duckdb-spatialSkill
- gdal-spatialSkill
- github-app-authSkill
- k8s-never-force-deleteSkill
- no-ai-attributionSkill
- nrp-k8sSkill
- nrp-s3Skill
- oci-artifactsSkill
- python-envSkill
- stac-navigationSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Run the shell script directly:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Repository Rulesets
Apply branch-protection rulesets and merge settings to repos. Two profiles available:
| Profile | Approvals | Dismiss stale reviews | Use for |
standard | 0 | no | smaller / solo projects |
strict | 1 | yes | larger / team projects |
Both profiles enforce: require PR, block deletion, block force push, squash-merge-only, delete branch on merge.
How to apply
Run the shell script directly:
/home/cboettig/.claude/skills/github-rulesets/apply-ruleset.sh OWNER/REPO [standard|strict]Or use gh one-liners directly:
Squash-merge-only + delete branch on merge
gh api -X PATCH repos/OWNER/REPO -f allow_squash_merge=true -f allow_merge_commit=false -f allow_rebase_merge=false -f delete_branch_on_merge=true --silentCreate/apply the ruleset
# standard (no approval required):
gh api -X POST repos/OWNER/REPO/rulesets --input /home/cboettig/.claude/skills/github-rulesets/ruleset-standard.json --silent
# strict (1 approval, dismiss stale):
gh api -X POST repos/OWNER/REPO/rulesets --input /home/cboettig/.claude/skills/github-rulesets/ruleset-strict.json --silentUpdate an existing ruleset
# Find the ruleset ID:
gh api repos/OWNER/REPO/rulesets --jq '.[].id'
# Update it:
gh api -X PUT repos/OWNER/REPO/rulesets/RULESET_ID --input /home/cboettig/.claude/skills/github-rulesets/ruleset-standard.json --silentWhat each ruleset does
The JSON payloads at ruleset-standard.json and ruleset-strict.json create a ruleset named default-branch-protection targeting ~DEFAULT_BRANCH with these rules:
deletion— prevents branch deletionnon_fast_forward— blocks force pushespull_request— requires a PR to merge (approval count and stale-review settings vary by profile)
The apply-ruleset.sh script is idempotent: it updates an existing ruleset with the same name rather than creating duplicates.
Notes
- Rulesets require the caller to have admin access to the repo.
- The
~DEFAULT_BRANCHref pattern automatically targets whatever the repo's default branch is (main, master, etc.). - Repo-level merge settings (squash-only) are separate from rulesets and set via
PATCH repos/OWNER/REPO.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

