managing-git-github-workflow
Git操作(add, commit, switch, push)とGitHub CLI(PR作成・編集、Issue作成、コメント取得)を実行。コミット作成、ブランチ管理、プルリクエスト作成・編集、Issue管理が必要な場合に使用。「コミットして」「PRを作成」「Issueを作成」「ブランチを切って」などのリクエストで起動。
When & Why to Use This Skill
This Claude skill automates Git and GitHub workflows, enabling seamless branch management, commit creation, and pull request handling via the GitHub CLI. It streamlines the software development lifecycle by automating version control tasks, issue tracking, and collaborative documentation, ensuring developers can manage their code repositories efficiently through natural language commands.
Use Cases
- Automated Branch & Commit Management: Quickly create feature branches and commit changes using standardized conventions (like feat, fix, refactor) to maintain a clean and professional repository history.
- Streamlined Pull Request Workflows: Generate and submit detailed Pull Requests with pre-defined templates, including titles and multi-line descriptions, directly through the GitHub CLI integration.
- Efficient Issue Tracking: Create and manage GitHub Issues or retrieve PR comments to stay updated on project requirements and team feedback without leaving the development context.
- Standardized Repository Maintenance: Execute routine Git operations such as pushing changes to remote repositories and switching branches while adhering to project-specific rules like branch protection.
| name | managing-git-github-workflow |
|---|---|
| description | Git操作(add, commit, switch, push)とGitHub CLI(PR作成・編集、Issue作成、コメント取得)を実行。コミット作成、ブランチ管理、プルリクエスト作成・編集、Issue管理が必要な場合に使用。「コミットして」「PRを作成」「Issueを作成」「ブランチを切って」などのリクエストで起動。 |
| allowed-tools | Bash, Read, Grep, Glob |
Git & GitHub ワークフロー
基本ワークフロー
- ブランチ作成
- 変更のコミット
- リモートへプッシュ
- PR作成
- レビュー対応・確認
コミット規約
日本語で簡潔に。タイプ例: feat, fix, refactor, docs, test, chore
git commit -m "feat: 新機能の概要"
詳細なテンプレートは references/commit-templates.md を参照。
ブランチ作成とコミット
# mainは保護されているため新ブランチで作業
git switch -c feature-<機能名>
git add .
git commit -m "feat: 変更内容"
# コミット後の確認
git log -1
git push -u origin feature-<機能名>
# プッシュ後の確認
git status
PR作成
HEREDOCで複数行のボディを作成:
gh pr create --title "feat: 機能追加" --body "$(cat <<'EOF'
## 概要
変更の概要
## 変更内容
- 詳細1
- 詳細2
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
詳細なPRテンプレートは references/pr-templates.md を参照。
PR編集・確認
# PR確認
gh pr view <PR番号>
gh pr view <PR番号> --comments
# ボディ編集
gh pr edit <PR番号> --body "$(cat <<'EOF'
更新内容
EOF
)"
# コメント詳細取得
gh api repos/{owner}/{repo}/pulls/<PR番号>/comments
Issue作成
gh issue create --title "タイトル" --body "$(cat <<'EOF'
## 問題の説明
詳細
## 再現手順
1. ステップ1
2. ステップ2
EOF
)"
詳細なIssueテンプレートは references/issue-templates.md を参照。
注意事項
- mainブランチでは直接作業しない
- コミットメッセージは日本語
- Co-Authored-By等の作成者情報は不要