
setup-github
このテンプレートから作ったリポジトリの GitHub 側を gh で設定する。Actions の secrets、Actions による PR 作成の許可、PR を作れる人の制限と auto-merge、既定ブランチのルールセットを揃える。テンプレートから新しいリポジトリを作ったとき、GitHub の設定を揃え直すときに使う。
- Installs
- 82
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/masseater/skills --skill setup-github- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads setup-github automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
GitHub の設定
設定はすべて gh で行う。対象リポジトリを REPO=<owner>/<name> とする。
どの手順も、同じ値で何度実行しても結果が変わらない。
1. アプリ名を変える
apps/web/app-name.ts の APP_NAME は、テンプレートの名前のままになっている。
APP_NAME はスタック名とリソース名の接頭辞になる。
状態は Cloudflare アカウントの中でスタック名ごとに保存されるため、同じアカウントを使う別のリポジトリと名前が重なると、互いのリソースを置き換えてしまう。
リポジトリ名に合わせて変える。
2. secrets を登録する
値はユーザーに尋ねる。
gh secret set OPENROUTER_API_KEY --repo "$REPO"
gh secret set CLAUDE_CODE_OAUTH_TOKEN --repo "$REPO"
gh secret set CLOUDFLARE_ACCOUNT_ID --repo "$REPO"
gh secret set CLOUDFLARE_API_TOKEN --repo "$REPO"
| 名前 | 用途 |
|---|---|
OPENROUTER_API_KEY | verify ワークフローの oxlint-plugin-decision |
CLAUDE_CODE_OAUTH_TOKEN | verify 失敗時に Claude Code が自動修正する |
CLOUDFLARE_ACCOUNT_ID | デプロイ先と Alchemy の状態を置くアカウント |
CLOUDFLARE_API_TOKEN | 同じアカウントの API トークン |
Organization のリポジトリなら、Organization の secrets に一度登録すれば、各リポジトリでの登録は要らない。
3. Actions に PR の作成を許可する
release-please と自動修正が PR を作るためである。
gh api --method PUT "repos/$REPO/actions/permissions/workflow" \
-f default_workflow_permissions=read -F can_approve_pull_request_reviews=true
4. PR を作れる人を collaborator に限り、auto-merge を有効にする
gh api --method PATCH "repos/$REPO" -f pull_request_creation_policy=collaborators_only \
-F allow_auto_merge=true -F allow_update_branch=true
5. 既定ブランチを保護する
既定ブランチの削除と force push を禁じ、最新の既定ブランチを取り込んでいない PR のマージを拒むルールセットを置く。
取り込みの検査は、up-to-date ワークフローのチェックを必須にし、strict_required_status_checks_policy を有効にして行う。
バイパスは置かない。release-please の PR は、Claude が既定ブランチを取り込んで push し、そこで動いた up-to-date を通してからマージする。
同じ名前のルールセットがあれば置き換える。
id="$(gh api "repos/$REPO/rulesets" --jq '.[] | select(.name == "protect default branch") | .id')"
gh api --method "$([ -n "$id" ] && echo PUT || echo POST)" "repos/$REPO/rulesets${id:+/$id}" --input - <<'JSON'
{
"name": "protect default branch",
"target": "branch",
"enforcement": "active",
"conditions": { "ref_name": { "include": ["~DEFAULT_BRANCH"], "exclude": [] } },
"bypass_actors": [],
"rules": [
{ "type": "deletion" },
{ "type": "non_fast_forward" },
{
"type": "required_status_checks",
"parameters": {
"strict_required_status_checks_policy": true,
"do_not_enforce_on_create": false,
"required_status_checks": [{ "context": "up-to-date", "integration_id": 15368 }]
}
}
]
}
JSON
6. 反映を確かめる
gh api "repos/$REPO" --jq '[.pull_request_creation_policy, .allow_auto_merge]' が ["collaborators_only",true] を返すことを確かめる。
gh api "repos/$REPO/rules/branches/main" --jq '[.[].type]' に required_status_checks があることも確かめる。
FAQ
What does the setup-github skill do?
このテンプレートから作ったリポジトリの GitHub 側を gh で設定する。Actions の secrets、Actions による PR 作成の許可、PR を作れる人の制限と auto-merge、既定ブランチのルールセットを揃える。テンプレートから新しいリポジトリを作ったとき、GitHub の設定を揃え直すときに使う。
How do I install setup-github?
Run npx skills add https://github.com/masseater/skills --skill setup-github in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/setup-github/ (personal) or .claude/skills/setup-github/ (project).
Which AI agents can use setup-github?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is setup-github safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains setup-github?
It is published by masseater in masseater/skills. It has 82 recorded installs.
More from masseater/skills
measure-dont-guess
masseater/skills
仮説を白黒つける計測を実装や修正の前に決めて実行し、その結果だけで判断する。不具合の原因を調べるとき、性能や挙動を比べるとき、新しい機能を書き始めるとき、「たぶん」で判断しそうになったときに使う。
integrate
masseater/skills
ライブラリや新しい実装手段を導入するときに使う。追加するだけで終わらせず、既存コードの移行と、その手段を使わせる機械的な強制まで行う。
how-to-use-react
masseater/skills
React 19.3 のコンポーネント、ローダー、サーバー処理を書く・直す・レビューするときに読む。状態の置き場所、非同期の組み方、並行 UI の API の使いどころ、props の形を決める。
skill-authoring
masseater/skills
Agent Skills の skill、つまり SKILL.md とそのディレクトリを作る・直す・添削するときに読む。本文を skill が必要な理由と達成したい状態から導いて書き、直すときも全体を導き直す。
setup-template
masseater/skills
masseater/typescript-template から作ったリポジトリを、テンプレートに揃える。GitHub 側の設定を gh で揃え、中身の移行が完了しているかを、テンプレートの骨格が入り、効き、古い形が消えているかで判定する。新しいリポジトリを作ったとき、AI に移行を任せたあとに使う。ほかのリポジトリでも使えるが、その場合は適用する手順をユーザーに確認する。
humanity-and-humanness
masseater/skills
人間がどう読み、どう考え、何を察するかを AI が前提として持つために読む。人間が読む文章を書くとき、ユーザーの判断を仰ぐとき、ユーザーの指摘の意図を読み取るときに使う。
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.