@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.
Files changed (214) hide show
  1. package/.documentation/agents.html +1 -1
  2. package/.documentation/apex.html +1 -1
  3. package/.documentation/business-analyse.html +1 -1
  4. package/.documentation/cli-commands.html +3 -3
  5. package/.documentation/commands.html +1 -1
  6. package/.documentation/efcore.html +1 -1
  7. package/.documentation/gitflow.html +231 -236
  8. package/.documentation/hooks.html +1 -1
  9. package/.documentation/index.html +1 -1
  10. package/.documentation/init.html +3 -3
  11. package/.documentation/installation.html +1075 -351
  12. package/.documentation/ralph-loop.html +1 -1
  13. package/.documentation/test-web.html +1 -1
  14. package/README.md +88 -20
  15. package/config/default-config.json +10 -1
  16. package/dist/index.js +276 -85
  17. package/dist/index.js.map +1 -1
  18. package/package.json +1 -1
  19. package/templates/agents/code-reviewer.md +163 -0
  20. package/templates/agents/efcore/db-deploy.md +25 -7
  21. package/templates/agents/efcore/db-reset.md +31 -10
  22. package/templates/agents/efcore/db-status.md +22 -5
  23. package/templates/agents/efcore/migration.md +70 -20
  24. package/templates/agents/gitflow/cleanup.md +8 -1
  25. package/templates/agents/gitflow/commit.md +7 -5
  26. package/templates/agents/gitflow/finish.md +6 -4
  27. package/templates/agents/gitflow/pr.md +8 -1
  28. package/templates/agents/gitflow/start.md +1 -1
  29. package/templates/commands/check-version.md +267 -0
  30. package/templates/commands/efcore/_shared.md +31 -2
  31. package/templates/commands/efcore/db-reset.md +18 -6
  32. package/templates/commands/efcore/migration.md +1 -1
  33. package/templates/commands/efcore/rebase-snapshot.md +1 -1
  34. package/templates/commands/efcore/squash.md +1 -0
  35. package/templates/commands/refactor.md +164 -0
  36. package/templates/project/DependencyInjection.Application.cs.template +25 -0
  37. package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
  38. package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
  39. package/templates/project/ExampleEntity.cs.template +116 -0
  40. package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
  41. package/templates/project/ExampleService.cs.template +146 -0
  42. package/templates/project/ExtensionsDbContext.cs.template +41 -0
  43. package/templates/project/IExtensionsDbContext.cs.template +22 -0
  44. package/templates/project/Program.cs.template +47 -0
  45. package/templates/project/README.md +79 -0
  46. package/templates/ralph/README.md +10 -8
  47. package/templates/ralph/ralph.config.yaml +2 -2
  48. package/templates/skills/_shared.md +44 -44
  49. package/templates/skills/ai-prompt/SKILL.md +55 -55
  50. package/templates/skills/apex/SKILL.md +235 -0
  51. package/templates/skills/apex/steps/step-00-init.md +203 -0
  52. package/templates/skills/apex/steps/step-01-analyze.md +210 -0
  53. package/templates/skills/apex/steps/step-02-plan.md +217 -0
  54. package/templates/skills/apex/steps/step-03-execute.md +178 -0
  55. package/templates/skills/apex/steps/step-04-validate.md +217 -0
  56. package/templates/skills/apex/steps/step-05-examine.md +207 -0
  57. package/templates/skills/apex/steps/step-06-resolve.md +181 -0
  58. package/templates/skills/apex/steps/step-07-tests.md +206 -0
  59. package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
  60. package/templates/skills/apex/templates/00-context.md +46 -0
  61. package/templates/skills/apex/templates/01-analyze.md +63 -0
  62. package/templates/skills/apex/templates/02-plan.md +63 -0
  63. package/templates/skills/apex/templates/03-execute.md +34 -0
  64. package/templates/skills/apex/templates/04-validate.md +61 -0
  65. package/templates/skills/apex/templates/05-examine.md +58 -0
  66. package/templates/skills/apex/templates/06-resolve.md +39 -0
  67. package/templates/skills/apex/templates/07-tests.md +56 -0
  68. package/templates/skills/apex/templates/08-run-tests.md +41 -0
  69. package/templates/skills/apex/templates/README.md +69 -0
  70. package/templates/skills/application/SKILL.md +50 -50
  71. package/templates/skills/application/templates-backend.md +25 -25
  72. package/templates/skills/application/templates-frontend.md +43 -43
  73. package/templates/skills/application/templates-i18n.md +29 -29
  74. package/templates/skills/application/templates-seed.md +77 -77
  75. package/templates/skills/business-analyse/SKILL.md +223 -0
  76. package/templates/skills/business-analyse/_shared.md +258 -0
  77. package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
  78. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
  79. package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
  80. package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
  81. package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
  82. package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
  83. package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
  84. package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
  85. package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
  86. package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
  87. package/templates/skills/business-analyse/questionnaire.md +177 -177
  88. package/templates/skills/business-analyse/react/components.md +340 -0
  89. package/templates/skills/business-analyse/react/i18n-template.md +245 -0
  90. package/templates/skills/business-analyse/react/schema.md +151 -0
  91. package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
  92. package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
  93. package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
  94. package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
  95. package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
  96. package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
  97. package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
  98. package/templates/skills/business-analyse/templates/00-context.md +105 -0
  99. package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
  100. package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
  101. package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
  102. package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
  103. package/templates/skills/business-analyse/templates-frd.md +217 -217
  104. package/templates/skills/business-analyse/templates-react.md +26 -26
  105. package/templates/skills/controller/SKILL.md +141 -92
  106. package/templates/skills/controller/postman-templates.md +15 -15
  107. package/templates/skills/controller/steps/step-00-init.md +191 -0
  108. package/templates/skills/controller/steps/step-01-analyze.md +146 -0
  109. package/templates/skills/controller/steps/step-02-plan.md +176 -0
  110. package/templates/skills/controller/steps/step-03-generate.md +219 -0
  111. package/templates/skills/controller/steps/step-04-perms.md +219 -0
  112. package/templates/skills/controller/steps/step-05-validate.md +107 -0
  113. package/templates/skills/controller/templates.md +77 -77
  114. package/templates/skills/documentation/SKILL.md +79 -79
  115. package/templates/skills/feature-full/SKILL.md +38 -38
  116. package/templates/skills/gitflow/SKILL.md +277 -0
  117. package/templates/{commands → skills}/gitflow/_shared.md +20 -20
  118. package/templates/skills/gitflow/phases/abort.md +173 -0
  119. package/templates/skills/gitflow/phases/cleanup.md +226 -0
  120. package/templates/skills/gitflow/phases/status.md +178 -0
  121. package/templates/skills/gitflow/steps/step-commit.md +255 -0
  122. package/templates/skills/gitflow/steps/step-finish.md +255 -0
  123. package/templates/skills/gitflow/steps/step-init.md +209 -0
  124. package/templates/skills/gitflow/steps/step-merge.md +225 -0
  125. package/templates/skills/gitflow/steps/step-plan.md +208 -0
  126. package/templates/skills/gitflow/steps/step-pr.md +235 -0
  127. package/templates/skills/gitflow/steps/step-start.md +334 -0
  128. package/templates/skills/gitflow/steps/step-sync.md +200 -0
  129. package/templates/skills/gitflow/templates/config.json +53 -0
  130. package/templates/skills/notification/SKILL.md +51 -51
  131. package/templates/skills/ralph-loop/SKILL.md +228 -0
  132. package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
  133. package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
  134. package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
  135. package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
  136. package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
  137. package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
  138. package/templates/skills/review-code/SKILL.md +219 -0
  139. package/templates/skills/review-code/references/clean-code-principles.md +140 -0
  140. package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
  141. package/templates/skills/review-code/references/feedback-patterns.md +149 -0
  142. package/templates/skills/review-code/references/security-checklist.md +127 -0
  143. package/templates/skills/ui-components/SKILL.md +54 -54
  144. package/templates/skills/workflow/SKILL.md +46 -46
  145. package/templates/commands/ai-prompt.md +0 -315
  146. package/templates/commands/apex/1-analyze.md +0 -100
  147. package/templates/commands/apex/2-plan.md +0 -145
  148. package/templates/commands/apex/3-execute.md +0 -171
  149. package/templates/commands/apex/4-examine.md +0 -116
  150. package/templates/commands/apex/5-tasks.md +0 -209
  151. package/templates/commands/apex.md +0 -76
  152. package/templates/commands/application/create.md +0 -362
  153. package/templates/commands/application/templates-backend.md +0 -463
  154. package/templates/commands/application/templates-frontend.md +0 -517
  155. package/templates/commands/application/templates-i18n.md +0 -478
  156. package/templates/commands/application/templates-seed.md +0 -362
  157. package/templates/commands/application.md +0 -303
  158. package/templates/commands/business-analyse/0-orchestrate.md +0 -156
  159. package/templates/commands/business-analyse/1-init.md +0 -99
  160. package/templates/commands/business-analyse/2-discover.md +0 -143
  161. package/templates/commands/business-analyse/3-analyse.md +0 -106
  162. package/templates/commands/business-analyse/4-specify.md +0 -133
  163. package/templates/commands/business-analyse/5-validate.md +0 -132
  164. package/templates/commands/business-analyse/6-handoff.md +0 -157
  165. package/templates/commands/business-analyse/7-doc-html.md +0 -103
  166. package/templates/commands/business-analyse/_shared.md +0 -176
  167. package/templates/commands/business-analyse/bug.md +0 -118
  168. package/templates/commands/business-analyse/change-request.md +0 -144
  169. package/templates/commands/business-analyse/hotfix.md +0 -116
  170. package/templates/commands/business-analyse.md +0 -121
  171. package/templates/commands/controller/create.md +0 -216
  172. package/templates/commands/controller/postman-templates.md +0 -528
  173. package/templates/commands/controller/templates.md +0 -600
  174. package/templates/commands/controller.md +0 -337
  175. package/templates/commands/create/agent.md +0 -138
  176. package/templates/commands/create/command.md +0 -166
  177. package/templates/commands/create/hook.md +0 -234
  178. package/templates/commands/create/plugin.md +0 -329
  179. package/templates/commands/create/project.md +0 -508
  180. package/templates/commands/create/skill.md +0 -199
  181. package/templates/commands/create.md +0 -220
  182. package/templates/commands/documentation/module.md +0 -202
  183. package/templates/commands/documentation/templates.md +0 -432
  184. package/templates/commands/documentation.md +0 -190
  185. package/templates/commands/epct.md +0 -69
  186. package/templates/commands/explain.md +0 -186
  187. package/templates/commands/feature-full.md +0 -267
  188. package/templates/commands/gitflow/1-init.md +0 -188
  189. package/templates/commands/gitflow/10-start.md +0 -190
  190. package/templates/commands/gitflow/11-finish.md +0 -382
  191. package/templates/commands/gitflow/12-cleanup.md +0 -103
  192. package/templates/commands/gitflow/13-sync.md +0 -216
  193. package/templates/commands/gitflow/14-rebase.md +0 -251
  194. package/templates/commands/gitflow/2-status.md +0 -122
  195. package/templates/commands/gitflow/3-commit.md +0 -209
  196. package/templates/commands/gitflow/4-plan.md +0 -174
  197. package/templates/commands/gitflow/5-exec.md +0 -202
  198. package/templates/commands/gitflow/6-abort.md +0 -121
  199. package/templates/commands/gitflow/7-pull-request.md +0 -176
  200. package/templates/commands/gitflow/8-review.md +0 -113
  201. package/templates/commands/gitflow/9-merge.md +0 -157
  202. package/templates/commands/gitflow.md +0 -128
  203. package/templates/commands/implement.md +0 -663
  204. package/templates/commands/init.md +0 -567
  205. package/templates/commands/mcp-integration.md +0 -330
  206. package/templates/commands/notification.md +0 -129
  207. package/templates/commands/oneshot.md +0 -57
  208. package/templates/commands/quickstart.md +0 -154
  209. package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
  210. package/templates/commands/ralph-loop/help.md +0 -126
  211. package/templates/commands/ralph-loop/ralph-loop.md +0 -120
  212. package/templates/commands/review.md +0 -106
  213. package/templates/commands/workflow.md +0 -193
  214. package/templates/gitflow/config.json +0 -138
