Synthèse automatique
Automatise le backport d'une pull request Next.js déjà fusionnée depuis canary vers une branche de release plus ancienne, en cherry-piquant le commit et en ouvrant la PR de backport.
Points forts
- Décrit un workflow git complet et ordonné : vérification du worktree, fetch, identification du commit de merge, création de branche, cherry-pick avec -x, validation, ouverture de PR
- Traite explicitement la sécurité de l'état git de l'utilisateur (ne pas écraser, reset ou stash sans accord) et demande la branche cible si elle n'est pas fiable
- Gère les cas limites : cherry-pick vide (changement déjà présent), conflits à résoudre en faveur des contraintes de compatibilité de la branche de release, merge commit GitHub inutilisable
- Précise les commandes de vérification les plus étroites selon les fichiers touchés et force la base de la PR sur la branche de release plutôt que canary
Limites
- Fortement lié au dépôt vercel/next.js et à ses conventions (canary, pnpm build-all, branches next-16-2) ; peu réutilisable tel quel ailleurs
- Suppose que gh est authentifié et que l'utilisateur a les droits pour pousser et ouvrir une PR
- Dépend de la skill $create-pr, qui n'est pas décrite ici
À utiliser quand une PR Next.js déjà fusionnée sur canary doit être reportée sur une branche de release existante comme next-16-2.
À éviter pour des backports sur d'autres dépôts ou pour des cherry-picks vers une branche dont la validation et les tests ne peuvent pas être exécutés.
Analyse de sécurité
PrudenceThe instructions are limited to standard, transparent git/gh workflow steps for backporting a merged PR. There is no destructive command, no credential or secret handling, no obfuscated payload, and no attempt to disable safety. It explicitly tells the agent to inspect `git status` and not to overwrite, reset, or stash unrelated user changes without consent. The residual risk is ordinary: it mutates git/remote state and opens PRs, which warrants a caution rather than safe rating, but nothing here is malicious or exfiltrating.
- •Skill drives mutating git operations on the user's worktree and remote: branch creation, cherry-pick, and (via $create-pr) pushing a branch and opening a PR
- •Uses network-fetching CLIs (git fetch, gh pr view) against vercel/next.js
- •No allowed-tools declared, so an agent may treat arbitrary shell commands as in scope
Exemples
Backport PR #74219 to next-16-2: cherry-pick it from canary, run the relevant checks, and open a draft backport PR against the release branch.Cherry-pick merged PR #73980 onto next-16-3 and open the draft backport PR — skip the integration tests, just prepare the cherry-pick and PR.Can you backport PR #74502 to next-16-2? If the change is already on that release branch, tell me instead of opening a PR.name: backport-pr description: > Backport a merged Next.js pull request from canary to a previous release branch such as next-16-2. Use when the user asks to backport, cherry-pick, or open a backport PR from a PR number to an older Next.js version. Covers finding the merged PR commit, creating a backport branch from the target release branch, cherry-picking from canary, validating, and opening the PR with the release branch as the base. metadata: internal: true
Backport PR
Use this skill when a user asks to backport a merged Next.js PR to a release branch.
Inputs
- Require a PR number and a target release branch, for example
next-16-2. - If the target branch is not provided and cannot be inferred confidently from the user's request, ask before mutating git state.
- Treat the target branch as variable; do not hard-code
next-16-2except when the user explicitly asks for it.
Workflow
-
Inspect the current worktree before changing branches:
git status --short git branch --show-currentPreserve unrelated user changes. Do not overwrite, reset, or stash them without the user's consent.
-
Sync the source and target branches:
git fetch origin canary:refs/remotes/origin/canary <target-branch>:refs/remotes/origin/<target-branch> -
Identify the commit that landed the PR on
canary:gh pr view <pr-number> --repo vercel/next.js --json number,title,state,url,mergeCommit,baseRefName,headRefName git log origin/canary --oneline --fixed-strings --grep="(#<pr-number>)"Prefer
mergeCommit.oidwhen the PR isMERGEDand the commit is contained inorigin/canary. If GitHub does not return a usable merge commit, use thegit log --grepresult and verify the commit subject references the PR number. -
Create the backport branch from the release branch:
git switch -c backport-<pr-number>-to-<target-branch> origin/<target-branch>After switching branches in this repo, run
pnpm build-allbefore Next.js integration tests unless the user explicitly limits the task to preparing the cherry-pick or PR. -
Cherry-pick the landed commit with provenance:
git cherry-pick -x <merged-commit-sha>Resolve conflicts in favor of preserving the release branch's compatibility constraints. If the cherry-pick is empty, verify whether the change is already present on the release branch and report that instead of opening a duplicate PR.
-
Verify with the narrowest commands that cover the touched files. Prefer focused tests,
pnpm typesfor TypeScript-only risk, and the relevant integration test mode for behavior changes. -
Open the backport PR using
$create-pr.Override the normal
$create-prbase branch: use--base <target-branch>, notcanary. Keep the PR as a draft unless the user explicitly asks otherwise.
PR Shape
Use a title like:
[backport] <original PR title>
Use a concise PR body:
Backports <original PR title/link> to `<target-branch>`.
<!-- NEXT_JS_LLM -->
Related Skills
$create-pr- Create the branch commit, push it, and open the draft PR.$pr-status-triage- Check CI failures or review feedback after the PR exists.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/backport-pr-to-next-js-release-branch-mte1lkjw/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/backport-pr-to-next-js-release-branch-mte1lkjw' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/backport-pr-to-next-js-release-branch-mte1lkjw/download' --output '.skill-downloads/backport-pr-to-next-js-release-branch-mte1lkjw/SKILL.md.part' && mv '.skill-downloads/backport-pr-to-next-js-release-branch-mte1lkjw/SKILL.md.part' '.skill-downloads/backport-pr-to-next-js-release-branch-mte1lkjw/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/backport-pr-to-next-js-release-branch-mte1lkjw/SKILL.md' && test -s '.skill-downloads/backport-pr-to-next-js-release-branch-mte1lkjw/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/backport-pr' && cp -R '.skill-downloads/backport-pr-to-next-js-release-branch-mte1lkjw' '.claude/skills/backport-pr'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/backport-pr-to-next-js-release-branch-mte1lkjw'openskills read 'backport-pr-to-next-js-release-branch-mte1lkjw'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/backport-pr-to-next-js-release-branch-mte1lkjw/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.