@atlashub/smartstack-cli 1.4.0 → 1.5.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 +8 -4
- package/.documentation/apex.html +8 -4
- package/.documentation/business-analyse.html +833 -406
- package/.documentation/commands.html +8 -4
- package/.documentation/css/styles.css +153 -15
- package/.documentation/efcore.html +8 -4
- package/.documentation/gitflow.html +795 -230
- package/.documentation/hooks.html +8 -4
- package/.documentation/index.html +13 -9
- package/.documentation/installation.html +23 -19
- package/.documentation/ralph-loop.html +530 -0
- package/.documentation/test-web.html +8 -4
- package/README.md +52 -10
- package/dist/index.js +813 -283
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/agents/efcore/conflicts.md +44 -17
- package/templates/agents/efcore/db-status.md +27 -6
- package/templates/agents/efcore/scan.md +43 -13
- package/templates/commands/ai-prompt.md +315 -315
- package/templates/commands/application/create.md +362 -362
- package/templates/commands/controller/create.md +216 -216
- package/templates/commands/controller.md +59 -0
- package/templates/commands/create/agent.md +138 -0
- package/templates/commands/create/command.md +166 -0
- package/templates/commands/create/hook.md +234 -0
- package/templates/commands/create/plugin.md +329 -0
- package/templates/commands/create/project.md +507 -0
- package/templates/commands/create/skill.md +199 -0
- package/templates/commands/create.md +220 -0
- package/templates/commands/documentation/module.md +202 -202
- package/templates/commands/efcore/_env-check.md +153 -153
- package/templates/commands/efcore/conflicts.md +109 -192
- package/templates/commands/efcore/db-status.md +101 -89
- package/templates/commands/efcore/migration.md +23 -11
- package/templates/commands/efcore/scan.md +115 -119
- package/templates/commands/efcore.md +54 -6
- package/templates/commands/feature-full.md +267 -267
- package/templates/commands/gitflow/11-finish.md +145 -11
- package/templates/commands/gitflow/13-sync.md +216 -216
- package/templates/commands/gitflow/14-rebase.md +251 -251
- package/templates/commands/gitflow/2-status.md +120 -10
- package/templates/commands/gitflow/3-commit.md +150 -0
- package/templates/commands/gitflow/7-pull-request.md +134 -5
- package/templates/commands/gitflow/9-merge.md +142 -1
- package/templates/commands/implement.md +663 -663
- package/templates/commands/init.md +562 -0
- package/templates/commands/mcp-integration.md +330 -0
- package/templates/commands/notification.md +129 -129
- package/templates/commands/validate.md +233 -0
- package/templates/commands/workflow.md +193 -193
- package/templates/skills/ai-prompt/SKILL.md +778 -778
- package/templates/skills/application/SKILL.md +563 -563
- package/templates/skills/application/templates-backend.md +450 -450
- package/templates/skills/application/templates-frontend.md +531 -531
- package/templates/skills/application/templates-i18n.md +520 -520
- package/templates/skills/application/templates-seed.md +647 -647
- package/templates/skills/controller/SKILL.md +240 -240
- package/templates/skills/controller/postman-templates.md +614 -614
- package/templates/skills/controller/templates.md +1468 -1468
- package/templates/skills/documentation/SKILL.md +133 -133
- package/templates/skills/documentation/templates.md +476 -476
- package/templates/skills/feature-full/SKILL.md +838 -838
- package/templates/skills/notification/SKILL.md +555 -555
- package/templates/skills/ui-components/SKILL.md +870 -870
- package/templates/skills/workflow/SKILL.md +582 -582
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Validate SmartStack conventions using MCP
|
|
3
|
+
agent: action
|
|
4
|
+
model: sonnet
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /validate - SmartStack Conventions Validator
|
|
8
|
+
|
|
9
|
+
Validates the SmartStack project against established conventions using **SmartStack MCP**.
|
|
10
|
+
|
|
11
|
+
**USAGE:** Before commits, PRs, or as part of CI/CD to ensure code quality.
|
|
12
|
+
|
|
13
|
+
**INTEGRATION:** Uses `mcp__smartstack__validate_conventions` for comprehensive analysis.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Available Commands
|
|
18
|
+
|
|
19
|
+
| Command | Description | Checks |
|
|
20
|
+
|---------|-------------|--------|
|
|
21
|
+
| `/validate` | Run all validations | All |
|
|
22
|
+
| `/validate:tables` | Validate table naming | SQL schemas, prefixes |
|
|
23
|
+
| `/validate:migrations` | Validate migration naming | Format, order |
|
|
24
|
+
| `/validate:services` | Validate service pattern | I*Service interfaces |
|
|
25
|
+
| `/validate:namespaces` | Validate namespace structure | Layer separation |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## STEP 1: Invoke MCP validate_conventions
|
|
30
|
+
|
|
31
|
+
> **MCP INTEGRATION:** This command uses the SmartStack MCP server for validation.
|
|
32
|
+
|
|
33
|
+
**Claude instruction:** Call the MCP tool:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"tool": "mcp__smartstack__validate_conventions",
|
|
38
|
+
"parameters": {
|
|
39
|
+
"checks": ["all"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For specific checks:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"tool": "mcp__smartstack__validate_conventions",
|
|
49
|
+
"parameters": {
|
|
50
|
+
"checks": ["tables", "migrations"]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## STEP 2: Parse MCP Response
|
|
58
|
+
|
|
59
|
+
The MCP returns a `ValidationResult`:
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
interface ValidationResult {
|
|
63
|
+
valid: boolean;
|
|
64
|
+
errors: ValidationIssue[];
|
|
65
|
+
warnings: ValidationIssue[];
|
|
66
|
+
summary: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface ValidationIssue {
|
|
70
|
+
type: 'error' | 'warning';
|
|
71
|
+
category: 'tables' | 'migrations' | 'services' | 'namespaces';
|
|
72
|
+
message: string;
|
|
73
|
+
file?: string;
|
|
74
|
+
line?: number;
|
|
75
|
+
suggestion?: string;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## STEP 3: Display Results
|
|
82
|
+
|
|
83
|
+
**If `valid: true` with no warnings:**
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
================================================================================
|
|
87
|
+
SMARTSTACK CONVENTIONS VALIDATION
|
|
88
|
+
================================================================================
|
|
89
|
+
|
|
90
|
+
STATUS: PASSED
|
|
91
|
+
|
|
92
|
+
Checks performed: tables, migrations, services, namespaces
|
|
93
|
+
Errors: 0
|
|
94
|
+
Warnings: 0
|
|
95
|
+
|
|
96
|
+
All conventions validated successfully!
|
|
97
|
+
|
|
98
|
+
================================================================================
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**If `valid: false` or has warnings:**
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
================================================================================
|
|
105
|
+
SMARTSTACK CONVENTIONS VALIDATION
|
|
106
|
+
================================================================================
|
|
107
|
+
|
|
108
|
+
STATUS: {valid ? "PASSED (with warnings)" : "FAILED"}
|
|
109
|
+
|
|
110
|
+
ERRORS ({errors.length})
|
|
111
|
+
--------------------------------------------------------------------------------
|
|
112
|
+
{for each error in errors}
|
|
113
|
+
[{error.category}] {error.message}
|
|
114
|
+
File: {error.file}
|
|
115
|
+
Suggestion: {error.suggestion}
|
|
116
|
+
{end for}
|
|
117
|
+
--------------------------------------------------------------------------------
|
|
118
|
+
|
|
119
|
+
WARNINGS ({warnings.length})
|
|
120
|
+
--------------------------------------------------------------------------------
|
|
121
|
+
{for each warning in warnings}
|
|
122
|
+
[{warning.category}] {warning.message}
|
|
123
|
+
File: {warning.file}
|
|
124
|
+
Suggestion: {warning.suggestion}
|
|
125
|
+
{end for}
|
|
126
|
+
--------------------------------------------------------------------------------
|
|
127
|
+
|
|
128
|
+
================================================================================
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Validation Rules
|
|
134
|
+
|
|
135
|
+
### Tables (`checks: ["tables"]`)
|
|
136
|
+
|
|
137
|
+
| Rule | Valid | Invalid |
|
|
138
|
+
|------|-------|---------|
|
|
139
|
+
| Schema | `core`, `extensions` | `dbo`, custom |
|
|
140
|
+
| Prefix | `auth_Users`, `nav_Items` | `Users`, `Items` |
|
|
141
|
+
|
|
142
|
+
**Valid prefixes:** `auth_`, `nav_`, `usr_`, `ai_`, `cfg_`, `wkf_`, `support_`, `entra_`, `ref_`, `loc_`, `lic_`
|
|
143
|
+
|
|
144
|
+
### Migrations (`checks: ["migrations"]`)
|
|
145
|
+
|
|
146
|
+
| Rule | Valid | Invalid |
|
|
147
|
+
|------|-------|---------|
|
|
148
|
+
| Format | `core_v1.0.0_001_AddUsers` | `AddUsersTable` |
|
|
149
|
+
| Order | v1.0.0 before v1.1.0 | v1.1.0 before v1.0.0 |
|
|
150
|
+
|
|
151
|
+
**Format:** `{context}_v{version}_{sequence}_{Description}`
|
|
152
|
+
|
|
153
|
+
### Services (`checks: ["services"]`)
|
|
154
|
+
|
|
155
|
+
| Rule | Valid | Invalid |
|
|
156
|
+
|------|-------|---------|
|
|
157
|
+
| Interface | `IUserService` | `UserServiceInterface` |
|
|
158
|
+
| Implementation | `UserService : IUserService` | `UserService` (no interface) |
|
|
159
|
+
|
|
160
|
+
### Namespaces (`checks: ["namespaces"]`)
|
|
161
|
+
|
|
162
|
+
| Layer | Expected Namespace |
|
|
163
|
+
|-------|-------------------|
|
|
164
|
+
| Domain | `SmartStack.Domain.*` |
|
|
165
|
+
| Application | `SmartStack.Application.*` |
|
|
166
|
+
| Infrastructure | `SmartStack.Infrastructure.*` |
|
|
167
|
+
| Api | `SmartStack.Api.*` |
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Options
|
|
172
|
+
|
|
173
|
+
| Option | Description |
|
|
174
|
+
|--------|-------------|
|
|
175
|
+
| `--fix` | Auto-fix simple issues (rename suggestions) |
|
|
176
|
+
| `--json` | Output raw MCP JSON response |
|
|
177
|
+
| `--strict` | Treat warnings as errors |
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## CI/CD Integration
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
# GitHub Actions
|
|
185
|
+
- name: Validate SmartStack conventions
|
|
186
|
+
run: |
|
|
187
|
+
OUTPUT=$(claude-code "/validate --json")
|
|
188
|
+
VALID=$(echo $OUTPUT | jq '.valid')
|
|
189
|
+
if [ "$VALID" != "true" ]; then
|
|
190
|
+
echo "::error::SmartStack convention violations detected"
|
|
191
|
+
exit 1
|
|
192
|
+
fi
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Pre-Commit Hook Integration
|
|
198
|
+
|
|
199
|
+
Add to `.claude/hooks/PreToolUse`:
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"matcher": "Edit|Write",
|
|
204
|
+
"hooks": [{
|
|
205
|
+
"type": "command",
|
|
206
|
+
"command": "claude-code /validate:quick"
|
|
207
|
+
}]
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## MCP Tool Reference
|
|
214
|
+
|
|
215
|
+
**Tool:** `mcp__smartstack__validate_conventions`
|
|
216
|
+
|
|
217
|
+
**Description:** Validate AtlasHub/SmartStack conventions: SQL schemas (core/extensions), domain table prefixes (auth_, nav_, ai_, etc.), migration naming ({context}_v{version}_{sequence}_*), service interfaces (I*Service), namespace structure
|
|
218
|
+
|
|
219
|
+
**Parameters:**
|
|
220
|
+
|
|
221
|
+
| Parameter | Type | Description |
|
|
222
|
+
|-----------|------|-------------|
|
|
223
|
+
| `path` | string | Project path (default: auto-detect) |
|
|
224
|
+
| `checks` | string[] | Types of checks: `tables`, `migrations`, `services`, `namespaces`, `all` |
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Why MCP Integration?
|
|
229
|
+
|
|
230
|
+
1. **Centralized Rules:** Convention rules defined once in MCP config
|
|
231
|
+
2. **Consistency:** Same validation in CLI, CI/CD, and IDE
|
|
232
|
+
3. **Extensibility:** Add new checks in MCP, available everywhere
|
|
233
|
+
4. **Structured Output:** Typed responses for automation
|
|
@@ -1,193 +1,193 @@
|
|
|
1
|
-
# /workflow - Gestion Workflows SmartStack
|
|
2
|
-
|
|
3
|
-
> **Synergie Skill/Commande:**
|
|
4
|
-
> - **Skill** (`templates/skills/workflow/`) → Invocation automatique par Claude
|
|
5
|
-
> - **Commande** (`/workflow`) → Invocation manuelle par l'utilisateur
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## ARGUMENTS
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
/workflow <action> [options]
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
| Action | Description |
|
|
16
|
-
|--------|-------------|
|
|
17
|
-
| `create` | Creer un nouveau workflow complet |
|
|
18
|
-
| `trigger` | Ajouter un nouveau trigger |
|
|
19
|
-
| `step` | Ajouter un step a un workflow existant |
|
|
20
|
-
| `template` | Creer un email template |
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## WORKFLOW
|
|
25
|
-
|
|
26
|
-
### /workflow create
|
|
27
|
-
|
|
28
|
-
Cree un workflow complet avec trigger et steps.
|
|
29
|
-
|
|
30
|
-
**Questions:**
|
|
31
|
-
1. Code du workflow ? (kebab-case)
|
|
32
|
-
2. Nom descriptif ?
|
|
33
|
-
3. Quel trigger ? (existant ou nouveau)
|
|
34
|
-
4. Quels steps ? (Email, Wait, Condition, Webhook)
|
|
35
|
-
5. Systeme ? (oui/non)
|
|
36
|
-
6. Priorite ? (1-100, defaut 10)
|
|
37
|
-
|
|
38
|
-
**Actions:**
|
|
39
|
-
1. Creer/utiliser le trigger
|
|
40
|
-
2. Ajouter le workflow dans WorkflowConfiguration.cs seed
|
|
41
|
-
3. Ajouter les steps dans WorkflowStepConfiguration.cs seed
|
|
42
|
-
4. Creer les email templates si necessaire
|
|
43
|
-
5. Creer migration EF Core
|
|
44
|
-
|
|
45
|
-
### /workflow trigger
|
|
46
|
-
|
|
47
|
-
Ajoute un nouveau trigger.
|
|
48
|
-
|
|
49
|
-
**Questions:**
|
|
50
|
-
1. Code du trigger ? (format: entity.event)
|
|
51
|
-
2. Nom descriptif ?
|
|
52
|
-
3. Variables disponibles ?
|
|
53
|
-
|
|
54
|
-
**Actions:**
|
|
55
|
-
1. Ajouter dans WorkflowTriggerConfiguration.cs seed
|
|
56
|
-
2. Creer migration EF Core
|
|
57
|
-
|
|
58
|
-
### /workflow step
|
|
59
|
-
|
|
60
|
-
Ajoute un step a un workflow existant.
|
|
61
|
-
|
|
62
|
-
**Questions:**
|
|
63
|
-
1. Quel workflow ?
|
|
64
|
-
2. Type de step ? (SendEmail, Wait, Condition, Webhook)
|
|
65
|
-
3. Configuration specifique selon le type
|
|
66
|
-
|
|
67
|
-
**Actions:**
|
|
68
|
-
1. Ajouter dans WorkflowStepConfiguration.cs seed
|
|
69
|
-
2. Mettre a jour l'ordre des steps
|
|
70
|
-
3. Creer migration EF Core
|
|
71
|
-
|
|
72
|
-
### /workflow template
|
|
73
|
-
|
|
74
|
-
Cree un email template.
|
|
75
|
-
|
|
76
|
-
**Questions:**
|
|
77
|
-
1. Code du template ?
|
|
78
|
-
2. Nom ?
|
|
79
|
-
3. Categorie ? (Transactional, Marketing, System)
|
|
80
|
-
4. Langues ? (fr, en, it, de)
|
|
81
|
-
|
|
82
|
-
**Actions:**
|
|
83
|
-
1. Ajouter dans EmailTemplateConfiguration.cs seed
|
|
84
|
-
2. Ajouter les translations
|
|
85
|
-
3. Creer migration EF Core
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## TEMPLATES
|
|
90
|
-
|
|
91
|
-
### Template Trigger Seed
|
|
92
|
-
|
|
93
|
-
```csharp
|
|
94
|
-
new
|
|
95
|
-
{
|
|
96
|
-
Id = Guid.Parse("$TRIGGER_GUID"),
|
|
97
|
-
Code = "$ENTITY.$EVENT",
|
|
98
|
-
Name = "$NAME",
|
|
99
|
-
Description = "$DESCRIPTION",
|
|
100
|
-
TriggerType = "$TRIGGER_TYPE",
|
|
101
|
-
AvailableVariablesJson = JsonSerializer.Serialize(new[]
|
|
102
|
-
{
|
|
103
|
-
new { Name = "entityId", Type = "Guid", Description = "Entity ID" },
|
|
104
|
-
new { Name = "entityName", Type = "string", Description = "Entity name" },
|
|
105
|
-
new { Name = "userEmail", Type = "string", Description = "User email" },
|
|
106
|
-
}),
|
|
107
|
-
IsActive = true,
|
|
108
|
-
CreatedAt = seedDate
|
|
109
|
-
},
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Template Workflow Seed
|
|
113
|
-
|
|
114
|
-
```csharp
|
|
115
|
-
new
|
|
116
|
-
{
|
|
117
|
-
Id = Guid.Parse("$WORKFLOW_GUID"),
|
|
118
|
-
Code = "$CODE",
|
|
119
|
-
Name = "$NAME",
|
|
120
|
-
Description = "$DESCRIPTION",
|
|
121
|
-
TriggerId = Guid.Parse("$TRIGGER_GUID"),
|
|
122
|
-
ApplicationId = (Guid?)null,
|
|
123
|
-
IsActive = true,
|
|
124
|
-
IsSystem = $IS_SYSTEM,
|
|
125
|
-
Priority = $PRIORITY,
|
|
126
|
-
CreatedAt = seedDate
|
|
127
|
-
},
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Template Step Seed (Email)
|
|
131
|
-
|
|
132
|
-
```csharp
|
|
133
|
-
new
|
|
134
|
-
{
|
|
135
|
-
Id = Guid.Parse("$STEP_GUID"),
|
|
136
|
-
WorkflowId = Guid.Parse("$WORKFLOW_GUID"),
|
|
137
|
-
Name = "$NAME",
|
|
138
|
-
StepType = WorkflowStepType.SendEmail,
|
|
139
|
-
StepOrder = $ORDER,
|
|
140
|
-
EmailTemplateId = Guid.Parse("$TEMPLATE_GUID"),
|
|
141
|
-
IsActive = true,
|
|
142
|
-
CreatedAt = seedDate
|
|
143
|
-
},
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Template Step Seed (Wait)
|
|
147
|
-
|
|
148
|
-
```csharp
|
|
149
|
-
new
|
|
150
|
-
{
|
|
151
|
-
Id = Guid.Parse("$STEP_GUID"),
|
|
152
|
-
WorkflowId = Guid.Parse("$WORKFLOW_GUID"),
|
|
153
|
-
Name = "$NAME",
|
|
154
|
-
StepType = WorkflowStepType.Wait,
|
|
155
|
-
StepOrder = $ORDER,
|
|
156
|
-
DelayMinutes = $DELAY_MINUTES,
|
|
157
|
-
IsActive = true,
|
|
158
|
-
CreatedAt = seedDate
|
|
159
|
-
},
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Template Declenchement
|
|
163
|
-
|
|
164
|
-
```csharp
|
|
165
|
-
await _workflowService.TriggerAsync(
|
|
166
|
-
"$TRIGGER_CODE",
|
|
167
|
-
new Dictionary<string, object>
|
|
168
|
-
{
|
|
169
|
-
["entityId"] = entity.Id,
|
|
170
|
-
["entityName"] = entity.Name,
|
|
171
|
-
["userEmail"] = _currentUser.Email
|
|
172
|
-
},
|
|
173
|
-
language: "fr",
|
|
174
|
-
cancellationToken: ct);
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## FICHIERS CLES
|
|
180
|
-
|
|
181
|
-
| Fichier | Role |
|
|
182
|
-
|---------|------|
|
|
183
|
-
| `Domain/Communications/Workflow.cs` | Entite workflow |
|
|
184
|
-
| `Domain/Communications/WorkflowStep.cs` | Entite step |
|
|
185
|
-
| `Domain/Communications/WorkflowTrigger.cs` | Entite trigger |
|
|
186
|
-
| `Infrastructure/.../WorkflowConfiguration.cs` | Seed workflows |
|
|
187
|
-
| `Infrastructure/.../WorkflowTriggerConfiguration.cs` | Seed triggers |
|
|
188
|
-
| `Infrastructure/.../WorkflowStepConfiguration.cs` | Seed steps |
|
|
189
|
-
| `Infrastructure/Services/Workflow/WorkflowExecutionService.cs` | Execution |
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
User: $ARGUMENTS
|
|
1
|
+
# /workflow - Gestion Workflows SmartStack
|
|
2
|
+
|
|
3
|
+
> **Synergie Skill/Commande:**
|
|
4
|
+
> - **Skill** (`templates/skills/workflow/`) → Invocation automatique par Claude
|
|
5
|
+
> - **Commande** (`/workflow`) → Invocation manuelle par l'utilisateur
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ARGUMENTS
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
/workflow <action> [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
| Action | Description |
|
|
16
|
+
|--------|-------------|
|
|
17
|
+
| `create` | Creer un nouveau workflow complet |
|
|
18
|
+
| `trigger` | Ajouter un nouveau trigger |
|
|
19
|
+
| `step` | Ajouter un step a un workflow existant |
|
|
20
|
+
| `template` | Creer un email template |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## WORKFLOW
|
|
25
|
+
|
|
26
|
+
### /workflow create
|
|
27
|
+
|
|
28
|
+
Cree un workflow complet avec trigger et steps.
|
|
29
|
+
|
|
30
|
+
**Questions:**
|
|
31
|
+
1. Code du workflow ? (kebab-case)
|
|
32
|
+
2. Nom descriptif ?
|
|
33
|
+
3. Quel trigger ? (existant ou nouveau)
|
|
34
|
+
4. Quels steps ? (Email, Wait, Condition, Webhook)
|
|
35
|
+
5. Systeme ? (oui/non)
|
|
36
|
+
6. Priorite ? (1-100, defaut 10)
|
|
37
|
+
|
|
38
|
+
**Actions:**
|
|
39
|
+
1. Creer/utiliser le trigger
|
|
40
|
+
2. Ajouter le workflow dans WorkflowConfiguration.cs seed
|
|
41
|
+
3. Ajouter les steps dans WorkflowStepConfiguration.cs seed
|
|
42
|
+
4. Creer les email templates si necessaire
|
|
43
|
+
5. Creer migration EF Core
|
|
44
|
+
|
|
45
|
+
### /workflow trigger
|
|
46
|
+
|
|
47
|
+
Ajoute un nouveau trigger.
|
|
48
|
+
|
|
49
|
+
**Questions:**
|
|
50
|
+
1. Code du trigger ? (format: entity.event)
|
|
51
|
+
2. Nom descriptif ?
|
|
52
|
+
3. Variables disponibles ?
|
|
53
|
+
|
|
54
|
+
**Actions:**
|
|
55
|
+
1. Ajouter dans WorkflowTriggerConfiguration.cs seed
|
|
56
|
+
2. Creer migration EF Core
|
|
57
|
+
|
|
58
|
+
### /workflow step
|
|
59
|
+
|
|
60
|
+
Ajoute un step a un workflow existant.
|
|
61
|
+
|
|
62
|
+
**Questions:**
|
|
63
|
+
1. Quel workflow ?
|
|
64
|
+
2. Type de step ? (SendEmail, Wait, Condition, Webhook)
|
|
65
|
+
3. Configuration specifique selon le type
|
|
66
|
+
|
|
67
|
+
**Actions:**
|
|
68
|
+
1. Ajouter dans WorkflowStepConfiguration.cs seed
|
|
69
|
+
2. Mettre a jour l'ordre des steps
|
|
70
|
+
3. Creer migration EF Core
|
|
71
|
+
|
|
72
|
+
### /workflow template
|
|
73
|
+
|
|
74
|
+
Cree un email template.
|
|
75
|
+
|
|
76
|
+
**Questions:**
|
|
77
|
+
1. Code du template ?
|
|
78
|
+
2. Nom ?
|
|
79
|
+
3. Categorie ? (Transactional, Marketing, System)
|
|
80
|
+
4. Langues ? (fr, en, it, de)
|
|
81
|
+
|
|
82
|
+
**Actions:**
|
|
83
|
+
1. Ajouter dans EmailTemplateConfiguration.cs seed
|
|
84
|
+
2. Ajouter les translations
|
|
85
|
+
3. Creer migration EF Core
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## TEMPLATES
|
|
90
|
+
|
|
91
|
+
### Template Trigger Seed
|
|
92
|
+
|
|
93
|
+
```csharp
|
|
94
|
+
new
|
|
95
|
+
{
|
|
96
|
+
Id = Guid.Parse("$TRIGGER_GUID"),
|
|
97
|
+
Code = "$ENTITY.$EVENT",
|
|
98
|
+
Name = "$NAME",
|
|
99
|
+
Description = "$DESCRIPTION",
|
|
100
|
+
TriggerType = "$TRIGGER_TYPE",
|
|
101
|
+
AvailableVariablesJson = JsonSerializer.Serialize(new[]
|
|
102
|
+
{
|
|
103
|
+
new { Name = "entityId", Type = "Guid", Description = "Entity ID" },
|
|
104
|
+
new { Name = "entityName", Type = "string", Description = "Entity name" },
|
|
105
|
+
new { Name = "userEmail", Type = "string", Description = "User email" },
|
|
106
|
+
}),
|
|
107
|
+
IsActive = true,
|
|
108
|
+
CreatedAt = seedDate
|
|
109
|
+
},
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Template Workflow Seed
|
|
113
|
+
|
|
114
|
+
```csharp
|
|
115
|
+
new
|
|
116
|
+
{
|
|
117
|
+
Id = Guid.Parse("$WORKFLOW_GUID"),
|
|
118
|
+
Code = "$CODE",
|
|
119
|
+
Name = "$NAME",
|
|
120
|
+
Description = "$DESCRIPTION",
|
|
121
|
+
TriggerId = Guid.Parse("$TRIGGER_GUID"),
|
|
122
|
+
ApplicationId = (Guid?)null,
|
|
123
|
+
IsActive = true,
|
|
124
|
+
IsSystem = $IS_SYSTEM,
|
|
125
|
+
Priority = $PRIORITY,
|
|
126
|
+
CreatedAt = seedDate
|
|
127
|
+
},
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Template Step Seed (Email)
|
|
131
|
+
|
|
132
|
+
```csharp
|
|
133
|
+
new
|
|
134
|
+
{
|
|
135
|
+
Id = Guid.Parse("$STEP_GUID"),
|
|
136
|
+
WorkflowId = Guid.Parse("$WORKFLOW_GUID"),
|
|
137
|
+
Name = "$NAME",
|
|
138
|
+
StepType = WorkflowStepType.SendEmail,
|
|
139
|
+
StepOrder = $ORDER,
|
|
140
|
+
EmailTemplateId = Guid.Parse("$TEMPLATE_GUID"),
|
|
141
|
+
IsActive = true,
|
|
142
|
+
CreatedAt = seedDate
|
|
143
|
+
},
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Template Step Seed (Wait)
|
|
147
|
+
|
|
148
|
+
```csharp
|
|
149
|
+
new
|
|
150
|
+
{
|
|
151
|
+
Id = Guid.Parse("$STEP_GUID"),
|
|
152
|
+
WorkflowId = Guid.Parse("$WORKFLOW_GUID"),
|
|
153
|
+
Name = "$NAME",
|
|
154
|
+
StepType = WorkflowStepType.Wait,
|
|
155
|
+
StepOrder = $ORDER,
|
|
156
|
+
DelayMinutes = $DELAY_MINUTES,
|
|
157
|
+
IsActive = true,
|
|
158
|
+
CreatedAt = seedDate
|
|
159
|
+
},
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Template Declenchement
|
|
163
|
+
|
|
164
|
+
```csharp
|
|
165
|
+
await _workflowService.TriggerAsync(
|
|
166
|
+
"$TRIGGER_CODE",
|
|
167
|
+
new Dictionary<string, object>
|
|
168
|
+
{
|
|
169
|
+
["entityId"] = entity.Id,
|
|
170
|
+
["entityName"] = entity.Name,
|
|
171
|
+
["userEmail"] = _currentUser.Email
|
|
172
|
+
},
|
|
173
|
+
language: "fr",
|
|
174
|
+
cancellationToken: ct);
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## FICHIERS CLES
|
|
180
|
+
|
|
181
|
+
| Fichier | Role |
|
|
182
|
+
|---------|------|
|
|
183
|
+
| `Domain/Communications/Workflow.cs` | Entite workflow |
|
|
184
|
+
| `Domain/Communications/WorkflowStep.cs` | Entite step |
|
|
185
|
+
| `Domain/Communications/WorkflowTrigger.cs` | Entite trigger |
|
|
186
|
+
| `Infrastructure/.../WorkflowConfiguration.cs` | Seed workflows |
|
|
187
|
+
| `Infrastructure/.../WorkflowTriggerConfiguration.cs` | Seed triggers |
|
|
188
|
+
| `Infrastructure/.../WorkflowStepConfiguration.cs` | Seed steps |
|
|
189
|
+
| `Infrastructure/Services/Workflow/WorkflowExecutionService.cs` | Execution |
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
User: $ARGUMENTS
|