github-repo-settings
Skill7 starsChanged 2 days agoMITView on GitHub
GitHub repo settings via `gh`: labels, merge methods, branch deletion, the default branch's ruleset, Pages, a public repo's security features. TRIGGER when: `.github/release.yaml` is created or its labels change; user asks to sync labels or create/delete a single label, change merge methods, toggle head-branch deletion, or enable GitHub Pages; a repo's CI first runs on a PR; a job of the `quality` or `security` workflow is added, renamed or removed; user asks about branch protection, rulesets or required checks, or Scorecard's Branch-Protection check; a repo gains an `actions/deploy-pages` workflow; a Pages deploy fails because Pages is off; a repository is or becomes public, or gains a `SECURITY.md`; user asks about secret scanning, push protection, Dependabot alerts or security updates, private vulnerability reporting, CodeQL or code scanning, or webhook secrets. SKIP when: workflow YAML with no repo setting involved (`github-actions-conventions`).
- Reads credentials
4 other projects use a version of this.
Adopted by
Most recently taken up by
- ankitgoyalio/skillstheir own version, first seen Nov 29, 2026
- leroyguillaume/skillsword for word, first seen Nov 22, 2026
- HugoOu/dsh-github-skillstheir own version, first seen Nov 16, 2026
- michaelbel/cuckcodertheir own version, first seen Aug 26, 2026
Other versions4 projects use a version of this.
Word for word · 1
- leroyguillaume/skills★ 7100% same
Edited · 0
None found.
Wrote their own version · 3
- ankitgoyalio/skills★ 1same name
- michaelbel/cuckcoder★ 1same name
- HugoOu/dsh-github-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- adr-conventionsSkill
- api-conventionsSkill
- architecture-conventionsSkill
- argocd-conventionsSkill
- ci-conventionsSkill
- config-conventionsSkill
- contributing-conventionsSkill
- councilSkill
- cryptography-conventionsSkill
- dependency-update-conventionsSkill
- diagram-conventionsSkill
- docker-conventionsSkill
- documentation-conventionsSkill
- frontend-conventionsSkill
- github-actions-conventionsSkill
- github-issue-conventionsSkill
- github-pr-conventionsSkill
- gitlab-ci-conventionsSkill
- helm-conventionsSkill
- herdr-core-delegationSkill
- herdr-delegationSkill
- herdr-tui-delegationSkill
- kopf-conventionsSkill
- kubernetes-operator-conventionsSkill
- logging-conventionsSkill
- logo-conventionsSkill
- mise-conventionsSkill
- ollama-conventionsSkill
- openssf-conventionsSkill
- pr-conventionsSkill
- pre-commit-conventionsSkill
- project-metadata-conventionsSkill
- python-async-conventionsSkill
- python-conventionsSkill
- readme-conventionsSkill
- release-script-conventionsSkill
- release-supply-chain-conventionsSkill
- renovate-ci-conventionsSkill
- rest-conventionsSkill
- rust-build-conventionsSkill
- rust-conventionsSkill
- rust-http-conventionsSkill
- security-policy-conventionsSkill
- signal-handling-conventionsSkill
- sql-conventionsSkill
- starlight-conventionsSkill
- systemd-conventionsSkill
- system-user-conventionsSkill
- task-conventionsSkill
- terraform-conventionsSkill
- topic-splittingSkill
- ui-copy-conventionsSkill
- web-layout-conventionsSkill
- yaml-conventionsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 56
Read .github/release.yaml, collect every concrete label it maps (drop "*").
- Very specific: line 59
Create any release.yaml label that's missing.
- Very specific: line 63
Only delete a label when the user actually wants it gone — never purely because it's absent from release.yaml.
- Very specific: line 90
breakingis always created alongsiderelease.yaml: If the file has no *Breaking changes* category, add one — as the first category, … - Very specific: line 105
Leave GitHub's default bug / enhancement colours and descriptions as-is unless asked to unify them with the new labels.
- Distinctive: line 138
Every repository with CI protects its default branch with a ruleset: no deletion, no force-push, changes through a pull request, and the …
- Distinctive: line 149
Check first, the answer decides between create and update:
- Distinctive: line 186
No branch-targeting ruleset yet.
- Distinctive: line 198
Verify: the rules that apply to the default branch, required checks included.
- Very specific: line 260
Verify — build_type must read workflow:
- Very specific: line 277
Every public repository has these on: secret scanning with push protection, Dependabot vulnerability alerts, private vulnerability …
- Distinctive: line 284
Check the visibility first.
- Very specific: line 330
Verify: both status fields read enabled, the alerts call succeeds (it answers 404 when they are off), security updates read false, private …
- Distinctive: line 356
Every call is idempotent: re-running it where the feature is already on changes nothing.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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 settings (gh CLI)
Administer GitHub repo settings from the CLI. All commands use gh, so the repo
is inferred from the current directory's origin remote unless --repo is given.
Sync labels to .github/release.yaml
.github/release.yaml only governs PR labels — the changelog generator reads
the labels on merged PRs, nothing else. So it is not the full set of labels a
repo should have. Two distinct purposes coexist:
- Issue-triage labels (
bug,enhancement,question,help wanted, …): classify reported problems/requests, whether or not the repo cuts releases. They legitimately exist even when absent fromrelease.yaml. Do not delete them just because the changelog config doesn't reference them. - PR / changelog labels (
feature,fix,chore,dependencies, …): classify the change shipped. These category labels are whatrelease.yamlmaps to categories. Area and ecosystem labels (rust, …) stay out of it and never select a category (seegithub-pr-conventions). Withoutrelease.yaml, none are created: nothing reads them (seegithub-pr-conventions), so the sync below does not apply. The labels on Renovate's PRs are its config's business (see the notes).
The same concept often has both: bug (issue) ↔ fix (PR), enhancement (issue)
↔ feature (PR). Inside one changelog category, listing both members of such a
pair is a duplicate — pick one (the PR-side label) and drop the other from
release.yaml; but keep the issue-side label alive on the repo. That is also
what github-pr-conventions assumes when it labels a PR: fix/feature by
default, bug/enhancement only where a repo still maps them.
The "*" catch-all in release.yaml is a wildcard, not a real label — never
create it.
Procedure:
- Read
.github/release.yaml, collect every concrete label it maps (drop"*"). These must all exist on the repo. - List current labels:
gh label list --limit 100. - Create any release.yaml label that's missing. Add any repo label missing from
release.yaml into the right category (or
exclude) if it's a category label; leave issue-triage and area/ecosystem labels out ofrelease.yamlbut keep them on the repo. - Only delete a label when the user actually wants it gone — never purely because
it's absent from
release.yaml.
The block below is a superset: keep breaking, the issue-triage labels, and
only the category and exclude labels the repo's release.yaml maps (see the
notes after it).
gh label create feature --description "New feature" --color 0e8a16 --force
gh label create fix --description "Bug fix" --color d73a4a --force
gh label create chore --description "Maintenance / housekeeping" --color fef2c0 --force
gh label create dependencies --description "Dependency updates" --color 0366d6 --force
gh label create documentation --description "Documentation only" --color 0075ca --force
gh label create breaking --description "Backwards-incompatible change" --color b60205 --force
gh label create security --description "Security fix" --color b60205 --force
gh label create deprecation --description "Deprecates a feature, removed in a later release" --color fbca04 --force
gh label create performance --description "Performance improvement" --color 5319e7 --force
# the exclude label, only when release.yaml has an `exclude.labels` entry
gh label create ignore-for-release --description "Exclude from release changelog" --color ededed --force
# issue-triage labels stay even though release.yaml never maps them
gh label create bug --description "Something isn't working" --color d73a4a --force
gh label create enhancement --description "New feature or request" --color a2eeef --force
gh label list --limit 100 # verifyNotes:
breakingis always created alongsiderelease.yaml. If the file has no Breaking changes category, add one — as the first category, since GitHub files a PR under the first match and a breaking PR also carries itsfeature/fixlabel (seegithub-actions-conventionsfor the baseline file).- Otherwise, only create the category labels the repo's
release.yamlactually maps; the exclude label only makes sense alongside anexclude.labelsentry. - Create the labels Renovate's config names (
labels,addLabels;dependency-update-conventions), reusing an ecosystem label the repo already has rather than a variant: two labels for one concept split every filter in two. gh label create --forceupserts, so it is safe to re-run.- Deleting a label removes it from every issue/PR it is on and cannot be
undone — it is destructive. Absence from
release.yamlis not a reason to delete; only do it when the user explicitly wants the label gone, and confirm the delete list first. - Leave GitHub's default
bug/enhancementcolours and descriptions as-is unless asked to unify them with the new labels.
Restrict merge methods to squash-only
gh repo edit --enable-squash-merge --enable-merge-commit=false --enable-rebase-merge=false
gh repo view --json mergeCommitAllowed,squashMergeAllowed,rebaseMergeAllowed # verifyExpected verification output:
{"mergeCommitAllowed":false,"rebaseMergeAllowed":false,"squashMergeAllowed":true}This greys out the "Create a merge commit" and "Rebase and merge" buttons on
PRs, leaving squash as the only option. Adjust the flags to allow other methods
(e.g. --enable-rebase-merge to add rebase back).
Auto-delete head branches on merge
gh repo edit --delete-branch-on-merge
gh repo view --json deleteBranchOnMerge # verify -> {"deleteBranchOnMerge":true}Once on, merging a PR deletes its head branch automatically (the branch is still
recoverable from the PR's "Restore branch" button for a while). Pass
--delete-branch-on-merge=false to turn it back off.
Protect the default branch with a ruleset
Every repository with CI protects its default branch with a ruleset:
no deletion, no force-push, changes through a pull request, and the
unfiltered CI jobs required to merge. A ruleset, never a classic branch
protection rule: ossf/scorecard-action's GITHUB_TOKEN can read a
ruleset but not a classic rule's details, which need an admin token, so
Scorecard's Branch-Protection check cannot grade a classic rule.
Set it once the CI has run on a first pull request, so the required checks carry the names the runs actually report. A required check that never reports blocks every pull request.
Check first, the answer decides between create and update:
gh api repos/{owner}/{repo}/rulesets --jq '.[] | {id, name, target}'The ruleset, with the repository's own checks, in a ruleset.json outside
the repository:
{
"name": "default branch",
"target": "branch",
"enforcement": "active",
"conditions": {"ref_name": {"include": ["~DEFAULT_BRANCH"], "exclude": []}},
"bypass_actors": [{"actor_id": 5, "actor_type": "RepositoryRole", "bypass_mode": "always"}],
"rules": [
{"type": "deletion"},
{"type": "non_fast_forward"},
{"type": "pull_request", "parameters": {
"required_approving_review_count": 0,
"dismiss_stale_reviews_on_push": true,
"require_code_owner_review": false,
"require_last_push_approval": false,
"required_review_thread_resolution": false
}},
{"type": "required_status_checks", "parameters": {
"strict_required_status_checks_policy": false,
"required_status_checks": [
{"context": "lint", "integration_id": 15368},
{"context": "test", "integration_id": 15368}
]
}}
]
}No branch-targeting ruleset yet; create it:
gh api -X POST repos/{owner}/{repo}/rulesets --input ruleset.jsonOne exists; update it rather than adding a second:
gh api -X PUT repos/{owner}/{repo}/rulesets/<id> --input ruleset.jsonVerify: the rules that apply to the default branch, required checks included.
gh api repos/{owner}/{repo}/rules/branches/<default-branch>Notes:
- Required checks: every job of
qualityand, when it exists,security, the workflows never filtered bypaths(github-actions-conventions). A job skipped on pull requests by anif:stays out, for the same reason as a filtered one.contextis the job's name asgh pr checks <number>prints it, one entry per matrix leg (integration (latest));integration_id15368 is GitHub Actions, so a status from anything else cannot satisfy it.coverageis never required: it reports, it does not gate (ci-conventions). - Renaming, adding or removing a job of
qualityorsecurityupdates the ruleset in the same change: once that pull request's CI has reported the new names, before it merges. A renamed or removed job otherwise blocks every pull request, its own included. - 0 approvals: a lone maintainer cannot approve their own pull request.
- The admin bypass is there for
scripts/release.sh(release-script-conventions), whose push lands the release commit straight on the default branch, which thepull_requestrule rejects. A repository without that script sets"bypass_actors": []. Scorecard's Branch-Protection check docks points for the bypass, a price accepted for a release flow that stays one command. strict_required_status_checks_policystaysfalse: requiring the branch to be up to date makes every open pull request catch up and re-run its CI after each merge.- A private repository on GitHub Free does not enforce rulesets, which need Pro, Team or Enterprise Cloud there. Say so rather than making the repository public.
Enable GitHub Pages in GitHub Actions mode
Any repo with a workflow that runs actions/deploy-pages (the docs pipeline
of github-actions-conventions) needs Pages switched on with source "GitHub
Actions" (build_type: workflow), never "Deploy from a branch" (legacy).
Without it the deploy job fails with a 404 from the Pages API, and a
legacy source would publish a gh-pages branch instead of the uploaded
artifact. Do it as soon as the workflow lands, not after its first red run.
Check first — the answer decides between create and update:
gh api repos/{owner}/{repo}/pages --jq '{build_type, html_url, cname}'A 404 means Pages is off; create it:
gh api -X POST repos/{owner}/{repo}/pages -f build_type=workflowAlready on with "build_type": "legacy"; switch it:
gh api -X PUT repos/{owner}/{repo}/pages -f build_type=workflowVerify — build_type must read workflow:
gh api repos/{owner}/{repo}/pages --jq .build_typeNotes:
gh apifills{owner}and{repo}from the current directory'sorigin.html_urlin the answer is the public URL; a Starlight site'ssite/basefollow it (seestarlight-conventions). Leavecnamealone unless the user asks for a custom domain — setting one changes every URL of the site.- Pages on a private repo needs a paid plan; the POST then fails with a 422. Say so rather than making the repo public.
Turn on a public repository's security features
Every public repository has these on: secret scanning with push
protection, Dependabot vulnerability alerts, private vulnerability
reporting, which the reporting link of its SECURITY.md
(security-policy-conventions) points at, and CodeQL code scanning. They
are free on a public repository. Turn them on as soon as a repository is
public, or when one is found off.
Check the visibility first. On a private repository secret scanning and code scanning need a paid GitHub Advanced Security licence and private vulnerability reporting does not exist; say so rather than making the repository public.
gh api repos/{owner}/{repo} --jq '{visibility, security_and_analysis}'Secret scanning and push protection:
gh api -X PATCH repos/{owner}/{repo} --input - <<'EOF'
{"security_and_analysis": {"secret_scanning": {"status": "enabled"}, "secret_scanning_push_protection": {"status": "enabled"}}}
EOFVulnerability alerts, which Renovate's vulnerabilityAlerts reads:
gh api -X PUT repos/{owner}/{repo}/vulnerability-alertsDependabot security updates off — Renovate opens the security PRs, and
both would open one for the same bump (dependency-update-conventions):
gh api -X DELETE repos/{owner}/{repo}/automated-security-fixesPrivate vulnerability reporting:
gh api -X PUT repos/{owner}/{repo}/private-vulnerability-reportingCodeQL code scanning in default setup, the repository's static analysis for
security (Scorecard's SAST check): GitHub picks the languages it supports,
the workflows included, and analyses pull requests, pushes to the default
branch and a weekly run, with no workflow file to pin or bump. It answers
202 while the first analysis starts:
gh api -X PATCH repos/{owner}/{repo}/code-scanning/default-setup -f state=configuredVerify: both status fields read enabled, the alerts call succeeds (it
answers 404 when they are off), security updates read false, private
vulnerability reporting true, and code scanning configured.
gh api repos/{owner}/{repo} --jq .security_and_analysisgh api --silent repos/{owner}/{repo}/vulnerability-alerts && echo enabledgh api repos/{owner}/{repo}/automated-security-fixes --jq .enabledgh api repos/{owner}/{repo}/private-vulnerability-reporting --jq .enabledgh api repos/{owner}/{repo}/code-scanning/default-setup --jq '{state, languages}'Notes:
- Every call is idempotent: re-running it where the feature is already on changes nothing.
- Turning one of these off is the user's decision, never the fix for a blocked push or a noisy alert: a push that push protection blocks holds a secret, and the secret is what gets fixed.
- CodeQL stays out of the ruleset's required checks: its analysis outlasts
the CI jobs. Its alerts are fixed at the source like any scanner's
(
ci-conventions), never dismissed to clear them.
Webhooks carry a secret
A repository webhook has a secret, so its receiver can check the
X-Hub-Signature-256 header and reject a forged delivery (Scorecard's
Webhooks check). List whether each hook has one; this prints a boolean,
never the value:
gh api repos/{owner}/{repo}/hooks --jq '.[] | {id, url: .config.url, secret: ((.config.secret // "") != "")}'A hook without one is the user's to fix: the receiving service must know the secret, and it is passed by reference, never written in a command line.
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.

