setup-repo
Configure GitHub repo settings and branch protection with auto-detected required CI checks from workflow files
Skill by lexfrei
Chalk Labs
Need help deploying setup-repo?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/lexfrei-setup-repo
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: devops, productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/setup-repo
What's inside
- Skill name
setup-repo- Description
- Configure GitHub repo settings and branch protection with auto-detected required CI checks from workflow files
- License
- BSD-3-Clause
- Instructions
- 105 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
## 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:
```bash
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:
```bash
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
4. Present the detected checks to the user using AskUserQuestion:
- Show the list of detected terminal jobs and their display names
- Ask: "These terminal CI jobs were detected. Use them as required status checks?"
- Options: "Yes, apply these" / "Let me customize"
- If the user wants to customize, ask them to provide the check names
## Step 4: Set branch protection
Run:
```bash
gh api --method PUT repos/{REPO}/branches/{BRANCH}/protection \
--input - <<'PAYLOAD'
{
"required_status_checks": {
"strict": true,
"contexts": [<CHECKS_JSON_ARRAY>]
},
"enforce_admins": true,
"required_pull_request_reviews": null,
"restrictions": null
}
PAYLOAD
```
Where `<CHECKS_JSON_ARRAY>` is the JSON array of check name strings, e.g. `["Notify PR", "E2E Tests"]`.
## Step 5: Summary
Print a summary:
```
Repository: {REPO}
Protected branch: {BRANCH}
Merge settings:
- Squash merge: enabled
- Merge commit: disabled
- Rebase merge: disabled
- Auto-delete branches: enabled
Branch protection:
- Required checks: {comma-separated list}
- Strict status checks: enabled (branch must be up-to-date)
- Enforce for admins: enabled
```From lexfrei/ccc, BSD-3-Clause.
More from lexfrei/ccc
- 0.637score
infostyle
lexfrei
Edit Russian prose into информационный стиль (Ilyahov/Sarycheva): strip meaningless words, unfold abstractions into facts and examples, rebuild sentences…
SkillAFreshness: A★ 11Claude Code +9 - 0.637score
taguchi
lexfrei
Plan a minimal set of debugging or testing runs with a Taguchi orthogonal array instead of changing one factor at a time.
SkillAFreshness: A★ 11Claude Code +9 - 0.637score
pairwise
lexfrei
Generate a minimal pairwise covering array for factors with arbitrary mixed level counts, using the bundled deterministic generator.
SkillAFreshness: A★ 11Claude Code +9 - 0.637score
pore-analysis
lexfrei
Measure porosity, pore size/shape, lattice period and ordering (psi6, Voronoi coordination, radial g(r) and orientational correlation length) from a top-view…
SkillAFreshness: A★ 11Claude Code +9 - 0.632score
lore
lexfrei
Read, search, and monitor Linux kernel mailing-list threads on lore.kernel.org.
SkillAFreshness: A★ 11Claude Code +9 - 0.632score
brew-cleanup
lexfrei
Reclaim Homebrew disk by removing old formula/cask versions, pruning the download cache, and uninstalling orphaned dependencies (brew autoremove).
SkillAFreshness: A★ 11Claude Code +9 - 0.632score
address-pr-comments
lexfrei
End-to-end closeout of unresolved review feedback across one or more GitHub PRs.
SkillAFreshness: A★ 11Claude Code +9 - 0.632score
go-cache
lexfrei
Reclaim Go disk by clearing the build, test, fuzz, and module caches.
SkillAFreshness: A★ 11Claude Code +9 - 0.632score
stale-forks
lexfrei
Find personal forks that no longer carry value — their unique commits are already merged upstream, or they hold no unique commits at all — and remove the…
SkillAFreshness: A★ 11Claude Code +9 - 0.632score
worktree-sweep
lexfrei
Find and remove stale git worktrees across one or many repositories.
SkillAFreshness: A★ 11Claude Code +9 - 0.632score
docker-prune
lexfrei
Reclaim Docker disk by pruning unused images, containers, networks, build cache, optionally volumes, and the build cache of non-default buildx builders; on…
SkillAFreshness: A★ 11Claude Code +9 - 0.632score
cleanup-all
lexfrei
Run the full local cleanup pipeline — stale git worktrees, dead personal forks, Docker prune, Go caches, and Homebrew — in one pass, each stage report →…
SkillAFreshness: A★ 11Claude Code +9
Signals
- Stars
- 11
- Forks
- 3
- Open issues
- 2
- Last commit (this folder)
- Mar 12, 2026 (7 months ago)
- Last release
- Oct 4, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- BSD-3-Clause
- Repository
- github.com/lexfrei/ccc
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from lexfrei
- 0.637score
infostyle
lexfrei
Edit Russian prose into информационный стиль (Ilyahov/Sarycheva): strip meaningless words, unfold abstractions into facts and examples, rebuild sentences…
SkillAFreshness: A★ 11Claude Code +9 - 0.637score
pore-analysis
lexfrei
Measure porosity, pore size/shape, lattice period and ordering (psi6, Voronoi coordination, radial g(r) and orientational correlation length) from a top-view…
SkillAFreshness: A★ 11Claude Code +9 - 0.637score
pairwise
lexfrei
Generate a minimal pairwise covering array for factors with arbitrary mixed level counts, using the bundled deterministic generator.
SkillAFreshness: A★ 11Claude Code +9 - 0.637score
taguchi
lexfrei
Plan a minimal set of debugging or testing runs with a Taguchi orthogonal array instead of changing one factor at a time.
SkillAFreshness: A★ 11Claude Code +9 - 0.632score
cleanup-all
lexfrei
Run the full local cleanup pipeline — stale git worktrees, dead personal forks, Docker prune, Go caches, and Homebrew — in one pass, each stage report →…
SkillAFreshness: A★ 11Claude Code +9 - 0.632score
docker-prune
lexfrei
Reclaim Docker disk by pruning unused images, containers, networks, build cache, optionally volumes, and the build cache of non-default buildx builders; on…
SkillAFreshness: A★ 11Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get setup-repo running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
setup-repo skill. Agent Mart. https://agentmart.dev/skills/lexfrei-setup-repo (last updated 2026-10-24)