From cook-fr
Crée automatiquement des Pull Requests GitHub avec analyse des modifications, modèle et labels, via `gh` et `git`.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cook-fr:pr-createThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Crée automatiquement des Pull Requests en analysant vos modifications Git pour un flux de travail plus fluide.
Crée automatiquement des Pull Requests en analysant vos modifications Git pour un flux de travail plus fluide.
# 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"
# 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"
# 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
# Préparer vos modifications
git add .
# Committer avec un message clair
git commit -m "feat: Implement user authentication API"
# Premier push (définit l'upstream)
git push -u origin feat-user-authentication
# Pushs suivants
git push
Étape 1 : Analyser les modifications
# 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
# 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
# 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)
# 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)
// 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.md{type}-{subject}
Exemples :
- feat-user-profile
- fix-login-error
- refactor-api-client
{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 :
# 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 bonnenpx claudepluginhub wasabeef/claude-code-cookbook --plugin cook-frAutomates pull request creation by analyzing Git changes, generating descriptions from templates, and selecting labels. Invoke with 'criar PR' or 'abrir pull request'.
Automates pull request creation by analyzing Git changes, generating descriptions from templates, and auto-selecting labels. Supports draft PRs and CI-triggered readiness.
Automates PR creation by analyzing git changes, selecting labels, and generating descriptions from templates. Supports draft PRs and CI-ready workflows.