@atlashub/smartstack-cli 1.13.2 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.documentation/agents.html +1 -1
- package/.documentation/apex.html +1 -1
- package/.documentation/business-analyse.html +1 -1
- package/.documentation/cli-commands.html +3 -3
- package/.documentation/commands.html +1 -1
- package/.documentation/efcore.html +1 -1
- package/.documentation/gitflow.html +231 -236
- package/.documentation/hooks.html +1 -1
- package/.documentation/index.html +1 -1
- package/.documentation/init.html +3 -3
- package/.documentation/installation.html +1075 -351
- package/.documentation/ralph-loop.html +1 -1
- package/.documentation/test-web.html +1 -1
- package/README.md +88 -20
- package/config/default-config.json +10 -1
- package/dist/index.js +276 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/agents/code-reviewer.md +163 -0
- package/templates/agents/efcore/db-deploy.md +25 -7
- package/templates/agents/efcore/db-reset.md +31 -10
- package/templates/agents/efcore/db-status.md +22 -5
- package/templates/agents/efcore/migration.md +70 -20
- package/templates/agents/gitflow/cleanup.md +8 -1
- package/templates/agents/gitflow/commit.md +7 -5
- package/templates/agents/gitflow/finish.md +6 -4
- package/templates/agents/gitflow/pr.md +8 -1
- package/templates/agents/gitflow/start.md +1 -1
- package/templates/commands/check-version.md +267 -0
- package/templates/commands/efcore/_shared.md +31 -2
- package/templates/commands/efcore/db-reset.md +18 -6
- package/templates/commands/efcore/migration.md +1 -1
- package/templates/commands/efcore/rebase-snapshot.md +1 -1
- package/templates/commands/efcore/squash.md +1 -0
- package/templates/commands/refactor.md +164 -0
- package/templates/project/DependencyInjection.Application.cs.template +25 -0
- package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
- package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
- package/templates/project/ExampleEntity.cs.template +116 -0
- package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
- package/templates/project/ExampleService.cs.template +146 -0
- package/templates/project/ExtensionsDbContext.cs.template +41 -0
- package/templates/project/IExtensionsDbContext.cs.template +22 -0
- package/templates/project/Program.cs.template +47 -0
- package/templates/project/README.md +79 -0
- package/templates/ralph/README.md +10 -8
- package/templates/ralph/ralph.config.yaml +2 -2
- package/templates/skills/_shared.md +44 -44
- package/templates/skills/ai-prompt/SKILL.md +55 -55
- package/templates/skills/apex/SKILL.md +235 -0
- package/templates/skills/apex/steps/step-00-init.md +203 -0
- package/templates/skills/apex/steps/step-01-analyze.md +210 -0
- package/templates/skills/apex/steps/step-02-plan.md +217 -0
- package/templates/skills/apex/steps/step-03-execute.md +178 -0
- package/templates/skills/apex/steps/step-04-validate.md +217 -0
- package/templates/skills/apex/steps/step-05-examine.md +207 -0
- package/templates/skills/apex/steps/step-06-resolve.md +181 -0
- package/templates/skills/apex/steps/step-07-tests.md +206 -0
- package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
- package/templates/skills/apex/templates/00-context.md +46 -0
- package/templates/skills/apex/templates/01-analyze.md +63 -0
- package/templates/skills/apex/templates/02-plan.md +63 -0
- package/templates/skills/apex/templates/03-execute.md +34 -0
- package/templates/skills/apex/templates/04-validate.md +61 -0
- package/templates/skills/apex/templates/05-examine.md +58 -0
- package/templates/skills/apex/templates/06-resolve.md +39 -0
- package/templates/skills/apex/templates/07-tests.md +56 -0
- package/templates/skills/apex/templates/08-run-tests.md +41 -0
- package/templates/skills/apex/templates/README.md +69 -0
- package/templates/skills/application/SKILL.md +50 -50
- package/templates/skills/application/templates-backend.md +25 -25
- package/templates/skills/application/templates-frontend.md +43 -43
- package/templates/skills/application/templates-i18n.md +29 -29
- package/templates/skills/application/templates-seed.md +77 -77
- package/templates/skills/business-analyse/SKILL.md +223 -0
- package/templates/skills/business-analyse/_shared.md +258 -0
- package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
- package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
- package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
- package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
- package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
- package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
- package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
- package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
- package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
- package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
- package/templates/skills/business-analyse/questionnaire.md +177 -177
- package/templates/skills/business-analyse/react/components.md +340 -0
- package/templates/skills/business-analyse/react/i18n-template.md +245 -0
- package/templates/skills/business-analyse/react/schema.md +151 -0
- package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
- package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
- package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
- package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
- package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
- package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
- package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
- package/templates/skills/business-analyse/templates/00-context.md +105 -0
- package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
- package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
- package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
- package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
- package/templates/skills/business-analyse/templates-frd.md +217 -217
- package/templates/skills/business-analyse/templates-react.md +26 -26
- package/templates/skills/controller/SKILL.md +141 -92
- package/templates/skills/controller/postman-templates.md +15 -15
- package/templates/skills/controller/steps/step-00-init.md +191 -0
- package/templates/skills/controller/steps/step-01-analyze.md +146 -0
- package/templates/skills/controller/steps/step-02-plan.md +176 -0
- package/templates/skills/controller/steps/step-03-generate.md +219 -0
- package/templates/skills/controller/steps/step-04-perms.md +219 -0
- package/templates/skills/controller/steps/step-05-validate.md +107 -0
- package/templates/skills/controller/templates.md +77 -77
- package/templates/skills/documentation/SKILL.md +79 -79
- package/templates/skills/feature-full/SKILL.md +38 -38
- package/templates/skills/gitflow/SKILL.md +277 -0
- package/templates/{commands → skills}/gitflow/_shared.md +20 -20
- package/templates/skills/gitflow/phases/abort.md +173 -0
- package/templates/skills/gitflow/phases/cleanup.md +226 -0
- package/templates/skills/gitflow/phases/status.md +178 -0
- package/templates/skills/gitflow/steps/step-commit.md +255 -0
- package/templates/skills/gitflow/steps/step-finish.md +255 -0
- package/templates/skills/gitflow/steps/step-init.md +209 -0
- package/templates/skills/gitflow/steps/step-merge.md +225 -0
- package/templates/skills/gitflow/steps/step-plan.md +208 -0
- package/templates/skills/gitflow/steps/step-pr.md +235 -0
- package/templates/skills/gitflow/steps/step-start.md +334 -0
- package/templates/skills/gitflow/steps/step-sync.md +200 -0
- package/templates/skills/gitflow/templates/config.json +53 -0
- package/templates/skills/notification/SKILL.md +51 -51
- package/templates/skills/ralph-loop/SKILL.md +228 -0
- package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
- package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
- package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
- package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
- package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
- package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
- package/templates/skills/review-code/SKILL.md +219 -0
- package/templates/skills/review-code/references/clean-code-principles.md +140 -0
- package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
- package/templates/skills/review-code/references/feedback-patterns.md +149 -0
- package/templates/skills/review-code/references/security-checklist.md +127 -0
- package/templates/skills/ui-components/SKILL.md +54 -54
- package/templates/skills/workflow/SKILL.md +46 -46
- package/templates/commands/ai-prompt.md +0 -315
- package/templates/commands/apex/1-analyze.md +0 -100
- package/templates/commands/apex/2-plan.md +0 -145
- package/templates/commands/apex/3-execute.md +0 -171
- package/templates/commands/apex/4-examine.md +0 -116
- package/templates/commands/apex/5-tasks.md +0 -209
- package/templates/commands/apex.md +0 -76
- package/templates/commands/application/create.md +0 -362
- package/templates/commands/application/templates-backend.md +0 -463
- package/templates/commands/application/templates-frontend.md +0 -517
- package/templates/commands/application/templates-i18n.md +0 -478
- package/templates/commands/application/templates-seed.md +0 -362
- package/templates/commands/application.md +0 -303
- package/templates/commands/business-analyse/0-orchestrate.md +0 -156
- package/templates/commands/business-analyse/1-init.md +0 -99
- package/templates/commands/business-analyse/2-discover.md +0 -143
- package/templates/commands/business-analyse/3-analyse.md +0 -106
- package/templates/commands/business-analyse/4-specify.md +0 -133
- package/templates/commands/business-analyse/5-validate.md +0 -132
- package/templates/commands/business-analyse/6-handoff.md +0 -157
- package/templates/commands/business-analyse/7-doc-html.md +0 -103
- package/templates/commands/business-analyse/_shared.md +0 -176
- package/templates/commands/business-analyse/bug.md +0 -118
- package/templates/commands/business-analyse/change-request.md +0 -144
- package/templates/commands/business-analyse/hotfix.md +0 -116
- package/templates/commands/business-analyse.md +0 -121
- package/templates/commands/controller/create.md +0 -216
- package/templates/commands/controller/postman-templates.md +0 -528
- package/templates/commands/controller/templates.md +0 -600
- package/templates/commands/controller.md +0 -337
- package/templates/commands/create/agent.md +0 -138
- package/templates/commands/create/command.md +0 -166
- package/templates/commands/create/hook.md +0 -234
- package/templates/commands/create/plugin.md +0 -329
- package/templates/commands/create/project.md +0 -508
- package/templates/commands/create/skill.md +0 -199
- package/templates/commands/create.md +0 -220
- package/templates/commands/documentation/module.md +0 -202
- package/templates/commands/documentation/templates.md +0 -432
- package/templates/commands/documentation.md +0 -190
- package/templates/commands/epct.md +0 -69
- package/templates/commands/explain.md +0 -186
- package/templates/commands/feature-full.md +0 -267
- package/templates/commands/gitflow/1-init.md +0 -188
- package/templates/commands/gitflow/10-start.md +0 -190
- package/templates/commands/gitflow/11-finish.md +0 -382
- package/templates/commands/gitflow/12-cleanup.md +0 -103
- package/templates/commands/gitflow/13-sync.md +0 -216
- package/templates/commands/gitflow/14-rebase.md +0 -251
- package/templates/commands/gitflow/2-status.md +0 -122
- package/templates/commands/gitflow/3-commit.md +0 -209
- package/templates/commands/gitflow/4-plan.md +0 -174
- package/templates/commands/gitflow/5-exec.md +0 -202
- package/templates/commands/gitflow/6-abort.md +0 -121
- package/templates/commands/gitflow/7-pull-request.md +0 -176
- package/templates/commands/gitflow/8-review.md +0 -113
- package/templates/commands/gitflow/9-merge.md +0 -157
- package/templates/commands/gitflow.md +0 -128
- package/templates/commands/implement.md +0 -663
- package/templates/commands/init.md +0 -567
- package/templates/commands/mcp-integration.md +0 -330
- package/templates/commands/notification.md +0 -129
- package/templates/commands/oneshot.md +0 -57
- package/templates/commands/quickstart.md +0 -154
- package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
- package/templates/commands/ralph-loop/help.md +0 -126
- package/templates/commands/ralph-loop/ralph-loop.md +0 -120
- package/templates/commands/review.md +0 -106
- package/templates/commands/workflow.md +0 -193
- package/templates/gitflow/config.json +0 -138
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: workflow
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
4
|
+
Creates and configures automated SmartStack workflows.
|
|
5
|
+
Use this skill when:
|
|
6
|
+
- User wants to automate actions (emails, webhooks)
|
|
7
|
+
- User mentions "workflow", "automation", "trigger"
|
|
8
|
+
- Creating a business process with steps
|
|
9
|
+
- Integrating transactional emails
|
|
10
10
|
Types: SendEmail, Wait, Condition, Webhook
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -14,16 +14,16 @@ description: |
|
|
|
14
14
|
|
|
15
15
|
> **Architecture:** Trigger → Steps → Actions (Email/Wait/Condition/Webhook)
|
|
16
16
|
|
|
17
|
-
**
|
|
17
|
+
**Reference:** [_shared.md](../_shared.md) for common services
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## WHEN THIS SKILL ACTIVATES
|
|
20
20
|
|
|
21
|
-
|
|
|
22
|
-
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
21
|
+
| Trigger | Example |
|
|
22
|
+
|---------|---------|
|
|
23
|
+
| Explicit request | "Create a workflow for registration" |
|
|
24
|
+
| Automatic email | "Send an email when a ticket is created" |
|
|
25
|
+
| Chaining | "After 24h without response, send a reminder" |
|
|
26
|
+
| Keywords | "workflow", "trigger", "automation", "email template" |
|
|
27
27
|
|
|
28
28
|
## FLOW
|
|
29
29
|
|
|
@@ -35,7 +35,7 @@ IWorkflowService.TriggerAsync(code, variables)
|
|
|
35
35
|
Workflow Steps: SendEmail → Wait → Condition → Webhook
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
## TRIGGERS
|
|
38
|
+
## AVAILABLE TRIGGERS
|
|
39
39
|
|
|
40
40
|
### User Events
|
|
41
41
|
| Trigger | Variables |
|
|
@@ -52,17 +52,17 @@ Workflow Steps: SendEmail → Wait → Condition → Webhook
|
|
|
52
52
|
| `ticket.resolved/assigned` | ticketId, ticketNumber, assigneeName |
|
|
53
53
|
| `ticket.sla-warning/breached` | ticketId, deadline, remainingMinutes |
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### Add a Trigger
|
|
56
56
|
```csharp
|
|
57
57
|
// WorkflowTriggerConfiguration.cs - GetSeedData()
|
|
58
58
|
new { Id = Guid.Parse("..."), Code = "entity.event", Name = "Entity Event",
|
|
59
59
|
AvailableVariablesJson = JsonSerializer.Serialize(new[]{ ... }), ... }
|
|
60
60
|
|
|
61
|
-
//
|
|
62
|
-
await _workflowService.TriggerAsync("entity.event", new Dictionary<string, object>{...}, language: "
|
|
61
|
+
// Trigger
|
|
62
|
+
await _workflowService.TriggerAsync("entity.event", new Dictionary<string, object>{...}, language: "en");
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
## TYPES
|
|
65
|
+
## STEP TYPES
|
|
66
66
|
|
|
67
67
|
### 1. SendEmail
|
|
68
68
|
```csharp
|
|
@@ -81,7 +81,7 @@ WorkflowStep.CreateConditionStep("Check premium", JsonSerializer.Serialize(new {
|
|
|
81
81
|
condition = "{{userType}} == 'Premium'",
|
|
82
82
|
trueStepOrder = 3, falseStepOrder = 4
|
|
83
83
|
}), order: 2);
|
|
84
|
-
//
|
|
84
|
+
// Operators: ==, !=, >, <, contains, &&, ||
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
### 4. Webhook
|
|
@@ -97,10 +97,10 @@ WorkflowStep.CreateWebhookStep("Notify CRM", JsonSerializer.Serialize(new {
|
|
|
97
97
|
## WORKFLOW CREATION
|
|
98
98
|
|
|
99
99
|
```csharp
|
|
100
|
-
// 1.
|
|
100
|
+
// 1. Create workflow
|
|
101
101
|
var workflow = Workflow.Create("welcome-sequence", "Welcome Sequence", description, triggerId, null, false, 10);
|
|
102
102
|
|
|
103
|
-
// 2.
|
|
103
|
+
// 2. Add steps
|
|
104
104
|
workflow.AddStep(WorkflowStep.CreateEmailStep("Welcome", templateId, 1));
|
|
105
105
|
workflow.AddStep(WorkflowStep.CreateWaitStep("Wait 24h", 1440, 2));
|
|
106
106
|
workflow.AddStep(WorkflowStep.CreateEmailStep("Follow-up", followUpTemplateId, 3));
|
|
@@ -109,16 +109,16 @@ workflow.AddStep(WorkflowStep.CreateEmailStep("Follow-up", followUpTemplateId, 3
|
|
|
109
109
|
builder.HasData(new { Id = ..., Code = "welcome-sequence", TriggerId = ..., IsActive = true, ... });
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
##
|
|
112
|
+
## TRIGGERING
|
|
113
113
|
|
|
114
114
|
```csharp
|
|
115
|
-
//
|
|
115
|
+
// In Service or Controller
|
|
116
116
|
await _workflowService.TriggerAsync("user.registered", new Dictionary<string, object>
|
|
117
117
|
{
|
|
118
118
|
["userId"] = user.Id,
|
|
119
119
|
["email"] = user.Email,
|
|
120
120
|
["confirmUrl"] = GenerateConfirmUrl(user.Id)
|
|
121
|
-
}, language: "
|
|
121
|
+
}, language: "en", ct);
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
## EMAIL TEMPLATES
|
|
@@ -129,10 +129,10 @@ EmailTemplate: Code, Name, Category, IsActive, Translations[]
|
|
|
129
129
|
EmailTemplateTranslation: LanguageCode, Subject, HtmlBody, TextBody
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
###
|
|
132
|
+
### Syntax (Handlebars)
|
|
133
133
|
```html
|
|
134
|
-
<h1>
|
|
135
|
-
{{#if isPremium}}<p>
|
|
134
|
+
<h1>Welcome {{userName}}!</h1>
|
|
135
|
+
{{#if isPremium}}<p>Thank you Premium member!</p>{{else}}<p>Premium offers...</p>{{/if}}
|
|
136
136
|
{{#each items}}<li>{{this.name}}</li>{{/each}}
|
|
137
137
|
```
|
|
138
138
|
|
|
@@ -148,31 +148,31 @@ workflowsApi.execute(workflowId, variables)
|
|
|
148
148
|
## CHECKLIST
|
|
149
149
|
|
|
150
150
|
```
|
|
151
|
-
□ Trigger
|
|
152
|
-
□ Workflow
|
|
151
|
+
□ Trigger identified (existing or new in WorkflowTriggerConfiguration.cs)
|
|
152
|
+
□ Workflow created: Unique code, Linked trigger, Priority (10=standard, 20+=priority)
|
|
153
153
|
□ Steps: SendEmail+templateId, Wait+delayMinutes, Condition+expression, Webhook+url
|
|
154
|
-
□ Email templates
|
|
155
|
-
□
|
|
154
|
+
□ Email templates created (if SendEmail)
|
|
155
|
+
□ Trigger added to source code
|
|
156
156
|
□ Tests: trigger, emails, variables
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
##
|
|
159
|
+
## ABSOLUTE RULES
|
|
160
160
|
|
|
161
161
|
| DO | DON'T |
|
|
162
162
|
|----|-------|
|
|
163
|
-
| IWorkflowService.TriggerAsync |
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
169
|
-
##
|
|
170
|
-
|
|
171
|
-
|
|
|
172
|
-
|
|
173
|
-
| `Domain/Communications/Workflow.cs` |
|
|
174
|
-
| `Domain/Communications/WorkflowStep.cs` |
|
|
175
|
-
| `Domain/Communications/WorkflowTrigger.cs` |
|
|
163
|
+
| IWorkflowService.TriggerAsync | Direct execution |
|
|
164
|
+
| All trigger variables | Hardcoded URLs in templates |
|
|
165
|
+
| Specify language for emails | Secrets in variables |
|
|
166
|
+
| Unique kebab-case codes | Infinite loops (A→B→A) |
|
|
167
|
+
| Log executions | Forget email templates |
|
|
168
|
+
|
|
169
|
+
## KEY FILES
|
|
170
|
+
|
|
171
|
+
| File | Role |
|
|
172
|
+
|------|------|
|
|
173
|
+
| `Domain/Communications/Workflow.cs` | Workflow entity |
|
|
174
|
+
| `Domain/Communications/WorkflowStep.cs` | Step entity |
|
|
175
|
+
| `Domain/Communications/WorkflowTrigger.cs` | Trigger entity |
|
|
176
176
|
| `Application/Common/Interfaces/IWorkflowService.cs` | Interface |
|
|
177
177
|
| `Infrastructure/Services/Workflow/WorkflowExecutionService.cs` | Implementation |
|
|
178
178
|
| `Infrastructure/.../WorkflowConfiguration.cs` | EF Config + Seed |
|
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
# /ai-prompt - Gestion Prompts IA SmartStack
|
|
2
|
-
|
|
3
|
-
> **Synergie Skill/Commande:**
|
|
4
|
-
> - **Skill** (`templates/skills/ai-prompt/`) → Invocation automatique par Claude
|
|
5
|
-
> - **Commande** (`/ai-prompt`) → Invocation manuelle par l'utilisateur
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## ARGUMENTS
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
/ai-prompt <action> [options]
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
| Action | Description |
|
|
16
|
-
|--------|-------------|
|
|
17
|
-
| `create` | Creer un nouveau prompt avec blocks |
|
|
18
|
-
| `schema` | Creer un schema de validation |
|
|
19
|
-
| `integrate` | Integrer l'IA dans un service existant |
|
|
20
|
-
| `test` | Tester un prompt avec des variables |
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## WORKFLOW
|
|
25
|
-
|
|
26
|
-
### /ai-prompt create
|
|
27
|
-
|
|
28
|
-
Cree un nouveau prompt avec ses blocks.
|
|
29
|
-
|
|
30
|
-
**Questions:**
|
|
31
|
-
1. Code du prompt ? (kebab-case)
|
|
32
|
-
2. Nom descriptif ?
|
|
33
|
-
3. Description ?
|
|
34
|
-
4. Type ? (Analyzer, Generator, Classifier, Assistant)
|
|
35
|
-
5. Blocks a creer ? (System, User, Examples)
|
|
36
|
-
6. Schema de validation ? (oui/non)
|
|
37
|
-
|
|
38
|
-
**Actions:**
|
|
39
|
-
1. Creer le prompt via API ou seed
|
|
40
|
-
2. Ajouter les blocks
|
|
41
|
-
3. Creer le schema si requis
|
|
42
|
-
4. Lier le schema au prompt
|
|
43
|
-
|
|
44
|
-
### /ai-prompt schema
|
|
45
|
-
|
|
46
|
-
Cree un schema de validation JSON.
|
|
47
|
-
|
|
48
|
-
**Questions:**
|
|
49
|
-
1. Code du schema ?
|
|
50
|
-
2. Nom ?
|
|
51
|
-
3. Proprietes requises ?
|
|
52
|
-
4. Type .NET associe ?
|
|
53
|
-
|
|
54
|
-
**Actions:**
|
|
55
|
-
1. Generer le JSON Schema
|
|
56
|
-
2. Creer le DTO C# correspondant
|
|
57
|
-
3. Ajouter dans la base de donnees
|
|
58
|
-
|
|
59
|
-
### /ai-prompt integrate
|
|
60
|
-
|
|
61
|
-
Integre l'execution IA dans un service existant.
|
|
62
|
-
|
|
63
|
-
**Questions:**
|
|
64
|
-
1. Quel service modifier ?
|
|
65
|
-
2. Quelle methode ajouter ? (Analyze, Generate, Classify)
|
|
66
|
-
3. Quel prompt utiliser ?
|
|
67
|
-
4. Retour type ?
|
|
68
|
-
|
|
69
|
-
**Actions:**
|
|
70
|
-
1. Injecter `IAiCompletionService`
|
|
71
|
-
2. Creer la methode d'execution
|
|
72
|
-
3. Ajouter la validation du resultat
|
|
73
|
-
4. Logger l'execution
|
|
74
|
-
|
|
75
|
-
### /ai-prompt test
|
|
76
|
-
|
|
77
|
-
Teste un prompt avec des variables.
|
|
78
|
-
|
|
79
|
-
**Questions:**
|
|
80
|
-
1. Quel prompt tester ?
|
|
81
|
-
2. Variables a injecter ?
|
|
82
|
-
|
|
83
|
-
**Actions:**
|
|
84
|
-
1. Afficher le prompt rendu
|
|
85
|
-
2. Executer contre le provider
|
|
86
|
-
3. Afficher le resultat et les metriques
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## TEMPLATES
|
|
91
|
-
|
|
92
|
-
### Template Prompt Block System
|
|
93
|
-
|
|
94
|
-
```csharp
|
|
95
|
-
new CreateBlockRequest
|
|
96
|
-
{
|
|
97
|
-
BlockType = PromptBlockType.System,
|
|
98
|
-
Label = "Instructions",
|
|
99
|
-
Content = @"Tu es un expert en $DOMAIN.
|
|
100
|
-
Analyse le contenu fourni et retourne:
|
|
101
|
-
- $OUTPUT_1
|
|
102
|
-
- $OUTPUT_2
|
|
103
|
-
- $OUTPUT_3
|
|
104
|
-
|
|
105
|
-
Reponds UNIQUEMENT en JSON valide correspondant au schema fourni.",
|
|
106
|
-
DisplayOrder = 1,
|
|
107
|
-
IsRequired = true
|
|
108
|
-
}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Template Prompt Block User
|
|
112
|
-
|
|
113
|
-
```csharp
|
|
114
|
-
new CreateBlockRequest
|
|
115
|
-
{
|
|
116
|
-
BlockType = PromptBlockType.User,
|
|
117
|
-
Label = "Input",
|
|
118
|
-
Content = "Contenu: {{content}}\nContexte: {{context}}",
|
|
119
|
-
DisplayOrder = 2,
|
|
120
|
-
IsRequired = true
|
|
121
|
-
}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Template JSON Schema
|
|
125
|
-
|
|
126
|
-
```json
|
|
127
|
-
{
|
|
128
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
129
|
-
"type": "object",
|
|
130
|
-
"required": ["$PROP_1", "$PROP_2"],
|
|
131
|
-
"properties": {
|
|
132
|
-
"$PROP_1": {
|
|
133
|
-
"type": "string",
|
|
134
|
-
"description": "$DESCRIPTION_1"
|
|
135
|
-
},
|
|
136
|
-
"$PROP_2": {
|
|
137
|
-
"type": "integer",
|
|
138
|
-
"minimum": 1,
|
|
139
|
-
"maximum": 10,
|
|
140
|
-
"description": "$DESCRIPTION_2"
|
|
141
|
-
},
|
|
142
|
-
"$PROP_3": {
|
|
143
|
-
"type": "array",
|
|
144
|
-
"items": { "type": "string" },
|
|
145
|
-
"maxItems": 5,
|
|
146
|
-
"description": "$DESCRIPTION_3"
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Template DTO Result
|
|
153
|
-
|
|
154
|
-
```csharp
|
|
155
|
-
// Application/AI/{Entity}AnalysisResult.cs
|
|
156
|
-
|
|
157
|
-
public class {Entity}AnalysisResult
|
|
158
|
-
{
|
|
159
|
-
[JsonPropertyName("$PROP_1")]
|
|
160
|
-
public string $Prop1 { get; set; } = string.Empty;
|
|
161
|
-
|
|
162
|
-
[JsonPropertyName("$PROP_2")]
|
|
163
|
-
public int $Prop2 { get; set; }
|
|
164
|
-
|
|
165
|
-
[JsonPropertyName("$PROP_3")]
|
|
166
|
-
public List<string> $Prop3 { get; set; } = new();
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Template Service Integration
|
|
171
|
-
|
|
172
|
-
```csharp
|
|
173
|
-
public async Task<{Entity}AnalysisResult?> Analyze{Entity}Async(
|
|
174
|
-
Guid entityId,
|
|
175
|
-
CancellationToken ct)
|
|
176
|
-
{
|
|
177
|
-
var entity = await _context.{Entity}s.FindAsync(entityId);
|
|
178
|
-
if (entity == null) return null;
|
|
179
|
-
|
|
180
|
-
try
|
|
181
|
-
{
|
|
182
|
-
var result = await _aiCompletionService
|
|
183
|
-
.ExecutePromptByCodeWithValidationAsync<{Entity}AnalysisResult>(
|
|
184
|
-
"{entity}-analyzer",
|
|
185
|
-
new Dictionary<string, object>
|
|
186
|
-
{
|
|
187
|
-
["content"] = entity.Content,
|
|
188
|
-
["context"] = entity.Context ?? ""
|
|
189
|
-
},
|
|
190
|
-
cancellationToken: ct);
|
|
191
|
-
|
|
192
|
-
if (result.Success && result.IsValid)
|
|
193
|
-
{
|
|
194
|
-
_logger.LogInformation(
|
|
195
|
-
"{Entity} {EntityId} analyzed in {Ms}ms: {Result}",
|
|
196
|
-
entityId,
|
|
197
|
-
result.ExecutionTimeMs,
|
|
198
|
-
result.Data.$Prop1);
|
|
199
|
-
|
|
200
|
-
return result.Data;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
if (!result.Success)
|
|
204
|
-
{
|
|
205
|
-
_logger.LogError(
|
|
206
|
-
"AI analysis failed for {Entity} {EntityId}: {Error}",
|
|
207
|
-
entityId, result.Error);
|
|
208
|
-
}
|
|
209
|
-
else if (!result.IsValid)
|
|
210
|
-
{
|
|
211
|
-
_logger.LogWarning(
|
|
212
|
-
"AI response invalid for {Entity} {EntityId}: {Errors}",
|
|
213
|
-
entityId, string.Join(", ", result.ValidationErrors));
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return null;
|
|
217
|
-
}
|
|
218
|
-
catch (Exception ex)
|
|
219
|
-
{
|
|
220
|
-
_logger.LogError(ex, "Exception analyzing {Entity} {EntityId}", entityId);
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### Template Controller Endpoint
|
|
227
|
-
|
|
228
|
-
```csharp
|
|
229
|
-
[HttpPost("{id}/analyze")]
|
|
230
|
-
[RequirePermission(Permissions.$Module.$Entity.Update)]
|
|
231
|
-
[ProducesResponseType(typeof({Entity}AnalysisResult), StatusCodes.Status200OK)]
|
|
232
|
-
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
|
233
|
-
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
234
|
-
public async Task<ActionResult<{Entity}AnalysisResult>> Analyze{Entity}(
|
|
235
|
-
Guid id,
|
|
236
|
-
CancellationToken ct)
|
|
237
|
-
{
|
|
238
|
-
var result = await _service.Analyze{Entity}Async(id, ct);
|
|
239
|
-
|
|
240
|
-
if (result == null)
|
|
241
|
-
return BadRequest(new { message = "Analysis failed" });
|
|
242
|
-
|
|
243
|
-
return Ok(result);
|
|
244
|
-
}
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
### Template Frontend Button
|
|
248
|
-
|
|
249
|
-
```tsx
|
|
250
|
-
import { Sparkles, Loader2 } from 'lucide-react';
|
|
251
|
-
|
|
252
|
-
interface AiAnalyzeButtonProps {
|
|
253
|
-
entityId: string;
|
|
254
|
-
onResult: (result: AnalysisResult) => void;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export function AiAnalyzeButton({ entityId, onResult }: AiAnalyzeButtonProps) {
|
|
258
|
-
const [loading, setLoading] = useState(false);
|
|
259
|
-
|
|
260
|
-
const handleAnalyze = async () => {
|
|
261
|
-
setLoading(true);
|
|
262
|
-
try {
|
|
263
|
-
const result = await {module}Api.analyze(entityId);
|
|
264
|
-
onResult(result);
|
|
265
|
-
toast.success('Analyse terminee');
|
|
266
|
-
} catch (error) {
|
|
267
|
-
toast.error('Erreur lors de l\'analyse');
|
|
268
|
-
} finally {
|
|
269
|
-
setLoading(false);
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
return (
|
|
274
|
-
<button
|
|
275
|
-
onClick={handleAnalyze}
|
|
276
|
-
disabled={loading}
|
|
277
|
-
className="inline-flex items-center gap-2 px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50"
|
|
278
|
-
>
|
|
279
|
-
{loading ? (
|
|
280
|
-
<Loader2 className="w-4 h-4 animate-spin" />
|
|
281
|
-
) : (
|
|
282
|
-
<Sparkles className="w-4 h-4" />
|
|
283
|
-
)}
|
|
284
|
-
Analyser avec IA
|
|
285
|
-
</button>
|
|
286
|
-
);
|
|
287
|
-
}
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
---
|
|
291
|
-
|
|
292
|
-
## FICHIERS CLES
|
|
293
|
-
|
|
294
|
-
| Fichier | Role |
|
|
295
|
-
|---------|------|
|
|
296
|
-
| `Domain/AI/Prompts/Prompt.cs` | Entite prompt |
|
|
297
|
-
| `Domain/AI/Schemas/OutputSchema.cs` | Schema validation |
|
|
298
|
-
| `Application/Common/Interfaces/IAiCompletionService.cs` | Interface |
|
|
299
|
-
| `Infrastructure/Services/AI/AiCompletionService.cs` | Implementation |
|
|
300
|
-
| `Infrastructure/Services/AI/PromptService.cs` | Gestion prompts |
|
|
301
|
-
|
|
302
|
-
---
|
|
303
|
-
|
|
304
|
-
## REGLES
|
|
305
|
-
|
|
306
|
-
1. **TOUJOURS** creer un schema de validation pour les reponses structurees
|
|
307
|
-
2. **TOUJOURS** creer le DTO C# correspondant au schema
|
|
308
|
-
3. **TOUJOURS** logger les executions avec tokens et duree
|
|
309
|
-
4. **TOUJOURS** gerer les erreurs (API down, validation)
|
|
310
|
-
5. **JAMAIS** exposer les prompts systeme au frontend
|
|
311
|
-
6. **JAMAIS** hardcoder les cles API
|
|
312
|
-
|
|
313
|
-
---
|
|
314
|
-
|
|
315
|
-
User: $ARGUMENTS
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Analyze phase - gather all context and create analysis report
|
|
3
|
-
argument-hint: <task-description>
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
You are an analysis specialist. Your mission is to gather ALL relevant context before implementation.
|
|
7
|
-
|
|
8
|
-
**You need to ULTRA THINK before launching agents.**
|
|
9
|
-
|
|
10
|
-
## Workflow
|
|
11
|
-
|
|
12
|
-
1. **SETUP TASK FOLDER**: Create organized workspace in .claude/tasks
|
|
13
|
-
- Find next task number: Check `.claude/tasks/` for existing folders
|
|
14
|
-
- Parse task description to create kebab-case name
|
|
15
|
-
- Create `.claude/tasks/nn-task-name/` folder structure
|
|
16
|
-
- **EXAMPLE**: "Add user authentication" → `.claude/tasks/01-add-user-authentication/`
|
|
17
|
-
- **CRITICAL**: Always use `.claude/tasks/` directory for task storage
|
|
18
|
-
|
|
19
|
-
2. **ULTRA THINK**: Plan analysis strategy
|
|
20
|
-
- **CRITICAL**: Know EXACTLY what to search for before launching agents
|
|
21
|
-
- Identify key concepts, files, patterns to find
|
|
22
|
-
- Determine which sources need analysis (codebase/docs/web)
|
|
23
|
-
- List specific questions each agent should answer
|
|
24
|
-
|
|
25
|
-
3. **LAUNCH PARALLEL ANALYSIS**: Gather context from all sources
|
|
26
|
-
- **Codebase exploration** (`explore-codebase` agent):
|
|
27
|
-
- Find similar implementations to use as examples
|
|
28
|
-
- Locate files that need modification
|
|
29
|
-
- Identify existing patterns and conventions
|
|
30
|
-
- Search for related utilities and helpers
|
|
31
|
-
|
|
32
|
-
- **Documentation exploration** (`explore-docs` agent):
|
|
33
|
-
- Search library docs for APIs and patterns
|
|
34
|
-
- Find best practices for tools being used
|
|
35
|
-
- Gather code examples from official docs
|
|
36
|
-
|
|
37
|
-
- **Web research** (`websearch` agent):
|
|
38
|
-
- Research latest approaches and solutions
|
|
39
|
-
- Find community examples and patterns
|
|
40
|
-
- Gather architectural guidance
|
|
41
|
-
|
|
42
|
-
- **CRITICAL**: Launch ALL agents in parallel in a single message
|
|
43
|
-
|
|
44
|
-
4. **SYNTHESIZE FINDINGS**: Create comprehensive analysis report
|
|
45
|
-
- Combine findings from all agents
|
|
46
|
-
- Organize by topic/concern
|
|
47
|
-
- Include file paths with line numbers (e.g., `src/auth.ts:42`)
|
|
48
|
-
- List relevant examples found in codebase
|
|
49
|
-
- Document key patterns and conventions to follow
|
|
50
|
-
- Note any dependencies or prerequisites
|
|
51
|
-
|
|
52
|
-
5. **SAVE ANALYSIS**: Write to `analyze.md`
|
|
53
|
-
- Save to `.claude/tasks/nn-task-name/analyze.md`
|
|
54
|
-
- **Structure**:
|
|
55
|
-
```markdown
|
|
56
|
-
# Task: [Description]
|
|
57
|
-
|
|
58
|
-
## Codebase Context
|
|
59
|
-
[Findings from codebase exploration]
|
|
60
|
-
|
|
61
|
-
## Documentation Insights
|
|
62
|
-
[Key information from docs]
|
|
63
|
-
|
|
64
|
-
## Research Findings
|
|
65
|
-
[Web research results]
|
|
66
|
-
|
|
67
|
-
## Key Files
|
|
68
|
-
- `path/to/file.ts:line` - Purpose
|
|
69
|
-
|
|
70
|
-
## Patterns to Follow
|
|
71
|
-
[Existing conventions]
|
|
72
|
-
|
|
73
|
-
## Dependencies
|
|
74
|
-
[Prerequisites and related systems]
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
6. **REPORT**: Summarize to user
|
|
78
|
-
- Confirm task folder created
|
|
79
|
-
- Highlight key findings
|
|
80
|
-
- Note any concerns or blockers discovered
|
|
81
|
-
- Suggest next step: Run the following command to create implementation plan:
|
|
82
|
-
```
|
|
83
|
-
/apex:plan <task-folder>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## Execution Rules
|
|
87
|
-
|
|
88
|
-
- **PARALLEL EXECUTION**: All agents must run simultaneously for speed
|
|
89
|
-
- **ULTRA THINK FIRST**: Never launch agents without clear search strategy
|
|
90
|
-
- **COMPREHENSIVE**: Gather more context than seems necessary
|
|
91
|
-
- **ORGANIZED**: Structure findings for easy planning phase
|
|
92
|
-
- **FILE REFERENCES**: Always include file paths with line numbers
|
|
93
|
-
|
|
94
|
-
## Priority
|
|
95
|
-
|
|
96
|
-
Context depth > Speed. Missing context causes failed implementations.
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
User: $ARGUMENTS
|