@atlashub/smartstack-cli 1.13.2 → 1.14.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 +1 -1
- package/.documentation/apex.html +1 -1
- package/.documentation/business-analyse.html +1 -1
- package/.documentation/cli-commands.html +3 -3
- package/.documentation/commands.html +1 -1
- package/.documentation/efcore.html +1 -1
- package/.documentation/gitflow.html +231 -236
- package/.documentation/hooks.html +1 -1
- package/.documentation/index.html +1 -1
- package/.documentation/init.html +3 -3
- package/.documentation/installation.html +1075 -351
- package/.documentation/ralph-loop.html +1 -1
- package/.documentation/test-web.html +1 -1
- package/README.md +88 -20
- package/config/default-config.json +10 -1
- package/dist/index.js +276 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/agents/code-reviewer.md +163 -0
- package/templates/agents/efcore/db-deploy.md +25 -7
- package/templates/agents/efcore/db-reset.md +31 -10
- package/templates/agents/efcore/db-status.md +22 -5
- package/templates/agents/efcore/migration.md +70 -20
- package/templates/agents/gitflow/cleanup.md +8 -1
- package/templates/agents/gitflow/commit.md +7 -5
- package/templates/agents/gitflow/finish.md +6 -4
- package/templates/agents/gitflow/pr.md +8 -1
- package/templates/agents/gitflow/start.md +1 -1
- package/templates/commands/check-version.md +267 -0
- package/templates/commands/efcore/_shared.md +31 -2
- package/templates/commands/efcore/db-reset.md +18 -6
- package/templates/commands/efcore/migration.md +1 -1
- package/templates/commands/efcore/rebase-snapshot.md +1 -1
- package/templates/commands/efcore/squash.md +1 -0
- package/templates/commands/refactor.md +164 -0
- package/templates/project/DependencyInjection.Application.cs.template +25 -0
- package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
- package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
- package/templates/project/ExampleEntity.cs.template +116 -0
- package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
- package/templates/project/ExampleService.cs.template +146 -0
- package/templates/project/ExtensionsDbContext.cs.template +41 -0
- package/templates/project/IExtensionsDbContext.cs.template +22 -0
- package/templates/project/Program.cs.template +47 -0
- package/templates/project/README.md +79 -0
- package/templates/ralph/README.md +10 -8
- package/templates/ralph/ralph.config.yaml +2 -2
- package/templates/skills/_shared.md +44 -44
- package/templates/skills/ai-prompt/SKILL.md +55 -55
- package/templates/skills/apex/SKILL.md +235 -0
- package/templates/skills/apex/steps/step-00-init.md +203 -0
- package/templates/skills/apex/steps/step-01-analyze.md +210 -0
- package/templates/skills/apex/steps/step-02-plan.md +217 -0
- package/templates/skills/apex/steps/step-03-execute.md +178 -0
- package/templates/skills/apex/steps/step-04-validate.md +217 -0
- package/templates/skills/apex/steps/step-05-examine.md +207 -0
- package/templates/skills/apex/steps/step-06-resolve.md +181 -0
- package/templates/skills/apex/steps/step-07-tests.md +206 -0
- package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
- package/templates/skills/apex/templates/00-context.md +46 -0
- package/templates/skills/apex/templates/01-analyze.md +63 -0
- package/templates/skills/apex/templates/02-plan.md +63 -0
- package/templates/skills/apex/templates/03-execute.md +34 -0
- package/templates/skills/apex/templates/04-validate.md +61 -0
- package/templates/skills/apex/templates/05-examine.md +58 -0
- package/templates/skills/apex/templates/06-resolve.md +39 -0
- package/templates/skills/apex/templates/07-tests.md +56 -0
- package/templates/skills/apex/templates/08-run-tests.md +41 -0
- package/templates/skills/apex/templates/README.md +69 -0
- package/templates/skills/application/SKILL.md +50 -50
- package/templates/skills/application/templates-backend.md +25 -25
- package/templates/skills/application/templates-frontend.md +43 -43
- package/templates/skills/application/templates-i18n.md +29 -29
- package/templates/skills/application/templates-seed.md +77 -77
- package/templates/skills/business-analyse/SKILL.md +223 -0
- package/templates/skills/business-analyse/_shared.md +258 -0
- package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
- package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
- package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
- package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
- package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
- package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
- package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
- package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
- package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
- package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
- package/templates/skills/business-analyse/questionnaire.md +177 -177
- package/templates/skills/business-analyse/react/components.md +340 -0
- package/templates/skills/business-analyse/react/i18n-template.md +245 -0
- package/templates/skills/business-analyse/react/schema.md +151 -0
- package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
- package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
- package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
- package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
- package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
- package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
- package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
- package/templates/skills/business-analyse/templates/00-context.md +105 -0
- package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
- package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
- package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
- package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
- package/templates/skills/business-analyse/templates-frd.md +217 -217
- package/templates/skills/business-analyse/templates-react.md +26 -26
- package/templates/skills/controller/SKILL.md +141 -92
- package/templates/skills/controller/postman-templates.md +15 -15
- package/templates/skills/controller/steps/step-00-init.md +191 -0
- package/templates/skills/controller/steps/step-01-analyze.md +146 -0
- package/templates/skills/controller/steps/step-02-plan.md +176 -0
- package/templates/skills/controller/steps/step-03-generate.md +219 -0
- package/templates/skills/controller/steps/step-04-perms.md +219 -0
- package/templates/skills/controller/steps/step-05-validate.md +107 -0
- package/templates/skills/controller/templates.md +77 -77
- package/templates/skills/documentation/SKILL.md +79 -79
- package/templates/skills/feature-full/SKILL.md +38 -38
- package/templates/skills/gitflow/SKILL.md +277 -0
- package/templates/{commands → skills}/gitflow/_shared.md +20 -20
- package/templates/skills/gitflow/phases/abort.md +173 -0
- package/templates/skills/gitflow/phases/cleanup.md +226 -0
- package/templates/skills/gitflow/phases/status.md +178 -0
- package/templates/skills/gitflow/steps/step-commit.md +255 -0
- package/templates/skills/gitflow/steps/step-finish.md +255 -0
- package/templates/skills/gitflow/steps/step-init.md +209 -0
- package/templates/skills/gitflow/steps/step-merge.md +225 -0
- package/templates/skills/gitflow/steps/step-plan.md +208 -0
- package/templates/skills/gitflow/steps/step-pr.md +235 -0
- package/templates/skills/gitflow/steps/step-start.md +334 -0
- package/templates/skills/gitflow/steps/step-sync.md +200 -0
- package/templates/skills/gitflow/templates/config.json +53 -0
- package/templates/skills/notification/SKILL.md +51 -51
- package/templates/skills/ralph-loop/SKILL.md +228 -0
- package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
- package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
- package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
- package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
- package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
- package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
- package/templates/skills/review-code/SKILL.md +219 -0
- package/templates/skills/review-code/references/clean-code-principles.md +140 -0
- package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
- package/templates/skills/review-code/references/feedback-patterns.md +149 -0
- package/templates/skills/review-code/references/security-checklist.md +127 -0
- package/templates/skills/ui-components/SKILL.md +54 -54
- package/templates/skills/workflow/SKILL.md +46 -46
- package/templates/commands/ai-prompt.md +0 -315
- package/templates/commands/apex/1-analyze.md +0 -100
- package/templates/commands/apex/2-plan.md +0 -145
- package/templates/commands/apex/3-execute.md +0 -171
- package/templates/commands/apex/4-examine.md +0 -116
- package/templates/commands/apex/5-tasks.md +0 -209
- package/templates/commands/apex.md +0 -76
- package/templates/commands/application/create.md +0 -362
- package/templates/commands/application/templates-backend.md +0 -463
- package/templates/commands/application/templates-frontend.md +0 -517
- package/templates/commands/application/templates-i18n.md +0 -478
- package/templates/commands/application/templates-seed.md +0 -362
- package/templates/commands/application.md +0 -303
- package/templates/commands/business-analyse/0-orchestrate.md +0 -156
- package/templates/commands/business-analyse/1-init.md +0 -99
- package/templates/commands/business-analyse/2-discover.md +0 -143
- package/templates/commands/business-analyse/3-analyse.md +0 -106
- package/templates/commands/business-analyse/4-specify.md +0 -133
- package/templates/commands/business-analyse/5-validate.md +0 -132
- package/templates/commands/business-analyse/6-handoff.md +0 -157
- package/templates/commands/business-analyse/7-doc-html.md +0 -103
- package/templates/commands/business-analyse/_shared.md +0 -176
- package/templates/commands/business-analyse/bug.md +0 -118
- package/templates/commands/business-analyse/change-request.md +0 -144
- package/templates/commands/business-analyse/hotfix.md +0 -116
- package/templates/commands/business-analyse.md +0 -121
- package/templates/commands/controller/create.md +0 -216
- package/templates/commands/controller/postman-templates.md +0 -528
- package/templates/commands/controller/templates.md +0 -600
- package/templates/commands/controller.md +0 -337
- package/templates/commands/create/agent.md +0 -138
- package/templates/commands/create/command.md +0 -166
- package/templates/commands/create/hook.md +0 -234
- package/templates/commands/create/plugin.md +0 -329
- package/templates/commands/create/project.md +0 -508
- package/templates/commands/create/skill.md +0 -199
- package/templates/commands/create.md +0 -220
- package/templates/commands/documentation/module.md +0 -202
- package/templates/commands/documentation/templates.md +0 -432
- package/templates/commands/documentation.md +0 -190
- package/templates/commands/epct.md +0 -69
- package/templates/commands/explain.md +0 -186
- package/templates/commands/feature-full.md +0 -267
- package/templates/commands/gitflow/1-init.md +0 -188
- package/templates/commands/gitflow/10-start.md +0 -190
- package/templates/commands/gitflow/11-finish.md +0 -382
- package/templates/commands/gitflow/12-cleanup.md +0 -103
- package/templates/commands/gitflow/13-sync.md +0 -216
- package/templates/commands/gitflow/14-rebase.md +0 -251
- package/templates/commands/gitflow/2-status.md +0 -122
- package/templates/commands/gitflow/3-commit.md +0 -209
- package/templates/commands/gitflow/4-plan.md +0 -174
- package/templates/commands/gitflow/5-exec.md +0 -202
- package/templates/commands/gitflow/6-abort.md +0 -121
- package/templates/commands/gitflow/7-pull-request.md +0 -176
- package/templates/commands/gitflow/8-review.md +0 -113
- package/templates/commands/gitflow/9-merge.md +0 -157
- package/templates/commands/gitflow.md +0 -128
- package/templates/commands/implement.md +0 -663
- package/templates/commands/init.md +0 -567
- package/templates/commands/mcp-integration.md +0 -330
- package/templates/commands/notification.md +0 -129
- package/templates/commands/oneshot.md +0 -57
- package/templates/commands/quickstart.md +0 -154
- package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
- package/templates/commands/ralph-loop/help.md +0 -126
- package/templates/commands/ralph-loop/ralph-loop.md +0 -120
- package/templates/commands/review.md +0 -106
- package/templates/commands/workflow.md +0 -193
- package/templates/gitflow/config.json +0 -138
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Phase 10 - Start a new feature, release or hotfix branch with worktree
|
|
3
|
-
agent: gitflow-start
|
|
4
|
-
model: haiku
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Phase 10: START - Démarrer une branche GitFlow
|
|
8
|
-
|
|
9
|
-
**Argument:** `$ARGUMENTS` = `{type} {name} [--no-worktree]`
|
|
10
|
-
|
|
11
|
-
> **Ref:** Fonctions `normalize_branch_name()`, `detect_worktree_mode()`, `read_gitflow_config()` dans [_shared.md](_shared.md)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Flux d'Exécution
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
AVEC args: Analyser → Vérifications → Créer branche → Config DB → Résumé
|
|
19
|
-
SANS args: Analyser → Question Type → Question Nom → Vérifications → Créer → Config DB → Résumé
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Étape 1: Analyser le contexte
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
CURRENT_BRANCH=$(git branch --show-current)
|
|
28
|
-
VERSION=$(grep -oP '"version":\s*"\K[^"]+' package.json 2>/dev/null || echo "0.1.0")
|
|
29
|
-
STATUS=$(git status --porcelain)
|
|
30
|
-
DEVELOP_AHEAD=$(git rev-list --count origin/main..origin/develop 2>/dev/null || echo "0")
|
|
31
|
-
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "none")
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**Afficher:**
|
|
35
|
-
- Branche: `{CURRENT_BRANCH}` | Version: `{VERSION}` | Tag: `{LAST_TAG}`
|
|
36
|
-
- develop → main: `{DEVELOP_AHEAD}` commits (si >0: "Release recommandée")
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Étape 2: Questions (si pas d'arguments)
|
|
41
|
-
|
|
42
|
-
### Type de branche
|
|
43
|
-
|
|
44
|
-
Options dynamiques selon contexte:
|
|
45
|
-
- `feature`: Depuis develop (toujours dispo)
|
|
46
|
-
- `release v{X.Y+1.0}`: Si DEVELOP_AHEAD > 0 (recommandé)
|
|
47
|
-
- `hotfix`: Depuis main
|
|
48
|
-
|
|
49
|
-
### Nom de branche
|
|
50
|
-
|
|
51
|
-
Selon langue configurée (`config.language.code`):
|
|
52
|
-
|
|
53
|
-
| Langue | Options suggérées |
|
|
54
|
-
|--------|-------------------|
|
|
55
|
-
| `en` | add-, update-, fix-, refactor-, improve- |
|
|
56
|
-
| `fr` | ajouter-, modifier-, corriger-, refactorer-, ameliorer- |
|
|
57
|
-
|
|
58
|
-
**Normalisation automatique:** Utiliser `normalize_branch_name()` de [_shared.md](_shared.md)
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Étape 3: Vérifications (OBLIGATOIRE même avec args)
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
BRANCH_FULL_NAME="${TYPE}/${NAME}"
|
|
66
|
-
git fetch origin --quiet
|
|
67
|
-
|
|
68
|
-
# Vérifier existence
|
|
69
|
-
LOCAL_EXISTS=$(git branch --list "$BRANCH_FULL_NAME")
|
|
70
|
-
REMOTE_EXISTS=$(git branch -r --list "origin/$BRANCH_FULL_NAME")
|
|
71
|
-
|
|
72
|
-
[ -n "$LOCAL_EXISTS" ] || [ -n "$REMOTE_EXISTS" ] && {
|
|
73
|
-
echo "ERROR: Branche '$BRANCH_FULL_NAME' existe déjà"
|
|
74
|
-
# Options: Autre nom | Checkout existante | Supprimer
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**Si working directory dirty:**
|
|
79
|
-
Options: `Stash` | `Commit (/gitflow:3-commit)` | `Continuer`
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Étape 4: Créer la branche
|
|
84
|
-
|
|
85
|
-
### Détection mode worktree
|
|
86
|
-
|
|
87
|
-
Utiliser `detect_worktree_mode()` de [_shared.md](_shared.md)
|
|
88
|
-
|
|
89
|
-
### Mode Organized
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
PROJECT_ROOT=".."
|
|
93
|
-
git fetch origin
|
|
94
|
-
|
|
95
|
-
case "$TYPE" in
|
|
96
|
-
feature) WORKTREE_PATH="$PROJECT_ROOT/features/$NAME"; BASE="origin/develop" ;;
|
|
97
|
-
release) WORKTREE_PATH="$PROJECT_ROOT/releases/v$VERSION"; BASE="origin/develop" ;;
|
|
98
|
-
hotfix) WORKTREE_PATH="$PROJECT_ROOT/hotfixes/$NAME"; BASE="origin/main" ;;
|
|
99
|
-
esac
|
|
100
|
-
|
|
101
|
-
mkdir -p "$(dirname $WORKTREE_PATH)"
|
|
102
|
-
git worktree add -b "$TYPE/$NAME" "$WORKTREE_PATH" "$BASE"
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### Mode --no-worktree
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
git checkout ${BASE_BRANCH} && git pull origin ${BASE_BRANCH}
|
|
109
|
-
git checkout -b ${TYPE}/${NAME}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## Étape 5: Config DB automatique (.NET)
|
|
115
|
-
|
|
116
|
-
Si `appsettings.json` détecté, créer `appsettings.Local.json`:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
DB_NAME="${PROJECT_NAME}_${TYPE}_${NAME}" | cut -c1-128
|
|
120
|
-
CONNECTION="Server=localhost;Database=$DB_NAME;Trusted_Connection=true;TrustServerCertificate=true"
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Convention: `{prefix}_feat_{name}` | `{prefix}_fix_{name}` | `{prefix}_rel_{version}`
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
## Étape 6: Résumé
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
{TYPE} CRÉÉ
|
|
131
|
-
- Branche: {type}/{name}
|
|
132
|
-
- Base: {develop|main} → Cible: {develop|main+develop}
|
|
133
|
-
- Worktree: {path}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
**PROCHAINES ÉTAPES**
|
|
137
|
-
|
|
138
|
-
1. Aller dans le worktree
|
|
139
|
-
2. Faire vos modifications et commiter
|
|
140
|
-
3. Créer la Pull Request
|
|
141
|
-
4. Après merge de la PR, finaliser
|
|
142
|
-
|
|
143
|
-
**COMMANDES**
|
|
144
|
-
|
|
145
|
-
Aller dans le worktree:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
cd {worktree_path}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
Commiter:
|
|
152
|
-
|
|
153
|
-
```
|
|
154
|
-
/gitflow:3-commit
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Créer la PR:
|
|
158
|
-
|
|
159
|
-
```
|
|
160
|
-
/gitflow:7-pull-request
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
Finaliser:
|
|
164
|
-
|
|
165
|
-
```
|
|
166
|
-
/gitflow:11-finish {type}/{name}
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## Cas Spéciaux
|
|
172
|
-
|
|
173
|
-
| Situation | Action |
|
|
174
|
-
|-----------|--------|
|
|
175
|
-
| develop > 10 commits ahead | Proposer release d'abord |
|
|
176
|
-
| Release déjà en cours | Proposer continuer ou nouvelle |
|
|
177
|
-
| Hotfix depuis branche != main | Stash auto → checkout main |
|
|
178
|
-
| main divergent de develop | Option "Reset main" dans release |
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## Modes CLI
|
|
183
|
-
|
|
184
|
-
| Commande | Résultat |
|
|
185
|
-
|----------|----------|
|
|
186
|
-
| `/gitflow:10-start` | Mode interactif |
|
|
187
|
-
| `/gitflow:10-start feature user-auth` | Direct: feature/user-auth |
|
|
188
|
-
| `/gitflow:10-start release` | Propose versions |
|
|
189
|
-
| `/gitflow:10-start hotfix login-fix` | Direct: hotfix/login-fix |
|
|
190
|
-
| `/gitflow:10-start feature test --no-worktree` | Sans worktree |
|
|
@@ -1,382 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Phase 11 - Finish and finalize a GitFlow branch (tag + merge back)
|
|
3
|
-
agent: gitflow-finish
|
|
4
|
-
model: sonnet
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Phase 11: FINISH - Finaliser une branche GitFlow
|
|
8
|
-
|
|
9
|
-
**Argument:** `$ARGUMENTS` = branche (optionnel, SCAN si absent)
|
|
10
|
-
|
|
11
|
-
> **IMPORTANT:** Cette commande EXECUTE les opérations automatiquement. Ne PAS afficher les commandes bash à l'utilisateur - les EXECUTER directement via l'outil Bash.
|
|
12
|
-
|
|
13
|
-
> **Ref:** Fonctions dans [_shared.md](_shared.md)
|
|
14
|
-
> **Ref:** Fonction `determine_base_branch()` dans [efcore/_shared.md](../efcore/_shared.md)
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## MODE D'EXÉCUTION
|
|
19
|
-
|
|
20
|
-
**CRITIQUE:** Tu dois EXECUTER chaque commande avec l'outil Bash, pas les afficher.
|
|
21
|
-
|
|
22
|
-
Workflow:
|
|
23
|
-
1. Détecter le contexte (worktree, branche, PR)
|
|
24
|
-
2. Exécuter les opérations silencieusement
|
|
25
|
-
3. Afficher uniquement le RÉSUMÉ final
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Étape 0: Détection du contexte
|
|
30
|
-
|
|
31
|
-
**EXECUTER:**
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
# Aller au repo principal si dans un worktree
|
|
35
|
-
MAIN_WORKTREE=$(git worktree list --porcelain | grep -m1 "^worktree " | sed 's/worktree //')
|
|
36
|
-
cd "$MAIN_WORKTREE"
|
|
37
|
-
|
|
38
|
-
# Synchroniser
|
|
39
|
-
git fetch --all --quiet
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Étape 1: Scan Proactif (si pas d'argument)
|
|
45
|
-
|
|
46
|
-
Si `$ARGUMENTS` est vide, scanner les branches avec PR mergées:
|
|
47
|
-
|
|
48
|
-
**EXECUTER:**
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
# Lister branches avec PR mergée (prêtes à finaliser)
|
|
52
|
-
for BRANCH in $(git branch -r | grep -E 'origin/(feature|release|hotfix)/' | sed 's/origin\///'); do
|
|
53
|
-
PR_MERGED=$(gh pr list --head "$BRANCH" --state merged --json number --jq '.[0].number' 2>/dev/null)
|
|
54
|
-
[ -n "$PR_MERGED" ] && echo "✅ $BRANCH (PR #$PR_MERGED mergée)"
|
|
55
|
-
done
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Puis demander à l'utilisateur quelle branche finaliser.
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Étape 2: Vérifier état de la PR
|
|
63
|
-
|
|
64
|
-
**EXECUTER:**
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
BRANCH="$1" # Argument fourni ou sélectionné
|
|
68
|
-
|
|
69
|
-
# Vérifier si PR mergée
|
|
70
|
-
PR_INFO=$(gh pr list --head "$BRANCH" --state merged --json number,mergedAt --jq '.[0]')
|
|
71
|
-
|
|
72
|
-
if [ -z "$PR_INFO" ]; then
|
|
73
|
-
# PR pas trouvée comme mergée - vérifier si main a les commits
|
|
74
|
-
git checkout main --quiet && git pull origin main --quiet
|
|
75
|
-
|
|
76
|
-
# Vérifier si la branche existe encore
|
|
77
|
-
if ! git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then
|
|
78
|
-
echo "✓ Branche déjà supprimée sur remote - PR probablement mergée via GitHub"
|
|
79
|
-
else
|
|
80
|
-
echo "⚠️ PR non trouvée comme mergée"
|
|
81
|
-
exit 1
|
|
82
|
-
fi
|
|
83
|
-
fi
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Étape 2.5: Vérification EF Core Post-Merge Manuel (CRITIQUE)
|
|
89
|
-
|
|
90
|
-
**Contexte:** Si la PR a été mergée manuellement (via GitHub/Azure DevOps UI), les checks EF Core de `/gitflow:9-merge` n'ont pas été exécutés. Cette étape rattrape cette vérification.
|
|
91
|
-
|
|
92
|
-
**EXECUTER:**
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
# Déterminer la branche cible selon le type
|
|
96
|
-
case "$BRANCH" in
|
|
97
|
-
feature/*|bugfix/*) TARGET_BRANCH="develop" ;;
|
|
98
|
-
release/*|hotfix/*) TARGET_BRANCH="main" ;;
|
|
99
|
-
esac
|
|
100
|
-
|
|
101
|
-
# Vérifier si le projet a des migrations EF Core
|
|
102
|
-
MIGRATIONS_DIR=$(find . -type d -name "Migrations" 2>/dev/null | head -1)
|
|
103
|
-
|
|
104
|
-
if [ -n "$MIGRATIONS_DIR" ] && [ -d "$MIGRATIONS_DIR" ]; then
|
|
105
|
-
echo "Vérification EF Core post-merge..."
|
|
106
|
-
|
|
107
|
-
git checkout "$TARGET_BRANCH" --quiet && git pull origin "$TARGET_BRANCH" --quiet
|
|
108
|
-
|
|
109
|
-
EF_CHECK_FAILED=""
|
|
110
|
-
|
|
111
|
-
# 1. Vérifier que le build passe
|
|
112
|
-
if ! dotnet build --no-restore --verbosity quiet 2>/dev/null; then
|
|
113
|
-
echo "❌ ERREUR: Build échoue sur $TARGET_BRANCH après merge"
|
|
114
|
-
echo "→ Possible conflit de migrations non résolu"
|
|
115
|
-
EF_CHECK_FAILED=true
|
|
116
|
-
fi
|
|
117
|
-
|
|
118
|
-
# 2. Vérifier que les migrations sont listables
|
|
119
|
-
if ! dotnet ef migrations list --no-build 2>/dev/null | tail -1 | grep -q "Done\|applied"; then
|
|
120
|
-
echo "⚠️ WARNING: Problème avec les migrations EF Core"
|
|
121
|
-
EF_CHECK_FAILED=true
|
|
122
|
-
fi
|
|
123
|
-
|
|
124
|
-
# 3. Vérifier pas de markers de conflit Git dans les fichiers
|
|
125
|
-
if grep -rq "<<<<<<\|>>>>>>\|======" "$MIGRATIONS_DIR" 2>/dev/null; then
|
|
126
|
-
echo "❌ ERREUR: Conflits Git non résolus dans $MIGRATIONS_DIR"
|
|
127
|
-
EF_CHECK_FAILED=true
|
|
128
|
-
fi
|
|
129
|
-
|
|
130
|
-
# 4. Pour release/hotfix: info sur divergence develop
|
|
131
|
-
if [[ "$BRANCH" =~ ^(release|hotfix)/ ]]; then
|
|
132
|
-
MAIN_COUNT=$(git ls-tree -r --name-only origin/main -- "$MIGRATIONS_DIR" 2>/dev/null | grep -c "\.cs$" || echo "0")
|
|
133
|
-
DEV_COUNT=$(git ls-tree -r --name-only origin/develop -- "$MIGRATIONS_DIR" 2>/dev/null | grep -c "\.cs$" || echo "0")
|
|
134
|
-
|
|
135
|
-
[ "$DEV_COUNT" -gt "$MAIN_COUNT" ] && \
|
|
136
|
-
echo "ℹ️ develop a $((DEV_COUNT - MAIN_COUNT)) migration(s) de plus que main (normal si features en cours)"
|
|
137
|
-
fi
|
|
138
|
-
|
|
139
|
-
if [ -n "$EF_CHECK_FAILED" ]; then
|
|
140
|
-
echo ""
|
|
141
|
-
echo "┌─────────────────────────────────────────────────────────────┐"
|
|
142
|
-
echo "│ PROBLÈME EF CORE DÉTECTÉ APRÈS MERGE MANUEL │"
|
|
143
|
-
echo "│ │"
|
|
144
|
-
echo "│ Commandes de diagnostic: │"
|
|
145
|
-
echo "│ /efcore:db-status - État des migrations │"
|
|
146
|
-
echo "│ /efcore:conflicts - Analyser les conflits │"
|
|
147
|
-
echo "│ /efcore:rebase-snapshot - Resync si snapshot diverge │"
|
|
148
|
-
echo "└─────────────────────────────────────────────────────────────┘"
|
|
149
|
-
# Ne pas bloquer, continuer avec le finish mais alerter
|
|
150
|
-
else
|
|
151
|
-
echo "✓ EF Core: Migrations OK sur $TARGET_BRANCH"
|
|
152
|
-
fi
|
|
153
|
-
fi
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
## Actions par type
|
|
159
|
-
|
|
160
|
-
### Feature
|
|
161
|
-
|
|
162
|
-
**EXECUTER ces commandes dans l'ordre:**
|
|
163
|
-
|
|
164
|
-
1. Checkout develop et pull:
|
|
165
|
-
```bash
|
|
166
|
-
git checkout develop && git pull origin develop
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
2. Supprimer branche locale:
|
|
170
|
-
```bash
|
|
171
|
-
git branch -d "$BRANCH" 2>/dev/null || git branch -D "$BRANCH" 2>/dev/null
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
3. Supprimer branche remote (si existe):
|
|
175
|
-
```bash
|
|
176
|
-
git push origin --delete "$BRANCH" 2>/dev/null || true
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
4. Cleanup worktree:
|
|
180
|
-
```bash
|
|
181
|
-
# Détecter et nettoyer le worktree
|
|
182
|
-
WORKTREE_PATH=""
|
|
183
|
-
case "$BRANCH" in
|
|
184
|
-
feature/*)
|
|
185
|
-
[ -d "../features/${BRANCH#feature/}" ] && WORKTREE_PATH="../features/${BRANCH#feature/}"
|
|
186
|
-
[ -d "../worktrees/features/${BRANCH#feature/}" ] && WORKTREE_PATH="../worktrees/features/${BRANCH#feature/}"
|
|
187
|
-
;;
|
|
188
|
-
esac
|
|
189
|
-
[ -n "$WORKTREE_PATH" ] && [ -d "$WORKTREE_PATH" ] && {
|
|
190
|
-
git worktree remove "$WORKTREE_PATH" --force 2>/dev/null || rm -rf "$WORKTREE_PATH"
|
|
191
|
-
git worktree prune
|
|
192
|
-
}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
### Release
|
|
198
|
-
|
|
199
|
-
**EXECUTER ces commandes dans l'ordre:**
|
|
200
|
-
|
|
201
|
-
1. Checkout main et pull (récupérer le merge de la PR):
|
|
202
|
-
```bash
|
|
203
|
-
git checkout main && git pull origin main
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
2. Extraire la version:
|
|
207
|
-
```bash
|
|
208
|
-
VERSION=$(echo "$BRANCH" | sed 's/release\/v\?//')
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
3. Créer le tag (si pas déjà existant):
|
|
212
|
-
```bash
|
|
213
|
-
if ! git tag -l "v$VERSION" | grep -q "v$VERSION"; then
|
|
214
|
-
git tag -a "v$VERSION" -m "Release v$VERSION"
|
|
215
|
-
git push origin "v$VERSION"
|
|
216
|
-
fi
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
4. Merge back vers develop:
|
|
220
|
-
```bash
|
|
221
|
-
git checkout develop && git pull origin develop
|
|
222
|
-
git merge main --no-ff -m "chore: merge release v$VERSION back to develop"
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
4.5. **Vérifier propagation migrations (CRITIQUE):**
|
|
226
|
-
```bash
|
|
227
|
-
# Comparer migrations main vs develop après merge
|
|
228
|
-
MAIN_MIGRATIONS=$(git ls-tree -r --name-only origin/main -- Migrations/ | grep "\.cs$" | grep -v "Designer\|Snapshot" | wc -l)
|
|
229
|
-
DEV_MIGRATIONS=$(find Migrations -name "*.cs" | grep -v "Designer\|Snapshot" | wc -l)
|
|
230
|
-
|
|
231
|
-
if [ "$DEV_MIGRATIONS" -lt "$MAIN_MIGRATIONS" ]; then
|
|
232
|
-
echo "⚠️ ATTENTION: develop a moins de migrations que main"
|
|
233
|
-
echo "→ Vérifier le merge des migrations"
|
|
234
|
-
fi
|
|
235
|
-
|
|
236
|
-
# Vérifier que le snapshot develop inclut tout de main
|
|
237
|
-
git diff origin/main -- Migrations/*ModelSnapshot.cs
|
|
238
|
-
# Si diff significatif → conflit de migrations à résoudre
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
5. Auto-incrémenter MINOR pour develop:
|
|
242
|
-
```bash
|
|
243
|
-
# Trouver package.json (web ou racine)
|
|
244
|
-
PKG_PATH=$(find . -name "package.json" -not -path "*/node_modules/*" | head -1)
|
|
245
|
-
if [ -n "$PKG_PATH" ]; then
|
|
246
|
-
CURRENT=$(cat "$PKG_PATH" | grep -oP '"version":\s*"\K[^"]+')
|
|
247
|
-
NEXT=$(echo "$CURRENT" | awk -F. '{print $1"."$2+1".0"}')
|
|
248
|
-
cd "$(dirname "$PKG_PATH")"
|
|
249
|
-
npm version "$NEXT" --no-git-tag-version
|
|
250
|
-
cd -
|
|
251
|
-
git add "$PKG_PATH"
|
|
252
|
-
[ -f "${PKG_PATH%.json}-lock.json" ] && git add "${PKG_PATH%.json}-lock.json"
|
|
253
|
-
git commit -m "chore: bump develop to v$NEXT for next release"
|
|
254
|
-
fi
|
|
255
|
-
git push origin develop
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
6. Cleanup:
|
|
259
|
-
```bash
|
|
260
|
-
git branch -d "$BRANCH" 2>/dev/null || git branch -D "$BRANCH" 2>/dev/null
|
|
261
|
-
git push origin --delete "$BRANCH" 2>/dev/null || true
|
|
262
|
-
|
|
263
|
-
WORKTREE_PATH=""
|
|
264
|
-
[ -d "../releases/${BRANCH#release/}" ] && WORKTREE_PATH="../releases/${BRANCH#release/}"
|
|
265
|
-
[ -d "../releases/v${VERSION}" ] && WORKTREE_PATH="../releases/v${VERSION}"
|
|
266
|
-
[ -d "../worktrees/releases/${VERSION}" ] && WORKTREE_PATH="../worktrees/releases/${VERSION}"
|
|
267
|
-
[ -n "$WORKTREE_PATH" ] && [ -d "$WORKTREE_PATH" ] && {
|
|
268
|
-
git worktree remove "$WORKTREE_PATH" --force 2>/dev/null || rm -rf "$WORKTREE_PATH"
|
|
269
|
-
git worktree prune
|
|
270
|
-
}
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
### Hotfix
|
|
276
|
-
|
|
277
|
-
**EXECUTER ces commandes dans l'ordre:**
|
|
278
|
-
|
|
279
|
-
1. Checkout main et pull:
|
|
280
|
-
```bash
|
|
281
|
-
git checkout main && git pull origin main
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
2. Auto-incrémenter PATCH:
|
|
285
|
-
```bash
|
|
286
|
-
PKG_PATH=$(find . -name "package.json" -not -path "*/node_modules/*" | head -1)
|
|
287
|
-
CURRENT=$(cat "$PKG_PATH" | grep -oP '"version":\s*"\K[^"]+')
|
|
288
|
-
NEW_VERSION=$(echo "$CURRENT" | awk -F. '{print $1"."$2"."$3+1}')
|
|
289
|
-
cd "$(dirname "$PKG_PATH")"
|
|
290
|
-
npm version "$NEW_VERSION" --no-git-tag-version
|
|
291
|
-
cd -
|
|
292
|
-
git add "$PKG_PATH"
|
|
293
|
-
[ -f "${PKG_PATH%.json}-lock.json" ] && git add "${PKG_PATH%.json}-lock.json"
|
|
294
|
-
git commit -m "chore: bump version to $NEW_VERSION"
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
3. Créer tag et push:
|
|
298
|
-
```bash
|
|
299
|
-
git tag -a "v$NEW_VERSION" -m "Hotfix v$NEW_VERSION"
|
|
300
|
-
git push origin main "v$NEW_VERSION"
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
4. Merge back vers develop:
|
|
304
|
-
```bash
|
|
305
|
-
git checkout develop && git pull origin develop
|
|
306
|
-
git merge main --no-ff -m "chore: merge hotfix v$NEW_VERSION back to develop"
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
4.5. **Vérifier propagation migrations (CRITIQUE):**
|
|
310
|
-
```bash
|
|
311
|
-
# Vérifier que le snapshot develop inclut les changements du hotfix
|
|
312
|
-
git diff origin/main -- Migrations/*ModelSnapshot.cs
|
|
313
|
-
# Si diff significatif → conflit de migrations à résoudre manuellement
|
|
314
|
-
|
|
315
|
-
# En cas de conflit:
|
|
316
|
-
# 1. Récupérer snapshot main (état production)
|
|
317
|
-
# 2. Régénérer migration develop si nécessaire
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
```bash
|
|
321
|
-
git push origin develop
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
5. Cleanup:
|
|
325
|
-
```bash
|
|
326
|
-
git branch -d "$BRANCH" 2>/dev/null || git branch -D "$BRANCH" 2>/dev/null
|
|
327
|
-
git push origin --delete "$BRANCH" 2>/dev/null || true
|
|
328
|
-
|
|
329
|
-
WORKTREE_PATH=""
|
|
330
|
-
[ -d "../hotfixes/${BRANCH#hotfix/}" ] && WORKTREE_PATH="../hotfixes/${BRANCH#hotfix/}"
|
|
331
|
-
[ -d "../worktrees/hotfixes/${BRANCH#hotfix/}" ] && WORKTREE_PATH="../worktrees/hotfixes/${BRANCH#hotfix/}"
|
|
332
|
-
[ -n "$WORKTREE_PATH" ] && [ -d "$WORKTREE_PATH" ] && {
|
|
333
|
-
git worktree remove "$WORKTREE_PATH" --force 2>/dev/null || rm -rf "$WORKTREE_PATH"
|
|
334
|
-
git worktree prune
|
|
335
|
-
}
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
---
|
|
339
|
-
|
|
340
|
-
## Résumé (AFFICHER à la fin)
|
|
341
|
-
|
|
342
|
-
```
|
|
343
|
-
{TYPE} FINALISÉ ✓
|
|
344
|
-
- Branche: {branch}
|
|
345
|
-
- PR: #{number} (mergée)
|
|
346
|
-
- Tag: {v1.2.3|N/A}
|
|
347
|
-
- Merge back develop: {done|N/A}
|
|
348
|
-
- Version develop: {NEXT_VERSION|unchanged}
|
|
349
|
-
- Worktree: nettoyé
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
**PROCHAINE ÉTAPE**
|
|
353
|
-
|
|
354
|
-
Démarrer une nouvelle feature:
|
|
355
|
-
|
|
356
|
-
```
|
|
357
|
-
/gitflow:10-start feature {name}
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
---
|
|
361
|
-
|
|
362
|
-
## Gestion des erreurs
|
|
363
|
-
|
|
364
|
-
| Erreur | Action |
|
|
365
|
-
|--------|--------|
|
|
366
|
-
| PR non mergée | `⚠️ Merger la PR d'abord: /gitflow:9-merge` |
|
|
367
|
-
| Conflit merge back | Résoudre puis: `git add . && git merge --continue && git push` |
|
|
368
|
-
| Tag existe déjà | Skip création tag, continuer |
|
|
369
|
-
| Branche déjà supprimée | Continuer avec cleanup worktree |
|
|
370
|
-
| Build échoue post-merge | `/efcore:db-status` puis `/efcore:conflicts` |
|
|
371
|
-
| Conflits Git dans migrations | Résoudre manuellement puis `/efcore:rebase-snapshot` |
|
|
372
|
-
| Snapshot désynchronisé | `/efcore:rebase-snapshot` sur la branche cible |
|
|
373
|
-
|
|
374
|
-
---
|
|
375
|
-
|
|
376
|
-
## Modes
|
|
377
|
-
|
|
378
|
-
| Commande | Action |
|
|
379
|
-
|----------|--------|
|
|
380
|
-
| `/gitflow:11-finish` | Scan et proposer branches prêtes |
|
|
381
|
-
| `/gitflow:11-finish feature/xxx` | Finaliser branche spécifique |
|
|
382
|
-
| `/gitflow:11-finish --skip-tag` | Sans créer de tag |
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Phase 12 - Cleanup worktrees and orphan branches (audit and remove)
|
|
3
|
-
agent: gitflow-cleanup
|
|
4
|
-
model: sonnet
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Phase 12: CLEANUP - Audit et nettoyage worktrees
|
|
8
|
-
|
|
9
|
-
**Argument:** `$ARGUMENTS` = options (--dry-run, --force, --stale-days=N)
|
|
10
|
-
|
|
11
|
-
> **Ref:** Fonction `cleanup_worktree_for_branch()` dans [_shared.md](_shared.md)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Prérequis
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
CURRENT=$(git rev-parse --abbrev-ref HEAD)
|
|
19
|
-
[[ "$CURRENT" != "main" && "$CURRENT" != "develop" ]] && {
|
|
20
|
-
echo "⚠️ Exécuter depuis main ou develop"
|
|
21
|
-
exit 1
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Workflow
|
|
28
|
-
|
|
29
|
-
### 1. Collecter
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
git worktree list --porcelain
|
|
33
|
-
git branch -a
|
|
34
|
-
git fetch --prune
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### 2. Analyser chaque worktree
|
|
38
|
-
|
|
39
|
-
| Vérification | Status |
|
|
40
|
-
|--------------|--------|
|
|
41
|
-
| Branche existe localement | ✓ Active / ✗ Orphelin |
|
|
42
|
-
| Branche existe sur remote | ✓ Trackée / ✗ Locale only |
|
|
43
|
-
| Dernière activité | Date dernier commit |
|
|
44
|
-
| Modifications | ✓ Clean / ⚠️ Dirty |
|
|
45
|
-
|
|
46
|
-
### 3. Catégoriser
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
AUDIT WORKTREES
|
|
50
|
-
───────────────────────────────────
|
|
51
|
-
📁 Permanents: main, develop (protégés)
|
|
52
|
-
📁 Actifs: feature/xxx (3 jours)
|
|
53
|
-
⚠️ Orphelins: feature/old (BRANCHE INEXISTANTE)
|
|
54
|
-
⏰ Stale: feature/abc (45 jours)
|
|
55
|
-
💾 Dirty: feature/wip (non committés)
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Actions
|
|
61
|
-
|
|
62
|
-
### Suppression worktree
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
[ -z "$(git -C $WORKTREE_PATH status --porcelain)" ] || {
|
|
66
|
-
echo "⚠️ Dirty - utiliser --force"
|
|
67
|
-
exit 1
|
|
68
|
-
}
|
|
69
|
-
git worktree remove "$WORKTREE_PATH" --force
|
|
70
|
-
rm -rf "$WORKTREE_PATH" 2>/dev/null
|
|
71
|
-
git worktree prune
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Détection dossiers orphelins
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
KNOWN=$(git worktree list --porcelain | grep "^worktree " | sed 's/worktree //')
|
|
78
|
-
for DIR in ../worktrees/{features,releases,hotfixes}/*; do
|
|
79
|
-
echo "$KNOWN" | grep -q "$DIR" || echo "⚠️ Orphelin: $DIR"
|
|
80
|
-
done
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Résumé
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
CLEANUP COMPLETE
|
|
89
|
-
- Analysés: {total} | Supprimés: {n}
|
|
90
|
-
- Orphelins: {n} | Stale: {n}
|
|
91
|
-
- Espace libéré: ~{size} MB
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Modes
|
|
97
|
-
|
|
98
|
-
| Commande | Action |
|
|
99
|
-
|----------|--------|
|
|
100
|
-
| `/gitflow:12-cleanup` | Audit interactif |
|
|
101
|
-
| `/gitflow:12-cleanup --dry-run` | Audit seul |
|
|
102
|
-
| `/gitflow:12-cleanup --force` | Supprime orphelins auto |
|
|
103
|
-
| `/gitflow:12-cleanup --stale-days=30` | Seuil stale |
|