Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Créer automatiquement une PR. Se déclenche avec « créer une PR », « ouvrir une pull request ».
.claude/skills/wasabeef-cre-er-automatiquement-une-pr/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 352% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 116% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 330% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 58% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 49% | 0% |
Crée automatiquement des Pull Requests en analysant vos modifications Git pour un flux de travail plus fluide.
bash# Créer automatiquement une PR à partir de vos modifications git add . && git commit -m "feat: Implement user authentication" "Create a Draft PR with the right description and labels" # Conserver votre modèle existant cp .github/PULL_REQUEST_TEMPLATE.md pr_body.md "Fill in the blanks but keep the template structure intact" # Marquer comme prêt une fois terminé gh pr ready "Switch to Ready for Review after checking quality"
bash# 1. Créer une branche et committer git checkout main && git pull git checkout -b feat-user-profile git add . && git commit -m "feat: Implement user profile feature" git push -u origin feat-user-profile # 2. Créer la PR "Please create a PR: 1. Check what changed with git diff --cached 2. Use the PR template from .github/PULL_REQUEST_TEMPLATE.md 3. Pick up to 3 labels that match the changes 4. Create it as a Draft (keep HTML comments)" # 3. La marquer comme prête après passage de la CI "Once CI is green, mark the PR as Ready for Review"
bash# Nomenclature des branches : {type}-{subject} git checkout main git pull git checkout -b feat-user-authentication # Confirmer que vous êtes sur la bonne branche git branch --show-current
bash# Préparer vos modifications git add . # Committer avec un message clair git commit -m "feat: Implement user authentication API"
bash# Premier push (définit l'upstream) git push -u origin feat-user-authentication # Pushs suivants git push
Étape 1 : Analyser les modifications
bash# Voir quels fichiers ont changé git diff --cached --name-only # Examiner les modifications réelles (premières 1000 lignes) git diff --cached | head -1000
Étape 2 : Générer automatiquement la description
bash# Priorité des modèles : # 1. Conserver la description PR existante telle quelle # 2. Utiliser .github/PULL_REQUEST_TEMPLATE.md # 3. Se rabattre sur le modèle par défaut cp .github/PULL_REQUEST_TEMPLATE.md pr_body.md # Remplir seulement les sections vides - ne pas toucher aux commentaires HTML ou séparateurs
Étape 3 : Sélectionner automatiquement les labels
bash# Obtenir les labels disponibles (non interactif) "Retrieve available labels from .github/labels.yml or GitHub repository and automatically select appropriate labels based on changes" # Sélection automatique par correspondance de motifs (max 3) # - Documentation : *.md, docs/ → documentation|docs # - Tests : test, spec → test|testing # - Corrections de bugs : fix|bug → bug|fix # - Nouvelles fonctionnalités : feat|feature → feature|enhancement
Étape 4 : Créer la PR via l'API GitHub (Préserver les commentaires HTML)
bash# Créer la PR "Create a Draft PR with the following information: - Title: Auto-generated from commit message - Description: Properly filled using .github/PULL_REQUEST_TEMPLATE.md - Labels: Auto-selected from changes (max 3) - Base branch: main - Preserve all HTML comments"
Méthode B : GitHub MCP (Solution de secours)
javascript// Créer une PR en préservant les commentaires HTML mcp__github__create_pull_request({ owner: "organization", repo: "repository", base: "main", head: "feat-user-authentication", title: "feat: Implement user authentication", body: prBodyContent, // Contenu complet incluant les commentaires HTML draft: true, maintainer_can_modify: true, });
*.md, README, docs/ → documentation|docs|doctest, spec → test|testing.github/, *.yml, Dockerfile → ci|build|infra|opspackage.json, pubspec.yaml → dependencies|depsfix|bug|error|crash|repair → bug|fixfeat|feature|add|implement|new-feature|implementation → feature|enhancement|featrefactor|clean|restructure → refactor|cleanup|cleanperformance|perf|optimize → performance|perfsecurity|secure → security.github/PULL_REQUEST_TEMPLATE.mdtext{type}-{subject} Exemples : - feat-user-profile - fix-login-error - refactor-api-client
text{type}: {description} Exemples : - feat: Implement user authentication API - fix: Correct login error - docs: Update README
.github/PULL_REQUEST_TEMPLATE.md<!-- Copilot review rule --><!-- ... --> restent tels quels--- restent en placeAttention : GitHub CLI (gh pr edit) échappe les commentaires HTML, et le traitement du shell peut créer des problèmes avec des chaînes comme EOF < /dev/null.
Comment corriger ceci :
bash# Committer vos corrections git add . git commit -m "fix: Address review feedback" git push
gh pr edit échappe les commentaires HTML et peut casser les choses--field de l'API GitHub pour une gestion appropriée.github/labels.ymlgh pr checks pour voir le statutgh pr ready quand la qualité semble bonneOther measured skills in the registry, with their headline benchmark lift.