/git:branch [source-branch] <issue-number-or-text>from git
Creates a new Git branch with a structured workflow, supporting GitHub issues and automatic source branch resolution from .env.claude.
Ships in git. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
IMPORTANT : Cette skill effectue une opération Git rapide et nécessite un format de sortie spécifique.
Lis le frontmatter de cette skill. Si un champ output-style est présent, exécute immédiatement :
/output-style <valeur-du-champ>
Note : Une fois que le champ output-style sera supporté nativement par Claude Code, cette instruction pourra être supprimée.
Créer une nouvelle branche Git de manière structurée avec support des issues GitHub.
CORE_SCRIPTS="${CLAUDE_PLUGIN_ROOT}/skills/branch-core/scripts"
IMPORTANT : Exécute ce workflow étape par étape :
🚨 ÉTAPE CRITIQUE : CHECKOUT VERS SOURCE D'ABORD 🚨
.env.claude à la racine du projet courant (pas celui du plugin, celui du projet utilisateur)MAIN_BRANCH (fallback pour SOURCE_BRANCH)Logique de désambiguisation selon le nombre d'arguments :
2 arguments fournis :
1 argument fourni :
MAIN_BRANCH de .env.claudegit branch --list "$ARG" non vide) → SOURCE_BRANCH, ISSUE_OR_TEXT non fourni (sera demandé à l'utilisateur)MAIN_BRANCH de .env.claude0 argument :
MAIN_BRANCH de .env.claudeSi SOURCE_BRANCH n'est toujours pas résolu (MAIN_BRANCH absent de .env.claude et pas fourni en argument) :
Question: "Depuis quelle branche veux-tu créer la nouvelle branche ?"
Options: ["main", "master", "develop", "Autre"]
bash "$CORE_SCRIPTS/validate-source-branch.sh" "$SOURCE_BRANCH"
git checkout $SOURCE_BRANCH avec Bashgit branch --show-current pour vérifier qu'on est bien dessusgit pull origin $SOURCE_BRANCH avec BashSi ISSUE_OR_TEXT est fourni (résolu à l'étape 2) :
eval "$(bash "$CORE_SCRIPTS/resolve-branch-name.sh" "$ISSUE_OR_TEXT")"
echo "BRANCH_NAME=$BRANCH_NAME"
echo "PREFIX=$PREFIX"
echo "PREFIX_SOURCE=$PREFIX_SOURCE"
BRANCH_NAME, PREFIX, PREFIX_SOURCE, ISSUE_NUMBER sont disponiblesSi ISSUE_OR_TEXT n'est pas fourni :
bash "$CORE_SCRIPTS/check-branch-exists.sh" "$BRANCH_NAME"
git checkout -b $BRANCH_NAME avec BashAffiche :
✅ Branche créée : $BRANCH_NAME
📝 Préfixe détecté : $PREFIX (source: $PREFIX_SOURCE)
📍 Depuis : $SOURCE_BRANCH
{Si issue} 🔗 Issue associée : #$ISSUE_NUMBER
📝 Le tracking sera configuré automatiquement au premier commit avec :
git push -u origin $BRANCH_NAME
⚠️ IMPORTANT - NE PAS configurer de tracking automatiquement :
git branch --set-upstream-to=origin/$SOURCE_BRANCH $BRANCH_NAME-uConventions de nommage des branches (préfixe détecté automatiquement) :
feature/{numéro}-{description} : Nouvelles fonctionnalitésfix/{numéro}-{description} : Corrections de bugshotfix/{numéro}-{description} : Corrections urgentes en productionchore/{numéro}-{description} : Maintenance, refactoringdocs/{numéro}-{description} : Documentationtest/{numéro}-{description} : TestsDétection automatique du préfixe (par priorité) :
feature/ si aucun indicateur trouvé# Exemple 1 : Issue seule (SOURCE_BRANCH = MAIN_BRANCH de .env.claude)
/git:branch 42
# → Résolution via branch-core : fix/42-login-form-crashes-on-submit
# Exemple 2 : Issue avec branche source explicite
/git:branch develop 42
# → Résolution via branch-core : fix/42-login-form-crashes-on-submit (depuis develop)
# Exemple 3 : Texte descriptif seul (SOURCE_BRANCH = MAIN_BRANCH de .env.claude)
/git:branch "fix login validation"
# → Résolution via branch-core : fix/login-validation
# Exemple 4 : Texte descriptif avec branche source
/git:branch main "Add OAuth support"
# → Résolution via branch-core : feature/add-oauth-support
# Exemple 5 : Sans argument (SOURCE_BRANCH = MAIN_BRANCH, demande issue/texte)
/git:branch
# Créer une branche avec issue (source = MAIN_BRANCH de .env.claude)
/git:branch 123
# Créer une branche avec texte descriptif (source = MAIN_BRANCH)
/git:branch "user authentication"
# Créer une branche depuis une branche source explicite avec issue
/git:branch develop 123
# Créer une branche fix avec texte explicite (source = MAIN_BRANCH)
/git:branch "fix login bug"
# Créer une branche hotfix (source = MAIN_BRANCH)
/git:branch "hotfix critical payment issue"
# Créer une branche depuis develop (demande issue/texte)
/git:branch develop
# Créer une branche depuis une branche existante avec issue
/git:branch feature/api-base 456
git push -u origin $BRANCH_NAMESOURCE_BRANCH doit exister localementSOURCE_BRANCH optionnel (défaut: MAIN_BRANCH de .env.claude)ISSUE_OR_TEXT est un numéro, l'issue doit exister sur GitHubProblème 1 évité :
feature/A et on crée feature/B depuis mainmain d'abord, la branche est créée depuis feature/Afeature/A se retrouvent sur feature/BProblème 2 évité :
main locale est en retard sur origin/mainSolution :
git checkout $SOURCE_BRANCHgit pull origin $SOURCE_BRANCHgit checkout -b $BRANCH_NAMEWhat SKILL.md sets; muted values are Claude Code's defaults
haikuBash(git checkout:*)# Hook 1: Bloquer si modifications non commitées
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "❌ ERREUR : Modifications non commitées détectées"
echo ""
echo "Fichiers modifiés :"
git status --short
echo ""
echo "Vous devez commit ou stash avant de créer une branche"
exit 1
fi
Bash(git checkout -b:*)# Hook 2: Feedback création
BRANCH=$(git branch --show-current)
echo "✅ Branche créée : $BRANCH"
echo "📝 Le tracking sera configuré automatiquement au premier commit"
Three short reads, in order
npx claudepluginhub atournayre/claude-marketplace --plugin git11 skills in this plugin
/git-branch-coreSkill interne fournissant les scripts communs pour la création de branches. Ne pas appeler directement - utilisé par git:branch et git:worktree.
/commitgit:commitCréer des commits bien formatés avec format conventional et emoji/conflitgit:conflitAnalyse les conflits git et propose à l'utilisateur une résolution pas à pas avec validation de chaque étape.