MCPInstall

create-pr

Conventional Commits 形式で GitHub PR を作成する。OWASP Top 10 のセキュリティチェック必須で、問題があれば PR 作成を中止。Summary/Test plan/Design を含む body を生成。「PR 作って」「プルリク」「gh pr create」などで使用。別リポジトリ (upstream) への貢献は contribute-skill。

Installs
1.9K
Last 24h
+18
Trending rank
#6305
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/fandhe-ai/agent-cli-skills --skill create-pr
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads create-pr automatically when relevant.

  3. 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.

create-pr

変更内容を分析してセキュリティチェック後に GitHub PR を作成します。

前提条件

  • gh CLI がインストールされ、認証済みであること
  • 現在のブランチがベースブランチからフォークされていること

フロー

Step 1: 変更内容を分析する

git log main..HEAD --oneline
git diff main...HEAD --stat

ベースブランチはリポジトリの規約に従う(main / develop 等)。

Step 2: セキュリティチェック(必須)

Agent ツールでセキュリティ確認を行う。

確認項目:

  • 認証・認可の実装漏れ
  • API キー・シークレットのハードコーディング
  • XSS の可能性
  • 入力バリデーションの欠如
  • OWASP Top 10

問題が見つかった場合はユーザーに警告し、対処後に PR 作成を再試行するよう案内する。

Step 2.5: Closes 対象 Issue の milestone 確認

この PR で close する予定の Issue(same-repo のみ)を特定し、milestone の割当状況を確認する。

  1. 候補の特定: 作業対象の Issue 番号(会話文脈)・ブランチのコミットメッセージ中の Closes #N / Fixes #N / Resolves #N 参照から候補を挙げる
  2. close 可否の確認: 候補ごとに「この PR で当該 Issue が完了するか」を確認する (部分実装・関連のみの Issue は close 対象にしない。Step 4 の PR body には close 対象のみ Closes #N と記載し、それ以外は Refs #N 等の関連参照にとどめる)
  3. milestone 確認: close 対象と確定した Issue について、以下で割当状況を確認する。 milestone 非運用リポジトリのガード: リポジトリに milestone が 1 件も存在しない場合 (closed 含む)は milestone 非運用リポジトリとみなし、この手順 3 のみ確認・警告なしで スキップして Step 3 へ進む(milestone を使わないリポジトリの PR 作成にノイズを加えない。 手順 1〜2 の close 可否確認は milestone と無関係の安全確認のためスキップしない)
# 非運用ガード: MILESTONE_COUNT が 0 なら手順 3 をスキップして Step 3 へ進む
MILESTONE_COUNT=$(gh api "repos/{owner}/{repo}/milestones?state=all" --jq 'length')

if ! [[ "${MILESTONE_COUNT}" =~ ^[0-9]+$ ]]; then
  # gh api の失敗等で件数が数値化できない場合は fail-open せず中止して原因を確認する
  echo "milestone 件数の取得に失敗した。原因を確認してから手順 3 をやり直す" >&2
  exit 1   # fail-closed: 診断だけ出して PR 作成へ進まない
elif [ "${MILESTONE_COUNT}" -eq 0 ]; then
  echo "milestone 非運用リポジトリのためスキップして Step 3 へ進む"
else
  # close 対象 Issue の milestone 割当状況を確認する
  gh issue view <N> --json milestone --jq '.milestone.title // empty'
fi
  • milestone が既に割当済み → 次の Step へ進む
  • 未割当の場合:
    • オープン中の milestone が 1 件のみなら、その milestone を割り当ててよいかユーザーに確認し、 同意が得られたら gh issue edit <N> --milestone <title> で付与する
    • 複数件 or 0 件の場合はユーザーに確認する。どの milestone を使うか決まらない場合は milestone なしのまま Step 3 へ進めてよいが、その旨を PR body に警告として明記する (milestone を必須とする CI ゲートがあるリポジトリではそちらが最終防衛線として 機能する前提とし、本 Step は PR 作成自体をブロックしない)

この PR で close する Issue がない場合はこの Step をスキップする。

Step 3: PR タイトルを生成する

Conventional Commits 形式: type(scope): subject

例:

feat(auth): ソーシャルログイン機能を追加
fix(api): レスポンスのエラーハンドリングを修正

Step 4: PR body を生成する

## Summary

- 変更内容の箇条書き

## Test plan

- [ ] 動作確認手順1
- [ ] 動作確認手順2
- [ ] エッジケース確認

## Design

- Figma: (あれば記載)

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

Step 5: PR を作成する

gh pr create \
  --base main \
  --title "type(scope): subject" \
  --body "$(cat <<'EOF'
...
EOF
)"

ユーザーに PR URL を返す。

検証

