create-pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecreate-pr
create-pr
変更内容を分析してセキュリティチェック後に GitHub PR を作成します。
Analyzes changes and creates a GitHub PR after performing security checks.
前提条件
Prerequisites
- CLI がインストールされ、認証済みであること
gh - 現在のブランチがベースブランチからフォークされていること
- The CLI is installed and authenticated
gh - The current branch is forked from the base branch
フロー
Flow
Step 1: 変更内容を分析する
Step 1: Analyze changes
bash
git log main..HEAD --oneline
git diff main...HEAD --statベースブランチはリポジトリの規約に従う( / 等)。
maindevelopbash
git log main..HEAD --oneline
git diff main...HEAD --statFollow the repository's conventions for the base branch (e.g., / ).
maindevelopStep 2: セキュリティチェック(必須)
Step 2: Security Check (Mandatory)
Agent ツールでセキュリティ確認を行う。
確認項目:
- 認証・認可の実装漏れ
- API キー・シークレットのハードコーディング
- XSS の可能性
- 入力バリデーションの欠如
- OWASP Top 10
問題が見つかった場合はユーザーに警告し、対処後に PR 作成を再試行するよう案内する。
Perform security checks using Agent tools.
Check items:
- Missing authentication/authorization implementations
- Hardcoded API keys/secrets
- Potential XSS vulnerabilities
- Lack of input validation
- OWASP Top 10
If issues are found, warn the user and guide them to retry PR creation after resolving the issues.
Step 3: PR タイトルを生成する
Step 3: Generate PR Title
Conventional Commits 形式:
type(scope): subject例:
feat(auth): ソーシャルログイン機能を追加
fix(api): レスポンスのエラーハンドリングを修正Conventional Commits format:
type(scope): subjectExamples:
feat(auth): Add social login functionality
fix(api): Fix response error handlingStep 4: PR body を生成する
Step 4: Generate PR Body
markdown
undefinedmarkdown
undefinedSummary
Summary
- 変更内容の箇条書き
- Bullet points of changes
Test plan
Test plan
- 動作確認手順1
- 動作確認手順2
- エッジケース確認
- Operation verification step 1
- Operation verification step 2
- Edge case verification
Design
Design
Step 5: PR を作成する
Step 5: Create PR
bash
gh pr create \
--base main \
--title "type(scope): subject" \
--body "$(cat <<'EOF'
...
EOF
)"ユーザーに PR URL を返す。
bash
gh pr create \
--base main \
--title "type(scope): subject" \
--body "$(cat <<'EOF'
...
EOF
)"Return the PR URL to the user.
注意事項
Notes
- ベースブランチはリポジトリの規約に従う
- セキュリティ問題が未解決の場合は PR 作成を中止する
- Draft PR を作成する場合は フラグを追加する(ユーザーに確認)
--draft - sandbox 環境での 併用:詳細は後述の「sandbox 環境での実行」節を参照
GIT_SSL_NO_VERIFY=1
- Follow the repository's conventions for the base branch
- Abort PR creation if security issues are unresolved
- Add the flag when creating a Draft PR (confirm with the user)
--draft - Use in sandbox environments: Refer to the "Execution in Sandbox Environments" section below for details
GIT_SSL_NO_VERIFY=1
sandbox 環境での実行
Execution in Sandbox Environments
sandbox で本スキルを実行する場合、ネットワーク越しの GitHub 操作には の併用を検討してください。本スキルの主なリモート操作は / で、「リモート書き込み」判定は 要 です。コマンド分類の詳細と TLS 検証無効化の注意事項は を参照してください。
GIT_SSL_NO_VERIFY=1git pushgh pr createdocs/sandbox-tls.mdWhen executing this skill in a sandbox environment, consider using for GitHub operations over the network. The main remote operations of this skill are / , which are classified as requires remote write access. For details on command classification and precautions for disabling TLS verification, refer to .
GIT_SSL_NO_VERIFY=1git pushgh pr createdocs/sandbox-tls.md