スキル一覧に戻る

create-pull-request

pjt222
更新日 Yesterday
1 閲覧
17
2
17
GitHubで表示
メタwordaiautomation

について

このスキルは、GitHub CLIを使用してGitHubプルリクエストの作成と管理を自動化し、ブランチの準備、PRの説明、レビューワークフローを処理します。機能ブランチからの変更提案、コードレビューの依頼、完了した作業のマージを行う開発者向けに設計されています。このスキルは、作成からフィードバックを経て最終的なマージとクリーンアップに至るPRの全ライフサイクルをカバーします。

クイックインストール

Claude Code

推奨
メイン
npx skills add pjt222/agent-almanac -a claude-code
プラグインコマンド代替
/plugin add https://github.com/pjt222/agent-almanac
Git クローン代替
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/create-pull-request

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Create Pull Request

Create GitHub pull request with clear title, structured description, proper branch setup.

When Use

  • Proposing changes from feature or fix branch for review
  • Merging completed work into main branch
  • Asking for code review from collaborators
  • Documenting purpose and scope of set of changes

Inputs

  • Required: Feature branch with committed changes
  • Required: Base branch to merge into (usually main)
  • Optional: Reviewers to request
  • Optional: Labels or milestone
  • Optional: Draft status

Steps

Step 1: Ensure Branch Is Ready

Verify branch is up to date with base and all changes committed:

# Check for uncommitted changes
git status

# Fetch latest from remote
git fetch origin

# Rebase on latest main (or merge)
git rebase origin/main

Got: Branch ahead of origin/main with no uncommitted changes, no conflicts.

If fail: Rebase conflicts? Resolve them (see resolve-git-conflicts skill), then git rebase --continue. Branch diverged far? Consider git merge origin/main instead.

Step 2: Review All Changes on the Branch

Examine full diff and commit history going into PR:

# See all commits on this branch (not on main)
git log origin/main..HEAD --oneline

# See the full diff against main
git diff origin/main...HEAD

# Check if branch tracks remote and is pushed
git status -sb

Got: All commits relevant to PR. Diff shows only intended changes.

If fail: Unrelated commits present? Consider interactive rebase to clean history before creating PR.

Step 3: Push the Branch

# Push branch to remote (set upstream tracking)
git push -u origin HEAD

Got: Branch shows on GitHub remote.

If fail: Push rejected? Pull first with git pull --rebase origin <branch> and resolve conflicts.

Step 4: Write PR Title and Description

Keep title under 70 characters. Use body for details:

gh pr create --title "Add weighted mean calculation" --body "$(cat <<'EOF'
## Summary
- Implement `weighted_mean()` with NA handling and zero-weight filtering
- Add input validation for mismatched vector lengths
- Include unit tests covering edge cases

## Test plan
- [ ] `devtools::test()` passes with no failures
- [ ] Manual verification with example data
- [ ] Edge cases: empty vectors, all-NA weights, zero-length input

🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"

For draft PRs:

gh pr create --title "WIP: Add authentication" --body "..." --draft

Got: PR created on GitHub with URL returned. Description clearly tells what changed and how to test.

If fail: gh not authenticated? Run gh auth login. Wrong base branch? Specify with --base main.

Step 5: Handle Review Feedback

Respond to review comments. Push updates:

# View PR comments
gh api repos/{owner}/{repo}/pulls/{number}/comments

# View PR review status
gh pr checks

# After making changes, commit and push
git add <files>
git commit -m "$(cat <<'EOF'
fix: address review feedback on input validation

EOF
)"
git push

Got: New commits show on PR. Review comments addressed.

If fail: CI checks fail after pushing? Read check output with gh pr checks. Fix issues before asking for re-review.

Step 6: Merge and Clean Up

After approval:

# Merge the PR (squash merge keeps history clean)
gh pr merge --squash --delete-branch

# Or merge with all commits preserved
gh pr merge --merge --delete-branch

# Or rebase merge (linear history)
gh pr merge --rebase --delete-branch

After merge, update local main:

git checkout main
git pull origin main

Got: PR merged, remote branch deleted, local main updated.

If fail: Merge blocked by failing checks or missing approvals? Fix those first. Do not force-merge without clearing blockers.

Checks

  • PR title concise (under 70 chars) and descriptive
  • PR body has summary of changes and test plan
  • All commits on branch relevant to PR
  • CI checks pass
  • Branch up to date with base branch
  • Reviewers assigned (if required by repo settings)
  • No sensitive data in diff

Pitfalls

  • PR too large: Keep PRs focused on single feature or fix. Big PRs harder to review, more merge conflicts.
  • Missing test plan: Always describe how changes can be verified, even for docs PRs.
  • Stale branch: Base branch moved far ahead? Rebase before creating PR to cut merge conflicts.
  • Force-pushing during review: Dodge force-pushing to branch with open review comments. Push new commits so reviewers see incremental changes.
  • Not reading CI output: Check gh pr checks before asking for re-review. Failing CI wastes reviewers' time.
  • Forgetting to delete branch: Use --delete-branch with merge to keep remote clean.

See Also

  • commit-changes - creating commits for PR
  • manage-git-branches - branch creation and naming conventions
  • resolve-git-conflicts - handling conflicts during rebase/merge
  • create-github-release - releasing after merge

GitHub リポジトリ

pjt222/agent-almanac
パス: i18n/caveman/skills/create-pull-request
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

関連スキル

content-collections

メタ

このスキルは、Content Collections(Markdown/MDXファイルを型安全なデータコレクションに変換するTypeScriptファーストのツール)の本番環境でテストされた設定を提供します。Zodバリデーションによる型安全性を実現し、ブログ、ドキュメントサイト、コンテンツ重視のVite + Reactアプリケーション構築時にご利用ください。Viteプラグインの設定、MDXコンパイルから、デプロイ最適化、スキーマバリデーションまで、すべてを網羅しています。

スキルを見る

polymarket

メタ

このスキルは、開発者がPolymarket予測市場プラットフォームを活用したアプリケーション構築を可能にします。API統合による取引や市場データの取得に加え、WebSocketを介したリアルタイムデータストリーミングにより、ライブ取引や市場活動を監視できます。取引戦略の実装や、ライブ市場更新を処理するツールの作成にご利用ください。

スキルを見る

creating-opencode-plugins

メタ

このスキルは、開発者がコマンド、ファイル、LSP操作など25種類以上のイベントタイプにフックするOpenCodeプラグインを作成することを支援します。JavaScript/TypeScriptモジュール向けに、プラグイン構造、イベントAPI仕様、および実装パターンを提供します。カスタムイベント駆動ロジックでOpenCode AIアシスタントのライフサイクルをインターセプト、監視、または拡張する必要がある場合にご利用ください。

スキルを見る

sglang

メタ

SGLangは、高性能なLLMサービングフレームワークであり、RadixAttentionプレフィックスキャッシュを活用したJSON、正規表現、エージェントワークフロー向けの高速で構造化された生成を特長とします。特にプレフィックスが繰り返されるタスクにおいて、大幅に高速な推論を実現し、複雑な構造化出力やマルチターン対話に最適です。制約付きデコードが必要な場合や、広範なプレフィックス共有を伴うアプリケーションを構築する場合は、vLLMなどの代替案ではなくSGLangを選択してください。

スキルを見る