Notre avis
Crée un worktree Git pour travailler sur une branche distincte dans un répertoire séparé sans changer de branche active.
Points forts
- Permet de travailler simultanément sur plusieurs branches sans conflit de répertoire de travail.
- Automatise la création du chemin du worktree et la sélection de la branche de base.
- Inclut un rappel pour le nettoyage après usage.
Limites
- Nécessite que le dépôt Git soit correctement initialisé et que la branche de base existe localement ou sur le remote.
- Ne gère pas les cas où le répertoire de destination existe déjà.
Utilisez cette compétence lorsque vous devez travailler sur une fonctionnalité ou un correctif dans un répertoire isolé tout en conservant la branche actuelle intacte.
Évitez de l'utiliser pour des opérations simples de changement de branche ou si vous préférez gérer manuellement les worktrees.
Analyse de sécurité
SûrThe skill only runs standard git worktree commands (git rev-parse, branch, worktree list/add/remove) within the repository, with no destructive actions or external communication.
Aucun point d'attention détecté
Exemples
/worktree feature-auth/worktree fix-bug develop/worktree existing-branchname: worktree description: Create a git worktree for parallel development. Use when the user wants to work on a feature branch in a separate directory without switching branches. disable-model-invocation: true allowed-tools: Bash, Read
Git Worktree
Create a git worktree for working on a separate branch in parallel.
Current State
- Repository: !
basename $(git rev-parse --show-toplevel) - Current branch: !
git branch --show-current - Existing worktrees: !
git worktree list
Instructions
Parse $ARGUMENTS to determine:
- Branch name - required (first argument)
- Base branch - optional (second argument, defaults to
main)
Workflow
-
Determine the worktree path: Use
../<repo-name>-<branch-name>as the directory (sibling to the current repo). -
Check if the branch already exists:
git branch --list <branch-name> git branch -r --list "origin/<branch-name>" -
Create the worktree:
- If branch exists locally or remotely:
git worktree add <path> <branch-name> - If new branch:
git worktree add -b <branch-name> <path> <base-branch>
- If branch exists locally or remotely:
-
Report the result with the full path so the user can navigate to it.
Examples
/worktree feature-auth→ Creates../<repo>-feature-authon new branchfeature-authfrommain/worktree fix-bug develop→ Creates../<repo>-fix-bugon new branchfix-bugfromdevelop/worktree existing-branch→ If branch exists, checks it out in a new worktree
Cleanup Reminder
After reporting success, remind the user how to clean up when done:
git worktree remove <path>
# or to also delete the branch:
git worktree remove <path> && git branch -d <branch-name>
Expert Next.js App Router
Developpement
Un skill qui transforme Claude en expert Next.js App Router.
Générateur de README
Developpement
Crée des README.md professionnels et complets pour vos projets.
Rédacteur de Documentation API
Developpement
Génère de la documentation API complète au format OpenAPI/Swagger.