@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
|
@@ -4,190 +4,91 @@ agent: gitflow-cleanup
|
|
|
4
4
|
model: sonnet
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Phase 12: CLEANUP - Audit et nettoyage
|
|
8
|
-
|
|
9
|
-
Tu es expert GitFlow. Audite et nettoie les worktrees orphelins ou obsoletes.
|
|
7
|
+
# Phase 12: CLEANUP - Audit et nettoyage worktrees
|
|
10
8
|
|
|
11
9
|
**Argument:** `$ARGUMENTS` = options (--dry-run, --force, --stale-days=N)
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
> **Ref:** Fonction `cleanup_worktree_for_branch()` dans [_shared.md](_shared.md)
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
---
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
## Prérequis
|
|
18
16
|
|
|
19
17
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
echo "⚠️
|
|
23
|
-
echo "Branche courante: $CURRENT_BRANCH"
|
|
24
|
-
echo ""
|
|
25
|
-
echo "Executez: git checkout develop && /gitflow:12-cleanup"
|
|
18
|
+
CURRENT=$(git rev-parse --abbrev-ref HEAD)
|
|
19
|
+
[[ "$CURRENT" != "main" && "$CURRENT" != "develop" ]] && {
|
|
20
|
+
echo "⚠️ Exécuter depuis main ou develop"
|
|
26
21
|
exit 1
|
|
27
|
-
|
|
22
|
+
}
|
|
28
23
|
```
|
|
29
24
|
|
|
30
25
|
---
|
|
31
26
|
|
|
32
27
|
## Workflow
|
|
33
28
|
|
|
34
|
-
### 1. Collecter
|
|
29
|
+
### 1. Collecter
|
|
35
30
|
|
|
36
31
|
```bash
|
|
37
|
-
# Lister tous les worktrees
|
|
38
32
|
git worktree list --porcelain
|
|
39
|
-
|
|
40
|
-
# Lister toutes les branches locales
|
|
41
33
|
git branch -a
|
|
42
|
-
|
|
43
|
-
# Lister les branches remote
|
|
44
34
|
git fetch --prune
|
|
45
|
-
git branch -r
|
|
46
35
|
```
|
|
47
36
|
|
|
48
37
|
### 2. Analyser chaque worktree
|
|
49
38
|
|
|
50
|
-
|
|
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 |
|
|
51
45
|
|
|
52
|
-
|
|
53
|
-
|--------------|-----------|--------|
|
|
54
|
-
| Branche existe localement | `git branch --list $BRANCH` | ✓ Active / ✗ Orphelin |
|
|
55
|
-
| Branche existe sur remote | `git branch -r --list origin/$BRANCH` | ✓ Trackee / ✗ Locale only |
|
|
56
|
-
| Derniere activite | `git log -1 --format=%ci $BRANCH` | Date dernier commit |
|
|
57
|
-
| Modifications non commitees | `git -C $WORKTREE status --porcelain` | ✓ Clean / ⚠️ Dirty |
|
|
58
|
-
|
|
59
|
-
### 3. Categoriser les worktrees
|
|
46
|
+
### 3. Catégoriser
|
|
60
47
|
|
|
61
48
|
```
|
|
62
49
|
AUDIT WORKTREES
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
📁
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
📁 Worktrees actifs:
|
|
70
|
-
✓ ../worktrees/features/xxx → feature/xxx (3 jours)
|
|
71
|
-
✓ ../worktrees/releases/v2 → release/v2.0.0 (1 jour)
|
|
72
|
-
|
|
73
|
-
⚠️ Worktrees orphelins (branche supprimee):
|
|
74
|
-
✗ ../worktrees/features/old → feature/old (BRANCHE INEXISTANTE)
|
|
75
|
-
✗ ../worktrees/hotfixes/fix → hotfix/fix (BRANCHE INEXISTANTE)
|
|
76
|
-
|
|
77
|
-
⏰ Worktrees stale (inactifs > {N} jours):
|
|
78
|
-
⚠ ../worktrees/features/abc → feature/abc (45 jours sans commit)
|
|
79
|
-
|
|
80
|
-
💾 Worktrees dirty (modifications non commitees):
|
|
81
|
-
⚠ ../worktrees/features/wip → feature/wip (fichiers modifies)
|
|
82
|
-
|
|
83
|
-
═══════════════════════════════════════════════════════════════
|
|
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)
|
|
84
56
|
```
|
|
85
57
|
|
|
86
58
|
---
|
|
87
59
|
|
|
88
|
-
## Actions
|
|
89
|
-
|
|
90
|
-
### Mode par defaut (interactif)
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
ACTIONS PROPOSEES
|
|
94
|
-
═══════════════════════════════════════════════════════════════
|
|
60
|
+
## Actions
|
|
95
61
|
|
|
96
|
-
|
|
97
|
-
[1] ../worktrees/features/old (branche inexistante)
|
|
98
|
-
[2] ../worktrees/hotfixes/fix (branche inexistante)
|
|
99
|
-
|
|
100
|
-
Stale a examiner (> 30 jours):
|
|
101
|
-
[3] ../worktrees/features/abc (45 jours)
|
|
102
|
-
|
|
103
|
-
Options:
|
|
104
|
-
[A] Supprimer tous les orphelins
|
|
105
|
-
[S] Supprimer tous les stale
|
|
106
|
-
[1-N] Supprimer individuellement
|
|
107
|
-
[D] Details sur un worktree
|
|
108
|
-
[Q] Quitter sans action
|
|
109
|
-
|
|
110
|
-
Choix: _
|
|
111
|
-
═══════════════════════════════════════════════════════════════
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Mode --dry-run
|
|
115
|
-
|
|
116
|
-
Affiche uniquement l'audit sans proposer d'actions.
|
|
117
|
-
|
|
118
|
-
### Mode --force
|
|
119
|
-
|
|
120
|
-
Supprime automatiquement tous les orphelins sans confirmation.
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
## Suppression d'un worktree
|
|
62
|
+
### Suppression worktree
|
|
125
63
|
|
|
126
64
|
```bash
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
echo "⚠️ Worktree dirty - modifications non commitees"
|
|
130
|
-
echo "Utilisez --force pour supprimer quand meme"
|
|
65
|
+
[ -z "$(git -C $WORKTREE_PATH status --porcelain)" ] || {
|
|
66
|
+
echo "⚠️ Dirty - utiliser --force"
|
|
131
67
|
exit 1
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
# Supprimer le worktree
|
|
68
|
+
}
|
|
135
69
|
git worktree remove "$WORKTREE_PATH" --force
|
|
136
|
-
|
|
137
|
-
# Nettoyer le dossier si reste
|
|
138
|
-
rm -rf "$WORKTREE_PATH" 2>/dev/null || true
|
|
139
|
-
|
|
140
|
-
# Pruner les worktrees
|
|
70
|
+
rm -rf "$WORKTREE_PATH" 2>/dev/null
|
|
141
71
|
git worktree prune
|
|
142
72
|
```
|
|
143
73
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
## Detection des dossiers orphelins
|
|
147
|
-
|
|
148
|
-
En plus des worktrees git, detecter les dossiers qui ne sont plus lies:
|
|
74
|
+
### Détection dossiers orphelins
|
|
149
75
|
|
|
150
76
|
```bash
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
# Scanner les dossiers de worktrees
|
|
155
|
-
WORKTREE_BASE="../worktrees"
|
|
156
|
-
for TYPE in features releases hotfixes; do
|
|
157
|
-
for DIR in "$WORKTREE_BASE/$TYPE"/*; do
|
|
158
|
-
if [ -d "$DIR" ]; then
|
|
159
|
-
# Verifier si c'est un worktree connu
|
|
160
|
-
if ! echo "$KNOWN_WORKTREES" | grep -q "$DIR"; then
|
|
161
|
-
echo "⚠️ Dossier orphelin: $DIR"
|
|
162
|
-
fi
|
|
163
|
-
fi
|
|
164
|
-
done
|
|
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"
|
|
165
80
|
done
|
|
166
81
|
```
|
|
167
82
|
|
|
168
83
|
---
|
|
169
84
|
|
|
170
|
-
##
|
|
85
|
+
## Résumé
|
|
171
86
|
|
|
172
87
|
```
|
|
173
88
|
CLEANUP COMPLETE
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
Permanents (proteges): {n_permanent}
|
|
178
|
-
Actifs: {n_active}
|
|
179
|
-
Supprimes: {n_deleted}
|
|
180
|
-
- Orphelins: {n_orphan}
|
|
181
|
-
- Stale: {n_stale}
|
|
182
|
-
Ignores (dirty): {n_dirty}
|
|
183
|
-
|
|
184
|
-
Espace libere: ~{size} MB
|
|
185
|
-
|
|
186
|
-
Dossiers orphelins: {n_orphan_dirs}
|
|
187
|
-
- Supprimes: {n_orphan_dirs_deleted}
|
|
188
|
-
|
|
189
|
-
═══════════════════════════════════════════════════════════════
|
|
190
|
-
Environnement propre!
|
|
89
|
+
- Analysés: {total} | Supprimés: {n}
|
|
90
|
+
- Orphelins: {n} | Stale: {n}
|
|
91
|
+
- Espace libéré: ~{size} MB
|
|
191
92
|
```
|
|
192
93
|
|
|
193
94
|
---
|
|
@@ -196,81 +97,7 @@ Environnement propre!
|
|
|
196
97
|
|
|
197
98
|
| Commande | Action |
|
|
198
99
|
|----------|--------|
|
|
199
|
-
| `/gitflow:12-cleanup` | Audit interactif
|
|
200
|
-
| `/gitflow:12-cleanup --dry-run` | Audit seul
|
|
201
|
-
| `/gitflow:12-cleanup --force` | Supprime
|
|
202
|
-
| `/gitflow:12-cleanup --stale-days=30` | Seuil
|
|
203
|
-
| `/gitflow:12-cleanup --include-stale` | Inclut les stale dans la suppression auto |
|
|
204
|
-
| `/gitflow:12-cleanup --verbose` | Affiche les details de chaque worktree |
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## Integration automatique
|
|
209
|
-
|
|
210
|
-
Cette commande est appelee automatiquement par:
|
|
211
|
-
- `/gitflow:11-finish` → Apres finalisation d'une branche
|
|
212
|
-
- `/gitflow:6-abort --branch` → Apres abandon d'une branche
|
|
213
|
-
|
|
214
|
-
Dans ces cas, seul le worktree de la branche concernee est nettoye (cleanup cible).
|
|
215
|
-
|
|
216
|
-
---
|
|
217
|
-
|
|
218
|
-
## Cleanup cible (usage interne)
|
|
219
|
-
|
|
220
|
-
Quand appelee depuis finish/abort avec une branche specifique:
|
|
221
|
-
|
|
222
|
-
```bash
|
|
223
|
-
# Usage interne
|
|
224
|
-
cleanup_worktree_for_branch() {
|
|
225
|
-
BRANCH=$1
|
|
226
|
-
WORKTREE_BASE="../worktrees"
|
|
227
|
-
|
|
228
|
-
# Determiner le chemin selon le type
|
|
229
|
-
if [[ $BRANCH == feature/* ]]; then
|
|
230
|
-
NAME=${BRANCH#feature/}
|
|
231
|
-
WORKTREE_PATH="$WORKTREE_BASE/features/$NAME"
|
|
232
|
-
elif [[ $BRANCH == release/* ]]; then
|
|
233
|
-
VERSION=${BRANCH#release/}
|
|
234
|
-
WORKTREE_PATH="$WORKTREE_BASE/releases/$VERSION"
|
|
235
|
-
elif [[ $BRANCH == hotfix/* ]]; then
|
|
236
|
-
NAME=${BRANCH#hotfix/}
|
|
237
|
-
WORKTREE_PATH="$WORKTREE_BASE/hotfixes/$NAME"
|
|
238
|
-
fi
|
|
239
|
-
|
|
240
|
-
# Supprimer si existe
|
|
241
|
-
if [ -d "$WORKTREE_PATH" ]; then
|
|
242
|
-
git worktree remove "$WORKTREE_PATH" --force 2>/dev/null || true
|
|
243
|
-
rm -rf "$WORKTREE_PATH" 2>/dev/null || true
|
|
244
|
-
git worktree prune
|
|
245
|
-
echo "✓ Worktree nettoye: $WORKTREE_PATH"
|
|
246
|
-
fi
|
|
247
|
-
}
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
## Logs
|
|
253
|
-
|
|
254
|
-
Chaque cleanup est logue dans `.claude/gitflow/logs/cleanup_{timestamp}.json`:
|
|
255
|
-
|
|
256
|
-
```json
|
|
257
|
-
{
|
|
258
|
-
"timestamp": "{ISO_DATE}",
|
|
259
|
-
"type": "cleanup",
|
|
260
|
-
"mode": "interactive|dry-run|force|targeted",
|
|
261
|
-
"branch": "{main|develop}",
|
|
262
|
-
"worktrees": {
|
|
263
|
-
"analyzed": {n},
|
|
264
|
-
"deleted": [
|
|
265
|
-
{ "path": "...", "branch": "...", "reason": "orphan|stale" }
|
|
266
|
-
],
|
|
267
|
-
"skipped": [
|
|
268
|
-
{ "path": "...", "branch": "...", "reason": "dirty|active|permanent" }
|
|
269
|
-
]
|
|
270
|
-
},
|
|
271
|
-
"orphan_dirs": {
|
|
272
|
-
"found": {n},
|
|
273
|
-
"deleted": {n}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
```
|
|
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 |
|