@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
|
@@ -10,31 +10,12 @@ description: |
|
|
|
10
10
|
Types: CRUD standard, Auth/Login, Custom actions
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
## STRATÉGIE MODÈLES (Qualité Maximale)
|
|
14
|
-
|
|
15
|
-
| Phase | Modèle | Coût estimé |
|
|
16
|
-
|-------|--------|-------------|
|
|
17
|
-
| Génération complète | **Sonnet** | ~$0.19 |
|
|
18
|
-
| Validation sécurité | **Opus** | ~$0.10 |
|
|
19
|
-
| **Total** | | **~$0.29** |
|
|
20
|
-
|
|
21
|
-
> **Note:** Si vous utilisez Opus pour tout, le skill fonctionne parfaitement
|
|
22
|
-
> mais coûte ~$0.94/controller. Sonnet offre le meilleur rapport qualité/coût
|
|
23
|
-
> pour la génération, Opus pour l'audit sécurité final.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
13
|
# Skill Controller SmartStack
|
|
28
14
|
|
|
29
|
-
|
|
30
|
-
> - **Skill** (`.claude/skills/controller/`) → Invocation automatique par Claude
|
|
31
|
-
> - **Commande** (`/controller:create`) → Invocation manuelle par l'utilisateur
|
|
32
|
-
> - Templates partagés dans `.claude/skills/controller/templates.md`
|
|
15
|
+
**Référence:** [_shared.md](../_shared.md) pour permissions, services, sécurité
|
|
33
16
|
|
|
34
17
|
## QUAND CE SKILL S'ACTIVE
|
|
35
18
|
|
|
36
|
-
Claude invoque automatiquement ce skill quand il détecte :
|
|
37
|
-
|
|
38
19
|
| Déclencheur | Exemple |
|
|
39
20
|
|-------------|---------|
|
|
40
21
|
| Demande explicite | "Crée un controller pour les tickets" |
|
|
@@ -42,139 +23,71 @@ Claude invoque automatiquement ce skill quand il détecte :
|
|
|
42
23
|
| Après entité Domain | "L'entité est prête, génère l'API" |
|
|
43
24
|
| Mots-clés | "CRUD", "endpoint", "controller", "API REST" |
|
|
44
25
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## WORKFLOW AUTOMATIQUE
|
|
26
|
+
## WORKFLOW
|
|
48
27
|
|
|
49
|
-
###
|
|
28
|
+
### 1. Détection du Type
|
|
50
29
|
|
|
51
30
|
| Indice | → Type |
|
|
52
31
|
|--------|--------|
|
|
53
|
-
| Authentification, login
|
|
54
|
-
| Module avec CRUD
|
|
55
|
-
| Actions spécifiques
|
|
56
|
-
|
|
57
|
-
### ÉTAPE 2: EXTRACTION DES PARAMÈTRES
|
|
58
|
-
|
|
59
|
-
| Paramètre | Source | Exemple |
|
|
60
|
-
|-----------|--------|---------|
|
|
61
|
-
| `$AREA` | Contexte navigation | `Admin`, `Support`, `Business`, `User` |
|
|
62
|
-
| `$MODULE` | Nom du module | `Tickets`, `Sla`, `Users` |
|
|
63
|
-
| `$ENTITY` | Entité Domain | `Ticket`, `SlaDefinition`, `User` |
|
|
64
|
-
| `$PERMISSION_PATH` | Hiérarchie | `platform.support.tickets` |
|
|
65
|
-
|
|
66
|
-
### ÉTAPE 3: EXÉCUTION
|
|
67
|
-
|
|
68
|
-
Suivre le workflow de la commande `/controller:create`
|
|
32
|
+
| Authentification, login | `auth` |
|
|
33
|
+
| Module avec CRUD | `crud` |
|
|
34
|
+
| Actions spécifiques | `custom` |
|
|
69
35
|
|
|
70
|
-
###
|
|
36
|
+
### 2. Extraction Paramètres
|
|
37
|
+
`$AREA` (Admin/Support/Business), `$MODULE`, `$ENTITY`, `$PERMISSION_PATH` (platform.support.tickets)
|
|
71
38
|
|
|
72
|
-
|
|
39
|
+
### 3. Exécution
|
|
40
|
+
Suivre workflow `/controller:create`
|
|
73
41
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
| Fichier | Rôle | Action |
|
|
77
|
-
|---------|------|--------|
|
|
78
|
-
| `Permissions.cs` | Constantes code | Ajouter la classe de permissions |
|
|
79
|
-
| `PermissionConfiguration.cs` | Seed EF Core | Ajouter les entrées HasData |
|
|
80
|
-
|
|
81
|
-
#### 4.2 Workflow obligatoire
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
85
|
-
│ WORKFLOW SYNCHRONISATION PERMISSIONS │
|
|
86
|
-
├──────────────────────────────────────────────────────────────────────────────┤
|
|
87
|
-
│ │
|
|
88
|
-
│ 1. GÉNÉRER CONTROLLER │
|
|
89
|
-
│ └─→ [RequirePermission(Permissions.{Module}.View)] │
|
|
90
|
-
│ │
|
|
91
|
-
│ 2. AJOUTER À Permissions.cs (Application layer) │
|
|
92
|
-
│ └─→ public static class {Module} { ... } │
|
|
93
|
-
│ │
|
|
94
|
-
│ 3. AJOUTER À PermissionConfiguration.cs (Infrastructure layer) │
|
|
95
|
-
│ └─→ HasData(new { Path = "...", ModuleId = ..., ... }) │
|
|
96
|
-
│ │
|
|
97
|
-
│ 4. CRÉER MIGRATION EF CORE │
|
|
98
|
-
│ └─→ /efcore:migration Add{Module}Permissions │
|
|
99
|
-
│ │
|
|
100
|
-
│ 5. VALIDER COHÉRENCE │
|
|
101
|
-
│ └─→ Vérifier que TOUS les paths dans Permissions.cs │
|
|
102
|
-
│ existent dans PermissionConfiguration.cs │
|
|
103
|
-
│ │
|
|
104
|
-
└──────────────────────────────────────────────────────────────────────────────┘
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
#### 4.3 Template PermissionConfiguration.cs
|
|
108
|
-
|
|
109
|
-
Voir le template complet dans [templates.md](templates.md#template-permissionconfiguration-seed)
|
|
110
|
-
|
|
111
|
-
#### 4.4 Checklist de validation
|
|
42
|
+
### 4. Synchronisation Permissions (OBLIGATOIRE)
|
|
112
43
|
|
|
113
44
|
```
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
□ Migration appliquée avec /efcore:db-deploy
|
|
45
|
+
1. GÉNÉRER CONTROLLER avec [RequirePermission(Permissions.{Module}.View)]
|
|
46
|
+
2. AJOUTER À Permissions.cs (Application layer)
|
|
47
|
+
3. AJOUTER À PermissionConfiguration.cs (Infrastructure - HasData)
|
|
48
|
+
4. CRÉER MIGRATION: /efcore:migration Add{Module}Permissions
|
|
49
|
+
5. VALIDER: tous paths dans Permissions.cs existent dans PermissionConfiguration.cs
|
|
120
50
|
```
|
|
121
51
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
## RÈGLES ABSOLUES - SÉCURITÉ
|
|
125
|
-
|
|
126
|
-
### 1. Logs Critiques (OBLIGATOIRE)
|
|
127
|
-
|
|
128
|
-
| Événement | Niveau | Pattern |
|
|
129
|
-
|-----------|--------|---------|
|
|
130
|
-
| Login échoué | `Critical` | `LogCritical("Login attempt on locked account...")` |
|
|
131
|
-
| Permission refusée | `Critical` | Auto via `SecurityAuditMiddleware` |
|
|
132
|
-
| Compte verrouillé | `Critical` | `LogCritical("Account locked...")` |
|
|
133
|
-
| Password change | `Warning` | `LogWarning("Password changed...")` |
|
|
134
|
-
| Création/MAJ | `Information` | `LogInformation("User {User} creating...")` |
|
|
135
|
-
| Suppression | `Warning` | `LogWarning("User {User} deleting...")` |
|
|
52
|
+
## SÉCURITÉ (OBLIGATOIRE)
|
|
136
53
|
|
|
137
|
-
###
|
|
54
|
+
### Logs Critiques
|
|
55
|
+
| Événement | Niveau |
|
|
56
|
+
|-----------|--------|
|
|
57
|
+
| Login échoué | `Critical` |
|
|
58
|
+
| Compte verrouillé | `Critical` |
|
|
59
|
+
| Password change | `Warning` |
|
|
60
|
+
| Suppression | `Warning` |
|
|
138
61
|
|
|
62
|
+
### Protection Comptes Système
|
|
139
63
|
```csharp
|
|
140
|
-
// TOUJOURS vérifier avant modification d'entité User-related
|
|
141
64
|
if (entity.UserType == UserType.System || entity.UserType == UserType.LocalAdmin)
|
|
142
65
|
return BadRequest(new { message = "Cannot modify system accounts" });
|
|
143
66
|
```
|
|
144
67
|
|
|
145
|
-
###
|
|
146
|
-
|
|
68
|
+
### Permissions
|
|
147
69
|
```csharp
|
|
148
|
-
//
|
|
149
|
-
[RequirePermission(Permissions.Support.Tickets.View)] // ✅ Correct
|
|
70
|
+
[RequirePermission(Permissions.Support.Tickets.View)] // ✅
|
|
150
71
|
[RequirePermission("platform.support.tickets.read")] // ❌ Éviter strings
|
|
151
72
|
```
|
|
152
73
|
|
|
153
|
-
###
|
|
154
|
-
|
|
74
|
+
### Cache Invalidation (si rôles/permissions)
|
|
155
75
|
```csharp
|
|
156
|
-
// Après modification de rôle ou permission
|
|
157
76
|
await _permissionService.InvalidateUserPermissionsCacheAsync(userId, ct);
|
|
158
77
|
```
|
|
159
78
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
## RÉFÉRENCE RAPIDE
|
|
163
|
-
|
|
164
|
-
### Services à Injecter
|
|
79
|
+
## SERVICES À INJECTER
|
|
165
80
|
|
|
166
81
|
| Service | Usage | Obligatoire |
|
|
167
82
|
|---------|-------|-------------|
|
|
168
|
-
| `IApplicationDbContext` | Accès DB | ✅
|
|
169
|
-
| `ICurrentUserService` | User courant | ✅
|
|
170
|
-
| `ILogger<T>` | Logging | ✅
|
|
171
|
-
| `IPermissionService` | Cache permissions | Si roles
|
|
83
|
+
| `IApplicationDbContext` | Accès DB | ✅ |
|
|
84
|
+
| `ICurrentUserService` | User courant | ✅ |
|
|
85
|
+
| `ILogger<T>` | Logging | ✅ |
|
|
86
|
+
| `IPermissionService` | Cache permissions | Si roles |
|
|
172
87
|
| `IPasswordService` | Hash passwords | Si auth |
|
|
173
88
|
| `IJwtService` | Tokens JWT | Si auth |
|
|
174
|
-
| `IUserSessionService` | Sessions | Si auth |
|
|
175
|
-
| `INotificationService` | Notifications | Si notifications |
|
|
176
89
|
|
|
177
|
-
|
|
90
|
+
## PRODUCES RESPONSE TYPE (OBLIGATOIRE)
|
|
178
91
|
|
|
179
92
|
```csharp
|
|
180
93
|
[ProducesResponseType(typeof(ItemDto), StatusCodes.Status200OK)]
|
|
@@ -182,59 +95,19 @@ await _permissionService.InvalidateUserPermissionsCacheAsync(userId, ct);
|
|
|
182
95
|
[ProducesResponseType(StatusCodes.Status403Forbidden)] // Si [RequirePermission]
|
|
183
96
|
[ProducesResponseType(StatusCodes.Status404NotFound)] // Si GET by ID
|
|
184
97
|
[ProducesResponseType(StatusCodes.Status400BadRequest)] // Si validation
|
|
185
|
-
[ProducesResponseType(StatusCodes.Status409Conflict)] // Si unique constraint
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## USER PATH TRACKING
|
|
191
|
-
|
|
192
|
-
> **IMPORTANT:** Le tracking du chemin utilisateur est géré par **infrastructure**, pas par les controllers.
|
|
193
|
-
|
|
194
|
-
### Middleware Existant
|
|
195
|
-
|
|
196
|
-
`ApplicationAccessTrackingMiddleware` track automatiquement :
|
|
197
|
-
- ✅ UserId, ApplicationId, ModuleId
|
|
198
|
-
- ✅ IP Address, User Agent, Device Type
|
|
199
|
-
- ✅ AccessedAt (timestamp)
|
|
200
|
-
|
|
201
|
-
### Enrichissement Recommandé (Séparé)
|
|
202
|
-
|
|
203
|
-
Pour tracker le **temps passé** sur chaque module :
|
|
204
|
-
|
|
205
|
-
```csharp
|
|
206
|
-
// Dans ApplicationAccess entity - AJOUTER :
|
|
207
|
-
public DateTime? LeftAt { get; private set; }
|
|
208
|
-
public TimeSpan? Duration => LeftAt.HasValue ? LeftAt - AccessedAt : null;
|
|
209
|
-
|
|
210
|
-
// Dans middleware - AJOUTER :
|
|
211
|
-
// 1. Au début de requête: créer/identifier session
|
|
212
|
-
// 2. À la fin de requête: calculer durée ou marquer "navigation away"
|
|
213
98
|
```
|
|
214
99
|
|
|
215
|
-
→ Ceci est un **enhancement infrastructure**, pas un controller concern.
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
100
|
## TESTS POSTMAN
|
|
220
101
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
| Test | User | Status Attendu |
|
|
224
|
-
|------|------|----------------|
|
|
102
|
+
| Test | User | Status |
|
|
103
|
+
|------|------|--------|
|
|
225
104
|
| GET list | SuperAdmin | 200 |
|
|
226
105
|
| GET list | NoPerm | 403 |
|
|
227
106
|
| GET list | Anonymous | 401 |
|
|
228
|
-
| POST create | ReadOnly | 403 |
|
|
229
107
|
| POST create | WithPerm | 201 |
|
|
230
108
|
| DELETE | ReadOnly | 403 |
|
|
231
109
|
|
|
232
|
-
→ Templates dans `postman-templates.md`
|
|
233
|
-
|
|
234
|
-
---
|
|
235
|
-
|
|
236
110
|
## FICHIERS ASSOCIÉS
|
|
237
111
|
|
|
238
|
-
-
|
|
239
|
-
-
|
|
240
|
-
- **Commande complète:** `.claude/commands/controller-create.md`
|
|
112
|
+
- [templates.md](templates.md)
|
|
113
|
+
- [postman-templates.md](postman-templates.md)
|
|
@@ -13,7 +13,8 @@ description: |
|
|
|
13
13
|
# Skill Documentation SmartStack
|
|
14
14
|
|
|
15
15
|
> **Note:** Ce skill fonctionne en synergie avec la commande `/documentation:module`.
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
**Référence:** [_shared.md](../_shared.md) pour architecture, i18n
|
|
17
18
|
|
|
18
19
|
## QUAND CE SKILL S'ACTIVE
|
|
19
20
|
|