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.
npx skills add mir-am/skills-agents-ai-coding --skill gh-protect-default-branchgit clone --depth 1 https://github.com/mir-am/skills-agents-ai-codingWrote 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.
[](https://agentmods.dev/skills/mir-am/skills-agents-ai-coding/gh-protect-default-branch)<a href="https://agentmods.dev/skills/mir-am/skills-agents-ai-coding/gh-protect-default-branch"><img src="https://agentmods.dev/badge/skills/mir-am/skills-agents-ai-coding/gh-protect-default-branch/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/mir-am/skills-agents-ai-coding/gh-protect-default-branch"><img src="https://agentmods.dev/badge/skills/mir-am/skills-agents-ai-coding/gh-protect-default-branch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00021 | $0.00865 |
| Opus 5 | $0.00010 | $0.00432 |
| Sonnet 5 | $0.00004 | $0.00173 |
| Haiku 4.5 | $0.00002 | $0.00086 |
Grade A, and why
gh-protect-default-branch 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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.
What I do
- Detect the repository's default branch automatically
- Apply minimal branch protection: require a pull request before merging, block force pushes and deletions
- Verify the protection was applied correctly
- Optionally remove protection if the user asks
When to use me
Use this skill when the user wants to protect the default branch from direct pushes so that changes can only be merged through pull requests.
Prerequisites
- GitHub CLI (
gh) must be installed and authenticated - Must be inside a git repo with a GitHub remote
- The authenticated user must have admin permissions on the repository
- If
ghnot installed -> error:Error: GitHub CLI not found. Install: https://cli.github.com/ - If not authenticated -> error:
Error: Not authenticated with GitHub. Run: gh auth login - If not admin -> error:
Error: Admin permissions required to set branch protection
Apply Protection Workflow
-
Validate GitHub access
gh auth status -
Detect default branch and repo
gh repo view --json nameWithOwner,defaultBranchRef --jq '"\(.nameWithOwner) \(.defaultBranchRef.name)"'Parse the output to get
OWNER/REPOandBRANCH. -
Apply minimal branch protection
gh api -X PUT \ -H "Accept: application/vnd.github+json" \ "repos/{owner}/{repo}/branches/{branch}/protection" \ --input - <<'EOF' { "required_status_checks": null, "enforce_admins": true, "required_pull_request_reviews": { "required_approving_review_count": 0 }, "restrictions": null, "allow_force_pushes": false, "allow_deletions": false } EOFReplace
{owner}/{repo}and{branch}with the values from step 2. -
Verify protection
gh api -H "Accept: application/vnd.github+json" \ "repos/{owner}/{repo}/branches/{branch}/protection" \ --jq '{pr_required: (.required_pull_request_reviews != null), force_push_blocked: ((.allow_force_pushes.enabled // false) == false), deletions_blocked: ((.allow_deletions.enabled // false) == false)}'All three fields should be
true.
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.
- 10d ago First seen · 105 lines · 21 tokens per session scan A 9acb679b48ca
gh-protect-default-branch is a skill published in the GitHub repository mir-am/skills-agents-ai-coding (2 stars, last pushed 4mo ago), licensed MIT. It adds 21 tokens to every session and 865 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.
Other skills, from other repositories
skill-upstream-pr
Improve an open-source GitHub skill and open a friendly suggestion PR upstream: fork, run skill-auto-improver, attach asm eval before/after metrics. Don't use for local-only skills, authoring from scratch, bulk repos, or registry publish.
work
Pick up ready leaf yaks and implement them — dispatch subagents in isolated worktrees, then merge back to main.
yak-worktree-workflow
Use when starting work on a yak - sets up an isolated git worktree, reads yak context, and guides the full cycle from claiming through merge and cleanup.
swe-worktree
Create an isolated git worktree for an SWE change workspace. Use before implementation when the user wants the change isolated from the current working tree.
git
Use when user asks for git operations: branch creation, committing changes, creating pull requests.
finishing-a-development-branch
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup.