setup-branch-protection

setup-branch-protection is a command for Claude Code from vyuh-labs/dxkit. It costs 0 tokens per session (1,384 once invoked), scanned A, original, MIT.

A command-line setup for GitHub branch protection, which controls when pull requests may be merged.

In plain words
What is it for?
Use it to protect the default branch or a named branch, require the guardrail check, and optionally require a set number of pull-request reviews.
Why use it?
It prevents a safety check from being merely informational by making the dxkit-guardrails check required before merging.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/vyuh-labs/dxkit/setup-branch-protection
Clone the repo
git clone --depth 1 https://github.com/vyuh-labs/dxkit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for setup-branch-protection

README.md
[![agentmods](https://agentmods.dev/badge/commands/vyuh-labs/dxkit/setup-branch-protection.svg)](https://agentmods.dev/commands/vyuh-labs/dxkit/setup-branch-protection)
Your own site
<a href="https://agentmods.dev/commands/vyuh-labs/dxkit/setup-branch-protection"><img src="https://agentmods.dev/badge/commands/vyuh-labs/dxkit/setup-branch-protection.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,384 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01384
Opus 5 $0.00000 $0.00692
Sonnet 5 $0.00000 $0.00277
Haiku 4.5 $0.00000 $0.00138

Measured 6d ago against content hash 991a9aecfaf7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

setup-branch-protection scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/setup-branch-protection.md · 123 lines

How it starts

The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.

vyuh-dxkit setup-branch-protection

Configure GitHub branch protection on the repo's default branch with dxkit-guardrails listed as a required status check. Without this step, the dxkit-guardrails workflow installed by init --with-ci only runs informationally — PRs can merge even if the guardrail fails. With it, merges are blocked on guardrail failures.

Why an automation CLI

The dxkit safety story is "local hooks for fast feedback, CI workflow as unbypassable enforcement." The CI layer only enforces when configured as a required status check via branch protection.

Manually configuring branch protection is a UI dance (Settings → Branches → Add rule → Require status checks → check dxkit-guardrails). Many admins skip this — and silently lose the entire safety guarantee.

This CLI automates the step in one command.

Usage

# Default: protect the repo's default branch, add dxkit-guardrails as
# a required check, don't change review-count policy
vyuh-dxkit setup-branch-protection

# Specify a branch other than the default
vyuh-dxkit setup-branch-protection --branch develop

# Also require N PR reviews before merge
vyuh-dxkit setup-branch-protection --require-reviews 1

# Force replace existing required-checks list with just dxkit-guardrails
vyuh-dxkit setup-branch-protection --force

Flags

Flag Effect
--branch <name> Branch to protect. Default: the repo's default branch (resolved via gh repo view --json defaultBranchRef).
--require-reviews N Number of required PR reviews before merge. Default: 0 (don't force a policy — preserves whatever the customer already had).
--force Replace the entire required-checks list with just dxkit-guardrails. Default: merge — preserve any other required checks the customer has configured.

Read the full file on GitHub · 123 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 123 lines · 0 tokens per session scan A 991a9aecfaf7

Subscribe to this mod's changes

setup-branch-protection is a command published in the GitHub repository vyuh-labs/dxkit (10 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,384 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other commands, from other repositories

ship

Persona: You are the Ship Commander -- the last line of defense before code reaches production. Nothing ships without your approval. Reflection Protocol: See agents/reflection-protocol.md for reflection requirements.

samibs/skillfoundry · 0 tokens

devops

You are the DevOps Specialist -- the single authority on version control, CI/CD pipelines, platform operations (GitHub, Azure DevOps, GitLab), infrastructure, deployment, backup, and cleanup. If it touches git, pipelines, or production infrastructure, it's yours.

samibs/skillfoundry · 0 tokens

sm-sail

Command "sm-sail" from ScienceIsNeato/slop-mop, covering /sm-sail — drive a pr to green, autonomously, the loop, when sail parks on review threads, when to stop before "pr ready" — only two reasons and expect convergence, not one pass.

ScienceIsNeato/slop-mop · 0 tokens

setup

Initialize a new project with SDLC-compliant structure. Creates required files, configures build system, sets up CI/CD, and establishes quality tooling.

zircote-plugins/sdlc-quality · 32 tokens

sm-buff

You usually don't run buff directly — run sm sail. sm sail drives the whole PR to green and calls buff watch / triage for you, stopping only when it needs you to act (see /sm-sail). Reach for sm buff here only for surgical work: inspecting a specific failure, or resolving a single review thread when sail has parked on…

ScienceIsNeato/slop-mop · 0 tokens

testarch-ci

Scaffold CI/CD quality pipeline with test execution. Use when the user says ""lets setup CI pipeline"" or ""I want to create quality gates"".

Alberto-Codes/docvet · 34 tokens