@atlashub/smartstack-cli 1.11.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.documentation/agents.html +7 -2
- package/.documentation/apex.html +7 -2
- package/.documentation/business-analyse.html +7 -2
- package/.documentation/cli-commands.html +871 -0
- package/.documentation/commands.html +7 -2
- package/.documentation/efcore.html +7 -2
- package/.documentation/gitflow.html +7 -2
- package/.documentation/hooks.html +7 -2
- package/.documentation/index.html +7 -2
- package/.documentation/init.html +7 -2
- package/.documentation/installation.html +7 -2
- package/.documentation/ralph-loop.html +7 -2
- package/.documentation/test-web.html +7 -2
- package/dist/index.js +1932 -336
- package/dist/index.js.map +1 -1
- package/package.json +8 -2
- package/templates/agents/efcore/squash.md +67 -31
- package/templates/agents/gitflow/finish.md +68 -56
- package/templates/commands/business-analyse/0-orchestrate.md +72 -556
- package/templates/commands/business-analyse/1-init.md +23 -193
- package/templates/commands/business-analyse/2-discover.md +85 -462
- package/templates/commands/business-analyse/3-analyse.md +40 -342
- package/templates/commands/business-analyse/4-specify.md +72 -537
- package/templates/commands/business-analyse/5-validate.md +43 -237
- package/templates/commands/business-analyse/6-handoff.md +93 -682
- package/templates/commands/business-analyse/7-doc-html.md +45 -544
- package/templates/commands/business-analyse/_shared.md +176 -0
- package/templates/commands/business-analyse/bug.md +50 -257
- package/templates/commands/business-analyse/change-request.md +59 -283
- package/templates/commands/business-analyse/hotfix.md +36 -120
- package/templates/commands/business-analyse.md +55 -574
- package/templates/commands/efcore/_shared.md +206 -0
- package/templates/commands/efcore/conflicts.md +39 -201
- package/templates/commands/efcore/db-deploy.md +28 -237
- package/templates/commands/efcore/db-reset.md +41 -390
- package/templates/commands/efcore/db-seed.md +44 -323
- package/templates/commands/efcore/db-status.md +31 -210
- package/templates/commands/efcore/migration.md +45 -368
- package/templates/commands/efcore/rebase-snapshot.md +38 -241
- package/templates/commands/efcore/scan.md +35 -204
- package/templates/commands/efcore/squash.md +158 -251
- package/templates/commands/efcore.md +49 -177
- package/templates/commands/gitflow/1-init.md +94 -1318
- package/templates/commands/gitflow/10-start.md +86 -990
- package/templates/commands/gitflow/11-finish.md +264 -454
- package/templates/commands/gitflow/12-cleanup.md +40 -213
- package/templates/commands/gitflow/2-status.md +51 -386
- package/templates/commands/gitflow/3-commit.md +108 -801
- package/templates/commands/gitflow/4-plan.md +42 -13
- package/templates/commands/gitflow/5-exec.md +60 -5
- package/templates/commands/gitflow/6-abort.md +54 -277
- package/templates/commands/gitflow/7-pull-request.md +74 -717
- package/templates/commands/gitflow/8-review.md +51 -178
- package/templates/commands/gitflow/9-merge.md +74 -404
- package/templates/commands/gitflow/_shared.md +196 -0
- package/templates/commands/quickstart.md +154 -0
- package/templates/commands/ralph-loop/ralph-loop.md +104 -2
- package/templates/hooks/hooks.json +13 -0
- package/templates/hooks/ralph-mcp-logger.sh +46 -0
- package/templates/hooks/ralph-session-end.sh +69 -0
- package/templates/ralph/README.md +91 -0
- package/templates/ralph/ralph.config.yaml +113 -0
- package/templates/scripts/setup-ralph-loop.sh +173 -0
- package/templates/skills/_shared.md +117 -0
- package/templates/skills/ai-prompt/SKILL.md +87 -654
- package/templates/skills/application/SKILL.md +76 -499
- package/templates/skills/controller/SKILL.md +38 -165
- package/templates/skills/documentation/SKILL.md +2 -1
- package/templates/skills/feature-full/SKILL.md +107 -732
- package/templates/skills/notification/SKILL.md +85 -474
- package/templates/skills/ui-components/SKILL.md +62 -762
- package/templates/skills/workflow/SKILL.md +85 -489
- package/templates/commands/gitflow/rescue.md +0 -867
- package/templates/skills/business-analyse/SKILL.md +0 -191
|
@@ -8,1405 +8,181 @@ model: sonnet
|
|
|
8
8
|
|
|
9
9
|
**Arguments:** `$ARGUMENTS`
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## PREMIÈRE CHOSE À FAIRE
|
|
14
|
-
|
|
15
|
-
Regarde si `$ARGUMENTS` contient une URL (commence par `https://` ou `git@`).
|
|
16
|
-
|
|
17
|
-
**Si OUI (URL détectée)** → Tu DOIS suivre le workflow ci-dessous. NE SAUTE AUCUNE ÉTAPE.
|
|
18
|
-
|
|
19
|
-
**Si NON** → Va directement à la section "MODE B ou C" plus bas.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## WORKFLOW QUAND URL DÉTECTÉE
|
|
24
|
-
|
|
25
|
-
Tu as reçu une URL de repository. Avant de créer quoi que ce soit, tu DOIS poser 3 questions à l'utilisateur.
|
|
26
|
-
|
|
27
|
-
### ÉTAPE 1 : Extraire les informations de l'URL
|
|
28
|
-
|
|
29
|
-
Extrais le nom suggéré du projet depuis l'URL :
|
|
30
|
-
- `https://github.com/org/mon-projet.git` → nom suggéré = "mon-projet"
|
|
31
|
-
- `https://dev.azure.com/org/project/_git/repo` → nom suggéré = "repo"
|
|
32
|
-
|
|
33
|
-
**NE CRÉE AUCUN DOSSIER MAINTENANT.** Tu dois d'abord poser les questions.
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
### ÉTAPE 2 : DEMANDER OÙ CRÉER LE PROJET
|
|
38
|
-
|
|
39
|
-
**MAINTENANT, utilise le tool AskUserQuestion pour demander à l'utilisateur où créer le projet.**
|
|
40
|
-
|
|
41
|
-
Pose cette question avec ces options :
|
|
42
|
-
- Question : "Où voulez-vous créer ce projet ?"
|
|
43
|
-
- Header : "Location"
|
|
44
|
-
- Options :
|
|
45
|
-
1. "C:/Dev" - Dossier de développement recommandé
|
|
46
|
-
2. "Répertoire courant" - Créer ici (affiche le chemin actuel)
|
|
47
|
-
3. "Chemin personnalisé" - Entrer un autre chemin
|
|
48
|
-
|
|
49
|
-
**ATTENDS LA RÉPONSE DE L'UTILISATEUR.**
|
|
50
|
-
|
|
51
|
-
Si l'utilisateur choisit "Chemin personnalisé", demande-lui de saisir le chemin.
|
|
52
|
-
|
|
53
|
-
Stocke le résultat dans `TARGET_FOLDER`.
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
### ÉTAPE 3 : DEMANDER LE NOM DU PROJET
|
|
58
|
-
|
|
59
|
-
**MAINTENANT, utilise le tool AskUserQuestion pour demander le nom du dossier projet.**
|
|
60
|
-
|
|
61
|
-
Pose cette question avec ces options :
|
|
62
|
-
- Question : "Quel nom pour le dossier du projet ? (Suggéré : {nom_extrait_de_url})"
|
|
63
|
-
- Header : "Name"
|
|
64
|
-
- Options :
|
|
65
|
-
1. "{nom_extrait_de_url}" - Utiliser le nom de l'URL (Recommandé)
|
|
66
|
-
2. "Nom personnalisé" - Entrer un autre nom
|
|
67
|
-
|
|
68
|
-
**ATTENDS LA RÉPONSE DE L'UTILISATEUR.**
|
|
69
|
-
|
|
70
|
-
Si l'utilisateur choisit "Nom personnalisé", demande-lui de saisir le nom.
|
|
71
|
-
|
|
72
|
-
Stocke le résultat dans `PROJECT_NAME`.
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
### ÉTAPE 4 : CONFIRMATION FINALE
|
|
77
|
-
|
|
78
|
-
**MAINTENANT, utilise le tool AskUserQuestion pour confirmer la création.**
|
|
79
|
-
|
|
80
|
-
Affiche un récapitulatif et demande confirmation :
|
|
81
|
-
- Question : "Créer le projet GitFlow avec ces paramètres ?\n\nProjet : {PROJECT_NAME}\nEmplacement : {TARGET_FOLDER}/\nChemin complet : {TARGET_FOLDER}/{PROJECT_NAME}/\nRepository : {URL}"
|
|
82
|
-
- Header : "Confirm"
|
|
83
|
-
- Options :
|
|
84
|
-
1. "Oui, créer le projet" - Procéder à la création (Recommandé)
|
|
85
|
-
2. "Modifier" - Revenir en arrière pour changer les paramètres
|
|
86
|
-
|
|
87
|
-
**ATTENDS LA RÉPONSE DE L'UTILISATEUR.**
|
|
88
|
-
|
|
89
|
-
Si l'utilisateur choisit "Modifier", retourne à l'ÉTAPE 2.
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
### ÉTAPE 5 : CRÉER LE PROJET (seulement après confirmation)
|
|
94
|
-
|
|
95
|
-
**SEULEMENT si l'utilisateur a confirmé "Oui, créer le projet" à l'étape 4**, tu peux maintenant :
|
|
96
|
-
|
|
97
|
-
1. Vérifier que l'URL est accessible
|
|
98
|
-
2. Vérifier que le dossier n'existe pas déjà
|
|
99
|
-
3. Créer la structure
|
|
100
|
-
|
|
101
|
-
Le chemin final est : `{TARGET_FOLDER}/{PROJECT_NAME}/`
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
### ÉTAPE 6 : Validation
|
|
106
|
-
|
|
107
|
-
Vérifie que :
|
|
108
|
-
1. L'URL du repository est accessible (test avec `git ls-remote`)
|
|
109
|
-
2. Le dossier `{TARGET_FOLDER}/{PROJECT_NAME}` n'existe pas déjà
|
|
110
|
-
|
|
111
|
-
Si un problème, informe l'utilisateur et arrête.
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
|
|
115
|
-
### ÉTAPE 7 : Créer la structure organisée
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
# Create project folder with organized structure
|
|
119
|
-
mkdir -p "$PROJECT_BASE"
|
|
120
|
-
cd "$PROJECT_BASE"
|
|
121
|
-
|
|
122
|
-
# Clone as bare repository (hidden)
|
|
123
|
-
git clone --bare "$REPO_URL" .bare
|
|
124
|
-
echo "gitdir: ./.bare" > .git
|
|
125
|
-
|
|
126
|
-
# Configure bare repo for worktrees
|
|
127
|
-
cd .bare
|
|
128
|
-
git config core.bare false
|
|
129
|
-
git config core.worktree ".."
|
|
130
|
-
cd ..
|
|
131
|
-
|
|
132
|
-
# Create organized worktree structure
|
|
133
|
-
mkdir -p features releases hotfixes
|
|
134
|
-
|
|
135
|
-
# Create permanent worktrees with numbered prefixes
|
|
136
|
-
git worktree add "01-Main" main
|
|
137
|
-
git worktree add "02-Develop" develop
|
|
138
|
-
|
|
139
|
-
# Initialize GitFlow config in 02-Develop (working directory)
|
|
140
|
-
cd "02-Develop"
|
|
141
|
-
mkdir -p .claude/gitflow/{plans,logs,migrations,backup,cache}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
**Resulting structure:**
|
|
145
|
-
```
|
|
146
|
-
{target_folder}/{repo_name}/
|
|
147
|
-
├── .bare/ # Hidden bare repository
|
|
148
|
-
├── .git # gitdir pointer to .bare
|
|
149
|
-
├── 01-Main/ # Permanent worktree (main branch)
|
|
150
|
-
│ └── ...
|
|
151
|
-
├── 02-Develop/ # Permanent worktree (develop branch) ← WORKING DIR
|
|
152
|
-
│ ├── .claude/gitflow/
|
|
153
|
-
│ │ ├── config.json
|
|
154
|
-
│ │ ├── plans/
|
|
155
|
-
│ │ ├── logs/
|
|
156
|
-
│ │ └── migrations/
|
|
157
|
-
│ └── ...
|
|
158
|
-
├── features/ # Feature worktrees go here
|
|
159
|
-
│ └── {feature-name}/
|
|
160
|
-
├── releases/ # Release worktrees go here
|
|
161
|
-
│ └── v{version}/
|
|
162
|
-
└── hotfixes/ # Hotfix worktrees go here
|
|
163
|
-
└── {hotfix-name}/
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### ÉTAPE 7.5 : Détection et Configuration Azure DevOps (Optionnel)
|
|
167
|
-
|
|
168
|
-
**Détecter si Azure CLI est installé:**
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
# Vérifier Azure CLI
|
|
172
|
-
AZ_CLI_INSTALLED=$(az --version 2>/dev/null | head -1)
|
|
173
|
-
|
|
174
|
-
# Vérifier l'extension azure-devops
|
|
175
|
-
AZ_DEVOPS_EXT=$(az extension show --name azure-devops 2>/dev/null | grep -o '"name": "azure-devops"')
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
**Si Azure CLI détecté, proposer la configuration:**
|
|
179
|
-
|
|
180
|
-
```javascript
|
|
181
|
-
if (AZ_CLI_INSTALLED) {
|
|
182
|
-
AskUserQuestion({
|
|
183
|
-
questions: [{
|
|
184
|
-
question: "Azure CLI détecté. Voulez-vous configurer l'intégration Azure DevOps ?",
|
|
185
|
-
header: "Azure DevOps",
|
|
186
|
-
options: [
|
|
187
|
-
{ label: "Oui", description: "Configurer Azure DevOps pour PR, work items et boards (Recommandé si vous utilisez Azure DevOps)" },
|
|
188
|
-
{ label: "Non", description: "Ignorer pour l'instant (peut être configuré plus tard)" },
|
|
189
|
-
{ label: "Installer extension", description: "L'extension azure-devops n'est pas installée" }
|
|
190
|
-
],
|
|
191
|
-
multiSelect: false
|
|
192
|
-
}]
|
|
193
|
-
})
|
|
194
|
-
}
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
**Si "Oui" sélectionné, demander les informations:**
|
|
198
|
-
|
|
199
|
-
```javascript
|
|
200
|
-
// Détecter l'organisation depuis le remote URL si Azure DevOps
|
|
201
|
-
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
|
|
202
|
-
// https://dev.azure.com/myorg/myproject/_git/myrepo → org=myorg, project=myproject
|
|
203
|
-
|
|
204
|
-
AskUserQuestion({
|
|
205
|
-
questions: [
|
|
206
|
-
{
|
|
207
|
-
question: "Quelle est votre organisation Azure DevOps ?",
|
|
208
|
-
header: "Organisation",
|
|
209
|
-
options: [
|
|
210
|
-
{ label: "${DETECTED_ORG}", description: "Détecté depuis l'URL remote (Recommandé)" },
|
|
211
|
-
{ label: "Autre", description: "Entrer une autre organisation" }
|
|
212
|
-
],
|
|
213
|
-
multiSelect: false
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
question: "Quel est le nom de votre projet Azure DevOps ?",
|
|
217
|
-
header: "Projet",
|
|
218
|
-
options: [
|
|
219
|
-
{ label: "${DETECTED_PROJECT}", description: "Détecté depuis l'URL remote (Recommandé)" },
|
|
220
|
-
{ label: "Autre", description: "Entrer un autre projet" }
|
|
221
|
-
],
|
|
222
|
-
multiSelect: false
|
|
223
|
-
}
|
|
224
|
-
]
|
|
225
|
-
})
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
**Configurer Azure CLI defaults:**
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
# Configurer les defaults Azure DevOps
|
|
232
|
-
az devops configure --defaults organization="$AZ_ORG" project="$AZ_PROJECT"
|
|
233
|
-
|
|
234
|
-
# Vérifier la connexion
|
|
235
|
-
az devops project show --project "$AZ_PROJECT" > /dev/null 2>&1 || {
|
|
236
|
-
echo "⚠️ Impossible de se connecter à Azure DevOps."
|
|
237
|
-
echo " Exécutez 'az login' pour vous authentifier."
|
|
238
|
-
}
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
**Si Azure CLI non installé, afficher les instructions:**
|
|
242
|
-
|
|
243
|
-
```
|
|
244
|
-
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
245
|
-
│ ℹ️ AZURE DEVOPS CLI NON DÉTECTÉ │
|
|
246
|
-
├──────────────────────────────────────────────────────────────────────────────┤
|
|
247
|
-
│ Pour activer l'intégration Azure DevOps (PR, work items, boards): │
|
|
248
|
-
│ │
|
|
249
|
-
│ 1. Installer Azure CLI: │
|
|
250
|
-
│ winget install Microsoft.AzureCLI │
|
|
251
|
-
│ │
|
|
252
|
-
│ 2. Installer l'extension: │
|
|
253
|
-
│ az extension add --name azure-devops │
|
|
254
|
-
│ │
|
|
255
|
-
│ 3. Se connecter: │
|
|
256
|
-
│ az login │
|
|
257
|
-
│ │
|
|
258
|
-
│ 4. Reconfigurer GitFlow: │
|
|
259
|
-
│ /gitflow:1-init --migrate │
|
|
260
|
-
│ │
|
|
261
|
-
│ Documentation: https://learn.microsoft.com/cli/azure/boards │
|
|
262
|
-
└──────────────────────────────────────────────────────────────────────────────┘
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
|
-
### ÉTAPE 7.6 : Configuration de la langue
|
|
268
|
-
|
|
269
|
-
> **IMPORTANT:** La langue choisie s'applique UNIQUEMENT au contenu descriptif :
|
|
270
|
-
> - Description des features/hotfixes (partie apres `feature/` ou `hotfix/`)
|
|
271
|
-
> - Messages de commit (partie apres le prefix `feat:`, `fix:`, etc.)
|
|
272
|
-
> - Description dans les titres de PR
|
|
273
|
-
>
|
|
274
|
-
> **NON AFFECTE par la langue (toujours en anglais):**
|
|
275
|
-
> - Prefixes de branches: `feature/`, `release/`, `hotfix/`
|
|
276
|
-
> - Prefixes de commits: `feat:`, `fix:`, `chore:`, etc.
|
|
277
|
-
> - Structure GitFlow
|
|
278
|
-
|
|
279
|
-
```javascript
|
|
280
|
-
AskUserQuestion({
|
|
281
|
-
questions: [{
|
|
282
|
-
question: "Quelle langue utiliser pour les descriptions ?",
|
|
283
|
-
header: "Langue",
|
|
284
|
-
options: [
|
|
285
|
-
{ label: "English (Recommended)", description: "Feature descriptions, commit messages in English" },
|
|
286
|
-
{ label: "Francais", description: "Descriptions en francais (prefixes restent en anglais)" }
|
|
287
|
-
],
|
|
288
|
-
multiSelect: false
|
|
289
|
-
}]
|
|
290
|
-
})
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
**Exemple selon la langue:**
|
|
294
|
-
|
|
295
|
-
| Element | English | Francais |
|
|
296
|
-
|---------|---------|----------|
|
|
297
|
-
| Branche | `feature/add-user-auth` | `feature/ajouter-auth-utilisateur` |
|
|
298
|
-
| Commit | `feat: add user authentication` | `feat: ajouter authentification utilisateur` |
|
|
299
|
-
| PR Title | `feat: Add User Authentication` | `feat: Ajouter Authentification Utilisateur` |
|
|
300
|
-
| Prefixes | `feature/`, `feat:` (inchange) | `feature/`, `feat:` (inchange) |
|
|
301
|
-
|
|
302
|
-
**Stocker le resultat dans la config:**
|
|
303
|
-
- `language.code`: "en" ou "fr"
|
|
304
|
-
- `language.descriptions`: dictionnaire des verbes d'action traduits (pour suggestions)
|
|
11
|
+
> **Ref:** Fonctions partagées dans [_shared.md](_shared.md)
|
|
305
12
|
|
|
306
13
|
---
|
|
307
14
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
```json
|
|
311
|
-
{
|
|
312
|
-
"version": "1.5.0",
|
|
313
|
-
"initMode": "clone",
|
|
314
|
-
"language": {
|
|
315
|
-
"code": "en",
|
|
316
|
-
"descriptions": {
|
|
317
|
-
"add": "add",
|
|
318
|
-
"update": "update",
|
|
319
|
-
"fix": "fix",
|
|
320
|
-
"refactor": "refactor",
|
|
321
|
-
"remove": "remove",
|
|
322
|
-
"improve": "improve",
|
|
323
|
-
"implement": "implement"
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
"repository": {
|
|
327
|
-
"name": "{repo_name}",
|
|
328
|
-
"remoteUrl": "{REPO_URL}",
|
|
329
|
-
"defaultBranch": "main"
|
|
330
|
-
},
|
|
331
|
-
"worktrees": {
|
|
332
|
-
"enabled": true,
|
|
333
|
-
"mode": "organized",
|
|
334
|
-
"basePath": "..",
|
|
335
|
-
"bareRepo": "../.bare",
|
|
336
|
-
"permanent": {
|
|
337
|
-
"main": { "path": "../01-Main", "prefix": "01" },
|
|
338
|
-
"develop": { "path": "../02-Develop", "prefix": "02" }
|
|
339
|
-
},
|
|
340
|
-
"structure": {
|
|
341
|
-
"features": "../features/",
|
|
342
|
-
"releases": "../releases/",
|
|
343
|
-
"hotfixes": "../hotfixes/"
|
|
344
|
-
},
|
|
345
|
-
"cleanupOnFinish": true
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
### ÉTAPE 9 : Afficher le résumé
|
|
15
|
+
## Détection du Mode
|
|
351
16
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
REPOSITORY
|
|
358
|
-
Name: {repo_name}
|
|
359
|
-
Remote: {REPO_URL}
|
|
360
|
-
|
|
361
|
-
STRUCTURE CREATED
|
|
362
|
-
{PROJECT_BASE}/
|
|
363
|
-
├── 01-Main/ ← main branch
|
|
364
|
-
├── 02-Develop/ ← develop branch (current directory)
|
|
365
|
-
├── features/ ← feature worktrees
|
|
366
|
-
├── releases/ ← release worktrees
|
|
367
|
-
└── hotfixes/ ← hotfix worktrees
|
|
368
|
-
|
|
369
|
-
WORKING DIRECTORY
|
|
370
|
-
{PROJECT_BASE}/02-Develop
|
|
371
|
-
|
|
372
|
-
NEXT STEPS
|
|
373
|
-
1. cd "{PROJECT_BASE}/02-Develop"
|
|
374
|
-
2. code . (or your preferred IDE)
|
|
375
|
-
3. /gitflow:10-start feature {name}
|
|
376
|
-
|
|
377
|
-
================================================================================
|
|
378
|
-
```
|
|
17
|
+
| Condition | Mode |
|
|
18
|
+
|-----------|------|
|
|
19
|
+
| `$ARGUMENTS` contient URL (`https://` ou `git@`) | **MODE A: Clone** |
|
|
20
|
+
| Pas dans un repo git ET pas d'URL | **MODE C: Interactive** |
|
|
21
|
+
| Dans un repo git existant | **MODE B: Existing** |
|
|
379
22
|
|
|
380
23
|
---
|
|
381
24
|
|
|
382
|
-
## MODE
|
|
383
|
-
|
|
384
|
-
**Trigger:** Current directory is NOT a git repository AND no URL provided in arguments
|
|
385
|
-
|
|
386
|
-
This mode guides the user through setting up a new GitFlow project interactively.
|
|
387
|
-
|
|
388
|
-
**Critical Flow Order:**
|
|
389
|
-
```
|
|
390
|
-
C.1 Target Directory (WHERE?) → C.2 Repository URL → C.3 Project Name (WHAT?) → C.4 Confirmation → C.5 Execute
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
### C.1 Ask for Target Directory (FIRST - Critical)
|
|
394
|
-
|
|
395
|
-
**IMPORTANT:** Ask WHERE to create the project BEFORE asking for repository details.
|
|
396
|
-
|
|
397
|
-
```javascript
|
|
398
|
-
AskUserQuestion({
|
|
399
|
-
questions: [{
|
|
400
|
-
question: "Where do you want to create your GitFlow project?",
|
|
401
|
-
header: "Location",
|
|
402
|
-
options: [
|
|
403
|
-
{ label: "Current directory", description: `Create in: ${process.cwd()} (Recommended)` },
|
|
404
|
-
{ label: "C:/Dev", description: "Common development folder (Windows)" },
|
|
405
|
-
{ label: "~/projects", description: "Common development folder (Unix)" },
|
|
406
|
-
{ label: "Custom path", description: "Enter a different location" }
|
|
407
|
-
],
|
|
408
|
-
multiSelect: false
|
|
409
|
-
}]
|
|
410
|
-
})
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
**If "Custom path" selected:**
|
|
414
|
-
```
|
|
415
|
-
Enter the target parent folder (project will be created inside):
|
|
416
|
-
> Example: C:/Projects or /home/user/dev
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
**Validate path exists:**
|
|
420
|
-
```bash
|
|
421
|
-
# Expand ~ if present
|
|
422
|
-
TARGET_PATH="${TARGET_PATH/#\~/$HOME}"
|
|
423
|
-
|
|
424
|
-
# Check directory exists
|
|
425
|
-
if [ ! -d "$TARGET_PATH" ]; then
|
|
426
|
-
echo "WARNING: Directory does not exist: $TARGET_PATH"
|
|
427
|
-
# Ask: Create it? or Choose different path?
|
|
428
|
-
AskUserQuestion({
|
|
429
|
-
questions: [{
|
|
430
|
-
question: "Directory '$TARGET_PATH' does not exist. Create it?",
|
|
431
|
-
header: "Create Dir",
|
|
432
|
-
options: [
|
|
433
|
-
{ label: "Yes, create it", description: "Create the directory and continue (Recommended)" },
|
|
434
|
-
{ label: "Choose different path", description: "Enter another location" }
|
|
435
|
-
],
|
|
436
|
-
multiSelect: false
|
|
437
|
-
}]
|
|
438
|
-
})
|
|
439
|
-
fi
|
|
25
|
+
## MODE A: Clone (URL détectée)
|
|
440
26
|
|
|
441
|
-
|
|
442
|
-
if [ ! -w "$TARGET_PATH" ]; then
|
|
443
|
-
echo "ERROR: No write permission to: $TARGET_PATH"
|
|
444
|
-
# Ask again
|
|
445
|
-
fi
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
### C.2 Ask for Repository URL
|
|
449
|
-
|
|
450
|
-
```javascript
|
|
451
|
-
AskUserQuestion({
|
|
452
|
-
questions: [{
|
|
453
|
-
question: "What repository do you want to clone?",
|
|
454
|
-
header: "Repository",
|
|
455
|
-
options: [
|
|
456
|
-
{ label: "GitHub", description: "https://github.com/org/repo.git" },
|
|
457
|
-
{ label: "GitLab", description: "https://gitlab.com/org/repo.git" },
|
|
458
|
-
{ label: "Azure DevOps", description: "https://dev.azure.com/org/project/_git/repo" },
|
|
459
|
-
{ label: "Other", description: "Any git remote URL (SSH or HTTPS)" }
|
|
460
|
-
],
|
|
461
|
-
multiSelect: false
|
|
462
|
-
}]
|
|
463
|
-
})
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
**Then prompt for the actual URL:**
|
|
467
|
-
```
|
|
468
|
-
Enter the repository URL:
|
|
469
|
-
> Example: https://github.com/organization/my-project.git
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
**Validate URL is accessible:**
|
|
473
|
-
```bash
|
|
474
|
-
git ls-remote "$REPO_URL" HEAD > /dev/null 2>&1 || {
|
|
475
|
-
echo "ERROR: Cannot access repository: $REPO_URL"
|
|
476
|
-
echo "Please verify:"
|
|
477
|
-
echo " - URL is correct"
|
|
478
|
-
echo " - You have access permissions"
|
|
479
|
-
echo " - Network connectivity"
|
|
480
|
-
# Ask again
|
|
481
|
-
}
|
|
482
|
-
```
|
|
27
|
+
### Workflow Obligatoire
|
|
483
28
|
|
|
484
|
-
|
|
29
|
+
**NE CRÉER AUCUN DOSSIER** avant confirmation utilisateur.
|
|
485
30
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
Extract suggestion from URL:
|
|
31
|
+
#### 1. Extraire nom suggéré
|
|
489
32
|
```bash
|
|
490
|
-
# Extract repo name from various URL formats
|
|
491
|
-
# https://github.com/org/my-project.git → my-project
|
|
492
|
-
# git@github.com:org/my-project.git → my-project
|
|
493
|
-
# https://dev.azure.com/org/project/_git/repo → repo
|
|
494
|
-
|
|
495
33
|
SUGGESTED_NAME=$(basename "$REPO_URL" .git)
|
|
496
34
|
```
|
|
497
35
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
```javascript
|
|
501
|
-
AskUserQuestion({
|
|
502
|
-
questions: [{
|
|
503
|
-
question: "What should we name this project folder?",
|
|
504
|
-
header: "Project Name", // Critical: explicit header
|
|
505
|
-
options: [
|
|
506
|
-
{ label: "${SUGGESTED_NAME}", description: `Use repository name: "${SUGGESTED_NAME}" (Recommended)` },
|
|
507
|
-
{ label: "Custom name", description: "Enter a different folder name" }
|
|
508
|
-
],
|
|
509
|
-
multiSelect: false
|
|
510
|
-
}]
|
|
511
|
-
})
|
|
512
|
-
```
|
|
513
|
-
|
|
514
|
-
**If "Custom name" selected:**
|
|
515
|
-
```
|
|
516
|
-
Enter the project folder name:
|
|
517
|
-
>
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
**Strict validation:**
|
|
521
|
-
```bash
|
|
522
|
-
# 1. Not empty
|
|
523
|
-
if [ -z "$PROJECT_NAME" ]; then
|
|
524
|
-
echo "ERROR: Project name cannot be empty"
|
|
525
|
-
# Ask again
|
|
526
|
-
fi
|
|
527
|
-
|
|
528
|
-
# 2. Valid characters only
|
|
529
|
-
if [[ ! "$PROJECT_NAME" =~ ^[a-zA-Z0-9._-]+$ ]]; then
|
|
530
|
-
echo "ERROR: Invalid characters in project name"
|
|
531
|
-
echo "Allowed: letters, numbers, dots (.), underscores (_), hyphens (-)"
|
|
532
|
-
echo "Not allowed: spaces, special characters"
|
|
533
|
-
# Ask again
|
|
534
|
-
fi
|
|
535
|
-
|
|
536
|
-
# 3. Doesn't already exist in target location
|
|
537
|
-
FULL_PROJECT_PATH="$TARGET_PATH/$PROJECT_NAME"
|
|
538
|
-
if [ -d "$FULL_PROJECT_PATH" ]; then
|
|
539
|
-
echo "ERROR: Folder already exists: $FULL_PROJECT_PATH"
|
|
540
|
-
# Ask for different name
|
|
541
|
-
fi
|
|
542
|
-
|
|
543
|
-
# 4. Reasonable length
|
|
544
|
-
if [ ${#PROJECT_NAME} -gt 100 ]; then
|
|
545
|
-
echo "ERROR: Project name too long (max 100 characters)"
|
|
546
|
-
# Ask again
|
|
547
|
-
fi
|
|
548
|
-
```
|
|
549
|
-
|
|
550
|
-
### C.4 Final Confirmation with Full Path
|
|
36
|
+
#### 2. Demander emplacement
|
|
37
|
+
Question: "Où créer ce projet?" | Options: `C:/Dev`, `Répertoire courant`, `Chemin personnalisé`
|
|
551
38
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
```javascript
|
|
555
|
-
AskUserQuestion({
|
|
556
|
-
questions: [{
|
|
557
|
-
question: `Create GitFlow project with these settings?\n
|
|
558
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
559
|
-
Project Name: ${PROJECT_NAME}
|
|
560
|
-
Location: ${TARGET_PATH}/
|
|
561
|
-
Full Path: ${FULL_PROJECT_PATH}/
|
|
562
|
-
Repository: ${REPO_URL}
|
|
563
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
564
|
-
|
|
565
|
-
Structure to be created:
|
|
566
|
-
${PROJECT_NAME}/
|
|
567
|
-
├── .bare/ (hidden bare repository)
|
|
568
|
-
├── 01-Main/ (main branch)
|
|
569
|
-
├── 02-Develop/ (develop branch) ← Working directory
|
|
570
|
-
├── features/
|
|
571
|
-
├── releases/
|
|
572
|
-
└── hotfixes/`,
|
|
573
|
-
header: "Confirm",
|
|
574
|
-
options: [
|
|
575
|
-
{ label: "Yes, create project", description: "Create structure and clone repository (Recommended)" },
|
|
576
|
-
{ label: "Change settings", description: "Go back and modify name, location, or repository" }
|
|
577
|
-
],
|
|
578
|
-
multiSelect: false
|
|
579
|
-
}]
|
|
580
|
-
})
|
|
581
|
-
```
|
|
39
|
+
#### 3. Demander nom projet
|
|
40
|
+
Question: "Nom du dossier projet?" | Options: `{SUGGESTED_NAME} (Recommandé)`, `Nom personnalisé`
|
|
582
41
|
|
|
583
|
-
|
|
584
|
-
|
|
42
|
+
#### 4. Confirmer
|
|
43
|
+
Afficher récapitulatif complet avec chemin final: `{TARGET_FOLDER}/{PROJECT_NAME}/`
|
|
585
44
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
Once all inputs are confirmed, execute the same steps as MODE A:
|
|
45
|
+
#### 5. Créer structure (après confirmation)
|
|
589
46
|
|
|
590
47
|
```bash
|
|
591
|
-
|
|
592
|
-
# FULL_PROJECT_PATH="$TARGET_PATH/$PROJECT_NAME"
|
|
593
|
-
|
|
594
|
-
# Create project folder with organized structure
|
|
595
|
-
mkdir -p "$FULL_PROJECT_PATH"
|
|
596
|
-
cd "$FULL_PROJECT_PATH"
|
|
597
|
-
|
|
598
|
-
# Clone as bare repository (hidden)
|
|
48
|
+
mkdir -p "$PROJECT_BASE" && cd "$PROJECT_BASE"
|
|
599
49
|
git clone --bare "$REPO_URL" .bare
|
|
600
50
|
echo "gitdir: ./.bare" > .git
|
|
601
|
-
|
|
602
|
-
# Configure bare repo for worktrees
|
|
603
|
-
cd .bare
|
|
604
|
-
git config core.bare false
|
|
605
|
-
git config core.worktree ".."
|
|
606
|
-
cd ..
|
|
607
|
-
|
|
608
|
-
# Create organized worktree structure
|
|
51
|
+
cd .bare && git config core.bare false && git config core.worktree ".." && cd ..
|
|
609
52
|
mkdir -p features releases hotfixes
|
|
610
|
-
|
|
611
|
-
# Create permanent worktrees with numbered prefixes
|
|
612
53
|
git worktree add "01-Main" main
|
|
613
|
-
git worktree add "02-Develop" develop
|
|
614
|
-
# If develop doesn't exist, create it from main
|
|
615
|
-
git worktree add "02-Develop" -b develop main
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
# Initialize GitFlow config in 02-Develop (working directory)
|
|
54
|
+
git worktree add "02-Develop" develop
|
|
619
55
|
cd "02-Develop"
|
|
620
56
|
mkdir -p .claude/gitflow/{plans,logs,migrations,backup,cache}
|
|
621
57
|
```
|
|
622
58
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
Generate the same config as MODE A (see A.4) and display:
|
|
626
|
-
|
|
59
|
+
**Structure résultante:**
|
|
627
60
|
```
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
STRUCTURE CREATED
|
|
637
|
-
${FULL_PROJECT_PATH}/
|
|
638
|
-
├── .bare/ ← Bare repository (hidden)
|
|
639
|
-
├── .git ← Pointer to .bare
|
|
640
|
-
├── 01-Main/ ← main branch (read-only reference)
|
|
641
|
-
├── 02-Develop/ ← develop branch (WORKING DIRECTORY)
|
|
642
|
-
├── features/ ← Feature worktrees will go here
|
|
643
|
-
├── releases/ ← Release worktrees will go here
|
|
644
|
-
└── hotfixes/ ← Hotfix worktrees will go here
|
|
645
|
-
|
|
646
|
-
WORKING DIRECTORY
|
|
647
|
-
${FULL_PROJECT_PATH}/02-Develop
|
|
648
|
-
|
|
649
|
-
NEXT STEPS
|
|
650
|
-
1. Open the project:
|
|
651
|
-
cd "${FULL_PROJECT_PATH}/02-Develop"
|
|
652
|
-
code .
|
|
653
|
-
|
|
654
|
-
2. Start a new feature:
|
|
655
|
-
/gitflow:10-start feature my-feature
|
|
656
|
-
|
|
657
|
-
================================================================================
|
|
61
|
+
{project}/
|
|
62
|
+
├── .bare/ # Bare repository
|
|
63
|
+
├── 01-Main/ # main branch
|
|
64
|
+
├── 02-Develop/ # develop branch ← WORKING DIR
|
|
65
|
+
├── features/ # Feature worktrees
|
|
66
|
+
├── releases/ # Release worktrees
|
|
67
|
+
└── hotfixes/ # Hotfix worktrees
|
|
658
68
|
```
|
|
659
69
|
|
|
660
70
|
---
|
|
661
71
|
|
|
662
|
-
## MODE B: Existing Repository
|
|
663
|
-
|
|
664
|
-
**Trigger:** Currently inside a git repository without URL argument
|
|
665
|
-
|
|
666
|
-
### 0. Check existing structure
|
|
72
|
+
## MODE B: Existing Repository
|
|
667
73
|
|
|
668
|
-
|
|
74
|
+
### 1. Vérifier structure existante
|
|
669
75
|
|
|
670
|
-
|
|
76
|
+
Si `.claude/gitflow/config.json` existe:
|
|
77
|
+
- Options: `Migrate` (màj config) | `Reset` (backup + recréer) | `Skip`
|
|
671
78
|
|
|
672
|
-
|
|
79
|
+
### 2. Analyser le repo
|
|
673
80
|
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
| EF Core config | crossBranch section | {exists?} | {OK/MISSING} |
|
|
679
|
-
| Folders | [plans/](.claude/gitflow/plans/), [logs/](.claude/gitflow/logs/), [migrations/](.claude/gitflow/migrations/) | {exists?} | {OK/INCOMPLETE} |
|
|
81
|
+
**Détections:**
|
|
82
|
+
- Branches: main/master, develop
|
|
83
|
+
- Version: `*.csproj` > `Directory.Build.props` > `VERSION` > dernier tag > `0.1.0`
|
|
84
|
+
- EF Core: références dans csproj
|
|
680
85
|
|
|
681
|
-
|
|
86
|
+
### 3. Générer plan
|
|
682
87
|
|
|
683
|
-
|
|
684
|
-
AskUserQuestion({
|
|
685
|
-
questions: [{
|
|
686
|
-
question: "Existing GitFlow structure detected (v{existing_version}). What do you want to do?",
|
|
687
|
-
header: "Init",
|
|
688
|
-
options: [
|
|
689
|
-
{ label: "Migrate", description: "Update to v1.2.0 - preserve existing config (Recommended)" },
|
|
690
|
-
{ label: "Reset", description: "Delete and recreate from scratch (loses config)" },
|
|
691
|
-
{ label: "Skip", description: "Keep current structure unchanged" }
|
|
692
|
-
],
|
|
693
|
-
multiSelect: false
|
|
694
|
-
}]
|
|
695
|
-
})
|
|
696
|
-
```
|
|
697
|
-
|
|
698
|
-
**Migration actions (if "Migrate" selected):**
|
|
699
|
-
1. Backup existing config to [.claude/gitflow/backup/](.claude/gitflow/backup/)
|
|
700
|
-
2. Add missing config sections (worktrees, efcore.crossBranch, etc.)
|
|
701
|
-
3. Create missing folders
|
|
702
|
-
4. Update version to 1.2.0
|
|
703
|
-
5. Preserve user customizations (branch names, versioning source, etc.)
|
|
88
|
+
Créer `.claude/gitflow/plans/init_{DATE}.md` puis exécuter avec `--exec`
|
|
704
89
|
|
|
705
|
-
|
|
706
|
-
1. Backup entire [.claude/gitflow/](.claude/gitflow/) to `.claude/gitflow.bak_<timestamp>/`
|
|
707
|
-
2. Delete [.claude/gitflow/](.claude/gitflow/)
|
|
708
|
-
3. Continue with fresh initialization
|
|
90
|
+
### 4. Demander style worktree
|
|
709
91
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
92
|
+
Options:
|
|
93
|
+
- `Organized (Recommandé)`: 01-Main/, 02-Develop/, features/, etc.
|
|
94
|
+
- `Adjacent`: ../worktrees/ (legacy)
|
|
95
|
+
- `Skip`: pas de worktrees
|
|
713
96
|
|
|
714
97
|
---
|
|
715
98
|
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
Analyze the repository and detect:
|
|
719
|
-
|
|
720
|
-
**Git:**
|
|
721
|
-
- Check if it's a Git repo
|
|
722
|
-
- List existing branches (main/master, develop)
|
|
723
|
-
- Get remote origin URL
|
|
724
|
-
|
|
725
|
-
**Version (.NET - priority order):**
|
|
726
|
-
1. `*.csproj` → `<Version>` tag
|
|
727
|
-
2. `Directory.Build.props` → `<Version>` tag
|
|
728
|
-
3. `AssemblyInfo.cs` → `[AssemblyVersion]` attribute
|
|
729
|
-
4. `VERSION` file → raw content
|
|
730
|
-
5. Last git tag → format `vX.Y.Z`
|
|
731
|
-
6. None → suggest `0.1.0` with `VERSION` file
|
|
732
|
-
|
|
733
|
-
**EF Core:**
|
|
734
|
-
- Detect if EF Core is referenced in csproj files
|
|
735
|
-
- List existing DbContexts
|
|
736
|
-
|
|
737
|
-
### 2. Generate the plan file
|
|
738
|
-
|
|
739
|
-
Create plan file in [.claude/gitflow/plans/](.claude/gitflow/plans/) named `init_<YYYYMMDD>.md` containing:
|
|
740
|
-
|
|
741
|
-
````markdown
|
|
742
|
-
# GitFlow Initialization Plan
|
|
743
|
-
|
|
744
|
-
> Read this file then execute:
|
|
745
|
-
|
|
746
|
-
```
|
|
747
|
-
/gitflow:1-init --exec
|
|
748
|
-
```
|
|
749
|
-
|
|
750
|
-
## Repository
|
|
751
|
-
| Info | Value |
|
|
752
|
-
|------|-------|
|
|
753
|
-
| Name | {repo_name} |
|
|
754
|
-
| Remote | {url_or_local} |
|
|
755
|
-
|
|
756
|
-
## Version
|
|
757
|
-
| Source | File | Version |
|
|
758
|
-
|--------|------|---------|
|
|
759
|
-
| {type} | {path} | {version} |
|
|
760
|
-
|
|
761
|
-
## Planned Actions
|
|
762
|
-
- [ ] Branches: main ({create|exists}), develop ({create|exists})
|
|
763
|
-
- [ ] Structure: .claude/gitflow/{config.json, plans/, logs/, migrations/}
|
|
764
|
-
- [ ] CLAUDE.md: Repository section
|
|
765
|
-
- [ ] EF Core: {active|inactive} - Contexts: {list}
|
|
766
|
-
|
|
767
|
-
## Configuration
|
|
768
|
-
- Versioning: SemVer
|
|
769
|
-
- Tag prefix: v
|
|
770
|
-
- Auto-increment: feature→minor, hotfix→patch, release→manual
|
|
771
|
-
|
|
772
|
-
## Modify?
|
|
773
|
-
Edit this file before executing.
|
|
774
|
-
|
|
775
|
-
## Execute
|
|
99
|
+
## MODE C: Interactive (pas de repo)
|
|
776
100
|
|
|
777
|
-
|
|
778
|
-
/gitflow:1-init --exec
|
|
779
|
-
```
|
|
780
|
-
````
|
|
781
|
-
|
|
782
|
-
### 3. Display message
|
|
101
|
+
**Flow:** Location → Repository URL → Project Name → Confirmation → Create
|
|
783
102
|
|
|
784
|
-
|
|
785
|
-
Plan generated: .claude/gitflow/plans/init_<DATE>.md
|
|
786
|
-
|
|
787
|
-
1. Read the file
|
|
788
|
-
2. Modify if necessary
|
|
789
|
-
3. Execute:
|
|
790
|
-
|
|
791
|
-
```
|
|
792
|
-
/gitflow:1-init --exec
|
|
793
|
-
```
|
|
794
|
-
````
|
|
103
|
+
Même structure que MODE A mais avec questions préalables pour URL et emplacement.
|
|
795
104
|
|
|
796
105
|
---
|
|
797
106
|
|
|
798
|
-
##
|
|
799
|
-
|
|
800
|
-
### Prerequisites
|
|
801
|
-
- Init plan exists in [.claude/gitflow/plans/](.claude/gitflow/plans/)
|
|
802
|
-
|
|
803
|
-
### Actions
|
|
804
|
-
1. **Branches**: Create main and develop if absent, checkout develop
|
|
805
|
-
2. **Structure**: Create [.claude/gitflow/](.claude/gitflow/) with subdirectories:
|
|
806
|
-
- [plans/](.claude/gitflow/plans/) - Integration plans
|
|
807
|
-
- [logs/](.claude/gitflow/logs/) - Operation history
|
|
808
|
-
- [migrations/](.claude/gitflow/migrations/) - EF Core snapshots
|
|
809
|
-
3. **Worktrees** (if `--with-worktrees`): Create worktrees structure (see below)
|
|
810
|
-
4. **Config**: Create [config.json](.claude/gitflow/config.json) with plan configuration
|
|
811
|
-
5. **CLAUDE.md**: Add Repository section if branches existed
|
|
812
|
-
6. **VERSION**: Create file if no source detected
|
|
813
|
-
7. **Commit** (ask): `chore(gitflow): initialization v{VERSION}`
|
|
814
|
-
|
|
815
|
-
### Creating Worktrees (v1.3)
|
|
816
|
-
|
|
817
|
-
If `--with-worktrees` is specified (default: true), ask user for structure preference:
|
|
818
|
-
|
|
819
|
-
```javascript
|
|
820
|
-
AskUserQuestion({
|
|
821
|
-
questions: [{
|
|
822
|
-
question: "Choose worktree organization style",
|
|
823
|
-
header: "Structure",
|
|
824
|
-
options: [
|
|
825
|
-
{ label: "Organized (Recommended)", description: "01-Main/, 02-Develop/, features/, releases/, hotfixes/ in parent folder" },
|
|
826
|
-
{ label: "Adjacent", description: "../worktrees/ folder next to repo (legacy mode)" },
|
|
827
|
-
{ label: "Skip worktrees", description: "No worktree structure, use branch switching" }
|
|
828
|
-
],
|
|
829
|
-
multiSelect: false
|
|
830
|
-
}]
|
|
831
|
-
})
|
|
832
|
-
```
|
|
833
|
-
|
|
834
|
-
#### Option 1: Organized Structure (Recommended)
|
|
835
|
-
|
|
836
|
-
```bash
|
|
837
|
-
# Move current repo to subfolder with numbered prefix
|
|
838
|
-
CURRENT_DIR=$(pwd)
|
|
839
|
-
PARENT_DIR=$(dirname "$CURRENT_DIR")
|
|
840
|
-
REPO_NAME=$(basename "$CURRENT_DIR")
|
|
841
|
-
|
|
842
|
-
# Create organized structure in parent
|
|
843
|
-
cd "$PARENT_DIR"
|
|
844
|
-
mkdir -p "${REPO_NAME}-gitflow"
|
|
845
|
-
mv "$REPO_NAME" "${REPO_NAME}-gitflow/.bare-temp"
|
|
846
|
-
|
|
847
|
-
cd "${REPO_NAME}-gitflow"
|
|
848
|
-
|
|
849
|
-
# Convert to bare repo structure
|
|
850
|
-
git clone --bare ".bare-temp" .bare
|
|
851
|
-
rm -rf .bare-temp
|
|
852
|
-
echo "gitdir: ./.bare" > .git
|
|
853
|
-
|
|
854
|
-
# Configure bare repo
|
|
855
|
-
cd .bare
|
|
856
|
-
git config core.bare false
|
|
857
|
-
git config core.worktree ".."
|
|
858
|
-
cd ..
|
|
859
|
-
|
|
860
|
-
# Create worktree structure
|
|
861
|
-
mkdir -p features releases hotfixes
|
|
862
|
-
git worktree add "01-Main" main
|
|
863
|
-
git worktree add "02-Develop" develop
|
|
864
|
-
|
|
865
|
-
# Move to 02-Develop as working directory
|
|
866
|
-
cd "02-Develop"
|
|
867
|
-
```
|
|
107
|
+
## Configuration Langue & Azure DevOps
|
|
868
108
|
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
parent/
|
|
872
|
-
└── {repo-name}-gitflow/ # Project folder
|
|
873
|
-
├── .bare/ # Bare repository
|
|
874
|
-
├── .git # gitdir pointer
|
|
875
|
-
├── 01-Main/ # Permanent worktree (main)
|
|
876
|
-
│ └── ...
|
|
877
|
-
├── 02-Develop/ # Permanent worktree (develop) ← WORKING DIR
|
|
878
|
-
│ ├── .claude/gitflow/
|
|
879
|
-
│ └── ...
|
|
880
|
-
├── features/ # Feature worktrees
|
|
881
|
-
│ └── {feature-name}/
|
|
882
|
-
├── releases/ # Release worktrees
|
|
883
|
-
│ └── v{version}/
|
|
884
|
-
└── hotfixes/ # Hotfix worktrees
|
|
885
|
-
└── {hotfix-name}/
|
|
886
|
-
```
|
|
887
|
-
|
|
888
|
-
#### Option 2: Adjacent Structure (Legacy)
|
|
889
|
-
|
|
890
|
-
```bash
|
|
891
|
-
# Base path (relative to main repo)
|
|
892
|
-
WORKTREE_BASE="../worktrees"
|
|
109
|
+
### Langue (v1.5)
|
|
110
|
+
Question: "Langue pour descriptions?" | Options: `English (Recommended)`, `Français`
|
|
893
111
|
|
|
894
|
-
|
|
895
|
-
mkdir -p "$WORKTREE_BASE/features"
|
|
896
|
-
mkdir -p "$WORKTREE_BASE/releases"
|
|
897
|
-
mkdir -p "$WORKTREE_BASE/hotfixes"
|
|
112
|
+
> **Note:** Prefixes (`feature/`, `feat:`) restent TOUJOURS en anglais. Seul le contenu descriptif change.
|
|
898
113
|
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
git worktree add "$WORKTREE_BASE/develop" develop
|
|
902
|
-
```
|
|
114
|
+
### Azure DevOps (optionnel)
|
|
115
|
+
Si Azure CLI détecté, proposer configuration: organization, project, reviewers
|
|
903
116
|
|
|
904
|
-
|
|
905
|
-
```
|
|
906
|
-
parent/
|
|
907
|
-
├── atlashub-project/ # Main repo (stays as-is)
|
|
908
|
-
│ ├── .claude/gitflow/
|
|
909
|
-
│ └── ...
|
|
910
|
-
└── worktrees/ # Adjacent folder
|
|
911
|
-
├── main/ # Permanent worktree
|
|
912
|
-
├── develop/ # Permanent worktree
|
|
913
|
-
├── features/ # Features in progress
|
|
914
|
-
│ └── {feature-name}/
|
|
915
|
-
├── releases/ # Releases in progress
|
|
916
|
-
│ └── v{version}/
|
|
917
|
-
└── hotfixes/ # Hotfixes in progress
|
|
918
|
-
└── {hotfix-name}/
|
|
919
|
-
```
|
|
117
|
+
---
|
|
920
118
|
|
|
921
|
-
|
|
119
|
+
## Config.json Template
|
|
922
120
|
|
|
923
|
-
#### Organized Mode (v1.5)
|
|
924
121
|
```json
|
|
925
122
|
{
|
|
926
123
|
"version": "1.5.0",
|
|
927
124
|
"initMode": "organized",
|
|
928
|
-
"language": {
|
|
929
|
-
|
|
930
|
-
"descriptions": {
|
|
931
|
-
"add": "add",
|
|
932
|
-
"update": "update",
|
|
933
|
-
"fix": "fix",
|
|
934
|
-
"refactor": "refactor",
|
|
935
|
-
"remove": "remove",
|
|
936
|
-
"improve": "improve",
|
|
937
|
-
"implement": "implement"
|
|
938
|
-
}
|
|
939
|
-
},
|
|
940
|
-
"naming": {
|
|
941
|
-
"normalize": true,
|
|
942
|
-
"maxLength": 50,
|
|
943
|
-
"separator": "-",
|
|
944
|
-
"lowercase": true,
|
|
945
|
-
"removeAccents": true,
|
|
946
|
-
"allowedChars": "a-z0-9-"
|
|
947
|
-
},
|
|
125
|
+
"language": { "code": "en" },
|
|
126
|
+
"naming": { "normalize": true, "maxLength": 50, "separator": "-" },
|
|
948
127
|
"repository": { "name": "", "defaultBranch": "main", "remoteUrl": "" },
|
|
949
|
-
"versioning": { "strategy": "semver", "current": "0.1.0", "
|
|
950
|
-
"git": { "branches": { "main": "main", "develop": "develop"
|
|
128
|
+
"versioning": { "strategy": "semver", "current": "0.1.0", "tagPrefix": "v" },
|
|
129
|
+
"git": { "branches": { "main": "main", "develop": "develop" } },
|
|
951
130
|
"worktrees": {
|
|
952
|
-
"enabled": true,
|
|
953
|
-
"
|
|
954
|
-
"
|
|
955
|
-
"bareRepo": "../.bare",
|
|
956
|
-
"permanent": {
|
|
957
|
-
"main": { "path": "../01-Main", "prefix": "01" },
|
|
958
|
-
"develop": { "path": "../02-Develop", "prefix": "02" }
|
|
959
|
-
},
|
|
960
|
-
"structure": {
|
|
961
|
-
"features": "../features/",
|
|
962
|
-
"releases": "../releases/",
|
|
963
|
-
"hotfixes": "../hotfixes/"
|
|
964
|
-
},
|
|
965
|
-
"cleanupOnFinish": true
|
|
131
|
+
"enabled": true, "mode": "organized",
|
|
132
|
+
"permanent": { "main": "../01-Main", "develop": "../02-Develop" },
|
|
133
|
+
"structure": { "features": "../features/", "releases": "../releases/", "hotfixes": "../hotfixes/" }
|
|
966
134
|
},
|
|
967
|
-
"database": {
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
"authType": "windows",
|
|
971
|
-
"username": "",
|
|
972
|
-
"password": "",
|
|
973
|
-
"namePrefix": "",
|
|
974
|
-
"autoCreateLocalConfig": true
|
|
975
|
-
},
|
|
976
|
-
"azureDevOps": {
|
|
977
|
-
"enabled": false,
|
|
978
|
-
"organization": "",
|
|
979
|
-
"project": "",
|
|
980
|
-
"defaultReviewers": [],
|
|
981
|
-
"workItemTypes": {
|
|
982
|
-
"feature": "User Story",
|
|
983
|
-
"hotfix": "Bug",
|
|
984
|
-
"release": "Epic"
|
|
985
|
-
},
|
|
986
|
-
"linkWorkItems": true,
|
|
987
|
-
"autoTransitionWorkItems": true
|
|
988
|
-
},
|
|
989
|
-
"efcore": {
|
|
990
|
-
"enabled": false, "contexts": [], "generateScript": false, "scriptOutputPath": "",
|
|
991
|
-
"crossBranch": { "enabled": true, "scanOnMigrationCreate": true, "blockOnConflict": true, "cacheExpiry": "1h" }
|
|
992
|
-
},
|
|
993
|
-
"workflow": { "requireConfirmation": true, "createCheckpoints": true, "commitConventions": "conventional", "push": { "afterCommit": "worktree", "afterFinish": "always" } }
|
|
994
|
-
}
|
|
995
|
-
```
|
|
996
|
-
|
|
997
|
-
### Language & Naming Configuration (NEW in v1.5)
|
|
998
|
-
|
|
999
|
-
La section `language` definit la langue pour le **contenu descriptif uniquement**.
|
|
1000
|
-
|
|
1001
|
-
> **IMPORTANT - Ce qui ne change PAS selon la langue:**
|
|
1002
|
-
> - Prefixes de branches: `feature/`, `release/`, `hotfix/` (toujours en anglais)
|
|
1003
|
-
> - Prefixes de commits: `feat:`, `fix:`, `chore:`, `docs:`, etc. (Conventional Commits)
|
|
1004
|
-
> - Structure GitFlow (worktrees, config, etc.)
|
|
1005
|
-
|
|
1006
|
-
| Parametre | Description | Defaut |
|
|
1007
|
-
|-----------|-------------|--------|
|
|
1008
|
-
| `code` | Code langue (en, fr) | `en` |
|
|
1009
|
-
| `descriptions` | Verbes d'action pour suggestions | voir ci-dessous |
|
|
1010
|
-
|
|
1011
|
-
**Verbes d'action suggeres par langue:**
|
|
1012
|
-
|
|
1013
|
-
| Action | English | Francais |
|
|
1014
|
-
|--------|---------|----------|
|
|
1015
|
-
| Ajouter | `add` | `ajouter` |
|
|
1016
|
-
| Modifier | `update` | `modifier` |
|
|
1017
|
-
| Corriger | `fix` | `corriger` |
|
|
1018
|
-
| Refactorer | `refactor` | `refactorer` |
|
|
1019
|
-
| Supprimer | `remove` | `supprimer` |
|
|
1020
|
-
| Ameliorer | `improve` | `ameliorer` |
|
|
1021
|
-
| Implementer | `implement` | `implementer` |
|
|
1022
|
-
|
|
1023
|
-
**Exemples concrets:**
|
|
1024
|
-
|
|
1025
|
-
| Element | English (code: "en") | Francais (code: "fr") |
|
|
1026
|
-
|---------|---------------------|----------------------|
|
|
1027
|
-
| Branche feature | `feature/add-user-auth` | `feature/ajouter-auth-utilisateur` |
|
|
1028
|
-
| Branche hotfix | `hotfix/fix-login-bug` | `hotfix/corriger-bug-login` |
|
|
1029
|
-
| Commit | `feat: add user authentication` | `feat: ajouter authentification` |
|
|
1030
|
-
| Titre PR | `feat: Add User Auth` | `feat: Ajouter Auth Utilisateur` |
|
|
1031
|
-
|
|
1032
|
-
> Note: Le prefix `feature/` et `feat:` restent TOUJOURS en anglais.
|
|
1033
|
-
|
|
1034
|
-
La section `naming` configure la normalisation automatique des noms.
|
|
1035
|
-
|
|
1036
|
-
| Parametre | Description | Defaut |
|
|
1037
|
-
|-----------|-------------|--------|
|
|
1038
|
-
| `normalize` | Activer la normalisation automatique | `true` |
|
|
1039
|
-
| `maxLength` | Longueur max des noms de branches | `50` |
|
|
1040
|
-
| `separator` | Separateur entre les mots | `-` |
|
|
1041
|
-
| `lowercase` | Forcer en minuscules | `true` |
|
|
1042
|
-
| `removeAccents` | Supprimer les accents | `true` |
|
|
1043
|
-
| `allowedChars` | Caracteres autorises (regex) | `a-z0-9-` |
|
|
1044
|
-
|
|
1045
|
-
**Fonction de normalisation (utilisee partout):**
|
|
1046
|
-
|
|
1047
|
-
```bash
|
|
1048
|
-
normalize_name() {
|
|
1049
|
-
local input="$1"
|
|
1050
|
-
local max_length="${2:-50}"
|
|
1051
|
-
|
|
1052
|
-
# 1. Convertir en minuscules
|
|
1053
|
-
local result=$(echo "$input" | tr '[:upper:]' '[:lower:]')
|
|
1054
|
-
|
|
1055
|
-
# 2. Supprimer les accents
|
|
1056
|
-
result=$(echo "$result" | sed 'y/àâäéèêëïîôùûüç/aaaeeeeiioouuc/')
|
|
1057
|
-
|
|
1058
|
-
# 3. Remplacer les espaces et underscores par des tirets
|
|
1059
|
-
result=$(echo "$result" | sed 's/[ _]/-/g')
|
|
1060
|
-
|
|
1061
|
-
# 4. Supprimer les caracteres speciaux (garder uniquement a-z, 0-9, -)
|
|
1062
|
-
result=$(echo "$result" | sed 's/[^a-z0-9-]//g')
|
|
1063
|
-
|
|
1064
|
-
# 5. Supprimer les tirets multiples
|
|
1065
|
-
result=$(echo "$result" | sed 's/--*/-/g')
|
|
1066
|
-
|
|
1067
|
-
# 6. Supprimer les tirets en debut/fin
|
|
1068
|
-
result=$(echo "$result" | sed 's/^-//;s/-$//')
|
|
1069
|
-
|
|
1070
|
-
# 7. Tronquer a la longueur max
|
|
1071
|
-
result=$(echo "$result" | cut -c1-$max_length)
|
|
1072
|
-
|
|
1073
|
-
# 8. Supprimer le tiret final apres troncature
|
|
1074
|
-
result=$(echo "$result" | sed 's/-$//')
|
|
1075
|
-
|
|
1076
|
-
echo "$result"
|
|
135
|
+
"database": { "enabled": true, "server": "localhost", "authType": "windows" },
|
|
136
|
+
"azureDevOps": { "enabled": false },
|
|
137
|
+
"efcore": { "enabled": false, "crossBranch": { "enabled": true, "blockOnConflict": true } }
|
|
1077
138
|
}
|
|
1078
|
-
|
|
1079
|
-
# Exemples:
|
|
1080
|
-
# "Ajouter l'authentification utilisateur" → "ajouter-lauthentification-utilisateur"
|
|
1081
|
-
# "Fix: Bug dans le login !!" → "fix-bug-dans-le-login"
|
|
1082
|
-
# "Ajout_Feature_Test" → "ajout-feature-test"
|
|
1083
139
|
```
|
|
1084
140
|
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
### Azure DevOps Configuration (NEW in v1.4)
|
|
1088
|
-
|
|
1089
|
-
La section `azureDevOps` configure l'integration avec Azure DevOps CLI pour les PR, work items et boards:
|
|
1090
|
-
|
|
1091
|
-
| Parametre | Description | Defaut |
|
|
1092
|
-
|-----------|-------------|--------|
|
|
1093
|
-
| `enabled` | Activer l'integration Azure DevOps | `false` |
|
|
1094
|
-
| `organization` | URL de l'organisation (ex: `https://dev.azure.com/myorg`) | - |
|
|
1095
|
-
| `project` | Nom du projet Azure DevOps | - |
|
|
1096
|
-
| `defaultReviewers` | Liste des reviewers par defaut pour les PR | `[]` |
|
|
1097
|
-
| `workItemTypes.feature` | Type de work item pour les features | `User Story` |
|
|
1098
|
-
| `workItemTypes.hotfix` | Type de work item pour les hotfixes | `Bug` |
|
|
1099
|
-
| `workItemTypes.release` | Type de work item pour les releases | `Epic` |
|
|
1100
|
-
| `linkWorkItems` | Lier automatiquement les PR aux work items | `true` |
|
|
1101
|
-
| `autoTransitionWorkItems` | Transitionner automatiquement les work items au merge | `true` |
|
|
1102
|
-
|
|
1103
|
-
**Commandes disponibles avec Azure DevOps:**
|
|
1104
|
-
|
|
1105
|
-
| Action | Commande |
|
|
1106
|
-
|--------|----------|
|
|
1107
|
-
| Creer PR avec work item | `az repos pr create --work-items 123` |
|
|
1108
|
-
| Completer PR (merge) | `az repos pr update --id 42 --status completed` |
|
|
1109
|
-
| Creer work item | `az boards work-item create --type "User Story" --title "..."` |
|
|
1110
|
-
| Lier commit a work item | Message commit avec `#123` |
|
|
1111
|
-
|
|
1112
|
-
**Installation Azure CLI:**
|
|
1113
|
-
|
|
1114
|
-
```bash
|
|
1115
|
-
# 1. Installer Azure CLI
|
|
1116
|
-
winget install Microsoft.AzureCLI
|
|
1117
|
-
|
|
1118
|
-
# 2. Ajouter l'extension Azure DevOps (auto-install au premier usage)
|
|
1119
|
-
az extension add --name azure-devops
|
|
1120
|
-
|
|
1121
|
-
# 3. Se connecter
|
|
1122
|
-
az login
|
|
141
|
+
**Sections optionnelles (si activées):**
|
|
1123
142
|
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
143
|
+
| Section | Champs additionnels |
|
|
144
|
+
|---------|---------------------|
|
|
145
|
+
| `language` | `descriptions: { add, update, fix, refactor, remove, improve }` |
|
|
146
|
+
| `database` | `username, password, namePrefix` (si authType=sql) |
|
|
147
|
+
| `azureDevOps` | `organization, project, defaultReviewers, workItemTypes, linkWorkItems` |
|
|
148
|
+
| `efcore` | `contexts[], generateScript, scriptOutputPath` |
|
|
1127
149
|
|
|
1128
150
|
---
|
|
1129
151
|
|
|
1130
|
-
|
|
152
|
+
## Database Auto-Config (v1.3)
|
|
1131
153
|
|
|
1132
|
-
|
|
154
|
+
Convention nommage DB par branche:
|
|
1133
155
|
|
|
1134
|
-
|
|
|
1135
|
-
|
|
1136
|
-
| `enabled` | Activer la creation automatique | `true` |
|
|
1137
|
-
| `server` | Serveur SQL Server | `localhost` |
|
|
1138
|
-
| `authType` | Type d'authentification (`windows` ou `sql`) | `windows` |
|
|
1139
|
-
| `username` | Utilisateur SQL (si authType=sql) | - |
|
|
1140
|
-
| `password` | Mot de passe SQL (si authType=sql) | - |
|
|
1141
|
-
| `namePrefix` | Prefixe des noms de DB (vide = nom du projet) | - |
|
|
1142
|
-
| `autoCreateLocalConfig` | Creer appsettings.Local.json automatiquement | `true` |
|
|
1143
|
-
|
|
1144
|
-
**Convention de nommage des bases de donnees:**
|
|
1145
|
-
|
|
1146
|
-
| Type branche | Pattern | Exemple |
|
|
1147
|
-
|--------------|---------|---------|
|
|
156
|
+
| Type | Pattern | Exemple |
|
|
157
|
+
|------|---------|---------|
|
|
1148
158
|
| develop | `{prefix}_Dev` | `SmartStack_Dev` |
|
|
1149
159
|
| feature/* | `{prefix}_feat_{name}` | `SmartStack_feat_user_auth` |
|
|
1150
|
-
| hotfix/* | `{prefix}_fix_{name}` | `
|
|
160
|
+
| hotfix/* | `{prefix}_fix_{name}` | `SmartStack_fix_login` |
|
|
1151
161
|
| release/* | `{prefix}_rel_{version}` | `SmartStack_rel_1_3_0` |
|
|
1152
162
|
|
|
1153
|
-
**Avantages:**
|
|
1154
|
-
- Isolation complete entre worktrees
|
|
1155
|
-
- Pas de conflits de base de donnees
|
|
1156
|
-
- Chaque developpeur peut travailler sur plusieurs features simultanement
|
|
1157
|
-
- Fichier `appsettings.Local.json` ignore par git (credentials securises)
|
|
1158
|
-
|
|
1159
|
-
#### Adjacent/Legacy Mode (v1.2 compatible)
|
|
1160
|
-
```json
|
|
1161
|
-
{
|
|
1162
|
-
"version": "1.4.0",
|
|
1163
|
-
"initMode": "adjacent",
|
|
1164
|
-
"repository": { "name": "", "defaultBranch": "main", "remoteUrl": "" },
|
|
1165
|
-
"versioning": { "strategy": "semver", "current": "0.1.0", "source": "auto", "sourceFile": "", "tagPrefix": "v", "autoIncrement": { "feature": "minor", "hotfix": "patch", "release": "manual" } },
|
|
1166
|
-
"git": { "branches": { "main": "main", "develop": "develop", "feature": "feature/", "release": "release/", "hotfix": "hotfix/" }, "mergeStrategy": "--no-ff", "protectedBranches": ["main", "develop"] },
|
|
1167
|
-
"worktrees": {
|
|
1168
|
-
"enabled": true,
|
|
1169
|
-
"mode": "adjacent",
|
|
1170
|
-
"basePath": "../worktrees",
|
|
1171
|
-
"permanent": { "main": true, "develop": true },
|
|
1172
|
-
"structure": { "features": "features/", "releases": "releases/", "hotfixes": "hotfixes/" },
|
|
1173
|
-
"cleanupOnFinish": true
|
|
1174
|
-
},
|
|
1175
|
-
"azureDevOps": {
|
|
1176
|
-
"enabled": false,
|
|
1177
|
-
"organization": "",
|
|
1178
|
-
"project": "",
|
|
1179
|
-
"defaultReviewers": [],
|
|
1180
|
-
"workItemTypes": { "feature": "User Story", "hotfix": "Bug", "release": "Epic" },
|
|
1181
|
-
"linkWorkItems": true,
|
|
1182
|
-
"autoTransitionWorkItems": true
|
|
1183
|
-
},
|
|
1184
|
-
"efcore": {
|
|
1185
|
-
"enabled": false, "contexts": [], "generateScript": false, "scriptOutputPath": "",
|
|
1186
|
-
"crossBranch": { "enabled": true, "scanOnMigrationCreate": true, "blockOnConflict": true, "cacheExpiry": "1h" }
|
|
1187
|
-
},
|
|
1188
|
-
"workflow": { "requireConfirmation": true, "createCheckpoints": true, "commitConventions": "conventional", "push": { "afterCommit": "worktree", "afterFinish": "always" } }
|
|
1189
|
-
}
|
|
1190
|
-
```
|
|
1191
|
-
|
|
1192
|
-
### Archive plan
|
|
1193
|
-
Rename to `init_<DATE>_DONE_<TIMESTAMP>.md`
|
|
1194
|
-
|
|
1195
|
-
---
|
|
1196
|
-
|
|
1197
|
-
## Modes
|
|
1198
|
-
|
|
1199
|
-
### Clone Mode (New in v1.3)
|
|
1200
|
-
|
|
1201
|
-
| Command | Action |
|
|
1202
|
-
|---------|--------|
|
|
1203
|
-
| `/gitflow:1-init {url}` | Clone repo to current directory with organized structure |
|
|
1204
|
-
| `/gitflow:1-init {url} {folder}` | Clone repo to target folder with organized structure |
|
|
1205
|
-
| `/gitflow:1-init {url} {folder} --yes` | Clone and initialize without prompts |
|
|
1206
|
-
|
|
1207
|
-
**Examples:**
|
|
1208
|
-
```bash
|
|
1209
|
-
/gitflow:1-init https://github.com/org/repo.git
|
|
1210
|
-
/gitflow:1-init https://github.com/org/repo.git c:/dev
|
|
1211
|
-
/gitflow:1-init git@github.com:org/repo.git c:/dev --yes
|
|
1212
|
-
```
|
|
1213
|
-
|
|
1214
|
-
### Interactive Mode (New in v1.3)
|
|
1215
|
-
|
|
1216
|
-
**Trigger:** Run `/gitflow:1-init` from a directory that is NOT a git repository
|
|
1217
|
-
|
|
1218
|
-
| Step | Action |
|
|
1219
|
-
|------|--------|
|
|
1220
|
-
| 1 | Detect no git repo → **ask for target directory (WHERE?)** |
|
|
1221
|
-
| 2 | Ask for repository URL |
|
|
1222
|
-
| 3 | Validate URL is accessible |
|
|
1223
|
-
| 4 | **Ask EXPLICITLY for project name (WHAT?)** |
|
|
1224
|
-
| 5 | Final confirmation with full path |
|
|
1225
|
-
| 6 | Create organized structure and clone |
|
|
1226
|
-
|
|
1227
|
-
**Flow:**
|
|
1228
|
-
```
|
|
1229
|
-
User runs: /gitflow:1-init
|
|
1230
|
-
|
|
1231
|
-
→ "Where do you want to create your GitFlow project?"
|
|
1232
|
-
[Current directory] [C:/Dev] [~/projects] [Custom path]
|
|
1233
|
-
|
|
1234
|
-
→ "What repository do you want to clone?"
|
|
1235
|
-
[GitHub] [GitLab] [Azure DevOps] [Other]
|
|
1236
|
-
|
|
1237
|
-
→ "Enter the repository URL:"
|
|
1238
|
-
> https://github.com/myorg/my-awesome-project.git
|
|
1239
|
-
|
|
1240
|
-
→ "What should we name this project folder?"
|
|
1241
|
-
[my-awesome-project (Recommended)] [Custom name]
|
|
1242
|
-
|
|
1243
|
-
→ "Create GitFlow project with these settings?
|
|
1244
|
-
Project Name: my-awesome-project
|
|
1245
|
-
Location: C:/Dev/
|
|
1246
|
-
Full Path: C:/Dev/my-awesome-project/
|
|
1247
|
-
Repository: https://github.com/myorg/my-awesome-project.git"
|
|
1248
|
-
[Yes, create project (Recommended)] [Change settings]
|
|
1249
|
-
|
|
1250
|
-
→ Creates structure and clones...
|
|
1251
|
-
→ Opens in 02-Develop
|
|
1252
|
-
```
|
|
1253
|
-
|
|
1254
|
-
### Existing Repo Mode
|
|
1255
|
-
|
|
1256
|
-
| Command | Action |
|
|
1257
|
-
|---------|--------|
|
|
1258
|
-
| `/gitflow:1-init` | Generate plan (asks if structure exists, asks for structure style) |
|
|
1259
|
-
| `/gitflow:1-init --exec` | Execute existing plan |
|
|
1260
|
-
| `/gitflow:1-init --yes` | Generate + execute without intermediate file |
|
|
1261
|
-
| `/gitflow:1-init --migrate` | Force migration of existing structure to v1.4.0 |
|
|
1262
|
-
| `/gitflow:1-init --reset` | Force reset (backup + recreate from scratch) |
|
|
1263
|
-
| `/gitflow:1-init --organized` | Force organized structure (01-Main, 02-Develop) |
|
|
1264
|
-
| `/gitflow:1-init --adjacent` | Force adjacent/legacy structure (../worktrees) |
|
|
1265
|
-
| `/gitflow:1-init --no-worktrees` | Generate plan without worktrees |
|
|
1266
|
-
| `/gitflow:1-init --with-azure-devops` | Configure Azure DevOps integration during init |
|
|
1267
|
-
| `/gitflow:1-init --skip-azure-devops` | Skip Azure DevOps detection/configuration |
|
|
1268
|
-
|
|
1269
|
-
---
|
|
1270
|
-
|
|
1271
|
-
## Migration Details
|
|
1272
|
-
|
|
1273
|
-
### v1.3 → v1.4 (Azure DevOps Integration)
|
|
1274
|
-
|
|
1275
|
-
When migrating to v1.4, these changes are available:
|
|
1276
|
-
|
|
1277
|
-
#### New Config Fields
|
|
1278
|
-
|
|
1279
|
-
```json
|
|
1280
|
-
{
|
|
1281
|
-
"version": "1.4.0",
|
|
1282
|
-
"azureDevOps": {
|
|
1283
|
-
"enabled": false, // NEW - Enable Azure DevOps CLI integration
|
|
1284
|
-
"organization": "", // NEW - Azure DevOps organization URL
|
|
1285
|
-
"project": "", // NEW - Azure DevOps project name
|
|
1286
|
-
"defaultReviewers": [], // NEW - Default PR reviewers
|
|
1287
|
-
"workItemTypes": { // NEW - Work item type mapping
|
|
1288
|
-
"feature": "User Story",
|
|
1289
|
-
"hotfix": "Bug",
|
|
1290
|
-
"release": "Epic"
|
|
1291
|
-
},
|
|
1292
|
-
"linkWorkItems": true, // NEW - Auto-link PR to work items
|
|
1293
|
-
"autoTransitionWorkItems": true // NEW - Auto-transition work items on merge
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
```
|
|
1297
|
-
|
|
1298
|
-
#### Migration Options
|
|
1299
|
-
|
|
1300
|
-
```javascript
|
|
1301
|
-
AskUserQuestion({
|
|
1302
|
-
questions: [{
|
|
1303
|
-
question: "v1.3 config detected. Azure DevOps integration is now available. Configure it?",
|
|
1304
|
-
header: "Azure DevOps",
|
|
1305
|
-
options: [
|
|
1306
|
-
{ label: "Yes, configure", description: "Set up Azure DevOps CLI integration (Recommended if using Azure DevOps)" },
|
|
1307
|
-
{ label: "Skip for now", description: "Just update version to v1.4.0, configure later" }
|
|
1308
|
-
],
|
|
1309
|
-
multiSelect: false
|
|
1310
|
-
}]
|
|
1311
|
-
})
|
|
1312
|
-
```
|
|
1313
|
-
|
|
1314
163
|
---
|
|
1315
164
|
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
When migrating to v1.3, these changes are available:
|
|
1319
|
-
|
|
1320
|
-
#### New Config Fields
|
|
165
|
+
## Résumé Final
|
|
1321
166
|
|
|
1322
|
-
```json
|
|
1323
|
-
{
|
|
1324
|
-
"version": "1.4.0",
|
|
1325
|
-
"initMode": "organized", // NEW - "organized" | "adjacent" | "clone" | "interactive"
|
|
1326
|
-
"worktrees": {
|
|
1327
|
-
"mode": "organized", // NEW - matches initMode
|
|
1328
|
-
"bareRepo": "../.bare", // NEW - path to bare repo (organized mode)
|
|
1329
|
-
"permanent": {
|
|
1330
|
-
"main": { "path": "../01-Main", "prefix": "01" }, // CHANGED - object with path/prefix
|
|
1331
|
-
"develop": { "path": "../02-Develop", "prefix": "02" } // CHANGED
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
167
|
```
|
|
168
|
+
GITFLOW INITIALIZED
|
|
169
|
+
- Repository: {name} | Remote: {url}
|
|
170
|
+
- Structure: {organized|adjacent} | Worktrees: {enabled|disabled}
|
|
171
|
+
- Working Dir: {path}/02-Develop
|
|
1336
172
|
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
```javascript
|
|
1340
|
-
AskUserQuestion({
|
|
1341
|
-
questions: [{
|
|
1342
|
-
question: "v1.2 config detected. How would you like to upgrade?",
|
|
1343
|
-
header: "Migrate",
|
|
1344
|
-
options: [
|
|
1345
|
-
{ label: "Keep adjacent", description: "Stay with ../worktrees structure (just update version)" },
|
|
1346
|
-
{ label: "Convert to organized", description: "Restructure to 01-Main/, 02-Develop/, etc. (Recommended)" },
|
|
1347
|
-
{ label: "Skip", description: "Keep v1.2 config unchanged" }
|
|
1348
|
-
],
|
|
1349
|
-
multiSelect: false
|
|
1350
|
-
}]
|
|
1351
|
-
})
|
|
173
|
+
→ Prochain: /gitflow:10-start feature {name}
|
|
1352
174
|
```
|
|
1353
175
|
|
|
1354
|
-
#### Convert to Organized (if selected)
|
|
1355
|
-
|
|
1356
|
-
1. Backup current worktrees
|
|
1357
|
-
2. Create new organized structure
|
|
1358
|
-
3. Move worktree contents to new locations
|
|
1359
|
-
4. Update config with new paths
|
|
1360
|
-
5. Clean up old structure
|
|
1361
|
-
|
|
1362
176
|
---
|
|
1363
177
|
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
When migrating from v1.0/v1.1 to v1.2:
|
|
1367
|
-
|
|
1368
|
-
#### Config additions
|
|
1369
|
-
|
|
1370
|
-
```json
|
|
1371
|
-
{
|
|
1372
|
-
"version": "1.2.0",
|
|
1373
|
-
"worktrees": {
|
|
1374
|
-
"enabled": true,
|
|
1375
|
-
"basePath": "../worktrees",
|
|
1376
|
-
"permanent": { "main": true, "develop": true },
|
|
1377
|
-
"structure": { "features": "features/", "releases": "releases/", "hotfixes": "hotfixes/" },
|
|
1378
|
-
"cleanupOnFinish": true
|
|
1379
|
-
},
|
|
1380
|
-
"efcore": {
|
|
1381
|
-
"crossBranch": {
|
|
1382
|
-
"enabled": true,
|
|
1383
|
-
"scanOnMigrationCreate": true,
|
|
1384
|
-
"blockOnConflict": true,
|
|
1385
|
-
"cacheExpiry": "1h"
|
|
1386
|
-
}
|
|
1387
|
-
},
|
|
1388
|
-
"workflow": {
|
|
1389
|
-
"push": {
|
|
1390
|
-
"afterCommit": "worktree",
|
|
1391
|
-
"afterFinish": "always"
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
```
|
|
1396
|
-
|
|
1397
|
-
#### Structure additions
|
|
1398
|
-
|
|
1399
|
-
```
|
|
1400
|
-
.claude/gitflow/
|
|
1401
|
-
├── backup/ # NEW - for migration backups
|
|
1402
|
-
├── cache/ # NEW - for cross-branch scan cache
|
|
1403
|
-
└── (existing folders preserved)
|
|
1404
|
-
```
|
|
1405
|
-
|
|
1406
|
-
### Preserved during all migrations
|
|
178
|
+
## Modes CLI
|
|
1407
179
|
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
- `
|
|
1411
|
-
-
|
|
1412
|
-
-
|
|
180
|
+
| Commande | Action |
|
|
181
|
+
|----------|--------|
|
|
182
|
+
| `/gitflow:1-init {url}` | Clone avec structure organisée |
|
|
183
|
+
| `/gitflow:1-init` | Interactive ou existing repo |
|
|
184
|
+
| `/gitflow:1-init --exec` | Exécuter plan existant |
|
|
185
|
+
| `/gitflow:1-init --yes` | Sans confirmation |
|
|
186
|
+
| `/gitflow:1-init --migrate` | Forcer migration config |
|
|
187
|
+
| `/gitflow:1-init --organized` | Forcer structure organisée |
|
|
188
|
+
| `/gitflow:1-init --adjacent` | Forcer structure legacy |
|