setup-github-repo
setup-github-repo reads the repository’s current GitHub state and applies only what is missing, so a second run on a
configured repo changes nothing.
When to use
Section titled “When to use”- “set up this new GitHub repo”
- “add branch protection” or “turn on Dependabot”
- “add a merge queue” or “stop agent merges from breaking main”
- “scaffold CI workflows for this repo”
Invoke
Section titled “Invoke”Run /setup-github-repo, or ask in plain words. It takes no arguments and works on the repo in the current directory.
What it changes
Section titled “What it changes”- Repository settings: delete branches on merge, allow auto-merge, squash and rebase merges, update PR branch; merge commits off.
- Dependabot security updates, if off.
- A
default-branch-protectionruleset when no branch ruleset exists. It blocks deleting and force-pushing the default branch, with Administrators able to bypass. It requires theall-checksstatus check when it also writespull-request.yml. - A merge backstop if the branch has none: a
merge-backstopruleset with no bypass actors, as a merge queue where GitHub offers one (public org repos, private repos on GitHub Enterprise Cloud), otherwise require up to date. It reports an existing queue, up-to-date rule, or third-party queue such as Mergify and adds nothing. - Workflow files under
.github/workflows/, never overwritten and not committed:pull-request.yml,release.yml,dependabot-automerge.yml(patch and minor only), andcodeql.yml. The CI steps are markedTODO. - Optional: wiki, projects, or discussions off; secret scanning and push protection on.
The state snapshot goes to the OS temp directory. It deletes a leftover .github/setup-state.json from older versions.
Asks before acting
Section titled “Asks before acting”It summarizes pending changes and asks you to confirm, asks before the backstop and each workflow file, and applies each optional setting only on a yes. GitHub Pages is left to the GitHub UI.
Hands off to
Section titled “Hands off to”init-buddy when gh is missing or logged out and that skill is installed.
Requirements
Section titled “Requirements”gh, logged in, and a git remote.detect-state.mjsandscaffold-workflows.mjs. They fall back tonpx -y repobuddy@^1.15.0 detect-stateandscaffold-workflows(needs network). See Skill scripts.- A required status check appears in GitHub only after CI has run once.
Example
Section titled “Example”/setup-github-repo add a merge queue and scaffold CIMore detail: skill README.