@atlashub/smartstack-cli 1.1.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.
- package/.documentation/agents.html +912 -0
- package/.documentation/apex.html +1014 -0
- package/.documentation/business-analyse.html +1074 -0
- package/.documentation/commands.html +676 -0
- package/.documentation/css/styles.css +2030 -0
- package/.documentation/efcore.html +2501 -0
- package/.documentation/gitflow.html +2053 -0
- package/.documentation/hooks.html +409 -0
- package/.documentation/index.html +319 -0
- package/.documentation/installation.html +458 -0
- package/.documentation/js/app.js +794 -0
- package/.documentation/test-web.html +509 -0
- package/README.md +90 -0
- package/config/default-config.json +86 -0
- package/config/settings.json +53 -0
- package/config/settings.local.example.json +16 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +38198 -0
- package/dist/index.js.map +1 -0
- package/package.json +86 -0
- package/templates/agents/action.md +36 -0
- package/templates/agents/efcore/conflicts.md +57 -0
- package/templates/agents/efcore/db-deploy.md +51 -0
- package/templates/agents/efcore/db-reset.md +59 -0
- package/templates/agents/efcore/db-seed.md +56 -0
- package/templates/agents/efcore/db-status.md +43 -0
- package/templates/agents/efcore/migration.md +85 -0
- package/templates/agents/efcore/rebase-snapshot.md +62 -0
- package/templates/agents/efcore/scan.md +60 -0
- package/templates/agents/efcore/squash.md +67 -0
- package/templates/agents/explore-codebase.md +65 -0
- package/templates/agents/explore-docs.md +97 -0
- package/templates/agents/fix-grammar.md +49 -0
- package/templates/agents/gitflow/abort.md +45 -0
- package/templates/agents/gitflow/cleanup.md +85 -0
- package/templates/agents/gitflow/commit.md +40 -0
- package/templates/agents/gitflow/exec.md +48 -0
- package/templates/agents/gitflow/finish.md +92 -0
- package/templates/agents/gitflow/init.md +139 -0
- package/templates/agents/gitflow/merge.md +62 -0
- package/templates/agents/gitflow/plan.md +42 -0
- package/templates/agents/gitflow/pr.md +78 -0
- package/templates/agents/gitflow/review.md +49 -0
- package/templates/agents/gitflow/start.md +61 -0
- package/templates/agents/gitflow/status.md +32 -0
- package/templates/agents/snipper.md +36 -0
- package/templates/agents/websearch.md +46 -0
- package/templates/commands/_resources/formatting-guide.md +124 -0
- package/templates/commands/ai-prompt.md +315 -0
- package/templates/commands/apex/1-analyze.md +100 -0
- package/templates/commands/apex/2-plan.md +145 -0
- package/templates/commands/apex/3-execute.md +171 -0
- package/templates/commands/apex/4-examine.md +116 -0
- package/templates/commands/apex/5-tasks.md +209 -0
- package/templates/commands/apex.md +76 -0
- package/templates/commands/application/create.md +362 -0
- package/templates/commands/application/templates-backend.md +463 -0
- package/templates/commands/application/templates-frontend.md +517 -0
- package/templates/commands/application/templates-i18n.md +478 -0
- package/templates/commands/application/templates-seed.md +362 -0
- package/templates/commands/application.md +303 -0
- package/templates/commands/business-analyse/1-init.md +269 -0
- package/templates/commands/business-analyse/2-discover.md +520 -0
- package/templates/commands/business-analyse/3-analyse.md +408 -0
- package/templates/commands/business-analyse/4-specify.md +598 -0
- package/templates/commands/business-analyse/5-validate.md +326 -0
- package/templates/commands/business-analyse/6-handoff.md +746 -0
- package/templates/commands/business-analyse/7-doc-html.md +602 -0
- package/templates/commands/business-analyse/bug.md +325 -0
- package/templates/commands/business-analyse/change-request.md +368 -0
- package/templates/commands/business-analyse/hotfix.md +200 -0
- package/templates/commands/business-analyse.md +559 -0
- package/templates/commands/controller/create.md +216 -0
- package/templates/commands/controller/postman-templates.md +528 -0
- package/templates/commands/controller/templates.md +600 -0
- package/templates/commands/controller.md +278 -0
- package/templates/commands/debug.md +95 -0
- package/templates/commands/documentation/module.md +202 -0
- package/templates/commands/documentation/templates.md +432 -0
- package/templates/commands/documentation.md +190 -0
- package/templates/commands/efcore/_env-check.md +153 -0
- package/templates/commands/efcore/conflicts.md +269 -0
- package/templates/commands/efcore/db-deploy.md +193 -0
- package/templates/commands/efcore/db-reset.md +426 -0
- package/templates/commands/efcore/db-seed.md +326 -0
- package/templates/commands/efcore/db-status.md +214 -0
- package/templates/commands/efcore/migration.md +388 -0
- package/templates/commands/efcore/rebase-snapshot.md +264 -0
- package/templates/commands/efcore/scan.md +202 -0
- package/templates/commands/efcore/squash.md +298 -0
- package/templates/commands/efcore.md +176 -0
- package/templates/commands/epct.md +69 -0
- package/templates/commands/explain.md +186 -0
- package/templates/commands/explore.md +45 -0
- package/templates/commands/feature-full.md +267 -0
- package/templates/commands/gitflow/1-init.md +1038 -0
- package/templates/commands/gitflow/10-start.md +768 -0
- package/templates/commands/gitflow/11-finish.md +323 -0
- package/templates/commands/gitflow/12-cleanup.md +276 -0
- package/templates/commands/gitflow/13-sync.md +216 -0
- package/templates/commands/gitflow/14-rebase.md +251 -0
- package/templates/commands/gitflow/2-status.md +167 -0
- package/templates/commands/gitflow/3-commit.md +194 -0
- package/templates/commands/gitflow/4-plan.md +145 -0
- package/templates/commands/gitflow/5-exec.md +147 -0
- package/templates/commands/gitflow/6-abort.md +344 -0
- package/templates/commands/gitflow/7-pull-request.md +226 -0
- package/templates/commands/gitflow/8-review.md +176 -0
- package/templates/commands/gitflow/9-merge.md +224 -0
- package/templates/commands/gitflow.md +128 -0
- package/templates/commands/implement.md +663 -0
- package/templates/commands/notification.md +129 -0
- package/templates/commands/oneshot.md +57 -0
- package/templates/commands/quick-search.md +72 -0
- package/templates/commands/review.md +106 -0
- package/templates/commands/utils/test-web-config.md +160 -0
- package/templates/commands/utils/test-web.md +151 -0
- package/templates/commands/workflow.md +193 -0
- package/templates/gitflow/config.json +138 -0
- package/templates/hooks/ef-migration-check.md +139 -0
- package/templates/hooks/hooks.json +15 -0
- package/templates/skills/ai-prompt/SKILL.md +778 -0
- package/templates/skills/application/SKILL.md +563 -0
- package/templates/skills/application/templates-backend.md +450 -0
- package/templates/skills/application/templates-frontend.md +531 -0
- package/templates/skills/application/templates-i18n.md +520 -0
- package/templates/skills/application/templates-seed.md +647 -0
- package/templates/skills/business-analyse/SKILL.md +191 -0
- package/templates/skills/business-analyse/questionnaire.md +283 -0
- package/templates/skills/business-analyse/templates-frd.md +477 -0
- package/templates/skills/business-analyse/templates-react.md +580 -0
- package/templates/skills/controller/SKILL.md +240 -0
- package/templates/skills/controller/postman-templates.md +614 -0
- package/templates/skills/controller/templates.md +1468 -0
- package/templates/skills/documentation/SKILL.md +133 -0
- package/templates/skills/documentation/templates.md +476 -0
- package/templates/skills/feature-full/SKILL.md +838 -0
- package/templates/skills/notification/SKILL.md +555 -0
- package/templates/skills/ui-components/SKILL.md +870 -0
- package/templates/skills/workflow/SKILL.md +582 -0
- package/templates/test-web/api-health.json +38 -0
- package/templates/test-web/minimal.json +19 -0
- package/templates/test-web/npm-package.json +46 -0
- package/templates/test-web/seo-check.json +54 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# /controller - Skill Controller SmartStack
|
|
2
|
+
|
|
3
|
+
> **Synergie Skill/Commande:**
|
|
4
|
+
> - **Skill** (`.claude/skills/controller/`) → Invocation automatique par Claude
|
|
5
|
+
> - **Commande** (`/controller:create`) → Invocation manuelle par l'utilisateur
|
|
6
|
+
> - Templates partagés dans `.claude/skills/controller/templates.md`
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## ARGUMENTS
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
/controller:create <area> <module> [entity]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| Variable | Extraction | Valeurs |
|
|
17
|
+
|----------|------------|---------|
|
|
18
|
+
| `$AREA` | Premier mot | `Admin`, `Support`, `Business`, `User`, `Auth` |
|
|
19
|
+
| `$MODULE` | Deuxième mot | Nom du module (PascalCase) |
|
|
20
|
+
| `$ENTITY` | Troisième mot (optionnel) | Nom de l'entité Domain (défaut = singulier de $MODULE) |
|
|
21
|
+
|
|
22
|
+
**Exemples:**
|
|
23
|
+
```
|
|
24
|
+
/controller:create Admin Users
|
|
25
|
+
/controller:create Support Tickets Ticket
|
|
26
|
+
/controller:create Business Leads Lead
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## VALIDATION CONTEXTES (CRITIQUE)
|
|
32
|
+
|
|
33
|
+
> **RAPPEL:** Les controllers client doivent être dans l'Area `Business`.
|
|
34
|
+
|
|
35
|
+
### Mapping Area → Context
|
|
36
|
+
|
|
37
|
+
| Area | Route Prefix | Permission Context | Autorisé Client |
|
|
38
|
+
|------|--------------|-------------------|-----------------|
|
|
39
|
+
| `Admin` | `api/admin/` | `platform.administration.*` | ❌ NON |
|
|
40
|
+
| `Support` | `api/support/` | `platform.support.*` | ❌ NON |
|
|
41
|
+
| `Business` | `api/business/` | `business.*` | ✅ OUI |
|
|
42
|
+
| `User` | `api/user/` | `personal.myspace.*` | ❌ NON |
|
|
43
|
+
| `Auth` | `api/auth/` | (AllowAnonymous) | ❌ NON |
|
|
44
|
+
|
|
45
|
+
### Validation Automatique
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
AVANT génération:
|
|
49
|
+
|
|
50
|
+
SI $AREA NOT IN ["Admin", "Support", "Business", "User", "Auth"]:
|
|
51
|
+
❌ ERREUR: "Area '$AREA' non reconnue"
|
|
52
|
+
SUGGÉRER: "Utilisez 'Business' pour les modules client"
|
|
53
|
+
ABORT
|
|
54
|
+
|
|
55
|
+
SI création par client ET $AREA IN ["Admin", "Support", "User", "Auth"]:
|
|
56
|
+
⚠️ WARNING: "L'area '$AREA' est réservée au core SmartStack"
|
|
57
|
+
SUGGÉRER: "Utilisez '/controller:create Business $MODULE $ENTITY'"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## RÈGLES ABSOLUES
|
|
63
|
+
|
|
64
|
+
1. **TOUJOURS** utiliser `[RequirePermission(Permissions.*)]` - jamais de strings
|
|
65
|
+
2. **TOUJOURS** ajouter `[ProducesResponseType]` pour chaque status possible
|
|
66
|
+
3. **TOUJOURS** logger les opérations (Info pour CRUD, Warning pour Delete/Sensitive)
|
|
67
|
+
4. **TOUJOURS** protéger les comptes système (UserType.System/LocalAdmin)
|
|
68
|
+
5. **JAMAIS** de SQL direct - utiliser EF Core
|
|
69
|
+
6. **JAMAIS** d'endpoint sans permission (sauf [AllowAnonymous] pour auth)
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## WORKFLOW
|
|
74
|
+
|
|
75
|
+
### ÉTAPE 1: PARSING DES ARGUMENTS
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
EXTRAIRE $AREA = premier mot des arguments (PascalCase)
|
|
79
|
+
EXTRAIRE $MODULE = deuxième mot des arguments (PascalCase)
|
|
80
|
+
EXTRAIRE $ENTITY = troisième mot OU singulier de $MODULE
|
|
81
|
+
|
|
82
|
+
SI $AREA absent → AskUserQuestion (options: Admin, Support, Business, User, Auth)
|
|
83
|
+
SI $MODULE absent → AskUserQuestion (texte libre)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### ÉTAPE 2: ANALYSE EXISTANTE
|
|
87
|
+
|
|
88
|
+
| Action | Commande |
|
|
89
|
+
|--------|----------|
|
|
90
|
+
| Entity Domain | `Glob "Domain/**/{Entity}.cs"` |
|
|
91
|
+
| Permissions existantes | `Read Permissions.cs` |
|
|
92
|
+
| DbContext DbSet | `Grep "{Entity}s" ApplicationDbContext.cs` |
|
|
93
|
+
| Controller existant | `Glob "Controllers/{Area}/{Module}Controller.cs"` |
|
|
94
|
+
|
|
95
|
+
### ÉTAPE 3: CONFIRMATION UTILISATEUR
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
AskUserQuestion({
|
|
99
|
+
questions: [
|
|
100
|
+
{
|
|
101
|
+
header: "Type",
|
|
102
|
+
question: "Quel type de controller ?",
|
|
103
|
+
options: [
|
|
104
|
+
{ label: "CRUD Complet (Recommended)", description: "GET list, GET by ID, POST, PUT, PATCH, DELETE" },
|
|
105
|
+
{ label: "Read-Only", description: "GET list, GET by ID uniquement" },
|
|
106
|
+
{ label: "Custom", description: "Actions spécifiques à définir" }
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
header: "Postman",
|
|
111
|
+
question: "Générer les tests Postman ?",
|
|
112
|
+
options: [
|
|
113
|
+
{ label: "Oui (Recommended)", description: "Ajoute tests dans SmartStack.Security.postman_collection.json" },
|
|
114
|
+
{ label: "Non", description: "Controller uniquement" }
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
})
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### ÉTAPE 4: VALIDATION SÉCURITÉ
|
|
122
|
+
|
|
123
|
+
**Vérifications obligatoires avant génération:**
|
|
124
|
+
|
|
125
|
+
1. ✅ Permission path existe ou sera créée
|
|
126
|
+
2. ✅ Format permission: `context.application.module.action`
|
|
127
|
+
3. ✅ DbSet existe dans ApplicationDbContext
|
|
128
|
+
4. ✅ Entity a les méthodes Create/Update nécessaires
|
|
129
|
+
|
|
130
|
+
### ÉTAPE 5: GÉNÉRATION
|
|
131
|
+
|
|
132
|
+
| Fichier | Chemin | Action |
|
|
133
|
+
|---------|--------|--------|
|
|
134
|
+
| Controller | `src/SmartStack.Api/Controllers/{Area}/{Module}Controller.cs` | CREATE |
|
|
135
|
+
| Permissions | `src/SmartStack.Application/Common/Authorization/Permissions.cs` | UPDATE |
|
|
136
|
+
| Tests Postman | `tests/SmartStack.Security.postman_collection.json` | UPDATE (si choisi) |
|
|
137
|
+
|
|
138
|
+
**Utiliser templates de** → `.claude/skills/controller/templates.md`
|
|
139
|
+
|
|
140
|
+
### ÉTAPE 6: SYNCHRONISATION BASE DE DONNÉES (OBLIGATOIRE)
|
|
141
|
+
|
|
142
|
+
> **CRITIQUE:** Un controller avec `[RequirePermission]` retournera **403 Forbidden** pour TOUS les utilisateurs si la permission n'existe pas dans la base de données.
|
|
143
|
+
|
|
144
|
+
#### Workflow obligatoire
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
148
|
+
│ WORKFLOW SYNCHRONISATION PERMISSIONS │
|
|
149
|
+
├──────────────────────────────────────────────────────────────────────────────┤
|
|
150
|
+
│ │
|
|
151
|
+
│ 1. GÉNÉRER CONTROLLER │
|
|
152
|
+
│ └─→ [RequirePermission(Permissions.{Module}.View)] │
|
|
153
|
+
│ │
|
|
154
|
+
│ 2. AJOUTER À Permissions.cs (Application layer) │
|
|
155
|
+
│ └─→ public static class {Module} { ... } │
|
|
156
|
+
│ │
|
|
157
|
+
│ 3. AJOUTER À PermissionConfiguration.cs (Infrastructure layer) │
|
|
158
|
+
│ └─→ HasData(new { Path = "...", ModuleId = ..., ... }) │
|
|
159
|
+
│ │
|
|
160
|
+
│ 4. CRÉER MIGRATION EF CORE │
|
|
161
|
+
│ └─→ /efcore:migration Add{Module}Permissions │
|
|
162
|
+
│ │
|
|
163
|
+
│ 5. VALIDER COHÉRENCE │
|
|
164
|
+
│ └─→ Vérifier que TOUS les paths dans Permissions.cs │
|
|
165
|
+
│ existent dans PermissionConfiguration.cs │
|
|
166
|
+
│ │
|
|
167
|
+
└──────────────────────────────────────────────────────────────────────────────┘
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### ÉTAPE 7: LOGS CRITIQUES - VÉRIFICATION
|
|
171
|
+
|
|
172
|
+
Après génération, **VÉRIFIER** que le controller contient :
|
|
173
|
+
|
|
174
|
+
| Événement | Niveau Requis | Présent ? |
|
|
175
|
+
|-----------|---------------|-----------|
|
|
176
|
+
| Login échoué (si auth) | `LogCritical` | ☐ |
|
|
177
|
+
| Compte verrouillé (si auth) | `LogCritical` | ☐ |
|
|
178
|
+
| Password change | `LogWarning` | ☐ |
|
|
179
|
+
| Création | `LogInformation` | ☐ |
|
|
180
|
+
| Modification | `LogInformation` | ☐ |
|
|
181
|
+
| Suppression | `LogWarning` | ☐ |
|
|
182
|
+
| Désactivation | `LogWarning` | ☐ |
|
|
183
|
+
|
|
184
|
+
### ÉTAPE 8: RÉSUMÉ FINAL
|
|
185
|
+
|
|
186
|
+
Afficher:
|
|
187
|
+
- ✅ Fichiers créés (chemins cliquables)
|
|
188
|
+
- 🔐 Permissions ajoutées
|
|
189
|
+
- 🧪 Tests Postman générés (si applicable)
|
|
190
|
+
- 📝 Prochaines étapes:
|
|
191
|
+
- Vérifier les DTOs
|
|
192
|
+
- Ajouter validation métier si nécessaire
|
|
193
|
+
- Tester avec Swagger/Postman
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## SOURCES DE DONNÉES
|
|
198
|
+
|
|
199
|
+
| Donnée | Source |
|
|
200
|
+
|--------|--------|
|
|
201
|
+
| Entity Domain | `src/SmartStack.Domain/**/{Entity}.cs` |
|
|
202
|
+
| DbContext | `src/SmartStack.Application/Common/Interfaces/IApplicationDbContext.cs` |
|
|
203
|
+
| Permissions | `src/SmartStack.Application/Common/Authorization/Permissions.cs` |
|
|
204
|
+
| Controllers existants | `src/SmartStack.Api/Controllers/**/*.cs` |
|
|
205
|
+
| Tests Postman | `tests/SmartStack.Security.postman_collection.json` |
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## RÈGLES SÉCURITÉ - LOGS CRITIQUES (OBLIGATOIRE)
|
|
210
|
+
|
|
211
|
+
| Événement | Niveau | Pattern |
|
|
212
|
+
|-----------|--------|---------|
|
|
213
|
+
| Login échoué | `Critical` | `LogCritical("Login attempt on locked account...")` |
|
|
214
|
+
| Permission refusée | `Critical` | Auto via `SecurityAuditMiddleware` |
|
|
215
|
+
| Compte verrouillé | `Critical` | `LogCritical("Account locked...")` |
|
|
216
|
+
| Password change | `Warning` | `LogWarning("Password changed...")` |
|
|
217
|
+
| Création/MAJ | `Information` | `LogInformation("User {User} creating...")` |
|
|
218
|
+
| Suppression | `Warning` | `LogWarning("User {User} deleting...")` |
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## CONTRAINTES TECHNIQUES
|
|
223
|
+
|
|
224
|
+
### Injection de Dépendances (Obligatoire)
|
|
225
|
+
|
|
226
|
+
```csharp
|
|
227
|
+
public {Module}Controller(
|
|
228
|
+
IApplicationDbContext context, // TOUJOURS
|
|
229
|
+
ICurrentUserService currentUser, // TOUJOURS
|
|
230
|
+
ILogger<{Module}Controller> logger // TOUJOURS
|
|
231
|
+
// + services spécifiques au module
|
|
232
|
+
)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### ProducesResponseType (Obligatoire)
|
|
236
|
+
|
|
237
|
+
```csharp
|
|
238
|
+
[ProducesResponseType(typeof(PagedResult<T>), StatusCodes.Status200OK)]
|
|
239
|
+
[ProducesResponseType(StatusCodes.Status401Unauthorized)] // Si [Authorize]
|
|
240
|
+
[ProducesResponseType(StatusCodes.Status403Forbidden)] // Si [RequirePermission]
|
|
241
|
+
[ProducesResponseType(StatusCodes.Status404NotFound)] // Si GET/PUT/DELETE by ID
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Logging Pattern (Obligatoire)
|
|
245
|
+
|
|
246
|
+
```csharp
|
|
247
|
+
// Information - opérations standard
|
|
248
|
+
_logger.LogInformation("User {User} created {Entity} {Id}",
|
|
249
|
+
_currentUser.Email, entity.Id);
|
|
250
|
+
|
|
251
|
+
// Warning - opérations sensibles
|
|
252
|
+
_logger.LogWarning("User {User} deleted {Entity} {Id} ({Name})",
|
|
253
|
+
_currentUser.Email, id, entity.Name);
|
|
254
|
+
|
|
255
|
+
// Critical - sécurité (automatique via middleware pour 401/403)
|
|
256
|
+
_logger.LogCritical("SECURITY: Login attempt on locked account - {Email} from {IP}",
|
|
257
|
+
email, ipAddress);
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## TEMPLATES
|
|
263
|
+
|
|
264
|
+
→ **Voir `.claude/skills/controller/templates.md`**
|
|
265
|
+
|
|
266
|
+
Templates disponibles:
|
|
267
|
+
- CRUD Controller (standard)
|
|
268
|
+
- Auth Controller (login/logout/change-password)
|
|
269
|
+
- Controller avec Relations (nested resources)
|
|
270
|
+
- Patterns réutilisables (pagination, error responses)
|
|
271
|
+
|
|
272
|
+
→ **Voir `.claude/skills/controller/postman-templates.md`**
|
|
273
|
+
|
|
274
|
+
Templates tests:
|
|
275
|
+
- GET list (200, 403, 401)
|
|
276
|
+
- POST create (201, 403)
|
|
277
|
+
- DELETE (403)
|
|
278
|
+
- Auth (login success/fail, invalid token)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Systematic bug debugging with deep analysis and resolution
|
|
3
|
+
argument-hint: <log|error|problem-description>
|
|
4
|
+
allowed-tools: Bash, Read, Edit, MultiEdit, Write, Grep, Glob, Task, WebSearch, WebFetch
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a systematic debugging specialist. Follow this ultra-deep analysis workflow to identify, understand, and resolve bugs.
|
|
8
|
+
|
|
9
|
+
**You need to always ULTRA THINK.**
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
1. **ANALYZE**: Deep log/error analysis
|
|
14
|
+
- Parse the provided log/error message carefully
|
|
15
|
+
- Extract key error patterns, stack traces, and symptoms
|
|
16
|
+
- Identify error types: runtime, compile-time, logic, performance
|
|
17
|
+
- **CRITICAL**: Document exact error context and reproduction steps
|
|
18
|
+
|
|
19
|
+
2. **EXPLORE**: Targeted codebase investigation
|
|
20
|
+
- Launch **parallel subagents** to search for error-related code (`explore-codebase`, `explore-docs`, `websearch`)
|
|
21
|
+
- Search for similar error patterns in codebase using Grep
|
|
22
|
+
- Find all files related to the failing component/module
|
|
23
|
+
- Examine recent changes that might have introduced the bug
|
|
24
|
+
- **ULTRA THINK**: Connect error symptoms to potential root causes
|
|
25
|
+
|
|
26
|
+
3. **ULTRA-THINK**: Deep root cause analysis
|
|
27
|
+
- **THINK DEEPLY** about the error chain: symptoms → immediate cause → root cause
|
|
28
|
+
- Consider all possible causes:
|
|
29
|
+
- Code logic errors
|
|
30
|
+
- Configuration issues
|
|
31
|
+
- Environment problems
|
|
32
|
+
- Race conditions
|
|
33
|
+
- Memory issues
|
|
34
|
+
- Network problems
|
|
35
|
+
- **CRITICAL**: Map the complete failure path from root cause to visible symptom
|
|
36
|
+
- Validate hypotheses against the evidence
|
|
37
|
+
|
|
38
|
+
4. **RESEARCH**: Solution investigation
|
|
39
|
+
- Launch **parallel subagents** for web research (`websearch`)
|
|
40
|
+
- Search for similar issues and solutions online
|
|
41
|
+
- Check documentation for affected libraries/frameworks
|
|
42
|
+
- Look for known bugs, workarounds, and best practices
|
|
43
|
+
- **THINK**: Evaluate solution approaches for this specific context
|
|
44
|
+
|
|
45
|
+
5. **IMPLEMENT**: Systematic resolution
|
|
46
|
+
- Choose the most appropriate solution based on analysis
|
|
47
|
+
- Follow existing codebase patterns and conventions
|
|
48
|
+
- Implement minimal, targeted fixes
|
|
49
|
+
- **STAY IN SCOPE**: Fix only what's needed for this specific bug
|
|
50
|
+
- Add defensive programming where appropriate
|
|
51
|
+
|
|
52
|
+
6. **VERIFY**: Comprehensive testing
|
|
53
|
+
- Test the specific scenario that was failing
|
|
54
|
+
- Run related tests to ensure no regressions
|
|
55
|
+
- Check edge cases around the fix
|
|
56
|
+
- **CRITICAL**: Verify the original error is completely resolved
|
|
57
|
+
|
|
58
|
+
## Deep Analysis Techniques
|
|
59
|
+
|
|
60
|
+
### Log Analysis
|
|
61
|
+
|
|
62
|
+
- Extract timestamps, error codes, stack traces
|
|
63
|
+
- Identify error propagation patterns
|
|
64
|
+
- Look for correlation with system events
|
|
65
|
+
|
|
66
|
+
### Code Investigation
|
|
67
|
+
|
|
68
|
+
- Trace execution path to error location
|
|
69
|
+
- Check variable states and data flow
|
|
70
|
+
- Examine error handling patterns
|
|
71
|
+
- Review recent commits affecting the area
|
|
72
|
+
|
|
73
|
+
### Root Cause Mapping
|
|
74
|
+
|
|
75
|
+
- **WHY technique**: Ask "why" 5 times minimum
|
|
76
|
+
- Consider environmental factors
|
|
77
|
+
- Check for timing/concurrency issues
|
|
78
|
+
- Validate assumptions about data/state
|
|
79
|
+
|
|
80
|
+
## Execution Rules
|
|
81
|
+
|
|
82
|
+
- **ULTRA THINK** at each phase transition
|
|
83
|
+
- Use parallel agents for comprehensive investigation
|
|
84
|
+
- Document findings and reasoning at each step
|
|
85
|
+
- **NEVER guess** - validate all hypotheses with evidence
|
|
86
|
+
- **MINIMAL CHANGES**: Fix root cause, not symptoms
|
|
87
|
+
- Test thoroughly before declaring resolution complete
|
|
88
|
+
|
|
89
|
+
## Priority
|
|
90
|
+
|
|
91
|
+
Understanding > Speed > Completeness. Every bug must be fully understood before attempting fixes.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
User: $ARGUMENTS
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# /documentation:module - Génération Documentation SmartStack
|
|
2
|
+
|
|
3
|
+
> **Synergie Skill/Commande:**
|
|
4
|
+
> - **Skill** (`.claude/skills/documentation/`) → Invocation automatique par Claude
|
|
5
|
+
> - **Commande** (`/documentation:module`) → Invocation manuelle par l'utilisateur
|
|
6
|
+
> - Templates partagés dans `.claude/skills/documentation/templates.md`
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## ARGUMENTS
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
/documentation:module <type> <target>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| Variable | Extraction | Valeurs |
|
|
17
|
+
|----------|------------|---------|
|
|
18
|
+
| `$TYPE` | Premier mot | `user` \| `developer` \| `database` \| `testing` |
|
|
19
|
+
| `$TARGET` | Reste de la ligne | Nom du module, outil, ou schéma |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## RÈGLES ABSOLUES
|
|
24
|
+
|
|
25
|
+
1. **JAMAIS** de texte en dur → `useTranslation('docs')`
|
|
26
|
+
2. **JAMAIS** d'ASCII art → composants React/HTML pour MCD
|
|
27
|
+
3. **TOUJOURS** lire les sources existantes avant de générer
|
|
28
|
+
4. **TOUJOURS** demander confirmation avant de créer les fichiers
|
|
29
|
+
5. **TOUJOURS** mettre à jour App.tsx et les index parents
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## WORKFLOW
|
|
34
|
+
|
|
35
|
+
### ÉTAPE 1: PARSING DES ARGUMENTS
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
EXTRAIRE $TYPE = premier mot des arguments
|
|
39
|
+
EXTRAIRE $TARGET = reste des arguments
|
|
40
|
+
|
|
41
|
+
SI $TYPE absent OU non reconnu → AskUserQuestion
|
|
42
|
+
SI $TARGET absent → AskUserQuestion
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### ÉTAPE 2: ANALYSE (selon $TYPE)
|
|
46
|
+
|
|
47
|
+
#### SI $TYPE == "user"
|
|
48
|
+
|
|
49
|
+
| Action | Commande |
|
|
50
|
+
|--------|----------|
|
|
51
|
+
| Trouver le module | `Grep "code.*$TARGET" src/.../Navigation/` |
|
|
52
|
+
| Composants React | `Glob "web/.../pages/**/*$TARGET*"` |
|
|
53
|
+
| Permissions | `Grep "$TARGET" src/.../Permissions.cs` |
|
|
54
|
+
| Endpoints API | `Grep "$TARGET" src/.../Controllers/` |
|
|
55
|
+
|
|
56
|
+
#### SI $TYPE == "database"
|
|
57
|
+
|
|
58
|
+
| Action | Commande |
|
|
59
|
+
|--------|----------|
|
|
60
|
+
| Tables du schéma | `Read ApplicationDbContextModelSnapshot.cs` |
|
|
61
|
+
| Configurations | `Glob "Persistence/Configurations/$TARGET/*.cs"` |
|
|
62
|
+
| Entités Domain | `Glob "Domain/Entities/$TARGET/*.cs"` |
|
|
63
|
+
|
|
64
|
+
#### SI $TYPE == "developer" ou "testing"
|
|
65
|
+
|
|
66
|
+
| Action | Commande |
|
|
67
|
+
|--------|----------|
|
|
68
|
+
| Doc existante | `Glob "pages/docs/developer/**/*$TARGET*"` |
|
|
69
|
+
| Fichiers config | `Glob "**/$TARGET*.{json,yaml}"` |
|
|
70
|
+
| Doc officielle | `WebSearch` |
|
|
71
|
+
|
|
72
|
+
### ÉTAPE 3: CONFIRMATION UTILISATEUR
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
AskUserQuestion({
|
|
76
|
+
questions: [{
|
|
77
|
+
header: "Détail",
|
|
78
|
+
question: "Quel niveau de détail pour '$TARGET' ?",
|
|
79
|
+
options: [
|
|
80
|
+
{ label: "Complet (Recommended)", description: "Toutes sections" },
|
|
81
|
+
{ label: "Standard", description: "Sections principales" },
|
|
82
|
+
{ label: "Minimal", description: "Référence rapide" }
|
|
83
|
+
]
|
|
84
|
+
}]
|
|
85
|
+
})
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### ÉTAPE 4: GÉNÉRATION
|
|
89
|
+
|
|
90
|
+
| $TYPE | Fichier | Chemin |
|
|
91
|
+
|-------|---------|--------|
|
|
92
|
+
| `user` | `{Module}DocPage.tsx` | `pages/docs/user/{context}/` |
|
|
93
|
+
| `developer` | `{Tool}Page.tsx` | `pages/docs/developer/tools/` |
|
|
94
|
+
| `database` | `{Schema}SchemaPage.tsx` | `pages/docs/developer/database/` |
|
|
95
|
+
| `testing` | `{Tool}TestingPage.tsx` | `pages/docs/developer/testing/` |
|
|
96
|
+
|
|
97
|
+
**Fichiers à créer/modifier:**
|
|
98
|
+
1. Page React (utiliser template de `templates.md`)
|
|
99
|
+
2. Traductions EN → `i18n/locales/en/docs.json`
|
|
100
|
+
3. Traductions FR → `i18n/locales/fr/docs.json`
|
|
101
|
+
4. Route → `App.tsx`
|
|
102
|
+
5. Index parent → lien de navigation
|
|
103
|
+
6. **UserIndexPage.tsx** → Ajouter le module à la hiérarchie (SI $TYPE == "user")
|
|
104
|
+
|
|
105
|
+
### ÉTAPE 4bis: INTÉGRATION UserIndexPage (SI $TYPE == "user")
|
|
106
|
+
|
|
107
|
+
**OBLIGATOIRE** pour les modules utilisateur: Vérifier et mettre à jour `UserIndexPage.tsx`
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
// Fichier: web/smartstack-web/src/pages/docs/user/UserIndexPage.tsx
|
|
111
|
+
|
|
112
|
+
// 1. Ajouter l'icône si nécessaire
|
|
113
|
+
import { ..., {IconName} } from 'lucide-react';
|
|
114
|
+
|
|
115
|
+
// 2. Trouver l'application parente dans la hiérarchie
|
|
116
|
+
// - Platform > Administration: pour les modules admin
|
|
117
|
+
// - Platform > Support: pour les modules support
|
|
118
|
+
// - Personal > MySpace: pour les modules personnels
|
|
119
|
+
|
|
120
|
+
// 3. Ajouter le module dans le tableau `modules` de l'application:
|
|
121
|
+
{
|
|
122
|
+
name: t('user.modules.{module}.name'),
|
|
123
|
+
icon: {IconName},
|
|
124
|
+
href: '/docs/user/{slug}',
|
|
125
|
+
description: t('user.modules.{module}.description')
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
// 4. Ajouter les traductions dans docs.json (fr + en):
|
|
129
|
+
"modules": {
|
|
130
|
+
"{module}": {
|
|
131
|
+
"name": "Nom du module",
|
|
132
|
+
"description": "Description courte"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Vérification:**
|
|
138
|
+
- Le module doit apparaître dans la page `/docs/user` sous son application parente
|
|
139
|
+
- Le lien doit pointer vers `/docs/user/{slug}`
|
|
140
|
+
|
|
141
|
+
### ÉTAPE 5: INTÉGRATION
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
// App.tsx
|
|
145
|
+
import { {Name}DocPage } from '@/pages/docs/{path}/{Name}DocPage';
|
|
146
|
+
<Route path="{slug}" element={<{Name}DocPage />} />
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### ÉTAPE 6: RÉSUMÉ FINAL
|
|
150
|
+
|
|
151
|
+
Afficher:
|
|
152
|
+
- ✅ Fichiers créés (chemins cliquables)
|
|
153
|
+
- 🔗 URL: `/docs/{path}/{slug}`
|
|
154
|
+
- 📝 Prochaines étapes
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## TEMPLATES
|
|
159
|
+
|
|
160
|
+
→ **Voir `.claude/skills/documentation/templates.md`**
|
|
161
|
+
|
|
162
|
+
Templates disponibles:
|
|
163
|
+
- User Module (maquettes UI, FAQ, API)
|
|
164
|
+
- Database Schema (MCD HTML, tables détaillées)
|
|
165
|
+
- Developer Tool (installation, config, CI/CD)
|
|
166
|
+
- Patterns réutilisables (CodeBlock, Stats, Badges)
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## SOURCES DE DONNÉES
|
|
171
|
+
|
|
172
|
+
| Donnée | Source |
|
|
173
|
+
|--------|--------|
|
|
174
|
+
| Tables DB | `ApplicationDbContextModelSnapshot.cs` |
|
|
175
|
+
| Configurations | `Persistence/Configurations/{schema}/*.cs` |
|
|
176
|
+
| Permissions | `Domain/Authorization/Permissions.cs` |
|
|
177
|
+
| Routes | `App.tsx` |
|
|
178
|
+
| Traductions | `i18n/locales/*/docs.json` |
|
|
179
|
+
| Doc outils | WebSearch |
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## STRUCTURE i18n
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"breadcrumb": { "documentation": "...", "user": "...", "developer": "..." },
|
|
188
|
+
"common": { "tableOfContents": "...", "externalResources": "..." },
|
|
189
|
+
"user": { "{module}": { "title": "...", "sections": {...} } },
|
|
190
|
+
"developer": { "tools": {...}, "database": {...} }
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## CONTRAINTES
|
|
197
|
+
|
|
198
|
+
- Variables CSS: `var(--text-primary)`, `var(--bg-secondary)`, `var(--color-primary-600)`
|
|
199
|
+
- Responsive: `grid-cols-1 md:grid-cols-2 lg:grid-cols-3`
|
|
200
|
+
- Icônes: `lucide-react` uniquement
|
|
201
|
+
- Liens externes: avec `<ExternalLink />` icon
|
|
202
|
+
- MCD: composants React/HTML (JAMAIS ASCII)
|