@@ -0,0 +1,200 @@
1
+ ---
2
+ name: step-sync
3
+ description: Sync with remote and rebase if behind
4
+ next_step: null
5
+ ---
6
+
7
+ # Step: SYNC - Synchronize with Remote
8
+
9
+ ## YOUR TASK:
10
+
11
+ Fetch from remote, detect divergence, push local commits, and rebase if behind base branch.
12
+
13
+ **ULTRA THINK about merge conflicts.**
14
+
15
+ ---
16
+
17
+ ## EXECUTION SEQUENCE:
18
+
19
+ ### 1. Fetch Remote State
20
+
21
+ ```bash
22
+ git fetch origin --quiet
23
+ CURRENT=$(git rev-parse --abbrev-ref HEAD)
24
+
25
+ # Determine base branch
26
+ case "$CURRENT" in
27
+ feature/*) BASE_BRANCH="develop" ;;
28
+ release/*) BASE_BRANCH="develop" ;;
29
+ hotfix/*) BASE_BRANCH="main" ;;
30
+ *) BASE_BRANCH="develop" ;;
31
+ esac
32
+ ```
33
+
34
+ ### 2. Analyze Divergence
35
+
36
+ ```bash
37
+ # Current branch vs remote
38
+ AHEAD=$(git rev-list --count origin/$CURRENT..HEAD 2>/dev/null || echo "0")
39
+ BEHIND=$(git rev-list --count HEAD..origin/$CURRENT 2>/dev/null || echo "0")
40
+
41
+ # Current branch vs base branch
42
+ BASE_AHEAD=$(git rev-list --count origin/$BASE_BRANCH..HEAD 2>/dev/null || echo "0")
43
+ BASE_BEHIND=$(git rev-list --count HEAD..origin/$BASE_BRANCH 2>/dev/null || echo "0")
44
+ ```
45
+
46
+ **State matrix:**
47
+
48
+ | Ahead | Behind | State | Action |
49
+ |-------|--------|-------|--------|
50
+ | 0 | 0 | Synced | Nothing to do |
51
+ | >0 | 0 | Ahead | Push |
52
+ | 0 | >0 | Behind | Pull |
53
+ | >0 | >0 | Diverged | Pull --rebase + Push |
54
+
55
+ ### 3. Display Status
56
+
57
+ ```
58
+ Sync Status: {CURRENT}
59
+
60
+ | Remote | Ahead | Behind | Status |
61
+ |--------|-------|--------|--------|
62
+ | origin/{CURRENT} | {AHEAD} | {BEHIND} | {state} |
63
+ | origin/{BASE_BRANCH} | {BASE_AHEAD} | {BASE_BEHIND} | {state} |
64
+ ```
65
+
66
+ ### 4. Push Local Commits
67
+
68
+ ```bash
69
+ [ "$AHEAD" -gt 0 ] && {
70
+ echo "Pushing $AHEAD commit(s) to origin/$CURRENT..."
71
+ git push origin $CURRENT
72
+ }
73
+ ```
74
+
75
+ ### 5. Pull Remote Commits
76
+
77
+ ```bash
78
+ [ "$BEHIND" -gt 0 ] && {
79
+ echo "Pulling $BEHIND commit(s) from origin/$CURRENT..."
80
+
81
+ # Check for uncommitted changes
82
+ DIRTY=$(git status --porcelain | wc -l)
83
+ [ "$DIRTY" -gt 0 ] && {
84
+ git stash push -m "sync-stash-$(date +%s)"
85
+ STASHED=true
86
+ }
87
+
88
+ git pull --rebase origin $CURRENT
89
+
90
+ [ "$STASHED" = true ] && git stash pop
91
+ }
92
+ ```
93
+
94
+ ### 6. Rebase on Base Branch (if behind)
95
+
96
+ ```bash
97
+ [ "$BASE_BEHIND" -gt 0 ] && {
98
+ echo "Branch is $BASE_BEHIND commits behind $BASE_BRANCH"
99
+
100
+ if [ "$auto_mode" = true ]; then
101
+ # Auto rebase
102
+ git rebase origin/$BASE_BRANCH
103
+ else
104
+ # Ask user
105
+ AskUserQuestion:
106
+ header: "Rebase"
107
+ question: "Rebase on $BASE_BRANCH? ($BASE_BEHIND commits behind)"
108
+ options:
109
+ - label: "Yes (Recommended)"
110
+ description: "Rebase to include latest changes"
111
+ - label: "No"
112
+ description: "Keep current base"
113
+ fi
114
+ }
115
+ ```
116
+
117
+ ### 7. Handle Rebase Conflicts
118
+
119
+ ```bash
120
+ # If rebase has conflicts
121
+ if [ -d ".git/rebase-merge" ] || [ -d ".git/rebase-apply" ]; then
122
+ echo "⚠️ REBASE CONFLICT DETECTED"
123
+
124
+ CONFLICTS=$(git diff --name-only --diff-filter=U)
125
+ echo "Conflicting files:"
126
+ echo "$CONFLICTS"
127
+
128
+ # Check for migration conflicts
129
+ MIGRATION_CONFLICTS=$(echo "$CONFLICTS" | grep "Migrations/")
130
+ [ -n "$MIGRATION_CONFLICTS" ] && {
131
+ echo "⚠️ Migration conflicts detected!"
132
+ echo "Recommend: /efcore:rebase-snapshot"
133
+ }
134
+
135
+ # Options
136
+ AskUserQuestion:
137
+ header: "Conflict"
138
+ question: "How to handle conflicts?"
139
+ options:
140
+ - label: "Resolve manually"
141
+ description: "I'll fix conflicts and continue"
142
+ - label: "Abort rebase"
143
+ description: "Cancel and return to previous state"
144
+ - label: "Accept theirs (migrations)"
145
+ description: "Use base branch migrations, regenerate ours"
146
+ fi
147
+ ```
148
+
149
+ ### 8. Force Push After Rebase
150
+
151
+ ```bash
152
+ # After successful rebase
153
+ if [ "$REBASED" = true ]; then
154
+ echo "Rebase complete. Force pushing..."
155
+ git push --force-with-lease origin $CURRENT
156
+ fi
157
+ ```
158
+
159
+ ### 9. Summary
160
+
161
+ ```
162
+ ╔══════════════════════════════════════════════════════════════════╗
163
+ ║ SYNC COMPLETE ║
164
+ ╠══════════════════════════════════════════════════════════════════╣
165
+ ║ Branch: {CURRENT} ║
166
+ ╠══════════════════════════════════════════════════════════════════╣
167
+ ║ Actions: ║
168
+ ║ {✅ Pushed {N} commits | ⬜ Nothing to push} ║
169
+ ║ {✅ Pulled {N} commits | ⬜ Nothing to pull} ║
170
+ ║ {✅ Rebased on {BASE_BRANCH} | ⬜ No rebase needed} ║
171
+ ╠══════════════════════════════════════════════════════════════════╣
172
+ ║ Status: In sync with remote ║
173
+ ╠══════════════════════════════════════════════════════════════════╣
174
+ ║ NEXT: /gitflow pr ║
175
+ ╚══════════════════════════════════════════════════════════════════╝
176
+ ```
177
+
178
+ ---
179
+
180
+ ## ERROR HANDLING:
181
+
182
+ | Error | Solution |
183
+ |-------|----------|
184
+ | Push rejected | Pull first, then push |
185
+ | Rebase conflict | Resolve or abort |
186
+ | Migration conflict | Use /efcore:rebase-snapshot |
187
+ | Force push blocked | Check branch protection |
188
+
189
+ ---
190
+
191
+ ## SUCCESS CRITERIA:
192
+
193
+ - All local commits pushed
194
+ - All remote commits pulled
195
+ - Rebased on base branch (if needed)
196
+ - No conflicts remaining
197
+
198
+ ## NEXT STEP:
199
+
200
+ User runs `/gitflow pr` to create pull request.
@@ -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
- Integre le systeme de notifications SmartStack dans le developpement.
5
- Utiliser ce skill quand:
6
- - L'utilisateur veut envoyer des notifications depuis une feature
7
- - L'utilisateur mentionne "notifier", "alerte", "notification", "in-app"
8
- - Creation d'un module qui necessite des notifications utilisateur
9
- - Integration SignalR pour real-time
10
- Types: In-App, Email (via Workflow), Push (futur)
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
- **Référence:** [_shared.md](../_shared.md) pour services communs
17
+ **Reference:** [_shared.md](../_shared.md) for common services
18
18
 
