setup-repo

setup-repo is a skill for Claude Code, Codex from lexfrei/ccc. It costs 22 tokens per session (898 once invoked), scanned A, original, BSD-3-Clause.

A repository setup command that configures GitHub merge settings and protects a selected branch. It can find required CI checks—automated build or test checks—from workflow files.

In plain words
What is it for?
Use it to configure squash-only merges, delete merged branches automatically, and require selected or automatically detected CI checks.
Why use it?
It avoids manually searching GitHub settings and listing the checks that must pass before merging.

Skill for Claude CodeCodex

Part of the git-tools plugin — 2 skills shipped together

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 skills/lexfrei/ccc/setup-repo
Any agent
npx skills add lexfrei/ccc --skill setup-repo
Clone the repo
git clone --depth 1 https://github.com/lexfrei/ccc

Made for: Claude Code, Codex.

Or install git-tools, the plugin that ships this one along with the rest of its 2 skills.

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-repo

README.md
[![agentmods](https://agentmods.dev/badge/skills/lexfrei/ccc/setup-repo.svg)](https://agentmods.dev/skills/lexfrei/ccc/setup-repo)
Your own site
<a href="https://agentmods.dev/skills/lexfrei/ccc/setup-repo"><img src="https://agentmods.dev/badge/skills/lexfrei/ccc/setup-repo.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 898 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 $0.00022 $0.00898
Opus 5 $0.00011 $0.00449
Sonnet 5 $0.00004 $0.00180
Haiku 4.5 $0.00002 $0.00090

Measured 5d ago against content hash 11dc34700be2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

setup-repo 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 5d 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.

skills/git-tools/skills/setup-repo/SKILL.md · 111 lines

How it starts

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

Arguments

Parse $ARGUMENTS for:

  • Positional argument: default branch name override (e.g. main, master)
  • --checks <name1,name2,...>: explicitly specify required status checks (skip auto-detection)

Examples:

  • /setup-repo → auto-detect everything
  • /setup-repo main → protect the main branch
  • /setup-repo --checks "Lint,Test,Notify PR" → explicit checks, skip auto-detection

Step 1: Identify repo and default branch

Run:

gh repo view --json nameWithOwner,defaultBranchRef --jq '{repo: .nameWithOwner, branch: .defaultBranchRef.name}'
  • Extract REPO (e.g. lexfrei/kuberture) and BRANCH (e.g. master)
  • If a positional argument was provided, use it as BRANCH instead

Report to the user: "Configuring {REPO}, protecting branch {BRANCH}"

Step 2: Configure repo merge settings

Run:

gh api --method PATCH repos/{REPO} \
  --field allow_squash_merge=true \
  --field allow_merge_commit=false \
  --field allow_rebase_merge=false \
  --field delete_branch_on_merge=true

Report: "Repo settings: squash-only merges, auto-delete branches"

Step 3: Detect required status checks

If --checks was provided: parse the comma-separated list and skip to Step 4.

Otherwise, auto-detect from workflow files:

  1. Find all workflow files: .github/workflows/*.yml and .github/workflows/*.yaml

  2. For each workflow file, read it and check if it has a pull_request trigger in the on: section. Skip workflows that only trigger on push, release, schedule, etc.

  3. For each PR-triggered workflow, analyze the jobs: section:

    • Build a map of job_key → { name: <display name>, needs: [<dependencies>] }
    • If a job has no name: field, use the job key as the display name
    • Collect all job keys that appear in ANY other job's needs: list — these are "depended-upon" jobs
    • "Terminal jobs" are jobs whose key does NOT appear in any other job's needs: list
    • The required check names are the name: fields of the terminal jobs

Read the full file on GitHub · 111 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. 5d ago First seen · 111 lines · 22 tokens per session scan A 11dc34700be2

Subscribe to this mod's changes

setup-repo is a skill published in the GitHub repository lexfrei/ccc (9 stars, last pushed 2d ago), licensed BSD-3-Clause. It adds 22 tokens to every session and 898 once invoked, about $0.0001 per session on Opus 5. 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 skills, from other repositories

ci-security-scanning-with-strix

Add security scanning to CI/CD with Strix — GitHub Actions, GitLab CI, or any pipeline — so every pull request gets a diff-scoped AI pentest that blocks vulnerable code before it merges, with results as PR comments and SARIF uploaded to code scanning. Covers both the self-hosted open-source CLI (runs in your runner)…

usestrix/strix · 140 tokens

import-prom-rule

Bulk import of a Prometheus alert rule YAML file (create a whole set of rules at once). Dedicated to handling a remote URL or local YAML text, automatically parsing the three formats groups / a plain rules array / a single rule. ⚠️ Do not use this skill for single-rule creation — when the user describes a single alert…

ccfos/nightingale · 125 tokens

chinese-git-workflow

国内 Git 平台配置参考——Gitee、Coding.net、极狐 GitLab、CNB 的 SSH/HTTPS/凭据/CI 接入差异与镜像同步配置。仅在用户显式 /chinese-git-workflow 时调用,不要根据上下文自动触发。.

jnMetaCode/superpowers-zh · 69 tokens

azsdk-common-pipeline-analysis

Analyze Azure SDK CI/CD pipeline failures into a structured diagnosis, and define the required output format. Load this skill before calling azsdkanalyzepipeline, which returns raw failure data that this skill interprets and formats. USE FOR: "pipeline failed", "build failure", "CI check failing", "tests failing in…

Azure/azure-sdk-for-net · 192 tokens

configure-env-variables

Configures environment variables for Power Pages site settings to support ALM across environments. Creates environment variable definitions in Dataverse, guides the user through linking site settings to those variables via the Power Pages Management app, adds the variables to the solution, and generates a…

microsoft/power-platform-skills · 119 tokens

release-openclaw-plugin-testing

Plan and run pre-release OpenClaw plugin validation across bundled plugins, package artifacts, lifecycle commands, doctor/fix, config round-trip, gateway startup, SDK compatibility, Docker E2E, Package Acceptance, and Testbox proof.

openclaw/openclaw · 54 tokens