git
Git操作を支援します。コミット、ブランチ作成、PRの作成時に使用します。「/git」で明示的に呼び出すこともできます。
When & Why to Use This Skill
This Claude skill streamlines version control workflows by automating essential Git operations such as branch creation, standardized commit messaging, and pull request management. It ensures development teams adhere to consistent naming conventions and structured documentation practices, significantly reducing manual overhead and improving repository maintainability.
Use Cases
- Standardized Branching: Automatically create feature, fix, or refactor branches using the required '<type>/<short-description>' format to maintain a clean repository structure.
- Conventional Commits: Generate professional commit messages that follow specific rules (e.g., feat, fix, refactor) with Japanese descriptions, ensuring a readable and searchable project history.
- Automated PR Preparation: Simplify the transition from development to review by drafting pull requests with titles and descriptions that match commit standards and include necessary issue links.
- Workflow Enforcement: Guide developers through the 'main-to-branch' workflow, ensuring that all work is performed in isolated environments before being merged via pull requests.
| name | git |
|---|---|
| description | Git操作を支援します。コミット、ブランチ作成、PRの作成時に使用します。「/git」で明示的に呼び出すこともできます。 |
Git スキル
開発フロー
作業は必ずブランチを切って進める。
1. main から作業ブランチを作成
2. ブランチで作業・コミット
3. PR を作成
4. レビュー後、main にマージ
作業開始時
git checkout main
git pull origin main
git checkout -b <type>/<short-description>
作業中
- こまめにコミット
- 1つのコミットは1つの変更に絞る
- 作業途中でも適宜プッシュしてバックアップ
作業完了時
git push -u origin <branch-name>
# PR を作成
コミットメッセージ規則
コミットメッセージは以下の形式に従う:
<type>: <subject>
Type
feat: 新機能fix: バグ修正docs: ドキュメントのみの変更style: コードの意味に影響しない変更(空白、フォーマット等)refactor: バグ修正でも機能追加でもないコード変更test: テストの追加・修正chore: ビルドプロセスやツールの変更
Subject
- 日本語で記述
- 動詞で始める(「追加した」ではなく「追加」)
- 50文字以内を目安に
例
feat: ユーザー認証機能を追加
fix: ログイン時のエラーハンドリングを修正
refactor: API呼び出し部分を共通化
ブランチ命名規則
<type>/<short-description>
feature/- 新機能fix/- バグ修正refactor/- リファクタリング
例: feature/user-auth, fix/login-error
PR作成時の注意
- タイトルはコミットメッセージと同じ形式
- 説明には変更内容の概要を記載
- 関連するIssueがあればリンク