@atlashub/smartstack-cli 1.13.2 → 1.14.0

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 (210) 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 +1 -1
  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 +1001 -352
  12. package/.documentation/ralph-loop.html +1 -1
  13. package/.documentation/test-web.html +1 -1
  14. package/README.md +88 -20
  15. package/dist/index.js +276 -85
  16. package/dist/index.js.map +1 -1
  17. package/package.json +1 -1
  18. package/templates/agents/code-reviewer.md +163 -0
  19. package/templates/agents/efcore/db-deploy.md +25 -7
  20. package/templates/agents/efcore/db-reset.md +31 -10
  21. package/templates/agents/efcore/db-status.md +22 -5
  22. package/templates/agents/efcore/migration.md +69 -19
  23. package/templates/agents/gitflow/cleanup.md +8 -1
  24. package/templates/agents/gitflow/commit.md +7 -5
  25. package/templates/agents/gitflow/finish.md +6 -4
  26. package/templates/agents/gitflow/pr.md +8 -1
  27. package/templates/agents/gitflow/start.md +1 -1
  28. package/templates/commands/check-version.md +267 -0
  29. package/templates/commands/efcore/_shared.md +30 -1
  30. package/templates/commands/efcore/db-reset.md +18 -6
  31. package/templates/commands/gitflow/OPTIMIZATIONS.md +206 -0
  32. package/templates/commands/refactor.md +164 -0
  33. package/templates/project/DependencyInjection.Application.cs.template +25 -0
  34. package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
  35. package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
  36. package/templates/project/ExampleEntity.cs.template +116 -0
  37. package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
  38. package/templates/project/ExampleService.cs.template +146 -0
  39. package/templates/project/ExtensionsDbContext.cs.template +41 -0
  40. package/templates/project/IExtensionsDbContext.cs.template +22 -0
  41. package/templates/project/Program.cs.template +47 -0
  42. package/templates/project/README.md +79 -0
  43. package/templates/ralph/README.md +10 -8
  44. package/templates/ralph/ralph.config.yaml +2 -2
  45. package/templates/skills/_shared.md +44 -44
  46. package/templates/skills/ai-prompt/SKILL.md +55 -55
  47. package/templates/skills/apex/SKILL.md +235 -0
  48. package/templates/skills/apex/steps/step-00-init.md +203 -0
  49. package/templates/skills/apex/steps/step-01-analyze.md +210 -0
  50. package/templates/skills/apex/steps/step-02-plan.md +217 -0
  51. package/templates/skills/apex/steps/step-03-execute.md +178 -0
  52. package/templates/skills/apex/steps/step-04-validate.md +217 -0
  53. package/templates/skills/apex/steps/step-05-examine.md +207 -0
  54. package/templates/skills/apex/steps/step-06-resolve.md +181 -0
  55. package/templates/skills/apex/steps/step-07-tests.md +206 -0
  56. package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
  57. package/templates/skills/apex/templates/00-context.md +46 -0
  58. package/templates/skills/apex/templates/01-analyze.md +63 -0
  59. package/templates/skills/apex/templates/02-plan.md +63 -0
  60. package/templates/skills/apex/templates/03-execute.md +34 -0
  61. package/templates/skills/apex/templates/04-validate.md +61 -0
  62. package/templates/skills/apex/templates/05-examine.md +58 -0
  63. package/templates/skills/apex/templates/06-resolve.md +39 -0
  64. package/templates/skills/apex/templates/07-tests.md +56 -0
  65. package/templates/skills/apex/templates/08-run-tests.md +41 -0
  66. package/templates/skills/apex/templates/README.md +69 -0
  67. package/templates/skills/application/SKILL.md +50 -50
  68. package/templates/skills/application/templates-backend.md +25 -25
  69. package/templates/skills/application/templates-frontend.md +43 -43
  70. package/templates/skills/application/templates-i18n.md +29 -29
  71. package/templates/skills/application/templates-seed.md +77 -77
  72. package/templates/skills/business-analyse/SKILL.md +223 -0
  73. package/templates/skills/business-analyse/_shared.md +258 -0
  74. package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
  75. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
  76. package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
  77. package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
  78. package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
  79. package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
  80. package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
  81. package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
  82. package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
  83. package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
  84. package/templates/skills/business-analyse/questionnaire.md +177 -177
  85. package/templates/skills/business-analyse/react/components.md +340 -0
  86. package/templates/skills/business-analyse/react/i18n-template.md +245 -0
  87. package/templates/skills/business-analyse/react/schema.md +151 -0
  88. package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
  89. package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
  90. package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
  91. package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
  92. package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
  93. package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
  94. package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
  95. package/templates/skills/business-analyse/templates/00-context.md +105 -0
  96. package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
  97. package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
  98. package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
  99. package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
  100. package/templates/skills/business-analyse/templates-frd.md +217 -217
  101. package/templates/skills/business-analyse/templates-react.md +26 -26
  102. package/templates/skills/controller/SKILL.md +141 -92
  103. package/templates/skills/controller/postman-templates.md +15 -15
  104. package/templates/skills/controller/steps/step-00-init.md +191 -0
  105. package/templates/skills/controller/steps/step-01-analyze.md +146 -0
  106. package/templates/skills/controller/steps/step-02-plan.md +176 -0
  107. package/templates/skills/controller/steps/step-03-generate.md +219 -0
  108. package/templates/skills/controller/steps/step-04-perms.md +219 -0
  109. package/templates/skills/controller/steps/step-05-validate.md +107 -0
  110. package/templates/skills/controller/templates.md +77 -77
  111. package/templates/skills/documentation/SKILL.md +79 -79
  112. package/templates/skills/feature-full/SKILL.md +38 -38
  113. package/templates/skills/gitflow/SKILL.md +277 -0
  114. package/templates/{commands → skills}/gitflow/_shared.md +20 -20
  115. package/templates/skills/gitflow/phases/abort.md +173 -0
  116. package/templates/skills/gitflow/phases/cleanup.md +226 -0
  117. package/templates/skills/gitflow/phases/status.md +178 -0
  118. package/templates/skills/gitflow/steps/step-commit.md +255 -0
  119. package/templates/skills/gitflow/steps/step-finish.md +255 -0
  120. package/templates/skills/gitflow/steps/step-init.md +209 -0
  121. package/templates/skills/gitflow/steps/step-merge.md +225 -0
  122. package/templates/skills/gitflow/steps/step-plan.md +208 -0
  123. package/templates/skills/gitflow/steps/step-pr.md +235 -0
  124. package/templates/skills/gitflow/steps/step-start.md +234 -0
  125. package/templates/skills/gitflow/steps/step-sync.md +200 -0
  126. package/templates/skills/gitflow/templates/config.json +53 -0
  127. package/templates/skills/notification/SKILL.md +51 -51
  128. package/templates/skills/ralph-loop/SKILL.md +228 -0
  129. package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
  130. package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
  131. package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
  132. package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
  133. package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
  134. package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
  135. package/templates/skills/review-code/SKILL.md +219 -0
  136. package/templates/skills/review-code/references/clean-code-principles.md +140 -0
  137. package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
  138. package/templates/skills/review-code/references/feedback-patterns.md +149 -0
  139. package/templates/skills/review-code/references/security-checklist.md +127 -0
  140. package/templates/skills/ui-components/SKILL.md +54 -54
  141. package/templates/skills/workflow/SKILL.md +46 -46
  142. package/templates/commands/ai-prompt.md +0 -315
  143. package/templates/commands/apex/1-analyze.md +0 -100
  144. package/templates/commands/apex/2-plan.md +0 -145
  145. package/templates/commands/apex/3-execute.md +0 -171
  146. package/templates/commands/apex/4-examine.md +0 -116
  147. package/templates/commands/apex/5-tasks.md +0 -209
  148. package/templates/commands/apex.md +0 -76
  149. package/templates/commands/application/create.md +0 -362
  150. package/templates/commands/application/templates-backend.md +0 -463
  151. package/templates/commands/application/templates-frontend.md +0 -517
  152. package/templates/commands/application/templates-i18n.md +0 -478
  153. package/templates/commands/application/templates-seed.md +0 -362
  154. package/templates/commands/application.md +0 -303
  155. package/templates/commands/business-analyse/0-orchestrate.md +0 -156
  156. package/templates/commands/business-analyse/1-init.md +0 -99
  157. package/templates/commands/business-analyse/2-discover.md +0 -143
  158. package/templates/commands/business-analyse/3-analyse.md +0 -106
  159. package/templates/commands/business-analyse/4-specify.md +0 -133
  160. package/templates/commands/business-analyse/5-validate.md +0 -132
  161. package/templates/commands/business-analyse/6-handoff.md +0 -157
  162. package/templates/commands/business-analyse/7-doc-html.md +0 -103
  163. package/templates/commands/business-analyse/_shared.md +0 -176
  164. package/templates/commands/business-analyse/bug.md +0 -118
  165. package/templates/commands/business-analyse/change-request.md +0 -144
  166. package/templates/commands/business-analyse/hotfix.md +0 -116
  167. package/templates/commands/business-analyse.md +0 -121
  168. package/templates/commands/controller/create.md +0 -216
  169. package/templates/commands/controller/postman-templates.md +0 -528
  170. package/templates/commands/controller/templates.md +0 -600
  171. package/templates/commands/controller.md +0 -337
  172. package/templates/commands/create/agent.md +0 -138
  173. package/templates/commands/create/command.md +0 -166
  174. package/templates/commands/create/hook.md +0 -234
  175. package/templates/commands/create/plugin.md +0 -329
  176. package/templates/commands/create/project.md +0 -508
  177. package/templates/commands/create/skill.md +0 -199
  178. package/templates/commands/create.md +0 -220
  179. package/templates/commands/documentation/module.md +0 -202
  180. package/templates/commands/documentation/templates.md +0 -432
  181. package/templates/commands/documentation.md +0 -190
  182. package/templates/commands/epct.md +0 -69
  183. package/templates/commands/explain.md +0 -186
  184. package/templates/commands/feature-full.md +0 -267
  185. package/templates/commands/gitflow/1-init.md +0 -188
  186. package/templates/commands/gitflow/10-start.md +0 -190
  187. package/templates/commands/gitflow/11-finish.md +0 -382
  188. package/templates/commands/gitflow/12-cleanup.md +0 -103
  189. package/templates/commands/gitflow/13-sync.md +0 -216
  190. package/templates/commands/gitflow/14-rebase.md +0 -251
  191. package/templates/commands/gitflow/2-status.md +0 -122
  192. package/templates/commands/gitflow/3-commit.md +0 -209
  193. package/templates/commands/gitflow/4-plan.md +0 -174
  194. package/templates/commands/gitflow/5-exec.md +0 -202
  195. package/templates/commands/gitflow/6-abort.md +0 -121
  196. package/templates/commands/gitflow/7-pull-request.md +0 -176
  197. package/templates/commands/gitflow/8-review.md +0 -113
  198. package/templates/commands/gitflow/9-merge.md +0 -157
  199. package/templates/commands/gitflow.md +0 -128
  200. package/templates/commands/implement.md +0 -663
  201. package/templates/commands/init.md +0 -567
  202. package/templates/commands/mcp-integration.md +0 -330
  203. package/templates/commands/notification.md +0 -129
  204. package/templates/commands/oneshot.md +0 -57
  205. package/templates/commands/quickstart.md +0 -154
  206. package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
  207. package/templates/commands/ralph-loop/help.md +0 -126
  208. package/templates/commands/ralph-loop/ralph-loop.md +0 -120
  209. package/templates/commands/review.md +0 -106
  210. package/templates/commands/workflow.md +0 -193
