/repo-governance:apply-standard [owner/name] [--human-approvals N] [--required-check CONTEXT ... | --clear-required-checks] [--review-drafts]from Repository Governance
Plan and apply a safe default GitHub repository governance standard: linear default-branch history, pull-request-only changes, no force pushes or deletion, automatic Copilot review, resolved review threads, clean merge defaults, and optional repository-specific status checks.
Ships in Repository Governance. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Configure one GitHub repository using the declarative policy in
${CLAUDE_SKILL_DIR}/standard.json and the idempotent executor
${CLAUDE_SKILL_DIR}/apply-standard.py.
This is an administrative write. Always plan first, show the complete target and diff, and apply only after explicit user approval.
The default branch receives one active ruleset with no bypass actors:
Repository merge settings are aligned with that ruleset:
The standard requires zero human approvals by default. Requiring a PR and
resolving review threads still creates an integration boundary without
deadlocking a solo repository. Team repositories should usually override this
with --human-approvals 1 or a stricter organization policy.
On an existing Standard default-branch governance ruleset, omitted CLI options
preserve repository-specific approval count, required status checks, and draft
review preference. Removing or replacing those overrides must be explicit.
Use the first plain owner/name argument when supplied. Otherwise resolve the
repository from the current checkout:
gh repo view --json nameWithOwner --jq .nameWithOwner
Run gh auth status and stop if the authenticated account lacks repository
administration permission. Never guess a repository from directory names.
The base standard deliberately omits rules that cannot be safe across every repository.
Add --required-check "<exact context>" once per stable CI check that must pass.
Supplying one or more replaces the checks managed by this standard ruleset.
Omitting the option preserves existing checks. Use --clear-required-checks
only when the user explicitly wants to remove them.
Use only exact context names observed in the repository's existing successful checks or documented workflow contract. Never guess names: a nonexistent required check permanently blocks merging.
Prefer requiring the cheapest authoritative checks, typically:
Do not require every matrix leg merely because it exists. Require the smallest set whose success means the PR is safe to integrate.
0.--human-approvals 1.Omitting --human-approvals preserves the existing value in this standard
ruleset. Copilot reviews are comments, not approvals, and do not satisfy a
required human approval.
Use --review-drafts only when early feedback is worth the additional review
runs and noise. Use --no-review-drafts to turn it off explicitly. Omitting both
preserves the existing preference; a new ruleset defaults to reviewing open PRs
and every subsequent push, but not drafts.
Select python3 when available, otherwise python. Run without --apply:
python3 "${CLAUDE_SKILL_DIR}/apply-standard.py" \
--repo owner/name \
[--human-approvals N] \
[--required-check "context" | --clear-required-checks] \
[--review-drafts | --no-review-drafts]
The script returns:
Read the plan critically. In particular, verify:
~DEFAULT_BRANCH;If the plan is already a no-op, report that the repository conforms and stop.
Present a concise table:
| Area | Current | Desired | Action |
|---|---|---|---|
| Merge methods | ... | squash + rebase | ... |
| Default branch | ... | PR-only, linear, no delete/force | ... |
| Review | ... | threads resolved, Copilot automatic | ... |
| CI | ... | named required checks or none | ... |
| Human approval | ... | N | ... |
Then ask apply / adjust / abort. Do not execute an administrative write
before an explicit apply.
After approval, rerun the identical arguments plus both safety flags:
python3 "${CLAUDE_SKILL_DIR}/apply-standard.py" \
--repo owner/name \
--apply \
--confirm-repo owner/name \
[the same overrides used in the approved plan]
--confirm-repo must exactly equal the resolved target. The executor upserts
the named ruleset rather than creating duplicates and patches only the declared
repository settings. If ruleset application fails after merge settings were
changed, it attempts to restore the previous merge settings and reports both
failures if rollback also fails.
Run the plan command once more afterward. Success means every action reports
none. Report any API rejection exactly; do not silently weaken the policy to
make the call pass.
Do not add these without repository-specific evidence:
CODEOWNERS file and an actual
ownership model.--apply and exact repository
confirmation.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jr-jesse123/claude-tookit --plugin repo-governance