devopsworktree
Gestion des git worktrees pour développement parallèle (création, liste, suppression, statut, switch)
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Gestion des git worktrees pour développement parallèle (création, liste, suppression, statut, switch)
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Audite un projet API Platform existant et produit un rapport de bonnes pratiques, performances et sécurité
Génère des DTOs (input/output) API Platform avec mapping vers les entités
Génère des filtres API Platform (search, date, range, order, boolean, exists, custom)
Génère un State Processor API Platform pour personnaliser la persistence des données
Génère un State Provider API Platform pour personnaliser la récupération de données
Génère une API Resource complète avec attribut
| name | devops:worktree |
| description | Gestion des git worktrees pour développement parallèle (création, liste, suppression, statut, switch) |
| model | sonnet |
| allowed-tools | ["Bash","Read","Write","Edit","Grep","AskUserQuestion"] |
| argument-hint | <action> [args] | [source-branch] <issue-number-or-text> |
| version | 1.0.0 |
| license | MIT |
| hooks | {"PreToolUse":[{"matcher":"Bash(git worktree add:*)","hooks":[{"type":"command","command":"# Hook 1: Bloquer si modifications non commitées\nif ! git diff --quiet || ! git diff --cached --quiet; then\n echo \"ERREUR : Modifications non commitées détectées\"\n echo \"\"\n echo \"Fichiers modifiés :\"\n git status --short\n echo \"\"\n echo \"Vous devez commit ou stash avant de créer un worktree\"\n exit 1\nfi\n","once":true}]}],"PostToolUse":[{"matcher":"Bash(git worktree add:*)","hooks":[{"type":"command","command":"# Hook 2: Feedback création\necho \"Worktree créé avec succès\"\n","once":false}]}]} |
Créer et gérer des worktrees Git pour le développement parallèle.
CORE_SCRIPTS="${CLAUDE_PLUGIN_ROOT}/scripts"
Créer un nouveau worktree avec résolution de branche depuis une issue GitHub ou un texte.
Usage :
/devops:worktree [source-branch] <issue-number-or-text>
Comportement :
WORKTREE_DIR et MAIN_BRANCH depuis .env.claudedevops:branch)validate-source-branch.shgit fetch origin $SOURCE_BRANCHresolve-branch-name.shcheck-branch-exists.sh$WORKTREE_DIR/$WORKTREE_DIRNAMEgit worktree add "$WORKTREE_PATH" -b "$BRANCH_NAME" "origin/$SOURCE_BRANCH"cd $WORKTREE_PATHLister tous les worktrees actifs.
Usage :
/devops:worktree list
Comportement :
git worktree list
Supprimer un worktree (après merge ou abandon).
Usage :
/devops:worktree remove <feature-name>
Comportement :
git worktree remove.claude/data/.dev-worktrees.json si présentAfficher le statut détaillé d'un ou tous les worktrees.
Usage :
/devops:worktree status [feature-name]
Afficher les commandes pour basculer vers un worktree existant.
Usage :
/devops:worktree switch <feature-name>
IMPORTANT : Exécute ce workflow étape par étape :
WORKTREE_DIR et MAIN_BRANCHWORKTREE_DIR absent, utilise AskUserQuestion :
Question: "La variable WORKTREE_DIR n'est pas définie dans .env.claude. Quel répertoire utiliser pour les worktrees ?"
Options: ["../worktrees", ".worktrees", "Autre"]
2 arguments : Premier = SOURCE_BRANCH, Second = ISSUE_OR_TEXT
1 argument :
0 argument : SOURCE_BRANCH = MAIN_BRANCH, ISSUE_OR_TEXT demandé
bash "$CORE_SCRIPTS/validate-source-branch.sh" "$SOURCE_BRANCH"
git fetch origin $SOURCE_BRANCH
Note : On utilise fetch au lieu de checkout + pull pour ne pas changer la branche courante.
eval "$(bash "$CORE_SCRIPTS/resolve-branch-name.sh" "$ISSUE_OR_TEXT")"
echo "BRANCH_NAME=$BRANCH_NAME"
echo "WORKTREE_DIRNAME=$WORKTREE_DIRNAME"
bash "$CORE_SCRIPTS/check-branch-exists.sh" "$BRANCH_NAME"
$WORKTREE_DIR/$WORKTREE_DIRNAMEtest -d "$WORKTREE_PATH"
git worktree add "$WORKTREE_PATH" -b "$BRANCH_NAME" "origin/$SOURCE_BRANCH"
Worktree créé : $BRANCH_NAME
Répertoire : $WORKTREE_PATH
Préfixe détecté : $PREFIX (source: $PREFIX_SOURCE)
Depuis : $SOURCE_BRANCH
{Si issue} Issue associée : #$ISSUE_NUMBER
Pour travailler dans ce worktree :
cd $WORKTREE_PATH
Le tracking sera configuré automatiquement au premier push avec :
git push -u origin $BRANCH_NAME
IMPORTANT - NE PAS configurer de tracking automatiquement
feature/<name> -> worktree dans $WORKTREE_DIR/feature-<name>hotfix/<name> -> worktree dans $WORKTREE_DIR/hotfix-<name>/ par - dans le nom de branche pour le répertoirefeature/42-login-fix -> feature-42-login-fix# Créer un worktree avec issue (source = MAIN_BRANCH)
/devops:worktree 123
# Créer un worktree avec texte descriptif
/devops:worktree "user authentication"
# Créer un worktree depuis une branche source explicite
/devops:worktree develop 123
# Lister les worktrees actifs
/devops:worktree list
# Supprimer un worktree
/devops:worktree remove feature-auth
# Voir le statut
/devops:worktree status
.env.claude (ou demandé)