@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.
Files changed (214) hide show
  1. package/.documentation/agents.html +1 -1
  2. package/.documentation/apex.html +1 -1
  3. package/.documentation/business-analyse.html +1 -1
  4. package/.documentation/cli-commands.html +3 -3
  5. package/.documentation/commands.html +1 -1
  6. package/.documentation/efcore.html +1 -1
  7. package/.documentation/gitflow.html +231 -236
  8. package/.documentation/hooks.html +1 -1
  9. package/.documentation/index.html +1 -1
  10. package/.documentation/init.html +3 -3
  11. package/.documentation/installation.html +1075 -351
  12. package/.documentation/ralph-loop.html +1 -1
  13. package/.documentation/test-web.html +1 -1
  14. package/README.md +88 -20
  15. package/config/default-config.json +10 -1
  16. package/dist/index.js +276 -85
  17. package/dist/index.js.map +1 -1
  18. package/package.json +1 -1
  19. package/templates/agents/code-reviewer.md +163 -0
  20. package/templates/agents/efcore/db-deploy.md +25 -7
  21. package/templates/agents/efcore/db-reset.md +31 -10
  22. package/templates/agents/efcore/db-status.md +22 -5
  23. package/templates/agents/efcore/migration.md +70 -20
  24. package/templates/agents/gitflow/cleanup.md +8 -1
  25. package/templates/agents/gitflow/commit.md +7 -5
  26. package/templates/agents/gitflow/finish.md +6 -4
  27. package/templates/agents/gitflow/pr.md +8 -1
  28. package/templates/agents/gitflow/start.md +1 -1
  29. package/templates/commands/check-version.md +267 -0
  30. package/templates/commands/efcore/_shared.md +31 -2
  31. package/templates/commands/efcore/db-reset.md +18 -6
  32. package/templates/commands/efcore/migration.md +1 -1
  33. package/templates/commands/efcore/rebase-snapshot.md +1 -1
  34. package/templates/commands/efcore/squash.md +1 -0
  35. package/templates/commands/refactor.md +164 -0
  36. package/templates/project/DependencyInjection.Application.cs.template +25 -0
  37. package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
  38. package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
  39. package/templates/project/ExampleEntity.cs.template +116 -0
  40. package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
  41. package/templates/project/ExampleService.cs.template +146 -0
  42. package/templates/project/ExtensionsDbContext.cs.template +41 -0
  43. package/templates/project/IExtensionsDbContext.cs.template +22 -0
  44. package/templates/project/Program.cs.template +47 -0
  45. package/templates/project/README.md +79 -0
  46. package/templates/ralph/README.md +10 -8
  47. package/templates/ralph/ralph.config.yaml +2 -2
  48. package/templates/skills/_shared.md +44 -44
  49. package/templates/skills/ai-prompt/SKILL.md +55 -55
  50. package/templates/skills/apex/SKILL.md +235 -0
  51. package/templates/skills/apex/steps/step-00-init.md +203 -0
  52. package/templates/skills/apex/steps/step-01-analyze.md +210 -0
  53. package/templates/skills/apex/steps/step-02-plan.md +217 -0
  54. package/templates/skills/apex/steps/step-03-execute.md +178 -0
  55. package/templates/skills/apex/steps/step-04-validate.md +217 -0
  56. package/templates/skills/apex/steps/step-05-examine.md +207 -0
  57. package/templates/skills/apex/steps/step-06-resolve.md +181 -0
  58. package/templates/skills/apex/steps/step-07-tests.md +206 -0
  59. package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
  60. package/templates/skills/apex/templates/00-context.md +46 -0
  61. package/templates/skills/apex/templates/01-analyze.md +63 -0
  62. package/templates/skills/apex/templates/02-plan.md +63 -0
  63. package/templates/skills/apex/templates/03-execute.md +34 -0
  64. package/templates/skills/apex/templates/04-validate.md +61 -0
  65. package/templates/skills/apex/templates/05-examine.md +58 -0
  66. package/templates/skills/apex/templates/06-resolve.md +39 -0
  67. package/templates/skills/apex/templates/07-tests.md +56 -0
  68. package/templates/skills/apex/templates/08-run-tests.md +41 -0
  69. package/templates/skills/apex/templates/README.md +69 -0
  70. package/templates/skills/application/SKILL.md +50 -50
  71. package/templates/skills/application/templates-backend.md +25 -25
  72. package/templates/skills/application/templates-frontend.md +43 -43
  73. package/templates/skills/application/templates-i18n.md +29 -29
  74. package/templates/skills/application/templates-seed.md +77 -77
  75. package/templates/skills/business-analyse/SKILL.md +223 -0
  76. package/templates/skills/business-analyse/_shared.md +258 -0
  77. package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
  78. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
  79. package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
  80. package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
  81. package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
  82. package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
  83. package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
  84. package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
  85. package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
  86. package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
  87. package/templates/skills/business-analyse/questionnaire.md +177 -177
  88. package/templates/skills/business-analyse/react/components.md +340 -0
  89. package/templates/skills/business-analyse/react/i18n-template.md +245 -0
  90. package/templates/skills/business-analyse/react/schema.md +151 -0
  91. package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
  92. package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
  93. package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
  94. package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
  95. package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
  96. package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
  97. package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
  98. package/templates/skills/business-analyse/templates/00-context.md +105 -0
  99. package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
  100. package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
  101. package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
  102. package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
  103. package/templates/skills/business-analyse/templates-frd.md +217 -217
  104. package/templates/skills/business-analyse/templates-react.md +26 -26
  105. package/templates/skills/controller/SKILL.md +141 -92
  106. package/templates/skills/controller/postman-templates.md +15 -15
  107. package/templates/skills/controller/steps/step-00-init.md +191 -0
  108. package/templates/skills/controller/steps/step-01-analyze.md +146 -0
  109. package/templates/skills/controller/steps/step-02-plan.md +176 -0
  110. package/templates/skills/controller/steps/step-03-generate.md +219 -0
  111. package/templates/skills/controller/steps/step-04-perms.md +219 -0
  112. package/templates/skills/controller/steps/step-05-validate.md +107 -0
  113. package/templates/skills/controller/templates.md +77 -77
  114. package/templates/skills/documentation/SKILL.md +79 -79
  115. package/templates/skills/feature-full/SKILL.md +38 -38
  116. package/templates/skills/gitflow/SKILL.md +277 -0
  117. package/templates/{commands → skills}/gitflow/_shared.md +20 -20
  118. package/templates/skills/gitflow/phases/abort.md +173 -0
  119. package/templates/skills/gitflow/phases/cleanup.md +226 -0
  120. package/templates/skills/gitflow/phases/status.md +178 -0
  121. package/templates/skills/gitflow/steps/step-commit.md +255 -0
  122. package/templates/skills/gitflow/steps/step-finish.md +255 -0
  123. package/templates/skills/gitflow/steps/step-init.md +209 -0
  124. package/templates/skills/gitflow/steps/step-merge.md +225 -0
  125. package/templates/skills/gitflow/steps/step-plan.md +208 -0
  126. package/templates/skills/gitflow/steps/step-pr.md +235 -0
  127. package/templates/skills/gitflow/steps/step-start.md +334 -0
  128. package/templates/skills/gitflow/steps/step-sync.md +200 -0
  129. package/templates/skills/gitflow/templates/config.json +53 -0
  130. package/templates/skills/notification/SKILL.md +51 -51
  131. package/templates/skills/ralph-loop/SKILL.md +228 -0
  132. package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
  133. package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
  134. package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
  135. package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
  136. package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
  137. package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
  138. package/templates/skills/review-code/SKILL.md +219 -0
  139. package/templates/skills/review-code/references/clean-code-principles.md +140 -0
  140. package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
  141. package/templates/skills/review-code/references/feedback-patterns.md +149 -0
  142. package/templates/skills/review-code/references/security-checklist.md +127 -0
  143. package/templates/skills/ui-components/SKILL.md +54 -54
  144. package/templates/skills/workflow/SKILL.md +46 -46
  145. package/templates/commands/ai-prompt.md +0 -315
  146. package/templates/commands/apex/1-analyze.md +0 -100
  147. package/templates/commands/apex/2-plan.md +0 -145
  148. package/templates/commands/apex/3-execute.md +0 -171
  149. package/templates/commands/apex/4-examine.md +0 -116
  150. package/templates/commands/apex/5-tasks.md +0 -209
  151. package/templates/commands/apex.md +0 -76
  152. package/templates/commands/application/create.md +0 -362
  153. package/templates/commands/application/templates-backend.md +0 -463
  154. package/templates/commands/application/templates-frontend.md +0 -517
  155. package/templates/commands/application/templates-i18n.md +0 -478
  156. package/templates/commands/application/templates-seed.md +0 -362
  157. package/templates/commands/application.md +0 -303
  158. package/templates/commands/business-analyse/0-orchestrate.md +0 -156
  159. package/templates/commands/business-analyse/1-init.md +0 -99
  160. package/templates/commands/business-analyse/2-discover.md +0 -143
  161. package/templates/commands/business-analyse/3-analyse.md +0 -106
  162. package/templates/commands/business-analyse/4-specify.md +0 -133
  163. package/templates/commands/business-analyse/5-validate.md +0 -132
  164. package/templates/commands/business-analyse/6-handoff.md +0 -157
  165. package/templates/commands/business-analyse/7-doc-html.md +0 -103
  166. package/templates/commands/business-analyse/_shared.md +0 -176
  167. package/templates/commands/business-analyse/bug.md +0 -118
  168. package/templates/commands/business-analyse/change-request.md +0 -144
  169. package/templates/commands/business-analyse/hotfix.md +0 -116
  170. package/templates/commands/business-analyse.md +0 -121
  171. package/templates/commands/controller/create.md +0 -216
  172. package/templates/commands/controller/postman-templates.md +0 -528
  173. package/templates/commands/controller/templates.md +0 -600
  174. package/templates/commands/controller.md +0 -337
  175. package/templates/commands/create/agent.md +0 -138
  176. package/templates/commands/create/command.md +0 -166
  177. package/templates/commands/create/hook.md +0 -234
  178. package/templates/commands/create/plugin.md +0 -329
  179. package/templates/commands/create/project.md +0 -508
  180. package/templates/commands/create/skill.md +0 -199
  181. package/templates/commands/create.md +0 -220
  182. package/templates/commands/documentation/module.md +0 -202
  183. package/templates/commands/documentation/templates.md +0 -432
  184. package/templates/commands/documentation.md +0 -190
  185. package/templates/commands/epct.md +0 -69
  186. package/templates/commands/explain.md +0 -186
  187. package/templates/commands/feature-full.md +0 -267
  188. package/templates/commands/gitflow/1-init.md +0 -188
  189. package/templates/commands/gitflow/10-start.md +0 -190
  190. package/templates/commands/gitflow/11-finish.md +0 -382
  191. package/templates/commands/gitflow/12-cleanup.md +0 -103
  192. package/templates/commands/gitflow/13-sync.md +0 -216
  193. package/templates/commands/gitflow/14-rebase.md +0 -251
  194. package/templates/commands/gitflow/2-status.md +0 -122
  195. package/templates/commands/gitflow/3-commit.md +0 -209
  196. package/templates/commands/gitflow/4-plan.md +0 -174
  197. package/templates/commands/gitflow/5-exec.md +0 -202
  198. package/templates/commands/gitflow/6-abort.md +0 -121
  199. package/templates/commands/gitflow/7-pull-request.md +0 -176
  200. package/templates/commands/gitflow/8-review.md +0 -113
  201. package/templates/commands/gitflow/9-merge.md +0 -157
  202. package/templates/commands/gitflow.md +0 -128
  203. package/templates/commands/implement.md +0 -663
  204. package/templates/commands/init.md +0 -567
  205. package/templates/commands/mcp-integration.md +0 -330
  206. package/templates/commands/notification.md +0 -129
  207. package/templates/commands/oneshot.md +0 -57
  208. package/templates/commands/quickstart.md +0 -154
  209. package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
  210. package/templates/commands/ralph-loop/help.md +0 -126
  211. package/templates/commands/ralph-loop/ralph-loop.md +0 -120
  212. package/templates/commands/review.md +0 -106
  213. package/templates/commands/workflow.md +0 -193
  214. 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 |