@@ -1,209 +0,0 @@
1
- ---
2
- description: Phase 3 - Smart commit with EF Core migration validation
3
- agent: gitflow-commit
4
- model: sonnet
5
- args: [message]
6
- ---
7
-
8
- # Phase 3: COMMIT - Migration-aware commits
9
-
10
- **Argument:** `$ARGUMENTS` = message (optionnel, auto-généré si absent)
11
-
12
- > **Ref:** Fonction `normalize_branch_name()` dans [_shared.md](_shared.md)
13
-
14
- ---
15
-
16
- ## Étape 0: Garde-fous Pré-commit
17
-
18
- ### 0.1 Protection des branches
19
-
20
- ```bash
21
- CURRENT=$(git rev-parse --abbrev-ref HEAD)
22
-
23
- # BLOCAGE: main
24
- [[ "$CURRENT" == "main" ]] && {
25
- echo "⛔ COMMIT BLOQUÉ - main est protégé"
26
- echo "→ /gitflow:10-start hotfix <nom> ou /gitflow:10-start release"
27
- exit 1
28
- }
29
-
30
- # AVERTISSEMENT: develop
31
- [[ "$CURRENT" == "develop" ]] && echo "⚠️ Commit sur develop déconseillé → /gitflow:10-start feature"
32
- ```
33
-
34
- **Si sur develop:** Proposer `RESCUE TO FEATURE` (voir section suivante)
35
-
36
- ### 0.2 RESCUE TO FEATURE (si sur develop)
37
-
38
- Analyse l'état et sauve tout vers une feature:
39
-
40
- ```bash
41
- git fetch origin --quiet
42
- STAGED=$(git diff --cached --name-only | wc -l)
43
- MODIFIED=$(git diff --name-only | wc -l)
44
- UNTRACKED=$(git ls-files --others --exclude-standard | wc -l)
45
- LOCAL_COMMITS=$(git rev-list --count origin/develop..HEAD 2>/dev/null || echo "0")
46
- REMOTE_COMMITS=$(git rev-list --count HEAD..origin/develop 2>/dev/null || echo "0")
47
- ```
48
-
49
- **Classification:**
50
-
51
- | Cas | Condition | Action |
52
- |-----|-----------|--------|
53
- | CLEAN | Rien à sauver | → /gitflow:10-start feature |
54
- | DIRTY_ONLY | Modifications, 0 commits | Stash → Créer feature → Unstash |
55
- | COMMITS_ONLY | Commits locaux, clean | Branch → Reset develop → Checkout |
56
- | COMMITS_AND_DIRTY | Les deux | Stash → Branch → Reset → Checkout → Unstash |
57
- | BEHIND | Remote en avance | Pull d'abord |
58
- | DIVERGED | Complexe | Rebase ou sauvegarder |
59
-
60
- **Exécution rescue:**
61
-
62
- ```bash
63
- RESCUE_TAG="rescue/develop-$(date +%Y%m%d-%H%M%S)"
64
- git tag "$RESCUE_TAG" HEAD # Backup
65
-
66
- [ "$HAS_CHANGES" = "true" ] && git stash push -m "rescue" --include-untracked
67
- [ "$LOCAL_COMMITS" -gt 0 ] && {
68
- git branch "$FEATURE_BRANCH"
69
- git reset --hard origin/develop
70
- }
71
- git checkout -b "$FEATURE_BRANCH" 2>/dev/null || git checkout "$FEATURE_BRANCH"
72
- [ "$STASHED" = "true" ] && git stash pop
73
-
74
- echo "✓ Rescue: $FEATURE_BRANCH créée | develop propre | Backup: $RESCUE_TAG"
75
- ```
76
-
77
- ### 0.3 Vérification synchronisation
78
-
79
- ```bash
80
- BEHIND=$(git rev-list --count HEAD..origin/$CURRENT 2>/dev/null || echo "0")
81
- [ "$BEHIND" -gt 0 ] && echo "⚠️ Branche $BEHIND commits en retard → /gitflow:13-sync"
82
- ```
83
-
84
- ### 0.4 Vérification working directory
85
-
86
- ```bash
87
- STAGED=$(git diff --cached --name-only | wc -l)
88
- MODIFIED=$(git diff --name-only | wc -l)
89
- UNTRACKED=$(git ls-files --others --exclude-standard | wc -l)
90
-
91
- [ "$STAGED" -eq 0 ] && [ "$MODIFIED" -eq 0 ] && [ "$UNTRACKED" -eq 0 ] && {
92
- echo "✓ Rien à committer"
93
- exit 0
94
- }
95
- ```
96
-
97
- ---
98
-
99
- ## Workflow Principal
100
-
101
- ### 1. Analyser fichiers
102
-
103
- Détecter: staged, modified, untracked, fichiers migration
104
-
105
- ### 2. Valider migrations EF Core
106
-
107
- Migration valide = **3 fichiers**:
108
- - `{Timestamp}_{Name}.cs`
109
- - `{Timestamp}_{Name}.Designer.cs`
110
- - `{Context}ModelSnapshot.cs`
111
-
112
- ### 3. Check opérations destructives (BLOQUANT)
113
-
114
- ```bash
115
- grep -n "DropTable\|DropColumn\|DeleteData" {migration}.cs
116
- ```
117
-
118
- | Pattern | Risque |
119
- |---------|--------|
120
- | `DropTable` | CRITICAL - Perte table |
121
- | `DropColumn` | CRITICAL - Perte données |
122
- | `DeleteData` | CRITICAL - Perte lignes |
123
- | `DropForeignKey` | HIGH - Intégrité |
124
-
125
- **Si détecté:** Confirmation explicite requise, log dans `.claude/gitflow/logs/`
126
-
127
- ### 4. Classifier commit
128
-
129
- | Fichiers | Prefix |
130
- |----------|--------|
131
- | Migrations seules | `db(migrations):` |
132
- | Migrations + code | `feat:` ou `fix:` |
133
- | Code sans migration | Selon type branche |
134
- | Config/docs | `chore:` |
135
-
136
- ### 5. Générer message (si absent)
137
-
138
- **Format:**
139
- ```
140
- {type}({scope}): {résumé 50 chars}
141
-
142
- **{CHANGEMENT}**
143
- PROBLEME: {situation problématique}
144
- SOLUTION: {approche technique}
145
- IMPACT: {bénéfice}
146
-
147
- Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
148
- ```
149
-
150
- **Verbes d'impact:**
151
- - `Implemente X pour Y` (pas "Ajout de...")
152
- - `Optimise X qui permet Y` (pas "Modification...")
153
- - `Resout X cause par Y` (pas "Correction...")
154
-
155
- ### 6. Exécuter commit
156
-
157
- ```bash
158
- git add -A
159
- git commit -m "$MESSAGE"
160
- ```
161
-
162
- ### 7. Push automatique
163
-
164
- Config: `.claude/gitflow/config.json` → `workflow.push.afterCommit`
165
-
166
- | Config | Worktree | Action |
167
- |--------|----------|--------|
168
- | `worktree` | Oui | Push auto |
169
- | `worktree` | Non | Demander |
170
- | `always` | - | Push auto |
171
- | `ask` | - | Demander |
172
- | `never` | - | Pas de push |
173
-
174
- ---
175
-
176
- ## Résumé
177
-
178
- ```
179
- COMMIT CRÉÉ
180
- - Branche: {branch} | Hash: {hash}
181
- - Message: {message}
182
- - Fichiers: {N} modifiés
183
- - EF Core: {OK|N/A}
184
- - Push: {done|pending}
185
-
186
- → Prochain: /gitflow:7-pull-request
187
- ```
188
-
189
- ---
190
-
191
- ## Erreurs courantes
192
-
193
- | Erreur | Solution |
194
- |--------|----------|
195
- | ModelSnapshot manquant | Ajouter le fichier |
196
- | Build échoue | `dotnet ef migrations remove` + fix |
197
- | Conflit détecté | Rebase d'abord |
198
- | Opération destructive | Confirmer ou modifier |
199
-
200
- ---
201
-
202
- ## Modes
203
-
204
- | Commande | Action |
205
- |----------|--------|
206
- | `/gitflow:3-commit {msg}` | Commit avec message |
207
- | `/gitflow:3-commit` | Auto-génère message |
208
- | `/gitflow:3-commit --validate` | Valider sans commit |
209
- | `/gitflow:3-commit --dry-run` | Simulation |
@@ -1,174 +0,0 @@
1
- ---
2
- description: Phase 4 - Generate integration plan with versioning and EF Core analysis
3
- agent: gitflow-plan
4
- model: sonnet
5
- ---
6
-
7
- # Phase 4: PLAN - Integration Planning
8
-
9
- Tu es expert GitFlow et EF Core. Cree un plan d'integration pour la branche courante.
10
-
11
- > **Ref:** Fonction `determine_base_branch()` dans [efcore/_shared.md](../efcore/_shared.md)
12
-
13
- ---
14
-
15
- ## Pre-validation (OBLIGATOIRE)
16
-
17
- **Verifier la branche courante AVANT toute action:**
18
-
19
- ```bash
20
- BRANCH=$(git rev-parse --abbrev-ref HEAD)
21
-
22
- # Branches autorisees: feature/*, release/*, hotfix/*
23
- if [[ ! $BRANCH =~ ^(feature|release|hotfix)/ ]]; then
24
- echo "ERREUR: Cette commande ne peut etre executee que depuis une branche GitFlow"
25
- echo ""
26
- echo "Branche actuelle: $BRANCH"
27
- echo "Branches autorisees: feature/*, release/*, hotfix/*"
28
- echo ""
29
- echo "Pour creer une branche:"
30
- echo " /gitflow:10-start feature \"description\""
31
- echo " /gitflow:10-start release \"v1.x.0\""
32
- echo " /gitflow:10-start hotfix \"correctif\""
33
- exit 1
34
- fi
35
- ```
36
-
37
- **Si branche invalide:** Afficher l'erreur et STOPPER. Ne pas continuer le workflow.
38
-
39
- ---
40
-
41
- ## Workflow
42
-
43
- ### 0. Determiner branche parente (CRITIQUE)
44
-
45
- ```bash
46
- # Utiliser determine_base_branch() de efcore/_shared.md
47
- determine_base_branch
48
-
49
- # Resultat:
50
- # - BASE_BRANCH = branche parente (develop pour feature, main pour release/hotfix)
51
- # - BRANCH_TYPE = type de branche courante
52
- ```
53
-
54
- | Branche courante | BASE_BRANCH | Cible merge |
55
- |------------------|-------------|-------------|
56
- | `feature/*` | `develop` | develop |
57
- | `release/*` | `main` | main + develop |
58
- | `hotfix/*` | `main` | main + develop |
59
-
60
- ### 1. Analyser contexte
61
-
62
- **Git:**
63
- - Branche courante et type (feature/release/hotfix)
64
- - Commits depuis divergence avec `$BASE_BRANCH`
65
- - Fichiers modifies
66
-
67
- **Version:**
68
- - Lire depuis source configuree (csproj, VERSION, etc.)
69
- - Calculer nouvelle version selon type branche
70
-
71
- **EF Core:**
72
- - Migrations sur cette branche
73
- - Migrations sur `$BASE_BRANCH` (absentes ici)
74
- - Conflit ModelSnapshot vs `$BASE_BRANCH`?
75
-
76
- ### 2. Determiner strategie
77
-
78
- **Feature → Develop (BASE_BRANCH=develop):**
79
- | Condition | Strategie |
80
- |-----------|-----------|
81
- | Pas de migrations | Rebase + Merge --no-ff |
82
- | Migrations sans conflit | Rebase + Merge --no-ff |
83
- | Conflit ModelSnapshot | Fetch snapshot develop + Remove migration + Re-add |
84
-
85
- **Release → Main + Develop (BASE_BRANCH=main):**
86
- | Condition | Strategie |
87
- |-----------|-----------|
88
- | Release stable | Tag v{VERSION} + Double merge |
89
- | Migrations pending | Fetch snapshot main + Script SQL idempotent |
90
- | Version | Auto-increment minor |
91
-
92
- **Hotfix → Main + Develop (BASE_BRANCH=main):**
93
- | Condition | Strategie |
94
- |-----------|-----------|
95
- | Migration urgente | Fetch snapshot main + Prefix `Hotfix_` + Script SQL |
96
- | Version | Auto-increment patch |
97
-
98
- ### 3. Generate plan file
99
-
100
- Create plan in [.claude/gitflow/plans/](.claude/gitflow/plans/) named `{type}-{nom}_{date}.md`:
101
-
102
- ````markdown
103
- # Plan: {BRANCH_NAME}
104
-
105
- ## Meta
106
- - **Source**: {branch} → **Cible**: {target}
107
- - **Version**: {current} → {new}
108
-
109
- ## Analyse
110
- | Git | EF Core |
111
- |-----|---------|
112
- | {n} commits | {n} migrations |
113
- | {n} fichiers | Conflit: {oui|non} |
114
-
115
- ## Pre-requis
116
- - [ ] Working dir propre
117
- - [ ] Build OK
118
- - [ ] Tests OK
119
-
120
- ## Etapes
121
- 1. Preparation (fetch, backup)
122
- 2. Migrations (si conflit: remove + rebase + re-add)
123
- 3. Integration (rebase/merge selon strategie)
124
- 4. Version (tag + update fichier source)
125
- 5. Validation (build, tests, migrations list)
126
-
127
- ## Rollback
128
- Reset au commit initial + restore migrations backup
129
-
130
- ## Executer
131
-
132
- ```
133
- /gitflow:5-exec {fichier_plan}
134
- ```
135
- ````
136
-
137
- ### 4. Afficher resume
138
-
139
- ````
140
- Plan genere: .claude/gitflow/plans/{name}.md
141
-
142
- Branche: {source} → {target}
143
- Version: {current} → {new}
144
- Strategie: {rebase|merge|remove+readd}
145
-
146
- Executez:
147
-
148
- ```
149
- /gitflow:5-exec
150
- ```
151
- ````
152
-
153
- ---
154
-
155
- ## Cas speciaux
156
-
157
- **Migrations sur les deux branches (feature):**
158
- - Recuperer snapshot de `$BASE_BRANCH` (develop)
159
- - Supprimer migrations de la feature
160
- - Regenerer migration consolidee
161
- - `dotnet ef migrations add {Feature}_Consolidated`
162
-
163
- **Migrations sur les deux branches (release/hotfix):**
164
- - Recuperer snapshot de `$BASE_BRANCH` (main)
165
- - Supprimer migrations de la branche
166
- - Regenerer migration consolidee
167
- - Script SQL idempotent pour production
168
-
169
- **Hotfix avec migration:**
170
- - Prefix migration `Hotfix_`
171
- - Recuperer snapshot main AVANT de creer
172
- - Script SQL FROM derniere migration main
173
-
174
- **Regle d'or:** Toujours `git checkout origin/$BASE_BRANCH -- *ModelSnapshot.cs` AVANT de regenerer
@@ -1,202 +0,0 @@
1
- ---
2
- description: Phase 5 - Execute plan with versioning auto-increment
3
- agent: gitflow-exec
4
- model: sonnet
5
- args: [plan_file]
6
- ---
7
-
8
- # Phase 5: EXEC - Plan Execution
9
-
10
- Tu es expert GitFlow et EF Core. Execute le plan d'integration de maniere securisee.
11
-
12
- **Argument:** `$ARGUMENTS` = chemin plan (optionnel, prend le plus recent)
13
-
14
- > **Ref:** Fonction `determine_base_branch()` dans [efcore/_shared.md](../efcore/_shared.md)
15
-
16
- ---
17
-
18
- ## Pre-validation (OBLIGATOIRE)
19
-
20
- **Verifier la branche courante AVANT toute action:**
21
-
22
- ```bash
23
- BRANCH=$(git rev-parse --abbrev-ref HEAD)
24
-
25
- # Branches autorisees: feature/*, release/*, hotfix/*
26
- if [[ ! $BRANCH =~ ^(feature|release|hotfix)/ ]]; then
27
- echo "ERREUR: Cette commande ne peut etre executee que depuis une branche GitFlow"
28
- echo ""
29
- echo "Branche actuelle: $BRANCH"
30
- echo "Branches autorisees: feature/*, release/*, hotfix/*"
31
- echo ""
32
- echo "Vous devez etre sur la branche source du plan pour l'executer."
33
- echo "Utilisez: git checkout {branche-source}"
34
- exit 1
35
- fi
36
- ```
37
-
38
- **Si branche invalide:** Afficher l'erreur et STOPPER. Ne pas continuer le workflow.
39
-
40
- ---
41
-
42
- ## Workflow
43
-
44
- ### 1. Load plan
45
-
46
- - Find plan file (argument or most recent in [.claude/gitflow/plans/](.claude/gitflow/plans/))
47
- - Extract: source branch, target, initial commit, version
48
-
49
- ### 1.5 Determiner branche parente (CRITIQUE)
50
-
51
- ```bash
52
- # Utiliser determine_base_branch() de efcore/_shared.md
53
- determine_base_branch
54
-
55
- # Resultat:
56
- # - BASE_BRANCH = branche parente (develop pour feature, main pour release/hotfix)
57
- # - BRANCH_TYPE = type de branche courante
58
- ```
59
-
60
- | Type branche | BASE_BRANCH | Snapshot a recuperer |
61
- |--------------|-------------|---------------------|
62
- | `feature/*` | `develop` | `origin/develop` |
63
- | `release/*` | `main` | `origin/main` |
64
- | `hotfix/*` | `main` | `origin/main` |
65
-
66
- ### 2. Verifier pre-requis
67
-
68
- - Working directory propre
69
- - Sur la bonne branche
70
- - Build OK
71
- - Plan valide
72
-
73
- ### 3. Create checkpoint (on source branch)
74
-
75
- Save checkpoint in [.claude/gitflow/logs/](.claude/gitflow/logs/)`checkpoint_{timestamp}.json`:
76
- - Branch, commit, plan, status
77
- - Backup migrations if present
78
- - **IMPORTANT: Commit checkpoint on source branch BEFORE merge**
79
-
80
- ```bash
81
- git add .claude/gitflow/logs/checkpoint_{timestamp}.json
82
- git commit -m "chore(gitflow): create integration checkpoint"
83
- ```
84
-
85
- ### 4. Executer etapes
86
-
87
- **Rebase (si necessaire):**
88
- - Fetch origin
89
- - Rebase sur target
90
- - Si conflit ModelSnapshot: accept theirs + regenerer migration
91
-
92
- **Merge:**
93
- - Checkout target (utiliser worktree si necessaire: `git -C {worktree_path}`)
94
- - Pull
95
- - Merge --no-ff source
96
-
97
- **Release/Hotfix - Version:**
98
- 1. Lire version depuis source configuree (csproj, VERSION, etc.)
99
- 2. Creer tag avec version actuelle
100
- 3. Calculer nouvelle version (minor pour release, patch pour hotfix)
101
- 4. Mettre a jour le fichier source
102
- 5. Sync config.json
103
-
104
- **Release - Double merge:**
105
- - Merge sur main
106
- - Tag
107
- - Merge main sur develop
108
-
109
- ### 5. Archiver plan (sur target branch)
110
-
111
- **IMPORTANT: Toujours archiver et commiter sur la branche cible AVANT le push**
112
-
113
- ```bash
114
- # Sur target branch (develop)
115
- mv .claude/gitflow/plans/{plan}.md .claude/gitflow/plans/{plan}_DONE_{timestamp}.md
116
- # Mettre a jour checkpoint avec status "completed"
117
- git add .claude/gitflow/logs/ .claude/gitflow/plans/
118
- git commit -m "chore(gitflow): archive integration plan and checkpoint"
119
- ```
120
-
121
- ### 6. Push
122
-
123
- - Push target branch
124
- - Push tag(s)
125
- - Verifier CI/CD declenche
126
-
127
- ### 7. Validation
128
-
129
- - Build OK
130
- - Tests OK (si disponibles)
131
- - Migrations list correcte
132
- - Historique git correct
133
-
134
- ### 8. Finaliser
135
-
136
- - Afficher resume et prochaines etapes
137
- - Suggerer nettoyage branche source si applicable
138
-
139
- ---
140
-
141
- ## Gestion conflits ModelSnapshot (CRITIQUE)
142
-
143
- **Regle d'or:** Toujours recuperer le snapshot de `$BASE_BRANCH` (pas hardcode "develop"!)
144
-
145
- Si conflit pendant rebase ou integration:
146
-
147
- ```bash
148
- # 1. Backup migrations actuelles
149
- BACKUP_DIR=".claude/gitflow/backup/migrations/exec_$(date +%Y%m%d_%H%M%S)"
150
- mkdir -p "$BACKUP_DIR"
151
- cp Migrations/*.cs "$BACKUP_DIR/"
152
-
153
- # 2. Recuperer ModelSnapshot de la branche PARENTE (CRUCIAL)
154
- git fetch origin "$BASE_BRANCH" --quiet
155
- git checkout "origin/$BASE_BRANCH" -- Migrations/*ModelSnapshot.cs
156
-
157
- # 3. Identifier et supprimer migrations de cette branche uniquement
158
- BASE_MIGRATIONS=$(git ls-tree -r --name-only "origin/$BASE_BRANCH" -- Migrations/ | grep "\.cs$")
159
- for mig in $(find Migrations -name "*.cs" -not -name "*Snapshot*" -not -name "*Designer*"); do
160
- MIG_NAME=$(basename "$mig")
161
- echo "$BASE_MIGRATIONS" | grep -q "$MIG_NAME" || rm -f "$mig" "${mig%.cs}.Designer.cs"
162
- done
163
-
164
- # 4. Regenerer migration consolidee
165
- dotnet ef migrations add "${BRANCH_TYPE}_Consolidated"
166
-
167
- # 5. Valider
168
- dotnet build --no-restore
169
- ```
170
-
171
- | Branche | BASE_BRANCH | Snapshot recupere de |
172
- |---------|-------------|---------------------|
173
- | `feature/*` | `develop` | `origin/develop` |
174
- | `release/*` | `main` | `origin/main` |
175
- | `hotfix/*` | `main` | `origin/main` |
176
-
177
- **Si rebase en cours:**
178
- ```bash
179
- git checkout "origin/$BASE_BRANCH" -- Migrations/*ModelSnapshot.cs
180
- git add Migrations/
181
- git rebase --continue
182
- ```
183
-
184
- ---
185
-
186
- ## Modes
187
-
188
- | Commande | Action |
189
- |----------|--------|
190
- | `/gitflow:5-exec` | Plan le plus recent |
191
- | `/gitflow:5-exec {plan}` | Plan specifie |
192
- | `/gitflow:5-exec --yes` | Sans confirmations |
193
- | `/gitflow:5-exec --dry-run` | Simulation |
194
- | `/gitflow:5-exec --resume` | Reprendre execution interrompue |
195
-
196
- ## Rollback rapide
197
-
198
- Si echec:
199
-
200
- ```
201
- /gitflow:6-abort --checkpoint
202
- ```
@@ -1,121 +0,0 @@
1
- ---
2
- description: Phase 6 - Abort operations, rollback, and branch abandonment
3
- agent: gitflow-abort
4
- model: sonnet
5
- args: [option]
6
- ---
7
-
8
- # Phase 6: ABORT - Rollback & Recovery
9
-
10
- **Argument:** `$ARGUMENTS` = option (--git, --checkpoint, --full, --migrations, --database, --branch)
11
-
12
- > **Ref:** Fonction `cleanup_worktree_for_branch()` dans [_shared.md](_shared.md)
13
-
14
- ---
15
-
16
- ## Analyse état
17
-
18
- ```bash
19
- # Opérations Git en cours
20
- [ -d ".git/rebase-merge" ] && echo "Rebase en cours"
21
- [ -f ".git/MERGE_HEAD" ] && echo "Merge en cours"
22
- [ -f ".git/CHERRY_PICK_HEAD" ] && echo "Cherry-pick en cours"
23
- git ls-files -u | grep -q . && echo "Conflits détectés"
24
- ```
25
-
26
- ---
27
-
28
- ## Options
29
-
30
- ### --git (Annuler opération Git)
31
-
32
- ```bash
33
- git rebase --abort 2>/dev/null || git merge --abort 2>/dev/null || git cherry-pick --abort 2>/dev/null
34
- ```
35
-
36
- ### --checkpoint (Rollback checkpoint)
37
-
38
- 1. Lire commit du checkpoint
39
- 2. Abort opérations en cours
40
- 3. Reset hard au commit
41
- 4. Restore migrations si backup existe
42
-
43
- ### --full (Rollback complet plan)
44
-
45
- 1. Lire commit initial du plan
46
- 2. Reset hard
47
- 3. Marquer plan ABORTED
48
-
49
- ### --migrations (Restore fichiers migration)
50
-
51
- Copier depuis `.claude/gitflow/logs/migrations_backup_*/`
52
-
53
- ### --database {migration}
54
-
55
- ```bash
56
- dotnet ef database update {migration}
57
- # Reset complet: dotnet ef database update 0
58
- ```
59
-
60
- ### --branch (Abandonner branche)
61
-
62
- #### Feature
63
- ```
64
- ✗ NE PAS merger sur develop
65
- ✓ Archiver (--archive)
66
- ✓ Supprimer branche + worktree
67
- ```
68
-
69
- #### Release
70
- ```
71
- ✗ NE PAS merger sur main
72
- ✗ NE PAS créer de tag
73
- ✓ Salvage corrections → develop (sauf --no-salvage)
74
- ✓ Supprimer branche + worktree
75
- ```
76
-
77
- #### Hotfix
78
- ```
79
- ✗ NE PAS merger sur main/develop
80
- ✓ Supprimer branche + worktree
81
- ```
82
-
83
- ---
84
-
85
- ## Résumé post-abandon
86
-
87
- ```
88
- BRANCHE ABANDONNÉE
89
- - Type: {feature|release|hotfix}
90
- - Branche: {nom}
91
- - Commits: {n} (perdus|salvagés|archivés)
92
- - Salvage: {done|skipped}
93
- - Worktree: nettoyé ✓
94
-
95
- → Prochain: /gitflow:10-start {type} {nom}
96
- ```
97
-
98
- ---
99
-
100
- ## Récupération
101
-
102
- ```bash
103
- # Feature archivée
104
- git checkout -b feature/{name} archive/feature/{name}
105
-
106
- # Via reflog
107
- git reflog
108
- git checkout -b {branch} {commit-hash}
109
- ```
110
-
111
- ---
112
-
113
- ## Modes
114
-
115
- | Commande | Action |
116
- |----------|--------|
117
- | `/gitflow:6-abort` | Analyse + propose |
118
- | `/gitflow:6-abort --git` | Annule opération Git |
119
- | `/gitflow:6-abort --branch` | Abandonner branche |
120
- | `/gitflow:6-abort --branch --archive` | Abandon + archive |
121
- | `/gitflow:6-abort --branch --no-salvage` | Sans salvage |