Créer une pull request

VérifiéSûr

Crée une pull request sur GitHub pour la branche courante en utilisant l'interface en ligne de commande `gh`. Idéal après avoir commité des modifications et avant de soumettre une PR, il exécute des vérifications préalables (commits, push) et formate automatiquement le titre et le corps selon des conventions.

Spar Skills Guide Bot
DeveloppementIntermédiaire
9002/06/2026
Claude CodeCursorWindsurfCopilotCodex
#pr#github-cli#pull-request#git-workflow#code-review

Recommandé pour

Notre avis

Crée une pull request à partir de la branche courante en utilisant GitHub CLI, avec un format structuré et des vérifications préalables.

Points forts

  • Automatise la création de PR avec GitHub CLI et un format standardisé.
  • Inclut des vérifications préalables (commits, push) pour éviter les erreurs.
  • Génère un titre concis et un corps structuré avec résumé et plan de test.

Limites

  • Nécessite que GitHub CLI soit installé et authentifié.
  • Ne gère que les PRs vers la branche 'main' par défaut.
  • Ne permet pas d'ajouter des reviewers, labels ou autres options avancées.
Quand l'utiliser

Utilisez cette compétence après avoir commité des modifications sur une branche et que vous souhaitez ouvrir une pull request avec un format propre.

Quand l'éviter

Évitez de l'utiliser si vous avez besoin d'une configuration complexe de PR (reviewers, milestones) ou si vous n'utilisez pas GitHub.

Analyse de sécurité

Sûr
Score qualité90/100

The skill runs standard git and gh commands for creating a pull request. It does not execute destructive actions, expose secrets, or use obfuscated payloads. Pre-flight checks ensure changes are committed and pushed, making it a safe automation.

Aucun point d'attention détecté

Exemples

Create a PR for current branch
Create a pull request for my current branch with a summary of changes and a test plan.
Open PR with specific title
Open a pull request titled 'Fix login error on mobile' and include a test plan that checks mobile login flow.
Create PR after committing
I've committed my changes. Please create a PR with a clear summary and test plan.

name: pr description: Create a pull request for the current branch using GitHub CLI. Use after committing changes when ready to open a PR. allowed-tools: Bash

Create Pull Request

Create a pull request for the current branch against main using the GitHub CLI.

Instructions

  1. Run git status to check for uncommitted changes (warn if any exist)
  2. Check if the branch has an upstream and is pushed
  3. Run git log main..HEAD --oneline to see all commits in this branch
  4. Run git diff main...HEAD --stat to understand the full scope of changes
  5. Create a PR with gh pr create

PR Format

Use a HEREDOC for the body to ensure proper formatting:

gh pr create --title "<concise title>" --body "$(cat <<'EOF'
## Summary
<1-3 bullet points describing what this PR does>

## Test plan
- [ ] <how to verify this works>
EOF
)"

Title Guidelines

  • Keep under 72 characters
  • Use imperative mood ("Add feature" not "Added feature")
  • Be specific about what changed

Body Guidelines

  • Summary: 1-3 bullet points explaining what and why
  • Test plan: Checklist of verification steps

Pre-flight Checks

Before creating the PR:

  1. Ensure all changes are committed
  2. Ensure branch is pushed to remote
  3. If not pushed, run git push -u origin HEAD first

Example

gh pr create --title "Fix cron machine image updates in CI/CD" --body "$(cat <<'EOF'
## Summary
- Fix CI/CD to explicitly pass --image when updating cron machines
- Cron machines created via `flyctl machine run` don't auto-update with app releases
- Fetches image from deployed app machines and passes it to machine update

## Test plan
- [ ] Deploy to staging and verify cron machine gets updated
- [ ] Check cron logs after next scheduled run
EOF
)"

After Creation

Return the PR URL so the user can review it.

Skills similaires