with one click
pr
Create pull requests
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Create pull requests
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Create formatted branches
Generate deployment summary
Create conventional commits
Contextual linting
Pre-commit security validation
| description | Create pull requests |
| name | pr |
| version | 1.0.0 |
Crée une Pull Request avec titre EN (Conventional Commits) et corps FR (template).
/pr
# Vérifier la branche actuelle
CURRENT_BRANCH=$(git branch --show-current)
# Vérifier si on est sur staging/main (interdit)
if [[ "$CURRENT_BRANCH" == "staging" || "$CURRENT_BRANCH" == "main" ]]; then
echo "â ERREUR: Impossible de crĂ©er une PR depuis staging/main"
echo "â Action : CrĂ©er une feature branch via /branch"
exit 1
fi
# Vérifier s'il y a des changements non commités
git status --porcelain
Si changements non commités :
â ïž WARNING: Changements non commitĂ©s dĂ©tectĂ©s
â Fichiers modifiĂ©s : 3
â Action suggĂ©rĂ©e : Commiter via /commit avant de crĂ©er la PR
â Voulez-vous continuer quand mĂȘme ? (y/n)
# Diff depuis staging
git diff staging...HEAD --stat
# Log des commits
git log staging..HEAD --oneline --no-merges
# Fichiers modifiés
git diff staging...HEAD --name-only
Parser les fichiers pour déterminer :
Compter les commits :
COMMIT_COUNT=$(git log staging..HEAD --oneline --no-merges | wc -l)
Si aucun commit :
â ERREUR: Aucun commit depuis staging
â Branche : valentin/feat/add-client-tracking
â Action : Faire des commits via /commit
STOP : Ne pas créer la PR.
Analyser les messages de commits :
git log staging..HEAD --pretty=format:"%s" --no-merges
Heuristiques :
feat(api): â Type feat, Scope apifeat(api): + fix(api): â Type du commit principal (dernier ou plus important)Extraire le type dominant :
feat, fix, refactor, chore, testExemples :
Commits :
- feat(api): add client_id to events
- feat(api): add client tracking service
- test(api): add client tracking tests
â Type : feat
â Scope : api
Commits :
- feat(api): add client_id to events
- feat(widget): add client filter
- fix(widget): fix date picker
â Type : feat (2 feat vs 1 fix)
â Scope : widget (2 widget vs 1 api) OU api,widget si Ă©quivalent
Format : type(scope): subject
RÚgles de génération :
Stratégie de génération :
Exemples :
Cas 1 : Un seul commit
Commit : feat(api): add client tracking to stat events
â Titre PR : feat(api): add client tracking to stat events
Cas 2 : Plusieurs commits mĂȘme feature
Commits :
- feat(api): add client_id column to stat_event
- feat(api): add client tracking service
- feat(api): update event controller
- test(api): add client tracking tests
â Titre PR : feat(api): add client tracking support
Cas 3 : Feature multi-domaines
Commits :
- feat(api): add client_id to events endpoint
- feat(widget): add client filter to dashboard
â Titre PR : feat(api,widget): add client tracking
Cas 4 : Fix avec refactor
Commits :
- fix(widget): fix date picker validation
- refactor(widget): simplify date utils
â Titre PR : fix(widget): correct date picker validation
# Tester avec pr-title-lint (simulation)
echo "feat(api): add client tracking" | npx @action-semantic/pull-request validate \
--types feat,refactor,fix,chore,test \
--scopes app,api,analytics,widget,jobs,ci
Si validation échoue :
â Titre invalide selon pr-title-lint
â Erreur : [dĂ©tails]
â Titre : feat(api): add client tracking
â Suggestion : [titre corrigĂ©]
Proposer le titre corrigé et redemander validation.
Charger le template :
## Description
[Description de la PR]
## Liens utiles
- đ Ticket Notion : [Lien vers le ticket](https://www.notion.so/...)
## Type de changement
- [x] Nouvelle fonctionnalité
- [ ] Correction de bug
- [ ] Amélioration de performance
- [ ] Refactoring
- [ ] Documentation
## Checklist
- [ ] Code testé localement
- [ ] Tests unitaires ajoutés/modifiés si nécessaire
- [ ] Respect des standards de code (ESLint)
- [ ] Migration de données nécessaire
## Notes complémentaires
[Notes pour le reviewer]
Remplir automatiquement :
Générer une description en français basée sur les commits :
Commits analysés :
- feat(api): add client_id to events
- feat(api): add client tracking service
- test(api): add tests
â Description :
Ajoute le support du tracking client dans les événements stat.
**Changements** :
- Ajout colonne `client_id` dans `stat_event`
- Nouveau service `ClientTrackingService`
- Tests unitaires et d'intégration
Cocher automatiquement basé sur le type :
feat â [x] Nouvelle fonctionnalitĂ©fix â [x] Correction de bugrefactor â [x] Refactoringchore â Aucun (ou Documentation si config/deps)test â AucunCocher automatiquement selon contexte :
[x] Code testé localement : Toujours coché
[x] Tests unitaires ajoutés/modifiés : Si fichiers *.test.ts, *.spec.ts modifiés
[x] Respect des standards de code (ESLint) : Si /lint a été exécuté avec succÚs
[x] Migration de données nécessaire : Si migrations Prisma/dbmate détectées
git diff staging...HEAD --name-only | grep -E '(prisma/migrations|analytics/migrations)'
Ajouter automatiquement :
package.json modifié, lister nouvelles depsExemple de notes auto-générées :
## Notes complémentaires
**Migrations DB** :
- `20260127_add_client_id_to_stat_event` : Ajout colonne client_id
**Dépendances** :
- Ajout : `@prisma/client@5.8.0`
**Points d'attention** :
- Le champ `client_id` est nullable pour compatibilité avec événements existants
- Tests E2E à exécuter manuellement aprÚs déploiement
# Vérifier si la branche est poussée
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null
Si branche non poussée :
# Pousser la branche avec tracking
git push -u origin $(git branch --show-current)
Message :
â Branche non poussĂ©e sur origin
â Push en cours : git push -u origin valentin/feat/add-client-tracking
â Branche poussĂ©e
# Créer la PR avec gh CLI
gh pr create \
--base staging \
--title "feat(api): add client tracking support" \
--body "$(cat <<'EOF'
## Description
Ajoute le support du tracking client dans les événements stat.
**Changements** :
- Ajout colonne `client_id` dans `stat_event`
- Nouveau service `ClientTrackingService`
- Tests unitaires et d'intégration
## Liens utiles
- đ Ticket Notion : [Lien vers le ticket](https://www.notion.so/...)
## Type de changement
- [x] Nouvelle fonctionnalité
- [ ] Correction de bug
- [ ] Amélioration de performance
- [ ] Refactoring
- [ ] Documentation
## Checklist
- [x] Code testé localement
- [x] Tests unitaires ajoutés/modifiés si nécessaire
- [x] Respect des standards de code (ESLint)
- [x] Migration de données nécessaire
## Notes complémentaires
**Migrations DB** :
- `20260127_add_client_id_to_stat_event` : Ajout colonne client_id
**Points d'attention** :
- Le champ `client_id` est nullable pour compatibilité avec événements existants
EOF
)"
# Récupérer l'URL de la PR
PR_URL=$(gh pr view --json url -q .url)
Message de succĂšs :
â
Pull Request créée avec succÚs
â Titre : feat(api): add client tracking support
â Base : staging
â URL : https://github.com/betagouv/api-engagement/pull/123
â Checks CI en cours :
- lint.yml (ESLint API)
- tests.yml (Prisma migration + tests API)
- build-check.yml (TypeScript API)
- pr-title-lint.yml (Validation titre)
â Prochaines Ă©tapes :
1. Attendre les checks CI (â 5-10 min)
2. Demander une review (@team)
3. Merger la PR aprĂšs approval
Branche : valentin/feat/add-client-tracking
Commits : 1
- feat(api): add client tracking to stat events
â Titre : feat(api): add client tracking to stat events
â Scope : api
â Type : Nouvelle fonctionnalitĂ©
â
PR créée : https://github.com/.../pull/123
Branche : marie/feat/client-filter
Commits : 3
- feat(api): add client_id to events endpoint
- feat(widget): add client filter component
- test(widget): add filter tests
â Titre : feat(api,widget): add client filtering
â Scopes : api, widget
â Type : Nouvelle fonctionnalitĂ©
â
PR créée : https://github.com/.../pull/124
Branche : thomas/fix/date-validation
Commits : 2
- fix(widget): fix date picker validation
- refactor(widget): simplify date utils
â Titre : fix(widget): correct date picker validation
â Scope : widget
â Type : Correction de bug
â
PR créée : https://github.com/.../pull/125
Branche : valentin/chore/update-deps
Commits : 1
- chore(ci): update dependencies
â Titre : chore(ci): update dependencies
â Scope : ci
â Type : Documentation (ou aucune case cochĂ©e)
â
PR créée : https://github.com/.../pull/126
Détecter et inclure dans les notes :
## Notes complémentaires
**Migrations DB** :
- Prisma : `20260127_add_client_id_to_stat_event`
- dbmate : `20260127_create_analytics_export_table`
**Actions post-merge** :
- Exécuter migrations en staging : `npm run prisma:migrate:core`
- Vérifier les données : `SELECT COUNT(*) FROM stat_event WHERE client_id IS NOT NULL`
Extraire depuis commits et mettre en avant :
## Description
â ïž **BREAKING CHANGE** : Suppression des endpoints `/analytics/*` (deprecated)
Migrer vers les nouveaux endpoints `/stats/*`.
...
Si package.json modifié avec versions majeures :
## Notes complémentaires
**Dépendances mises à jour** :
- `@prisma/client` : `5.7.0` â `5.8.0` (minor)
- `express` : `4.18.0` â `5.0.0` (major â ïž)
**Breaking changes potentiels** :
- Express 5 : [Lien vers migration guide](https://expressjs.com/en/guide/migrating-5.html)
Supporter création de draft PR :
/pr --draft
gh pr create --draft \
--base staging \
--title "feat(api): add client tracking (WIP)" \
--body "..."
Permissions requises dans .claude/settings.local.json :
Bash(git branch:*)Bash(git status:*)Bash(git diff:*)Bash(git log:*)Bash(git push:*)Bash(gh pr create:*)Bash(gh pr view:*)Read(*)Ce skill est le point culminant du workflow :
/branch â CrĂ©er branche/commit]/pr â CrĂ©er Pull Requeststaging (branche de base par dĂ©faut)gh CLI (GitHub officiel)