19
- ## QUAND CE SKILL S'ACTIVE
19
+ ## WHEN THIS SKILL ACTIVATES
20
20
 
21
- | Declencheur | Exemple |
22
- |-------------|---------|
23
- | Demande explicite | "Notifie l'utilisateur quand un ticket est cree" |
24
- | Event-driven | "Quand le SLA expire, prevenir l'utilisateur" |
25
- | Real-time | "Afficher en temps reel les nouvelles notifications" |
26
- | Mots-cles | "notifier", "alerte", "SignalR", "real-time" |
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 DE NOTIFICATION
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
- ### Ajouter un Nouveau Type
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. Utilisation
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. Identifier le Besoin
59
+ ### 1. Identify the Need
60
60
  | Question | Action |
61
61
  |----------|--------|
62
- | Real-time ? | → In-App + SignalR |
63
- | Email ? | → Workflow + EmailTemplate |
64
- | Entite liee ? | → relatedEntityType/Id |
65
- | Navigation ? | → actionUrl |
62
+ | Real-time? | → In-App + SignalR |
63
+ | Email? | → Workflow + EmailTemplate |
64
+ | Related entity? | → relatedEntityType/Id |
65
+ | Navigation? | → actionUrl |
66
66
 
67
- ### 2. Envoi de Notification
67
+ ### 2. Send Notification
68
68
  ```csharp
69
69
  // Simple
70
70
  await _notificationService.SendNotificationAsync(userId, NotificationType.TicketCreated,
71
- "Nouveau ticket", $"Ticket #{ticket.Number} cree", ct);
71
+ "New ticket", $"Ticket #{ticket.Number} created", ct);
72
72
 
73
- // Avec entite liee
73
+ // With related entity
74
74
  await _notificationService.SendNotificationAsync(userId, NotificationType.TicketAssigned,
75
- "Ticket assigne", message,
75
+ "Ticket assigned", message,
76
76
  relatedEntityType: "Ticket", relatedEntityId: ticket.Id,
77
77
  actionUrl: $"/support/tickets/{ticket.Id}", ct);
78
78
 
79
- // Multi-utilisateurs
79
+ // Multi-user
80
80
  await _notificationService.SendNotificationsAsync(userIds, type, title, message, ct);
81
81
 
82
- // Par role
82
+ // By role
83
83
  await _notificationService.SendNotificationToRoleAsync("Admin", type, title, message, ct);
84
84
  ```
