@atlashub/smartstack-cli 1.13.2 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +1 -1
- package/.documentation/hooks.html +1 -1
- package/.documentation/index.html +1 -1
- package/.documentation/init.html +3 -3
- package/.documentation/installation.html +1001 -352
- package/.documentation/ralph-loop.html +1 -1
- package/.documentation/test-web.html +1 -1
- package/README.md +88 -20
- 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 +69 -19
- 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 +30 -1
- package/templates/commands/efcore/db-reset.md +18 -6
- package/templates/commands/gitflow/OPTIMIZATIONS.md +206 -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 +234 -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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0.0",
|
|
3
|
+
"repository": {
|
|
4
|
+
"name": "",
|
|
5
|
+
"defaultBranch": "main",
|
|
6
|
+
"remoteUrl": ""
|
|
7
|
+
},
|
|
8
|
+
"git": {
|
|
9
|
+
"provider": "github",
|
|
10
|
+
"branches": {
|
|
11
|
+
"main": "main",
|
|
12
|
+
"develop": "develop"
|
|
13
|
+
},
|
|
14
|
+
"prefixes": {
|
|
15
|
+
"feature": "feature/",
|
|
16
|
+
"release": "release/",
|
|
17
|
+
"hotfix": "hotfix/"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"worktrees": {
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"mode": "organized",
|
|
23
|
+
"structure": {
|
|
24
|
+
"features": "../features",
|
|
25
|
+
"releases": "../releases",
|
|
26
|
+
"hotfixes": "../hotfixes"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"versioning": {
|
|
30
|
+
"strategy": "semver",
|
|
31
|
+
"current": "0.1.0",
|
|
32
|
+
"tagPrefix": "v",
|
|
33
|
+
"sources": ["csproj", "package.json", "VERSION"]
|
|
34
|
+
},
|
|
35
|
+
"efcore": {
|
|
36
|
+
"enabled": true,
|
|
37
|
+
"validateOnCommit": true,
|
|
38
|
+
"blockDestructive": true,
|
|
39
|
+
"migrationNaming": "{context}_v{version}_{sequence}_{Description}"
|
|
40
|
+
},
|
|
41
|
+
"workflow": {
|
|
42
|
+
"push": {
|
|
43
|
+
"afterCommit": "worktree"
|
|
44
|
+
},
|
|
45
|
+
"pr": {
|
|
46
|
+
"autoLabels": true,
|
|
47
|
+
"requireReview": true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"language": {
|
|
51
|
+
"code": "en"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: notification
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
Types: In-App, Email (via Workflow), Push (
|
|
4
|
+
Integrates SmartStack notification system into development.
|
|
5
|
+
Use this skill when:
|
|
6
|
+
- User wants to send notifications from a feature
|
|
7
|
+
- User mentions "notify", "alert", "notification", "in-app"
|
|
8
|
+
- Creating a module that requires user notifications
|
|
9
|
+
- SignalR integration for real-time
|
|
10
|
+
Types: In-App, Email (via Workflow), Push (future)
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# Skill Notification SmartStack
|
|
14
14
|
|
|
15
15
|
> **Architecture:** In-App (DB + SignalR) + Email (via Workflows)
|
|
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
|
-
| Event-driven | "
|
|
25
|
-
| Real-time | "
|
|
26
|
-
|
|
|
21
|
+
| Trigger | Example |
|
|
22
|
+
|---------|---------|
|
|
23
|
+
| Explicit request | "Notify the user when a ticket is created" |
|
|
24
|
+
| Event-driven | "When SLA expires, alert the user" |
|
|
25
|
+
| Real-time | "Display new notifications in real-time" |
|
|
26
|
+
| Keywords | "notify", "alert", "SignalR", "real-time" |
|
|
27
27
|
|
|
28
28
|
## FLOW
|
|
29
29
|
|
|
@@ -35,7 +35,7 @@ DB (store) + SignalR Hub (real-time)
|
|
|
35
35
|
Frontend: useSignalR() → NotificationBell
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
## TYPES
|
|
38
|
+
## NOTIFICATION TYPES
|
|
39
39
|
|
|
40
40
|
| Type | Usage |
|
|
41
41
|
|------|-------|
|
|
@@ -44,46 +44,46 @@ Frontend: useSignalR() → NotificationBell
|
|
|
44
44
|
| `SystemAnnouncement` | Global |
|
|
45
45
|
| `SlaWarning/ResponseBreached/ResolutionBreached` | SLA |
|
|
46
46
|
|
|
47
|
-
###
|
|
47
|
+
### Add a New Type
|
|
48
48
|
```csharp
|
|
49
49
|
// 1. Domain/Support/Enums/NotificationType.cs
|
|
50
50
|
public enum NotificationType { ..., $NEW_TYPE = XX }
|
|
51
51
|
|
|
52
|
-
// 2.
|
|
52
|
+
// 2. Usage
|
|
53
53
|
await _notificationService.SendNotificationAsync(userId, NotificationType.$NEW_TYPE, title, message,
|
|
54
54
|
relatedEntityType: "Entity", relatedEntityId: id, actionUrl: "/path");
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
## WORKFLOW INTEGRATION
|
|
58
58
|
|
|
59
|
-
### 1.
|
|
59
|
+
### 1. Identify the Need
|
|
60
60
|
| Question | Action |
|
|
61
61
|
|----------|--------|
|
|
62
|
-
| Real-time
|
|
63
|
-
| Email
|
|
64
|
-
|
|
|
65
|
-
| Navigation
|
|
62
|
+
| Real-time? | → In-App + SignalR |
|
|
63
|
+
| Email? | → Workflow + EmailTemplate |
|
|
64
|
+
| Related entity? | → relatedEntityType/Id |
|
|
65
|
+
| Navigation? | → actionUrl |
|
|
66
66
|
|
|
67
|
-
### 2.
|
|
67
|
+
### 2. Send Notification
|
|
68
68
|
```csharp
|
|
69
69
|
// Simple
|
|
70
70
|
await _notificationService.SendNotificationAsync(userId, NotificationType.TicketCreated,
|
|
71
|
-
"
|
|
71
|
+
"New ticket", $"Ticket #{ticket.Number} created", ct);
|
|
72
72
|
|
|
73
|
-
//
|
|
73
|
+
// With related entity
|
|
74
74
|
await _notificationService.SendNotificationAsync(userId, NotificationType.TicketAssigned,
|
|
75
|
-
"Ticket
|
|
75
|
+
"Ticket assigned", message,
|
|
76
76
|
relatedEntityType: "Ticket", relatedEntityId: ticket.Id,
|
|
77
77
|
actionUrl: $"/support/tickets/{ticket.Id}", ct);
|
|
78
78
|
|
|
79
|
-
// Multi-
|
|
79
|
+
// Multi-user
|
|
80
80
|
await _notificationService.SendNotificationsAsync(userIds, type, title, message, ct);
|
|
81
81
|
|
|
82
|
-
//
|
|
82
|
+
// By role
|
|
83
83
|
await _notificationService.SendNotificationToRoleAsync("Admin", type, title, message, ct);
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
### 3. Preferences
|
|
86
|
+
### 3. User Preferences
|
|
87
87
|
```csharp
|
|
88
88
|
var (shouldEmail, shouldInApp, shouldPush) = await _notificationService.ShouldNotifyAsync(userId, type);
|
|
89
89
|
if (shouldInApp) await _notificationService.SendNotificationAsync(...);
|
|
@@ -112,12 +112,12 @@ notificationsApi.delete(id) / deleteAll()
|
|
|
112
112
|
|
|
113
113
|
### NotificationBell Component
|
|
114
114
|
```tsx
|
|
115
|
-
<NotificationBell /> //
|
|
115
|
+
<NotificationBell /> // Manages useSignalR, badge unreadCount, dropdown
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
-
## PATTERNS
|
|
118
|
+
## ADVANCED PATTERNS
|
|
119
119
|
|
|
120
|
-
### SLA Warning (Job
|
|
120
|
+
### SLA Warning (Hangfire Job)
|
|
121
121
|
```csharp
|
|
122
122
|
var tickets = await _context.Tickets
|
|
123
123
|
.Where(t => t.SlaDeadline <= DateTime.UtcNow.AddMinutes(30) && !t.SlaWarningNotificationSent)
|
|
@@ -128,39 +128,39 @@ foreach (var ticket in tickets) {
|
|
|
128
128
|
}
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
### Notification
|
|
131
|
+
### Grouped Notification
|
|
132
132
|
```csharp
|
|
133
133
|
if (entities.Count == 1) await SendSingle(...);
|
|
134
|
-
else await SendBatch($"{entities.Count}
|
|
134
|
+
else await SendBatch($"{entities.Count} new elements", ...);
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
## CHECKLIST
|
|
138
138
|
|
|
139
139
|
```
|
|
140
|
-
□
|
|
141
|
-
□ INotificationService
|
|
142
|
-
□
|
|
143
|
-
□ Frontend: useSignalR
|
|
144
|
-
□
|
|
140
|
+
□ Notification type identified (existing or new enum)
|
|
141
|
+
□ INotificationService injected
|
|
142
|
+
□ Send with: userId, type, title, message, relatedEntityType?, relatedEntityId?, actionUrl?
|
|
143
|
+
□ Frontend: useSignalR configured, toast/UI on receipt
|
|
144
|
+
□ If email: workflow configured
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
##
|
|
147
|
+
## ABSOLUTE RULES
|
|
148
148
|
|
|
149
149
|
| DO | DON'T |
|
|
150
150
|
|----|-------|
|
|
151
|
-
| INotificationService |
|
|
152
|
-
| NotificationType enum |
|
|
153
|
-
| relatedEntityType/Id + actionUrl | Notifications
|
|
154
|
-
|
|
|
155
|
-
| CancellationToken |
|
|
151
|
+
| INotificationService | Direct DB access |
|
|
152
|
+
| NotificationType enum | Hardcoded types |
|
|
153
|
+
| relatedEntityType/Id + actionUrl | Notifications without context |
|
|
154
|
+
| Respect user preferences | Spam notifications |
|
|
155
|
+
| CancellationToken | Hardcoded messages (use i18n) |
|
|
156
156
|
|
|
157
|
-
##
|
|
157
|
+
## KEY FILES
|
|
158
158
|
|
|
159
|
-
|
|
|
160
|
-
|
|
161
|
-
| `Domain/Support/Notification.cs` |
|
|
159
|
+
| File | Role |
|
|
160
|
+
|------|------|
|
|
161
|
+
| `Domain/Support/Notification.cs` | Entity |
|
|
162
162
|
| `Domain/Support/Enums/NotificationType.cs` | Types |
|
|
163
163
|
| `Application/Common/Interfaces/INotificationService.cs` | Interface |
|
|
164
164
|
| `Infrastructure/Services/SignalR/NotificationHubService.cs` | Real-time |
|
|
165
|
-
| `web/src/hooks/useSignalR.ts` |
|
|
165
|
+
| `web/src/hooks/useSignalR.ts` | Frontend hook |
|
|
166
166
|
| `web/src/components/notifications/NotificationBell.tsx` | UI |
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ralph-loop
|
|
3
|
+
description: Iterative AI development loop with MCP validation, progress tracking, and completion promises.
|
|
4
|
+
argument-hint: "[-m N] [-c TEXT] [-v] <task description>"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<objective>
|
|
8
|
+
Execute the Ralph Weegund technique - an iterative development methodology where the same prompt is fed repeatedly until completion. Uses progressive step loading with MCP validation and progress persistence.
|
|
9
|
+
</objective>
|
|
10
|
+
|
|
11
|
+
<quick_start>
|
|
12
|
+
**Basic usage:**
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
/ralph-loop implement user authentication
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**With completion promise:**
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
/ralph-loop -c "COMPLETE" refactor the cache layer
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**With max iterations:**
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
/ralph-loop -m 20 -c "TESTS PASS" add comprehensive tests
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Verbose mode:**
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
/ralph-loop -v -c "DONE" fix all linting errors
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Flags:**
|
|
37
|
+
|
|
38
|
+
- `-m N` (max): Maximum iterations before auto-stop
|
|
39
|
+
- `-c TEXT` (complete): Completion promise text
|
|
40
|
+
- `-v` (verbose): Detailed logging
|
|
41
|
+
|
|
42
|
+
See `<parameters>` for complete flag list.
|
|
43
|
+
</quick_start>
|
|
44
|
+
|
|
45
|
+
<parameters>
|
|
46
|
+
|
|
47
|
+
<flags>
|
|
48
|
+
**Flags:**
|
|
49
|
+
| Short | Long | Description |
|
|
50
|
+
|-------|------|-------------|
|
|
51
|
+
| `-m N` | `--max-iterations N` | Maximum iterations (default: 50) |
|
|
52
|
+
| `-c TEXT` | `--completion-promise TEXT` | Text that signals completion |
|
|
53
|
+
| `-v` | `--verbose` | Enable detailed logging |
|
|
54
|
+
| `-r` | `--resume` | Resume from previous state |
|
|
55
|
+
</flags>
|
|
56
|
+
|
|
57
|
+
<examples>
|
|
58
|
+
```bash
|
|
59
|
+
# Basic loop
|
|
60
|
+
/ralph-loop implement feature X
|
|
61
|
+
|
|
62
|
+
# With completion signal
|
|
63
|
+
/ralph-loop -c "ALL TESTS PASS" fix failing tests
|
|
64
|
+
|
|
65
|
+
# Limited iterations with completion
|
|
66
|
+
/ralph-loop -m 10 -c "REFACTOR COMPLETE" clean up auth module
|
|
67
|
+
|
|
68
|
+
# Resume previous loop
|
|
69
|
+
/ralph-loop -r
|
|
70
|
+
|
|
71
|
+
# Verbose mode
|
|
72
|
+
/ralph-loop -v -m 25 -c "DONE" implement CRUD for products
|
|
73
|
+
```
|
|
74
|
+
</examples>
|
|
75
|
+
|
|
76
|
+
<parsing_rules>
|
|
77
|
+
**Argument parsing:**
|
|
78
|
+
|
|
79
|
+
1. `-m N` or `--max-iterations N` -> `{max_iterations}` = N
|
|
80
|
+
2. `-c TEXT` or `--completion-promise TEXT` -> `{completion_promise}` = TEXT
|
|
81
|
+
3. `-v` or `--verbose` -> `{verbose_mode}` = true
|
|
82
|
+
4. `-r` or `--resume` -> `{resume_mode}` = true
|
|
83
|
+
5. Remainder -> `{task_description}`
|
|
84
|
+
</parsing_rules>
|
|
85
|
+
|
|
86
|
+
</parameters>
|
|
87
|
+
|
|
88
|
+
<ralph_concept>
|
|
89
|
+
**Core concept:**
|
|
90
|
+
|
|
91
|
+
The same prompt is fed to Claude repeatedly. The "self-referential" aspect comes from Claude seeing its own previous work in files and git history.
|
|
92
|
+
|
|
93
|
+
**Each iteration:**
|
|
94
|
+
1. Claude receives the SAME prompt
|
|
95
|
+
2. Works on the task, modifying files
|
|
96
|
+
3. Checks completion criteria
|
|
97
|
+
4. If not complete: saves progress, iteration count increments
|
|
98
|
+
5. Claude sees previous work in the files
|
|
99
|
+
6. Iteratively improves until completion promise is output
|
|
100
|
+
|
|
101
|
+
**Completion signal:**
|
|
102
|
+
```
|
|
103
|
+
<promise>{completion_promise}</promise>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The loop only stops when this exact tag is output or max iterations reached.
|
|
107
|
+
</ralph_concept>
|
|
108
|
+
|
|
109
|
+
<workflow>
|
|
110
|
+
**Standard flow:**
|
|
111
|
+
1. Parse flags and task description
|
|
112
|
+
2. Verify MCP servers are available (MANDATORY)
|
|
113
|
+
3. Initialize .ralph/ structure and state files
|
|
114
|
+
4. Load current task from prd.json (or create initial tasks)
|
|
115
|
+
5. Execute ONE task per iteration
|
|
116
|
+
6. Commit changes, update progress
|
|
117
|
+
7. Check completion criteria
|
|
118
|
+
8. If complete: generate final report
|
|
119
|
+
</workflow>
|
|
120
|
+
|
|
121
|
+
<state_variables>
|
|
122
|
+
**Persist throughout all steps:**
|
|
123
|
+
|
|
124
|
+
| Variable | Type | Description |
|
|
125
|
+
|----------|------|-------------|
|
|
126
|
+
| `{task_description}` | string | The prompt/task to execute |
|
|
127
|
+
| `{max_iterations}` | number | Maximum iterations allowed |
|
|
128
|
+
| `{completion_promise}` | string | Text that signals completion |
|
|
129
|
+
| `{verbose_mode}` | boolean | Enable detailed logging |
|
|
130
|
+
| `{resume_mode}` | boolean | Resume from previous state |
|
|
131
|
+
| `{current_iteration}` | number | Current iteration count |
|
|
132
|
+
| `{tasks_completed}` | number | Number of tasks completed |
|
|
133
|
+
| `{tasks_total}` | number | Total tasks in prd.json |
|
|
134
|
+
|
|
135
|
+
</state_variables>
|
|
136
|
+
|
|
137
|
+
<mcp_requirements>
|
|
138
|
+
**MANDATORY MCP Validation:**
|
|
139
|
+
|
|
140
|
+
Before ANY work, verify MCP servers:
|
|
141
|
+
|
|
142
|
+
1. **SmartStack MCP** - `mcp__smartstack__validate_conventions`
|
|
143
|
+
2. **Context7 MCP** - `mcp__plugin_context7_context7__resolve-library-id`
|
|
144
|
+
|
|
145
|
+
**If ANY MCP unavailable:**
|
|
146
|
+
- DO NOT proceed
|
|
147
|
+
- Log failure to `.ralph/logs/`
|
|
148
|
+
- Output error message
|
|
149
|
+
- Suggest: `smartstack check-mcp`
|
|
150
|
+
|
|
151
|
+
**Throughout work, use:**
|
|
152
|
+
- `mcp__smartstack__validate_conventions` - Before commits
|
|
153
|
+
- `mcp__smartstack__check_migrations` - Before EF Core changes
|
|
154
|
+
- `mcp__smartstack__scaffold_extension` - For code generation
|
|
155
|
+
</mcp_requirements>
|
|
156
|
+
|
|
157
|
+
<entry_point>
|
|
158
|
+
|
|
159
|
+
**FIRST ACTION:** Load `steps/step-00-init.md`
|
|
160
|
+
|
|
161
|
+
</entry_point>
|
|
162
|
+
|
|
163
|
+
<step_files>
|
|
164
|
+
**Progressive loading - only load current step:**
|
|
165
|
+
|
|
166
|
+
| Step | File | Purpose |
|
|
167
|
+
|------|------|---------|
|
|
168
|
+
| 00 | `steps/step-00-init.md` | Parse args, verify MCP, initialize state |
|
|
169
|
+
| 01 | `steps/step-01-task.md` | Load current task from prd.json |
|
|
170
|
+
| 02 | `steps/step-02-execute.md` | Execute ONE task |
|
|
171
|
+
| 03 | `steps/step-03-commit.md` | Commit, update prd.json/progress.txt |
|
|
172
|
+
| 04 | `steps/step-04-check.md` | Check completion, decide next action |
|
|
173
|
+
| 05 | `steps/step-05-report.md` | Generate final report |
|
|
174
|
+
|
|
175
|
+
</step_files>
|
|
176
|
+
|
|
177
|
+
<file_structure>
|
|
178
|
+
**Ralph creates these files:**
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
.ralph/
|
|
182
|
+
├── prd.json # Task list with status
|
|
183
|
+
├── progress.txt # Persistent memory between iterations
|
|
184
|
+
├── logs/
|
|
185
|
+
│ └── {timestamp}.log
|
|
186
|
+
└── reports/
|
|
187
|
+
└── {feature-name}.md
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**prd.json structure:**
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"feature": "{task_description}",
|
|
194
|
+
"created": "2024-01-01T00:00:00Z",
|
|
195
|
+
"max_iterations": 50,
|
|
196
|
+
"completion_promise": "COMPLETE",
|
|
197
|
+
"tasks": [
|
|
198
|
+
{ "id": 1, "description": "Task 1", "passes": false },
|
|
199
|
+
{ "id": 2, "description": "Task 2", "passes": false }
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
</file_structure>
|
|
204
|
+
|
|
205
|
+
<execution_rules>
|
|
206
|
+
|
|
207
|
+
- **Load one step at a time** - Only load the current step file
|
|
208
|
+
- **VERIFY MCP FIRST** - Never skip MCP validation
|
|
209
|
+
- **ONE TASK PER ITERATION** - Don't batch tasks
|
|
210
|
+
- **COMMIT AFTER EACH TASK** - Atomic progress
|
|
211
|
+
- **UPDATE progress.txt** - Persist learnings
|
|
212
|
+
- **NEVER fake completion** - Only output promise when truly done
|
|
213
|
+
</execution_rules>
|
|
214
|
+
|
|
215
|
+
<success_criteria>
|
|
216
|
+
|
|
217
|
+
- All tasks in prd.json have `passes: true`
|
|
218
|
+
- MCP validations pass
|
|
219
|
+
- Git commits atomic per task
|
|
220
|
+
- Completion promise output when genuinely complete
|
|
221
|
+
- Final report generated in `.ralph/reports/`
|
|
222
|
+
</success_criteria>
|
|
223
|
+
|
|
224
|
+
<available_commands>
|
|
225
|
+
**Related commands:**
|
|
226
|
+
- `/ralph-loop:cancel-ralph` - Cancel active loop
|
|
227
|
+
- `/ralph-loop:help` - Show documentation
|
|
228
|
+
</available_commands>
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-00-init
|
|
3
|
+
description: Initialize Ralph loop - parse args, verify MCP, setup state
|
|
4
|
+
next_step: steps/step-01-task.md
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Step 0: Initialization
|
|
8
|
+
|
|
9
|
+
## MANDATORY EXECUTION RULES:
|
|
10
|
+
|
|
11
|
+
- NEVER skip MCP verification
|
|
12
|
+
- ALWAYS parse ALL flags before any other action
|
|
13
|
+
- ONLY check for resume if -r flag is set
|
|
14
|
+
- YOU ARE AN INITIALIZER, not an executor
|
|
15
|
+
- FORBIDDEN to load step-01 until init is complete
|
|
16
|
+
|
|
17
|
+
## YOUR TASK:
|
|
18
|
+
|
|
19
|
+
Initialize the Ralph loop by parsing flags, verifying MCP availability, and setting up the execution environment.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
<defaults>
|
|
24
|
+
## Default Configuration
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
max_iterations: 50
|
|
28
|
+
completion_promise: null
|
|
29
|
+
verbose_mode: false
|
|
30
|
+
resume_mode: false
|
|
31
|
+
current_iteration: 1
|
|
32
|
+
```
|
|
33
|
+
</defaults>
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## EXECUTION SEQUENCE:
|
|
38
|
+
|
|
39
|
+
### 1. Parse Flags and Input
|
|
40
|
+
|
|
41
|
+
**Step 1: Load defaults from config above**
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
{max_iterations} = 50
|
|
45
|
+
{completion_promise} = null
|
|
46
|
+
{verbose_mode} = false
|
|
47
|
+
{resume_mode} = false
|
|
48
|
+
{current_iteration} = 1
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Step 2: Parse user input and override defaults:**
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
Flags:
|
|
55
|
+
-m N or --max-iterations N -> {max_iterations} = N
|
|
56
|
+
-c TEXT or --completion-promise TEXT -> {completion_promise} = TEXT
|
|
57
|
+
-v or --verbose -> {verbose_mode} = true
|
|
58
|
+
-r or --resume -> {resume_mode} = true
|
|
59
|
+
|
|
60
|
+
Remainder -> {task_description}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 2. Verify MCP Servers (MANDATORY)
|
|
64
|
+
|
|
65
|
+
**CRITICAL: Do NOT proceed without MCP verification!**
|
|
66
|
+
|
|
67
|
+
**Check SmartStack MCP:**
|
|
68
|
+
```
|
|
69
|
+
mcp__smartstack__validate_conventions:
|
|
70
|
+
checks: ["all"]
|
|
71
|
+
(just to verify connectivity)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Check Context7 MCP:**
|
|
75
|
+
```
|
|
76
|
+
mcp__plugin_context7_context7__resolve-library-id:
|
|
77
|
+
libraryName: "test"
|
|
78
|
+
query: "connectivity check"
|
|
79
|
+
(just to verify connectivity)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**If ANY MCP fails:**
|
|
83
|
+
```
|
|
84
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
85
|
+
║ ❌ MCP SERVER UNAVAILABLE ║
|
|
86
|
+
╠══════════════════════════════════════════════════════════════════╣
|
|
87
|
+
║ Server: {failed_server} ║
|
|
88
|
+
║ Status: Connection failed ║
|
|
89
|
+
╠══════════════════════════════════════════════════════════════════╣
|
|
90
|
+
║ RALPH CANNOT PROCEED WITHOUT MCP ║
|
|
91
|
+
║ ║
|
|
92
|
+
║ Troubleshooting: ║
|
|
93
|
+
║ 1. Run: smartstack check-mcp ║
|
|
94
|
+
║ 2. Restart Claude Code ║
|
|
95
|
+
║ 3. Check MCP server configuration ║
|
|
96
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
97
|
+
|
|
98
|
+
STOP - Do not proceed.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 3. Check Resume Mode
|
|
102
|
+
|
|
103
|
+
**If {resume_mode} = true:**
|
|
104
|
+
|
|
105
|
+
1. Check for existing `.ralph/prd.json`
|
|
106
|
+
2. If found:
|
|
107
|
+
- Read prd.json to restore state
|
|
108
|
+
- Read progress.txt for context
|
|
109
|
+
- Set {current_iteration} from state
|
|
110
|
+
- Continue to step-01
|
|
111
|
+
3. If not found:
|
|
112
|
+
- Error: "No active Ralph loop to resume"
|
|
113
|
+
- Ask user to start new loop
|
|
114
|
+
|
|
115
|
+
### 4. Initialize .ralph/ Structure
|
|
116
|
+
|
|
117
|
+
**Create directory structure:**
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
.ralph/
|
|
121
|
+
├── prd.json # Will be created in step-01
|
|
122
|
+
├── progress.txt # Will be created in step-01
|
|
123
|
+
├── logs/
|
|
124
|
+
└── reports/
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Commands:**
|
|
128
|
+
```bash
|
|
129
|
+
mkdir -p .ralph/logs
|
|
130
|
+
mkdir -p .ralph/reports
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 5. Validate Completion Promise
|
|
134
|
+
|
|
135
|
+
**If {completion_promise} is null:**
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
AskUserQuestion:
|
|
139
|
+
header: "Promise"
|
|
140
|
+
question: "What text should signal completion?"
|
|
141
|
+
options:
|
|
142
|
+
- label: "COMPLETE"
|
|
143
|
+
description: "Standard completion signal"
|
|
144
|
+
- label: "ALL TESTS PASS"
|
|
145
|
+
description: "For test-focused tasks"
|
|
146
|
+
- label: "DONE"
|
|
147
|
+
description: "Simple completion"
|
|
148
|
+
- label: "Custom..."
|
|
149
|
+
description: "Specify custom text"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 6. Log Initialization
|
|
153
|
+
|
|
154
|
+
**If {verbose_mode} = true:**
|
|
155
|
+
|
|
156
|
+
Write to `.ralph/logs/{timestamp}.log`:
|
|
157
|
+
```
|
|
158
|
+
[{timestamp}] RALPH LOOP INITIALIZED
|
|
159
|
+
Task: {task_description}
|
|
160
|
+
Max iterations: {max_iterations}
|
|
161
|
+
Completion promise: {completion_promise}
|
|
162
|
+
MCP Status: SmartStack ✅, Context7 ✅
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 7. Show Summary and Proceed
|
|
166
|
+
|
|
167
|
+
**Always show COMPACT summary:**
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
171
|
+
║ RALPH LOOP INITIALIZED ║
|
|
172
|
+
╠══════════════════════════════════════════════════════════════════╣
|
|
173
|
+
║ Task: {task_description} ║
|
|
174
|
+
║ Max iterations: {max_iterations} ║
|
|
175
|
+
║ Completion: <promise>{completion_promise}</promise> ║
|
|
176
|
+
║ MCP: ✅ Ready ║
|
|
177
|
+
╠══════════════════════════════════════════════════════════════════╣
|
|
178
|
+
║ Files: ║
|
|
179
|
+
║ - .ralph/prd.json (tasks) ║
|
|
180
|
+
║ - .ralph/progress.txt (memory) ║
|
|
181
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
182
|
+
|
|
183
|
+
-> Loading tasks...
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Then proceed directly to step-01-task.md**
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## SUCCESS METRICS:
|
|
191
|
+
|
|
192
|
+
- All flags correctly parsed
|
|
193
|
+
- MCP servers verified and available
|
|
194
|
+
- .ralph/ directory structure created
|
|
195
|
+
- Completion promise defined
|
|
196
|
+
- Output is COMPACT
|
|
197
|
+
- Proceeded to step-01 immediately after summary
|
|
198
|
+
|
|
199
|
+
## NEXT STEP:
|
|
200
|
+
|
|
201
|
+
After showing initialization summary, always proceed directly to `./step-01-task.md`
|