PR 作成後に以下を確認してから完了を宣言する(対象リポジトリに .claude/rules/verification.md が存在する場合はそちらの5段階ゲートに従う。存在しない場合は次の要点に従う: コマンドを新規実行し、出力全体・終了コードを確認してから完了を宣言する)。「PR を作成したはず」等の推測語での完了主張は禁止。

# PR が作成されたことと CI ステータスを確認する
gh pr view <pr-number>
gh pr checks <pr-number>

よくある失敗

問題回避策
セキュリティ問題を検出しても PR 作成を続行するStep 2 で問題を発見したら即座に処理を中止し、ユーザーに警告して修正を依頼する
PR URL を返さずに完了するgh pr create の出力から PR URL を取得してユーザーに提示する
Conventional Commits 形式に準拠しないタイトルをつけるtype(scope): subject(72文字以内)の形式を厳守する
Closes 対象 Issue が milestone 未割当のまま PR 作成 → CI で初めて失敗するStep 2.5 で必ず確認する。milestone を決めきれない場合も PR body に警告を残す

注意事項

  • ベースブランチはリポジトリの規約に従う
  • セキュリティ問題が未解決の場合は PR 作成を中止する
  • Step 2.5 の milestone 確認は省略しない(Closes 対象がない場合は Step 2.5 全体を、milestone 非運用リポジトリでは手順 3 のみをスキップ可)
  • Draft PR を作成する場合は --draft フラグを追加する(ユーザーに確認)

sandbox 環境での実行

このスキルはネットワーク越しの GitHub 操作(git push / gh pr create)を必須とする。該当コマンドはコマンド単位で sandbox 無効にして実行する。ネットワーク遮断を解除できない環境では実行できない。

FAQ

What does the create-pr skill do?

Conventional Commits 形式で GitHub PR を作成する。OWASP Top 10 のセキュリティチェック必須で、問題があれば PR 作成を中止。Summary/Test plan/Design を含む body を生成。「PR 作って」「プルリク」「gh pr create」などで使用。別リポジトリ (upstream) への貢献は contribute-skill。

How do I install create-pr?

Run npx skills add https://github.com/fandhe-ai/agent-cli-skills --skill create-pr 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/create-pr/ (personal) or .claude/skills/create-pr/ (project).

Which AI agents can use create-pr?

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 create-pr 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 create-pr?

It is published by fandhe-ai in fandhe-ai/agent-cli-skills. It has 1,864 recorded installs.

More from fandhe-ai/agent-cli-skills

View all →

create-plan

fandhe-ai/agent-cli-skills

実装タスクの計画を /local-plans/ .md に作成する。「計画立てて」「設計して」「実装方針を考えて」「タスク分解して」で使用。 Explore Agent でコードベースを先に調査し、検証可能な粒度・並列実行可能な単位で記述する。 plan-verifier Agent で検証可能な標準フォーマット(背景・現状・設計・ファイル構成ツリー・実装ステップ・検証方法)に従う。 実装消化は implement-issue、Issue 化は create-issue-tree(未導入なら create-issue)を参照。

create-commit

fandhe-ai/agent-cli-skills

Conventional Commits 形式で git コミットを作成する。staged 差分から type/scope を推定し、breaking change やシークレット混入 (.env 等) を検出。pre-commit フックを必ず通す (--no-verify 不可)。「コミットして」「git commit」「変更を記録して」などで使用。

implement-issue

fandhe-ai/agent-cli-skills

GitHub Issue を読み込み、/local-plans/ - .md に詳細計画を作成してユーザー承認後にコードを実装する。実装後はセキュリティレビュー (OWASP Top 10) → テスト実行 → Conventional Commits でコミット。Issue 番号や URL を渡された実装依頼、「Issue N を実装して」「この Issue を着手」などで使用。

AI & Agents1.9K installs

create-issue

fandhe-ai/agent-cli-skills

GitHub Issue を親子構造 (sub-issues) で作成する。gh issue create で親・子 Issue を生成し、gh api .../subissues で親子関係を紐付ける。タイトルは Conventional Commits 形式 (feat:, fix: 等) を推奨。「Issue 作って」「タスクを分解して Issue 化」などで使用。

Backend & APIs1.9K installs

implement-review

fandhe-ai/agent-cli-skills

コード変更 (git diff) の品質・アーキテクチャ準拠・セキュリティ (OWASP Top 10) を Agent ツール委譲で読み取り専用レビューする。コミット前/PR 作成前のセルフレビュー、「変更をレビューして」「コードレビューして」などで使用。GitHub PR のレビューには implement-review-pr を使用。

implement-review-pr

fandhe-ai/agent-cli-skills

GitHub PR の CI ステータス (gh pr checks)・コード品質・セキュリティ (OWASP Top 10)・Conventional Commits 準拠をレビューする。gh pr review --approve/--request-changes/--comment でレビュー投稿も可能。「PR N をレビュー」「PR レビューして」などで使用。ローカル diff のレビューには implement-review を使用。

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

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.