@atlashub/smartstack-cli 1.5.1 → 1.5.2
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/css/styles.css +2168 -2168
- package/.documentation/js/app.js +794 -794
- package/config/default-config.json +86 -86
- package/config/settings.json +53 -53
- package/config/settings.local.example.json +16 -16
- package/dist/index.js +0 -0
- package/dist/index.js.map +1 -1
- package/package.json +88 -88
- package/templates/agents/action.md +36 -36
- package/templates/agents/efcore/conflicts.md +84 -84
- package/templates/agents/efcore/db-deploy.md +51 -51
- package/templates/agents/efcore/db-reset.md +59 -59
- package/templates/agents/efcore/db-seed.md +56 -56
- package/templates/agents/efcore/db-status.md +64 -64
- package/templates/agents/efcore/migration.md +85 -85
- package/templates/agents/efcore/rebase-snapshot.md +62 -62
- package/templates/agents/efcore/scan.md +90 -90
- package/templates/agents/efcore/squash.md +67 -67
- package/templates/agents/explore-codebase.md +65 -65
- package/templates/agents/explore-docs.md +97 -97
- package/templates/agents/fix-grammar.md +49 -49
- package/templates/agents/gitflow/abort.md +45 -45
- package/templates/agents/gitflow/cleanup.md +85 -85
- package/templates/agents/gitflow/commit.md +40 -40
- package/templates/agents/gitflow/exec.md +48 -48
- package/templates/agents/gitflow/finish.md +92 -92
- package/templates/agents/gitflow/init.md +139 -139
- package/templates/agents/gitflow/merge.md +62 -62
- package/templates/agents/gitflow/plan.md +42 -42
- package/templates/agents/gitflow/pr.md +78 -78
- package/templates/agents/gitflow/review.md +49 -49
- package/templates/agents/gitflow/start.md +61 -61
- package/templates/agents/gitflow/status.md +32 -32
- package/templates/agents/snipper.md +36 -36
- package/templates/agents/websearch.md +46 -46
- package/templates/commands/_resources/formatting-guide.md +124 -124
- package/templates/commands/ai-prompt.md +315 -315
- package/templates/commands/apex/1-analyze.md +100 -100
- package/templates/commands/apex/2-plan.md +145 -145
- package/templates/commands/apex/3-execute.md +171 -171
- package/templates/commands/apex/4-examine.md +116 -116
- package/templates/commands/apex/5-tasks.md +209 -209
- package/templates/commands/apex.md +76 -76
- package/templates/commands/application/create.md +362 -362
- package/templates/commands/application/templates-backend.md +463 -463
- package/templates/commands/application/templates-frontend.md +517 -517
- package/templates/commands/application/templates-i18n.md +478 -478
- package/templates/commands/application/templates-seed.md +362 -362
- package/templates/commands/application.md +303 -303
- package/templates/commands/business-analyse/0-orchestrate.md +640 -640
- package/templates/commands/business-analyse/1-init.md +269 -269
- package/templates/commands/business-analyse/2-discover.md +520 -520
- package/templates/commands/business-analyse/3-analyse.md +408 -408
- package/templates/commands/business-analyse/4-specify.md +598 -598
- package/templates/commands/business-analyse/5-validate.md +326 -326
- package/templates/commands/business-analyse/6-handoff.md +746 -746
- package/templates/commands/business-analyse/7-doc-html.md +602 -602
- package/templates/commands/business-analyse/bug.md +325 -325
- package/templates/commands/business-analyse/change-request.md +368 -368
- package/templates/commands/business-analyse/hotfix.md +200 -200
- package/templates/commands/business-analyse.md +640 -640
- package/templates/commands/controller/create.md +216 -216
- package/templates/commands/controller/postman-templates.md +528 -528
- package/templates/commands/controller/templates.md +600 -600
- package/templates/commands/controller.md +337 -337
- package/templates/commands/create/agent.md +138 -138
- package/templates/commands/create/command.md +166 -166
- package/templates/commands/create/hook.md +234 -234
- package/templates/commands/create/plugin.md +329 -329
- package/templates/commands/create/project.md +507 -507
- package/templates/commands/create/skill.md +199 -199
- package/templates/commands/create.md +220 -220
- package/templates/commands/debug.md +95 -95
- package/templates/commands/documentation/module.md +202 -202
- package/templates/commands/documentation/templates.md +432 -432
- package/templates/commands/documentation.md +190 -190
- package/templates/commands/efcore/_env-check.md +153 -153
- package/templates/commands/efcore/conflicts.md +186 -186
- package/templates/commands/efcore/db-deploy.md +193 -193
- package/templates/commands/efcore/db-reset.md +426 -426
- package/templates/commands/efcore/db-seed.md +326 -326
- package/templates/commands/efcore/db-status.md +226 -226
- package/templates/commands/efcore/migration.md +400 -400
- package/templates/commands/efcore/rebase-snapshot.md +264 -264
- package/templates/commands/efcore/scan.md +198 -198
- package/templates/commands/efcore/squash.md +298 -298
- package/templates/commands/efcore.md +224 -224
- package/templates/commands/epct.md +69 -69
- package/templates/commands/explain.md +186 -186
- package/templates/commands/explore.md +45 -45
- package/templates/commands/feature-full.md +267 -267
- package/templates/commands/gitflow/1-init.md +1038 -1038
- package/templates/commands/gitflow/10-start.md +768 -768
- package/templates/commands/gitflow/11-finish.md +457 -457
- package/templates/commands/gitflow/12-cleanup.md +276 -276
- package/templates/commands/gitflow/13-sync.md +216 -216
- package/templates/commands/gitflow/14-rebase.md +251 -251
- package/templates/commands/gitflow/2-status.md +277 -277
- package/templates/commands/gitflow/3-commit.md +344 -344
- package/templates/commands/gitflow/4-plan.md +145 -145
- package/templates/commands/gitflow/5-exec.md +147 -147
- package/templates/commands/gitflow/6-abort.md +344 -344
- package/templates/commands/gitflow/7-pull-request.md +453 -355
- package/templates/commands/gitflow/8-review.md +240 -176
- package/templates/commands/gitflow/9-merge.md +451 -365
- package/templates/commands/gitflow.md +128 -128
- package/templates/commands/implement.md +663 -663
- package/templates/commands/init.md +567 -567
- package/templates/commands/mcp-integration.md +330 -330
- package/templates/commands/notification.md +129 -129
- package/templates/commands/oneshot.md +57 -57
- package/templates/commands/quick-search.md +72 -72
- package/templates/commands/ralph-loop/cancel-ralph.md +18 -18
- package/templates/commands/ralph-loop/help.md +126 -126
- package/templates/commands/ralph-loop/ralph-loop.md +18 -18
- package/templates/commands/review.md +106 -106
- package/templates/commands/utils/test-web-config.md +160 -160
- package/templates/commands/utils/test-web.md +151 -151
- package/templates/commands/validate.md +233 -233
- package/templates/commands/workflow.md +193 -193
- package/templates/gitflow/config.json +138 -138
- package/templates/hooks/ef-migration-check.md +139 -139
- package/templates/hooks/hooks.json +25 -25
- package/templates/hooks/stop-hook.sh +177 -177
- package/templates/skills/ai-prompt/SKILL.md +778 -778
- package/templates/skills/application/SKILL.md +563 -563
- package/templates/skills/application/templates-backend.md +450 -450
- package/templates/skills/application/templates-frontend.md +531 -531
- package/templates/skills/application/templates-i18n.md +520 -520
- package/templates/skills/application/templates-seed.md +647 -647
- package/templates/skills/business-analyse/SKILL.md +191 -191
- package/templates/skills/business-analyse/questionnaire.md +283 -283
- package/templates/skills/business-analyse/templates-frd.md +477 -477
- package/templates/skills/business-analyse/templates-react.md +580 -580
- package/templates/skills/controller/SKILL.md +240 -240
- package/templates/skills/controller/postman-templates.md +614 -614
- package/templates/skills/controller/templates.md +1468 -1468
- package/templates/skills/documentation/SKILL.md +133 -133
- package/templates/skills/documentation/templates.md +476 -476
- package/templates/skills/feature-full/SKILL.md +838 -838
- package/templates/skills/notification/SKILL.md +555 -555
- package/templates/skills/ui-components/SKILL.md +870 -870
- package/templates/skills/workflow/SKILL.md +582 -582
- package/templates/test-web/api-health.json +38 -38
- package/templates/test-web/minimal.json +19 -19
- package/templates/test-web/npm-package.json +46 -46
- package/templates/test-web/seo-check.json +54 -54
|
@@ -1,355 +1,453 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Phase 7 - Create Pull Request with auto-generated description and checks
|
|
3
|
-
agent: gitflow-pr
|
|
4
|
-
model: haiku
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Phase 7: PULL-REQUEST - Creation PR avec checks
|
|
8
|
-
|
|
9
|
-
Tu es expert GitFlow. Cree une Pull Request avec validation complete.
|
|
10
|
-
|
|
11
|
-
**Argument:** `$ARGUMENTS` = branche cible (optionnel, **SCAN AUTOMATIQUE** si sur main/develop)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## ETAPE 0:
|
|
16
|
-
|
|
17
|
-
> **
|
|
18
|
-
|
|
19
|
-
### 0.
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
|
267
|
-
|
|
268
|
-
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
|
334
|
-
|
|
335
|
-
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
1
|
+
---
|
|
2
|
+
description: Phase 7 - Create Pull Request with auto-generated description and checks
|
|
3
|
+
agent: gitflow-pr
|
|
4
|
+
model: haiku
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Phase 7: PULL-REQUEST - Creation PR avec checks
|
|
8
|
+
|
|
9
|
+
Tu es expert GitFlow. Cree une Pull Request avec validation complete.
|
|
10
|
+
|
|
11
|
+
**Argument:** `$ARGUMENTS` = branche cible (optionnel, **SCAN AUTOMATIQUE** si sur main/develop)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ETAPE 0: DETECTION DU PROVIDER GIT
|
|
16
|
+
|
|
17
|
+
> **CRITIQUE:** Detecter si le remote est GitHub ou Azure DevOps pour utiliser le bon CLI.
|
|
18
|
+
|
|
19
|
+
### 0.0 Detection du provider
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
REMOTE_URL=$(git remote get-url origin 2>/dev/null || echo "")
|
|
23
|
+
|
|
24
|
+
if [[ "$REMOTE_URL" == *"dev.azure.com"* ]] || [[ "$REMOTE_URL" == *"visualstudio.com"* ]]; then
|
|
25
|
+
GIT_PROVIDER="azuredevops"
|
|
26
|
+
# Extraire org et project depuis l'URL Azure DevOps
|
|
27
|
+
# Format: https://dev.azure.com/{org}/{project}/_git/{repo}
|
|
28
|
+
# ou: https://{org}@dev.azure.com/{org}/{project}/_git/{repo}
|
|
29
|
+
if [[ "$REMOTE_URL" =~ dev\.azure\.com/([^/]+)/([^/]+)/_git/([^/]+) ]]; then
|
|
30
|
+
AZURE_ORG="${BASH_REMATCH[1]}"
|
|
31
|
+
AZURE_PROJECT="${BASH_REMATCH[2]}"
|
|
32
|
+
AZURE_REPO="${BASH_REMATCH[3]}"
|
|
33
|
+
fi
|
|
34
|
+
echo "Provider: Azure DevOps (org: $AZURE_ORG, project: $AZURE_PROJECT)"
|
|
35
|
+
elif [[ "$REMOTE_URL" == *"github.com"* ]]; then
|
|
36
|
+
GIT_PROVIDER="github"
|
|
37
|
+
echo "Provider: GitHub"
|
|
38
|
+
else
|
|
39
|
+
GIT_PROVIDER="unknown"
|
|
40
|
+
echo "⚠️ Provider non reconnu - tentative avec GitHub CLI"
|
|
41
|
+
fi
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 0.0.1 Verification CLI disponible
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
if [ "$GIT_PROVIDER" = "azuredevops" ]; then
|
|
48
|
+
if ! command -v az &> /dev/null; then
|
|
49
|
+
echo "❌ Azure CLI non installe!"
|
|
50
|
+
echo ""
|
|
51
|
+
echo "Installation:"
|
|
52
|
+
echo " Windows: winget install Microsoft.AzureCLI"
|
|
53
|
+
echo " macOS: brew install azure-cli"
|
|
54
|
+
echo " Linux: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash"
|
|
55
|
+
exit 1
|
|
56
|
+
fi
|
|
57
|
+
# Verifier extension devops
|
|
58
|
+
if ! az devops --help &> /dev/null; then
|
|
59
|
+
echo "Installation extension Azure DevOps..."
|
|
60
|
+
az extension add --name azure-devops
|
|
61
|
+
fi
|
|
62
|
+
else
|
|
63
|
+
if ! command -v gh &> /dev/null; then
|
|
64
|
+
echo "❌ GitHub CLI non installe!"
|
|
65
|
+
echo ""
|
|
66
|
+
echo "Installation: https://cli.github.com"
|
|
67
|
+
exit 1
|
|
68
|
+
fi
|
|
69
|
+
fi
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## ETAPE 1: SCAN PROACTIF (si sur main/develop)
|
|
75
|
+
|
|
76
|
+
> **COMPORTEMENT PROACTIF:** Si on est sur main ou develop, scanner TOUTES les branches pour proposer celles qui ont besoin d'une PR.
|
|
77
|
+
|
|
78
|
+
### 1.1 Detection du contexte
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
CURRENT=$(git rev-parse --abbrev-ref HEAD)
|
|
82
|
+
|
|
83
|
+
# Si sur main ou develop → mode scan
|
|
84
|
+
if [[ "$CURRENT" == "main" || "$CURRENT" == "develop" ]]; then
|
|
85
|
+
SCAN_MODE=true
|
|
86
|
+
else
|
|
87
|
+
SCAN_MODE=false
|
|
88
|
+
fi
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 1.2 Scanner les branches sans PR (si SCAN_MODE)
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
if [ "$SCAN_MODE" = true ]; then
|
|
95
|
+
git fetch --all --quiet
|
|
96
|
+
|
|
97
|
+
# Lister toutes les branches feature/release/hotfix
|
|
98
|
+
FEATURES=$(git branch -r | grep 'origin/feature/' | sed 's|origin/||' | tr -d ' ')
|
|
99
|
+
RELEASES=$(git branch -r | grep 'origin/release/' | sed 's|origin/||' | tr -d ' ')
|
|
100
|
+
HOTFIXES=$(git branch -r | grep 'origin/hotfix/' | sed 's|origin/||' | tr -d ' ')
|
|
101
|
+
|
|
102
|
+
ALL_BRANCHES="$FEATURES $RELEASES $HOTFIXES"
|
|
103
|
+
|
|
104
|
+
for BRANCH in $ALL_BRANCHES; do
|
|
105
|
+
# Verifier si PR existe (ouverte ou mergee)
|
|
106
|
+
if [ "$GIT_PROVIDER" = "azuredevops" ]; then
|
|
107
|
+
PR_EXISTS=$(az repos pr list --repository "$AZURE_REPO" --source-branch "$BRANCH" --organization "https://dev.azure.com/$AZURE_ORG" --project "$AZURE_PROJECT" --query "[0].pullRequestId" -o tsv 2>/dev/null)
|
|
108
|
+
else
|
|
109
|
+
PR_EXISTS=$(gh pr list --head "$BRANCH" --json number --jq '.[0]')
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
if [ -z "$PR_EXISTS" ]; then
|
|
113
|
+
# Pas de PR → candidat
|
|
114
|
+
# Compter les commits
|
|
115
|
+
if [[ "$BRANCH" == hotfix/* || "$BRANCH" == release/* ]]; then
|
|
116
|
+
BASE="main"
|
|
117
|
+
else
|
|
118
|
+
BASE="develop"
|
|
119
|
+
fi
|
|
120
|
+
COMMITS=$(git rev-list --count origin/$BASE..origin/$BRANCH 2>/dev/null || echo "0")
|
|
121
|
+
|
|
122
|
+
if [ "$COMMITS" -gt 0 ]; then
|
|
123
|
+
NEEDS_PR+=("$BRANCH|$COMMITS|$BASE")
|
|
124
|
+
fi
|
|
125
|
+
fi
|
|
126
|
+
done
|
|
127
|
+
fi
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 0.3 Afficher le tableau des branches sans PR
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
================================================================================
|
|
134
|
+
GITFLOW PULL-REQUEST - SCAN DES BRANCHES
|
|
135
|
+
================================================================================
|
|
136
|
+
|
|
137
|
+
📋 BRANCHES SANS PR (action recommandee):
|
|
138
|
+
┌─────────────────────────────┬───────────┬──────────┬───────────┬─────────────┐
|
|
139
|
+
│ Branche │ Type │ Commits │ Cible │ Prete? │
|
|
140
|
+
├─────────────────────────────┼───────────┼──────────┼───────────┼─────────────┤
|
|
141
|
+
│ feature/add-user-auth │ feature │ 5 │ develop │ ✅ Oui │
|
|
142
|
+
│ feature/wip-refactor │ feature │ 2 │ develop │ ⚠️ Build? │
|
|
143
|
+
│ hotfix/fix-login │ hotfix │ 1 │ main │ ✅ Oui │
|
|
144
|
+
│ release/v1.5.0 │ release │ 8 │ main │ ✅ Oui │
|
|
145
|
+
└─────────────────────────────┴───────────┴──────────┴───────────┴─────────────┘
|
|
146
|
+
|
|
147
|
+
✅ BRANCHES AVEC PR OUVERTE:
|
|
148
|
+
┌─────────────────────────────┬───────────┬────────────┬────────────────────────┐
|
|
149
|
+
│ Branche │ Type │ PR # │ Statut │
|
|
150
|
+
├─────────────────────────────┼───────────┼────────────┼────────────────────────┤
|
|
151
|
+
│ feature/add-orders │ feature │ #43 │ Review en cours │
|
|
152
|
+
└─────────────────────────────┴───────────┴────────────┴────────────────────────┘
|
|
153
|
+
|
|
154
|
+
================================================================================
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### 0.4 Proposition interactive (si SCAN_MODE)
|
|
158
|
+
|
|
159
|
+
```javascript
|
|
160
|
+
if (NEEDS_PR.length > 0) {
|
|
161
|
+
// Trier par priorite: hotfixes > releases > features
|
|
162
|
+
const sorted = NEEDS_PR.sort((a, b) => {
|
|
163
|
+
const priority = { 'hotfix': 0, 'release': 1, 'feature': 2 }
|
|
164
|
+
return priority[getType(a)] - priority[getType(b)]
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
AskUserQuestion({
|
|
168
|
+
questions: [{
|
|
169
|
+
question: "Pour quelle branche voulez-vous creer une PR ?",
|
|
170
|
+
header: "PR",
|
|
171
|
+
options: sorted.map(item => {
|
|
172
|
+
const [branch, commits, target] = item.split('|')
|
|
173
|
+
return {
|
|
174
|
+
label: branch,
|
|
175
|
+
description: `${commits} commits → ${target} (${getType(branch)})`
|
|
176
|
+
}
|
|
177
|
+
}),
|
|
178
|
+
multiSelect: false
|
|
179
|
+
}]
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
// Switcher vers la branche selectionnee
|
|
183
|
+
// git checkout $SELECTED_BRANCH
|
|
184
|
+
// Puis continuer avec le workflow normal
|
|
185
|
+
} else {
|
|
186
|
+
console.log("✅ Toutes les branches ont deja une PR!")
|
|
187
|
+
console.log("")
|
|
188
|
+
console.log("Actions disponibles:")
|
|
189
|
+
if (GIT_PROVIDER === "azuredevops") {
|
|
190
|
+
console.log(" - Voir les PRs: az repos pr list --repository " + AZURE_REPO)
|
|
191
|
+
} else {
|
|
192
|
+
console.log(" - Voir les PRs: gh pr list")
|
|
193
|
+
}
|
|
194
|
+
console.log(" - Merger une PR: /gitflow:9-merge <numero>")
|
|
195
|
+
console.log(" - Finaliser: /gitflow:11-finish")
|
|
196
|
+
exit(0)
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Pre-checks obligatoires
|
|
203
|
+
|
|
204
|
+
### 1. Validation branche et detection cible
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# Branche courante (ou selectionnee depuis scan)
|
|
208
|
+
CURRENT=$(git rev-parse --abbrev-ref HEAD)
|
|
209
|
+
|
|
210
|
+
# Verifier que ce n'est pas main/develop (sauf si scan mode a selectionne une branche)
|
|
211
|
+
if [[ "$CURRENT" == "main" || "$CURRENT" == "develop" ]]; then
|
|
212
|
+
if [ "$SCAN_MODE" = true ] && [ -n "$SELECTED_BRANCH" ]; then
|
|
213
|
+
# On a selectionne une branche depuis le scan, switcher
|
|
214
|
+
git checkout "$SELECTED_BRANCH"
|
|
215
|
+
CURRENT="$SELECTED_BRANCH"
|
|
216
|
+
else
|
|
217
|
+
echo "⚠️ Vous etes sur '$CURRENT' - impossible de creer une PR depuis cette branche."
|
|
218
|
+
echo ""
|
|
219
|
+
echo "→ Utilisez cette commande depuis une branche feature/release/hotfix"
|
|
220
|
+
echo " ou executez-la depuis main/develop pour scanner les branches disponibles."
|
|
221
|
+
exit 1
|
|
222
|
+
fi
|
|
223
|
+
fi
|
|
224
|
+
|
|
225
|
+
# ============================================
|
|
226
|
+
# DETECTION AUTOMATIQUE DE LA CIBLE
|
|
227
|
+
# ============================================
|
|
228
|
+
# GitFlow standard:
|
|
229
|
+
# - feature/* → develop
|
|
230
|
+
# - release/* → main (puis merge back to develop apres)
|
|
231
|
+
# - hotfix/* → main (puis merge back to develop apres)
|
|
232
|
+
# ============================================
|
|
233
|
+
|
|
234
|
+
if [[ -n "$ARGUMENTS" && "$ARGUMENTS" != "--"* ]]; then
|
|
235
|
+
# Cible explicite fournie par l'utilisateur
|
|
236
|
+
TARGET="$ARGUMENTS"
|
|
237
|
+
else
|
|
238
|
+
# Detection automatique selon le type de branche
|
|
239
|
+
if [[ "$CURRENT" == hotfix/* ]]; then
|
|
240
|
+
TARGET="main"
|
|
241
|
+
echo "Hotfix detecte → PR vers main (GitFlow standard)"
|
|
242
|
+
elif [[ "$CURRENT" == release/* ]]; then
|
|
243
|
+
TARGET="main"
|
|
244
|
+
echo "Release detectee → PR vers main (GitFlow standard)"
|
|
245
|
+
else
|
|
246
|
+
TARGET="develop"
|
|
247
|
+
echo "Feature/autre → PR vers develop"
|
|
248
|
+
fi
|
|
249
|
+
fi
|
|
250
|
+
|
|
251
|
+
echo "Cible: $TARGET"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**Cibles par defaut (GitFlow standard):**
|
|
255
|
+
|
|
256
|
+
| Type branche | Cible PR | Raison |
|
|
257
|
+
|--------------|----------|--------|
|
|
258
|
+
| `feature/*` | `develop` | Features integrees sur develop |
|
|
259
|
+
| `release/*` | `main` | Releases deployees sur main |
|
|
260
|
+
| `hotfix/*` | `main` | Hotfixes appliques sur main d'abord |
|
|
261
|
+
|
|
262
|
+
### 2. Synchronisation
|
|
263
|
+
|
|
264
|
+
| Check | Commande | Action si echec |
|
|
265
|
+
|-------|----------|-----------------|
|
|
266
|
+
| Fetch | `git fetch origin` | - |
|
|
267
|
+
| A jour vs target | `git rev-list --count HEAD..origin/{target}` | `git rebase origin/{target}` |
|
|
268
|
+
| Pas de conflits | `git merge-tree` | Resoudre conflits d'abord |
|
|
269
|
+
|
|
270
|
+
### 3. Qualite code
|
|
271
|
+
|
|
272
|
+
| Check | Commande | Bloquant |
|
|
273
|
+
|-------|----------|----------|
|
|
274
|
+
| Build | `dotnet build` | OUI |
|
|
275
|
+
| Tests | `dotnet test` | OUI |
|
|
276
|
+
| Format | `dotnet format --verify-no-changes` | NON (warning) |
|
|
277
|
+
|
|
278
|
+
### 4. EF Core (si applicable)
|
|
279
|
+
|
|
280
|
+
| Check | Validation |
|
|
281
|
+
|-------|------------|
|
|
282
|
+
| Migrations completes | 3 fichiers (Migration + Designer + ModelSnapshot) |
|
|
283
|
+
| Build avec migrations | `dotnet ef migrations script --idempotent` |
|
|
284
|
+
| Pas de pending | Toutes migrations commitees |
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Generation PR
|
|
289
|
+
|
|
290
|
+
### Titre automatique
|
|
291
|
+
|
|
292
|
+
| Type branche | Format titre |
|
|
293
|
+
|--------------|--------------|
|
|
294
|
+
| `feature/*` | `feat: {description from branch name}` |
|
|
295
|
+
| `hotfix/*` | `fix: {description from branch name}` |
|
|
296
|
+
| `release/*` | `release: v{version}` |
|
|
297
|
+
| Autre | `{branch name}` |
|
|
298
|
+
|
|
299
|
+
**Extraction description:**
|
|
300
|
+
```
|
|
301
|
+
feature/add-user-authentication → "add user authentication"
|
|
302
|
+
hotfix/fix-login-bug → "fix login bug"
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Description automatique
|
|
306
|
+
|
|
307
|
+
```markdown
|
|
308
|
+
## Summary
|
|
309
|
+
|
|
310
|
+
{Liste des commits depuis divergence avec develop}
|
|
311
|
+
|
|
312
|
+
## Changes
|
|
313
|
+
|
|
314
|
+
- {Fichiers modifies groupes par type}
|
|
315
|
+
|
|
316
|
+
## Checklist
|
|
317
|
+
|
|
318
|
+
- [ ] Tests ajoutés/mis à jour
|
|
319
|
+
- [ ] Documentation mise à jour
|
|
320
|
+
- [ ] Breaking changes documentés
|
|
321
|
+
- [ ] Migration EF Core testée (si applicable)
|
|
322
|
+
|
|
323
|
+
## EF Core Migrations
|
|
324
|
+
|
|
325
|
+
{Liste des migrations incluses, ou "Aucune migration"}
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
🤖 Generated with GitFlow
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Labels automatiques
|
|
332
|
+
|
|
333
|
+
| Condition | Label |
|
|
334
|
+
|-----------|-------|
|
|
335
|
+
| `feature/*` | `enhancement` |
|
|
336
|
+
| `hotfix/*` | `bug` |
|
|
337
|
+
| `release/*` | `release` |
|
|
338
|
+
| Contient migrations | `database` |
|
|
339
|
+
| Tests modifies | `tests` |
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## Execution
|
|
344
|
+
|
|
345
|
+
### Pour GitHub
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
if [ "$GIT_PROVIDER" = "github" ]; then
|
|
349
|
+
gh pr create \
|
|
350
|
+
--base {target} \
|
|
351
|
+
--title "{titre}" \
|
|
352
|
+
--body "{description}" \
|
|
353
|
+
--label "{labels}" \
|
|
354
|
+
--assignee "@me"
|
|
355
|
+
fi
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### Pour Azure DevOps
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
if [ "$GIT_PROVIDER" = "azuredevops" ]; then
|
|
362
|
+
az repos pr create \
|
|
363
|
+
--repository "$AZURE_REPO" \
|
|
364
|
+
--source-branch "$CURRENT" \
|
|
365
|
+
--target-branch "{target}" \
|
|
366
|
+
--title "{titre}" \
|
|
367
|
+
--description "{description}" \
|
|
368
|
+
--organization "https://dev.azure.com/$AZURE_ORG" \
|
|
369
|
+
--project "$AZURE_PROJECT"
|
|
370
|
+
fi
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
> **Note Azure DevOps:** Les labels et assignees ne sont pas supportes via CLI. Ajoutez-les manuellement via l'interface web si necessaire.
|
|
374
|
+
|
|
375
|
+
### Options supplementaires
|
|
376
|
+
|
|
377
|
+
| Option | Condition | GitHub | Azure DevOps |
|
|
378
|
+
|--------|-----------|--------|--------------|
|
|
379
|
+
| Draft | Si WIP dans titre | `--draft` | `--draft` |
|
|
380
|
+
| Reviewer | Si configure | `--reviewer` | Non supporte CLI |
|
|
381
|
+
| Milestone | Si release | `--milestone` | Non supporte CLI |
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## Post-creation
|
|
386
|
+
|
|
387
|
+
1. Afficher URL de la PR
|
|
388
|
+
2. Afficher checklist restante
|
|
389
|
+
3. Suggerer `/gitflow:8-review` pour auto-review
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## Resume
|
|
394
|
+
|
|
395
|
+
```
|
|
396
|
+
PULL REQUEST CREEE
|
|
397
|
+
────────────────────────────────
|
|
398
|
+
PR: #{number}
|
|
399
|
+
Titre: {titre}
|
|
400
|
+
Base: {target} ← {current}
|
|
401
|
+
URL: {url}
|
|
402
|
+
|
|
403
|
+
Checks:
|
|
404
|
+
Build: ✓/✗
|
|
405
|
+
Tests: ✓/✗
|
|
406
|
+
EF Core: ✓/✗/N/A
|
|
407
|
+
Conflicts: ✓/✗
|
|
408
|
+
|
|
409
|
+
Labels: {labels}
|
|
410
|
+
────────────────────────────────
|
|
411
|
+
Prochain: /gitflow:8-review #{number}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## Erreurs courantes
|
|
417
|
+
|
|
418
|
+
| Erreur | Solution |
|
|
419
|
+
|--------|----------|
|
|
420
|
+
| "No commits between" | Verifier que branche a des commits |
|
|
421
|
+
| "Merge conflict" | `git rebase origin/{target}` + resoudre |
|
|
422
|
+
| "Build failed" | Corriger erreurs avant PR |
|
|
423
|
+
| "PR already exists" | Afficher URL existante |
|
|
424
|
+
| "az: command not found" | Installer Azure CLI: `winget install Microsoft.AzureCLI` |
|
|
425
|
+
| "gh: command not found" | Installer GitHub CLI: https://cli.github.com |
|
|
426
|
+
| "Please run 'az login'" | Authentification requise: `az login` |
|
|
427
|
+
|
|
428
|
+
## Providers supportes
|
|
429
|
+
|
|
430
|
+
| Provider | CLI | Detection URL |
|
|
431
|
+
|----------|-----|---------------|
|
|
432
|
+
| **GitHub** | `gh` | `github.com` |
|
|
433
|
+
| **Azure DevOps** | `az repos` | `dev.azure.com` ou `visualstudio.com` |
|
|
434
|
+
|
|
435
|
+
## Modes
|
|
436
|
+
|
|
437
|
+
| Commande | Action |
|
|
438
|
+
|----------|--------|
|
|
439
|
+
| `/gitflow:7-pull-request` | PR vers cible auto-detectee (feature→develop, hotfix/release→main) |
|
|
440
|
+
| `/gitflow:7-pull-request develop` | PR vers develop (override) |
|
|
441
|
+
| `/gitflow:7-pull-request main` | PR vers main (override) |
|
|
442
|
+
| `/gitflow:7-pull-request --draft` | PR en draft |
|
|
443
|
+
| `/gitflow:7-pull-request --dry-run` | Simulation |
|
|
444
|
+
|
|
445
|
+
**Detection automatique de la cible:**
|
|
446
|
+
|
|
447
|
+
```
|
|
448
|
+
feature/* → develop (integration continue)
|
|
449
|
+
release/* → main (deploiement production)
|
|
450
|
+
hotfix/* → main (correction urgente production)
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
> **Note:** Le merge back vers develop est gere par `/gitflow:11-finish` apres le merge de la PR.
|