85
85
 
86
- ### 3. Preferences Utilisateur
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 /> // Gere useSignalR, badge unreadCount, dropdown
115
+ <NotificationBell /> // Manages useSignalR, badge unreadCount, dropdown
116
116
  ```
117
117
 
118
- ## PATTERNS AVANCES
118
+ ## ADVANCED PATTERNS
119
119
 
120
- ### SLA Warning (Job Hangfire)
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 Groupee
131
+ ### Grouped Notification
132
132
  ```csharp
133
133
  if (entities.Count == 1) await SendSingle(...);
134
- else await SendBatch($"{entities.Count} nouveaux elements", ...);
134
+ else await SendBatch($"{entities.Count} new elements", ...);
135
135
  ```
136
136
 
137
137
  ## CHECKLIST
138
138
 
139
139
  ```
140
- Type notification identifie (existant ou nouveau enum)
141
- □ INotificationService injecte
142
- Envoi avec: userId, type, title, message, relatedEntityType?, relatedEntityId?, actionUrl?
143
- □ Frontend: useSignalR configure, toast/UI sur reception
144
- Si email: workflow configure
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
- ## REGLES ABSOLUES
147
+ ## ABSOLUTE RULES
148
148
 
149
149
  | DO | DON'T |
150
150
  |----|-------|
151
- | INotificationService | Acces DB direct |
152
- | NotificationType enum | Types hardcodes |
153
- | relatedEntityType/Id + actionUrl | Notifications sans contexte |
154
- | Respecter preferences utilisateur | Spam notifications |
155
- | CancellationToken | Messages hardcodes (utiliser i18n) |
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
- ## FICHIERS CLES
157
+ ## KEY FILES
158
158
 
159
- | Fichier | Role |
160
- |---------|------|
161
- | `Domain/Support/Notification.cs` | Entite |
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` | Hook frontend |
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>