git-workflow
Skill1 starsChanged 6 months agoMITView on GitHub
ブランチ戦略・コミット規約・PR運用を定めるGit運用スキル。新規リポジトリのルール策定時、開発フロー整備時、AIエージェント並列開発の調整時に使う。
- Reads credentials
118 other projects use a version of this.
Adopted by
Most recently taken up by
- Lukk17/agent-standardstheir own version, first seen Oct 5, 2026
- JameMy0001/antigravity-skills-hubtheir own version, first seen Oct 2, 2026
- NinjaSln-labs/agent-skillstheir own version, first seen Oct 2, 2026
- 1pedroosilva/databricks-genie-skillstheir own version, first seen Oct 2, 2026
- vospr/context-engineering-templatetheir own version, first seen Oct 1, 2026
- fusebase-dev/fusebase-flowtheir own version, first seen Oct 1, 2026
Used with
Projects with it also use squad-commands, typescript-patterns and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillsquad-commands
Categorized catalog of common Squad operations. Coordinator reads this file and presents it as an interactive menu when the user asks for available commands or help.
Also in 3 projects that use this
cohen-lielSkilltypescript-patterns
TypeScript best practices and patterns. Use when writing TypeScript code, defining types, working with generics, or converting JavaScript to TypeScript.
Also in 4 projects that use this
MicrosoftSkillcost-optimization
Optimize existing Azure resources and analyze Reservations or Savings Plans. WHEN: \"optimize Azure costs\", \"reduce cloud spending\", \"rightsize resources\", \"find idle resources\", \"orphaned disk\", \"deleted VM still charged\", \"public IP still charging\", \"reservation utilization\", \"Savings Plan coverage\", \"commitment recommendation\", \"why is pay-as-you-go still charged\". DO NOT USE FOR: cost spikes, forecasts, pricing estimates, budgets, or governance.
Also in 5 projects that use this
YepAPISkillbackground-jobs
Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.
Also in 3 projects that use this
Vimalk0703Skilldependency-management
Vet packages before adoption, audit for vulnerabilities, pin versions, and prevent dependency bloat.
Also in 3 projects that use this
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
Also in 7 projects that use this
- +1 more from microsoft
Other versions118 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 118
- JetBrains/ideavim★ 10ksame name
- Galaxy-Dawn/claude-scholar★ 5.7ksame name
- github/gh-aw★ 5.3ksame name
- microsoft/Generative-AI-for-beginners-dotnet★ 3.1ksame name
- microsoft/waza★ 1.4ksame name
- laolaoshiren/claude-code-skills-zh★ 876same name
- Mindrally/skills★ 266same name
- Azure/fleet★ 226same name
- povvo/claudikins-kernel★ 128same name
- extra-org/extra★ 113same name
108 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository42 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibilitySkill
- analytics-kpiSkill
- api-designSkill
- architecture-designSkill
- cicd-deploymentSkill
- codebase-explorationSkill
- code-reviewSkill
- database-designSkill
- debuggingSkill
- decision-makingSkill
- detailed-designSkill
- documentationSkill
- estimationSkill
- growth-launchSkill
- i18n-localizationSkill
- idea-generationSkill
- implementationSkill
- legal-complianceSkill
- llm-integrationSkill
- market-researchSkill
- microservicesSkill
- mobile-app-releaseSkill
- monetizationSkill
- monitoring-operationsSkill
- mvp-developmentSkill
- non-functional-requirementsSkill
- orchestrationSkill
- performance-optimizationSkill
- project-managementSkill
- refactoringSkill
- requirements-definitionSkill
- screen-designSkill
- securitySkill
- session-handoffSkill
- skill-authoringSkill
- skill-navigatorSkill
- solo-developmentSkill
- task-breakdownSkill
- task-executionSkill
- testingSkill
- ux-researchSkill
The file
Files
Git運用・ブランチ戦略
目的
チームとAIエージェントが同一リポジトリで安全に協調するための運用ルールを定める。 コンフリクト・意図不明コミット・壊れたmainを防ぎ、レビューコストを下げる。
使うタイミング
- 新規リポジトリのブランチ戦略・運用ルールを決めるとき
- PRが大きすぎる・コミット粒度が荒いなどチームで問題が出ているとき
- AIエージェントを複数並列で走らせるとき(ブランチ/worktree設計)
- CI/CDパイプラインと連動したリリースフローを整備するとき([[cicd-deployment]])
ブランチ戦略の選択
| 戦略 | 採用基準 | 注意 |
| GitHub Flow | Webサービス・個人開発・SaaS。デフォルト推奨 | main+短命featureブランチのみ。シンプルで十分 |
| Git Flow | 複数バージョンを同時保守するパッケージ製品 | develop/release/hotfixが必要な場合のみ採用。多くの場面で過剰 |
| Trunk-based | 高頻度デプロイ・フィーチャーフラグが整備済みの組織 | CI品質・フィーチャーフラグ運用が前提。未整備なら先にそちらを整える |
迷ったら GitHub Flow を選ぶ。Git Flowは採用コストに見合うか必ず検討する。
進め方
- ブランチ戦略を選択する — 上表の基準で1つ決め、チームに明示する
- リポジトリ保護ルールを設定する — mainへの直pushを禁止、PR必須、ステータスチェック必須
- ブランチ命名規則を決める —
feat/,fix/,chore/プレフィックス + issue番号(例:feat/123-user-auth) - コミット規約を導入する — Conventional Commitsを採用、CIでlintする
- PRテンプレートを作成する —
.github/pull_request_template.mdを配置 - マージ方式を統一する — squashを基本とし、例外ルールを明文化する
- 新規メンバー/エージェントへの周知 — CONTRIBUTING.md またはCLAUDE.mdに上記を記載する
設計の要点
コミット
- 1コミット1意図: 機能追加とリファクタリングを混ぜない
- Conventional Commits:
feat:,fix:,refactor:,docs:,test:,chore:,perf:を使う - bodyに「なぜ」を書く: 「何をしたか」はdiffを見ればわかる。判断の理由・背景を残す
- WIPコミットはマージ前に整理:
git rebase -iでまとめるか、squashマージで吸収する - メッセージ例:
fix: カート合計が0になるバグを修正+ body割引クーポン適用時にtaxの計算順が逆転していたため
ブランチ
- 短命に保つ: 目安は1〜3日でマージ。長引くほどコンフリクトリスクが増大
- mainを毎日取り込む:
git fetch && git rebase origin/mainを習慣化 - 大きい機能はフィーチャーフラグで分割: 未完成のままmainにマージし、フラグで非活性化する
- 作業領域をファイル構成で分ける: 同一ファイルへの並行修正はコンフリクトの温床
PR運用
- 400行以下を目安: 超える場合は分割を検討。[[code-review]] と連携
- ドラフトPRを早めに出す: WIP状態でも方向性のフィードバックを受ける
- 説明テンプレートを埋める: 何を・なぜ・確認方法・スクリーンショット(UI変更時)
- 1PRは1つの関心事: 機能追加とバグ修正を同一PRに混ぜない
マージ方式
| 方式 | 使いどころ |
| Squash merge | featureブランチ(デフォルト)。細かいWIPコミットをmainに持ち込まない |
| Merge commit | ブランチ履歴を保持したい場合(リリースブランチ→mainなど) |
| Rebase | 線形履歴が必要な場合。共有ブランチには使わない |
リポジトリ内で方式を統一する。混在は混乱の原因。
成果物テンプレート
# リポジトリ運用ルール
## ブランチ戦略
GitHub Flow(main + 短命featureブランチ)
## ブランチ命名
- feat/<issue番号>-<概要>
- fix/<issue番号>-<概要>
- chore/<概要>
- release/<バージョン> # リリースブランチが必要な場合のみ
## コミット規約(Conventional Commits)
形式: <type>(<scope>): <概要>
type: feat / fix / refactor / docs / test / chore / perf
- bodyに変更の理由を記載する
- WIPコミットはPRマージ前に整理する
## PRルール
- 400行以下を目安に分割する
- .github/pull_request_template.md のテンプレートを必ず埋める
- レビュアーを最低1名指定する
- CIが通過するまでマージしない
## PRテンプレート (.github/pull_request_template.md)
### 何を変えたか
### なぜ変えたか
### 確認方法
### スクリーンショット(UI変更時)
## マージ方式
- featureブランチ → main: Squash merge
- その他: Merge commit
## 保護ルール(main)
- 直pushを禁止
- PR必須(1名以上の承認)
- ステータスチェック必須(CI通過)
- force pushを禁止チェックリスト
- ブランチ戦略を選択し、チームに明示した
- mainブランチの保護ルールを設定した(直push禁止・PR必須)
- ブランチ命名規則を決めた
- Conventional Commitsを導入し、CIでlintする設定をした
- PRテンプレートを配置した(
.github/pull_request_template.md) - マージ方式をリポジトリで統一した
.gitignoreに.env・秘密情報ファイルを含めた- CONTRIBUTING.md またはCLAUDE.mdに運用ルールを記載した
アンチパターン
- 巨大PR: 1000行超のPRはレビューが形骸化する。分割必須
- 意味のないコミットメッセージ:
fix・update・wipだけでは意図がわからない - 数週間生きるfeatureブランチ: コンフリクトが大量発生し、マージに数日かかる
- mainが壊れた状態の放置: ビルド失敗・テスト失敗を放置すると全員の開発が止まる
.envファイルのコミット: 漏れた場合は履歴削除でなくキーのローテーションが正解([[security]])- 共有ブランチへのforce push: チームメンバーの作業を消す危険がある
- mainへの直push: 保護ルールで物理的に禁止する
モデル委譲ガイド
共通原則は [[orchestration]] を参照。
| 役割 | 担当 | Git運用における作業例 |
| 司令塔(メインモデル) | 意思決定・統合 | ブランチ戦略の選択、コンフリクト解決の判断、エージェント作業の統合とmainへのマージ |
| Opus相当 | 複雑な実働 | コンフリクトの複雑な解決、運用ルール文書のドラフト、既存履歴の整理(rebase設計) |
| Sonnet相当 | 通常の実働 | PRテンプレート作成、CONTRIBUTING.md作成、コミットメッセージの整形、差分レビュー補助 |
| Haiku相当 | 軽作業 | ブランチ一覧の取得、コミットログの要約、ファイル変更状況の確認 |
AIエージェント並列開発時のブランチ/worktree運用
複数エージェントが同一リポジトリで並列開発する場合、エージェントごとにgit worktreeで作業領域を分離する。
# 司令塔がエージェント用worktreeを事前に作成する
git worktree add ../agent-api feat/agent-api-layer
git worktree add ../agent-db feat/agent-db-schema
git worktree add ../agent-test feat/agent-test-suite
# エージェントはそれぞれ自分のworktreeパスのみ操作する
# 統合は司令塔がレビュー後にmainへマージする- インターフェースを固定してから並列化: APIの型・関数シグネチャを先に決め、司令塔がCLAUDE.mdに記録してから各エージェントに作業を委譲する
- 同一ファイルへの並行書き込み禁止: ファイル担当をエージェント間で重複させない
- 統合は司令塔が行う: 各エージェントのブランチを司令塔がレビュー → squash merge → 次の作業を委譲する順序を守る
関連スキル
- [[orchestration]] — 複数エージェント協調の共通原則
- [[code-review]] — PRレビューの観点と自動化
- [[security]] — 秘密情報漏洩時の対応、.gitignore設計
- [[cicd-deployment]] — タグ・リリース運用、CI設定との連携
- [[implementation]] — 実装フェーズのコミット粒度管理
- [[solo-development]] — 個人開発でのシンプルなGit運用
- [[project-management]] — ブランチとissue/マイルストーンの連携
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

