/gh-repo-setup:gh-repo-setupfrom gh-repo-setup
Audits and sets up a GitHub repository's surface with gh. Covers label taxonomy, issue forms, PR template, CODEOWNERS, SECURITY.md, CONTRIBUTING.md, and branch or tag rulesets, with a dry-run plan and an applied/skipped/failed report. Use when creating or tidying a repo, or when asked to add rulesets, templates, or labels. GitHub only, not for Forgejo, Codeberg or Gitea.
Ships in gh-repo-setup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Not for workflow content (gh-actions), Dependabot config (dependabot), security features (gh-code-security), agent instruction files (agent-instructions), or a Forgejo, Codeberg or Gitea repo.
Run git remote -v first, and name the remote the work concerns rather than assuming origin. If it is codeberg.org, a host where curl -fsS https://<host>/api/forgejo/v1/version answers, or the repo has a .forgejo/ directory or .gitea/workflows, stop and tell the user this skill is GitHub-only. No Forgejo skill covers repo setup; forgejo-cli covers labels and other fj commands. Continue only on github.com or a host gh auth status --hostname <host> knows.
Bring a repository's metadata and config files up to a baseline without touching code. Every module is idempotent: re-running fills gaps and reports drift, and never overwrites customized files.
Creating labels, rulesets, or settings changes shared state, and committing or pushing files does too. Show the plan first and get approval for each group of writes. Commit and push only when asked.
Run gh auth status and gh repo view --json nameWithOwner,defaultBranchRef,isFork,visibility. Name the acting account and the target repo to the user. If auth fails, stop and tell them to run gh auth login. Never ask for a token in chat.
Admin writes (rulesets, settings) need admin rights. Check with gh api repos/{owner}/{repo} --jq .permissions.
Audit what exists, read-only:
gh label list --limit 200
gh api repos/{owner}/{repo}/contents/.github --jq '.[].path'
gh api repos/{owner}/{repo}/rulesets --jq '.[] | {id, name, target, enforcement}'
ls CODEOWNERS .github/CODEOWNERS docs/CODEOWNERS SECURITY.md CONTRIBUTING.md 2>/dev/null
gh api expands {owner} and {repo} from the current directory's repo.
Read the repo's own conventions first (README, CONTRIBUTING, existing templates and label names). Match them over the defaults below.
Show a table of module | action (create/update/skip) | exact command | reason and wait for approval. Write out the exact gh or gh api command for each write, including its overwrite behavior (for example, gh label create --force replaces the color and description of an existing label, so list the labels it would change). Ask only what changes the plan: whether automation bots depend on specific label names, which language community files use, and who owns the code for CODEOWNERS.
Run in this order. Skip any module the repo already satisfies.
| Module | Output | Read |
|---|---|---|
| Labels | A small taxonomy upserted through the labels API | labels |
| Issue forms | .github/ISSUE_TEMPLATE/*.yml plus config.yml | community files |
| PR template | .github/PULL_REQUEST_TEMPLATE.md | community files |
| Ownership and policy | CODEOWNERS, SECURITY.md, CONTRIBUTING.md | community files |
| CI | Default workflow | Hand off to gh-actions. It owns triggers, permissions, and action refs. When .github/workflows/ exists, add it to CODEOWNERS with the CI owners (see community files) |
| Rulesets | Branch and tag protection through the REST API | rulesets. Read it before any ruleset write |
Prefer rulesets to legacy branch protection. They layer, can be switched to evaluate or disabled without deleting, and can be listed and audited through one API.
Fill every placeholder (<owner>, <repo>, contact addresses) before writing a file. An unreplaced placeholder ships a broken link.
When a file exists, diff it against the proposal and ask before replacing anything the team may have customized.
After applying, re-query each module and give module | applied/skipped/failed | note. Report failures with the API error text, not a summary. A 403 on workflow files usually means the token lacks the workflow scope, and a 404 on a ruleset write usually means missing admin rights or the wrong verb (see the rulesets reference).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub adminhead/claude-plugins --plugin gh-repo-setupOther plugins' skills for the same job