mrskiro/dotfiles/setting-up-repo

Claude Code and agent skill by mrskiro/dotfiles

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

"setup the repo" "configure repo settings" "リポジトリの設定" "squash mergeにして" "branch protection" — Apply standard GitHub repository settings via gh API. Use when creating a new repository, after "gh repo create", when reviewing repository configuration, or when the user mentions branch protection, SHA pinning, or wants to align a repo with their standard settings.

Install

npx vskill@latest install mrskiro/dotfiles/setting-up-repo

SKILL.md

The same SKILL.md was published earlier as mrskiro/dotfiles/setting-up-repo.

Apply a consistent set of GitHub repository settings via gh api. The values below are the owner's standard, derived from their existing repositories.

Workflow

1. Identify the target repository
  • If an argument is provided, use it as the repo (e.g., owner/repo)
  • Otherwise, detect from the current git remote: git remote get-url origin
  • Confirm the repo with the user before making changes
2. Fetch current settings

Run and display the current state so the user can see what will change:

gh api repos/{owner}/{repo} --jq '{
has_wiki,
has_projects,
has_discussions,
allow_squash_merge,
allow_merge_commit,
allow_rebase_merge,
delete_branch_on_merge,
squash_merge_commit_title,
squash_merge_commit_message,
visibility
}'

Also fetch Actions permissions:

gh api repos/{owner}/{repo}/actions/permissions
3. Apply repository settings
gh api repos/{owner}/{repo} -X PATCH \
-F has_wiki=false \
-F has_projects=false \
-F has_discussions=false \
-F allow_squash_merge=true \
-F allow_merge_commit=false \
-F allow_rebase_merge=false \
-F delete_branch_on_merge=true \
-f squash_merge_commit_title=COMMIT_OR_PR_TITLE \
-f squash_merge_commit_message=COMMIT_MESSAGES
4. Enable SHA pinning for Actions
gh api repos/{owner}/{repo}/actions/permissions -X PUT \
-F enabled=true \
-f allowed_actions=all \
-F sha_pinning_required=true

This forces all GitHub Actions to use full-length commit SHA references instead of tags.

5. Branch protection (public repos only)

Check if the repo is public. If public, apply branch protection to the default branch:

gh api repos/{owner}/{repo}/branches/main/protection -X PUT \
--input - <<EOF
{
"required_status_checks": null,
"enforce_admins": true,
"required_pull_request_reviews": null,
"restrictions": null,
"allow_force_pushes": false,
"allow_deletions": false,
"required_linear_history": true
}
EOF

If private, branch protection API requires GitHub Pro. Instead:

  1. Create a Claude Code hook to block direct pushes to main. Write .claude/hooks/block-main-push.sh:
bash
#!/usr/bin/env bash
set -euo pipefail
INPUT=$(cat)
CMD=$(printf '%s' "$INPUT" | jq -r '.tool_input.command // empty' 2>/dev/null)
case "$CMD" in
*git\ push*) ;;
*) exit 0 ;;
esac
BRANCH=$(git branch --show-current 2>/dev/null)
case "$BRANCH" in
main|master)
jq -n '{
decision: "block",
reason: "Direct push to main is not allowed. Create a branch and open a PR."
}'
;;
esac

Register it in .claude/settings.json:

json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": ".claude/hooks/block-main-push.sh"
}
]
}
]
}
}
  1. Guide the user to optionally create a ruleset in GitHub UI:

https://github.com/{owner}/{repo}/settings/rules

6. Report

Show a before/after summary of what changed. Only report settings that actually changed — skip ones that were already correct.

Format:

## Repo Setup: {owner}/{repo}
| Setting | Before | After |
|---------|--------|-------|
| ... | ... | ... |
Applied N changes. M settings were already correct.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mrskiro/dotfiles/setting-up-repo/badge)](https://verified-skill.com/skills/mrskiro/dotfiles/setting-up-repo)

Something wrong with this skill or its page? Tell us.