@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.
Files changed (210) 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 +1 -1
  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 +1001 -352
  12. package/.documentation/ralph-loop.html +1 -1
  13. package/.documentation/test-web.html +1 -1
  14. package/README.md +88 -20
  15. package/dist/index.js +276 -85
  16. package/dist/index.js.map +1 -1
  17. package/package.json +1 -1
  18. package/templates/agents/code-reviewer.md +163 -0
  19. package/templates/agents/efcore/db-deploy.md +25 -7
  20. package/templates/agents/efcore/db-reset.md +31 -10
  21. package/templates/agents/efcore/db-status.md +22 -5
  22. package/templates/agents/efcore/migration.md +69 -19
  23. package/templates/agents/gitflow/cleanup.md +8 -1
  24. package/templates/agents/gitflow/commit.md +7 -5
  25. package/templates/agents/gitflow/finish.md +6 -4
  26. package/templates/agents/gitflow/pr.md +8 -1
  27. package/templates/agents/gitflow/start.md +1 -1
  28. package/templates/commands/check-version.md +267 -0
  29. package/templates/commands/efcore/_shared.md +30 -1
  30. package/templates/commands/efcore/db-reset.md +18 -6
  31. package/templates/commands/gitflow/OPTIMIZATIONS.md +206 -0
  32. package/templates/commands/refactor.md +164 -0
  33. package/templates/project/DependencyInjection.Application.cs.template +25 -0
  34. package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
  35. package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
  36. package/templates/project/ExampleEntity.cs.template +116 -0
  37. package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
  38. package/templates/project/ExampleService.cs.template +146 -0
  39. package/templates/project/ExtensionsDbContext.cs.template +41 -0
  40. package/templates/project/IExtensionsDbContext.cs.template +22 -0
  41. package/templates/project/Program.cs.template +47 -0
  42. package/templates/project/README.md +79 -0
  43. package/templates/ralph/README.md +10 -8
  44. package/templates/ralph/ralph.config.yaml +2 -2
  45. package/templates/skills/_shared.md +44 -44
  46. package/templates/skills/ai-prompt/SKILL.md +55 -55
  47. package/templates/skills/apex/SKILL.md +235 -0
  48. package/templates/skills/apex/steps/step-00-init.md +203 -0
  49. package/templates/skills/apex/steps/step-01-analyze.md +210 -0
  50. package/templates/skills/apex/steps/step-02-plan.md +217 -0
  51. package/templates/skills/apex/steps/step-03-execute.md +178 -0
  52. package/templates/skills/apex/steps/step-04-validate.md +217 -0
  53. package/templates/skills/apex/steps/step-05-examine.md +207 -0
  54. package/templates/skills/apex/steps/step-06-resolve.md +181 -0
  55. package/templates/skills/apex/steps/step-07-tests.md +206 -0
  56. package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
  57. package/templates/skills/apex/templates/00-context.md +46 -0
  58. package/templates/skills/apex/templates/01-analyze.md +63 -0
  59. package/templates/skills/apex/templates/02-plan.md +63 -0
  60. package/templates/skills/apex/templates/03-execute.md +34 -0
  61. package/templates/skills/apex/templates/04-validate.md +61 -0
  62. package/templates/skills/apex/templates/05-examine.md +58 -0
  63. package/templates/skills/apex/templates/06-resolve.md +39 -0
  64. package/templates/skills/apex/templates/07-tests.md +56 -0
  65. package/templates/skills/apex/templates/08-run-tests.md +41 -0
  66. package/templates/skills/apex/templates/README.md +69 -0
  67. package/templates/skills/application/SKILL.md +50 -50
  68. package/templates/skills/application/templates-backend.md +25 -25
  69. package/templates/skills/application/templates-frontend.md +43 -43
  70. package/templates/skills/application/templates-i18n.md +29 -29
  71. package/templates/skills/application/templates-seed.md +77 -77
  72. package/templates/skills/business-analyse/SKILL.md +223 -0
  73. package/templates/skills/business-analyse/_shared.md +258 -0
  74. package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
  75. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
  76. package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
  77. package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
  78. package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
  79. package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
  80. package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
  81. package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
  82. package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
  83. package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
  84. package/templates/skills/business-analyse/questionnaire.md +177 -177
  85. package/templates/skills/business-analyse/react/components.md +340 -0
  86. package/templates/skills/business-analyse/react/i18n-template.md +245 -0
  87. package/templates/skills/business-analyse/react/schema.md +151 -0
  88. package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
  89. package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
  90. package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
  91. package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
  92. package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
  93. package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
  94. package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
  95. package/templates/skills/business-analyse/templates/00-context.md +105 -0
  96. package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
  97. package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
  98. package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
  99. package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
  100. package/templates/skills/business-analyse/templates-frd.md +217 -217
  101. package/templates/skills/business-analyse/templates-react.md +26 -26
  102. package/templates/skills/controller/SKILL.md +141 -92
  103. package/templates/skills/controller/postman-templates.md +15 -15
  104. package/templates/skills/controller/steps/step-00-init.md +191 -0
  105. package/templates/skills/controller/steps/step-01-analyze.md +146 -0
  106. package/templates/skills/controller/steps/step-02-plan.md +176 -0
  107. package/templates/skills/controller/steps/step-03-generate.md +219 -0
  108. package/templates/skills/controller/steps/step-04-perms.md +219 -0
  109. package/templates/skills/controller/steps/step-05-validate.md +107 -0
  110. package/templates/skills/controller/templates.md +77 -77
  111. package/templates/skills/documentation/SKILL.md +79 -79
  112. package/templates/skills/feature-full/SKILL.md +38 -38
  113. package/templates/skills/gitflow/SKILL.md +277 -0
  114. package/templates/{commands → skills}/gitflow/_shared.md +20 -20
  115. package/templates/skills/gitflow/phases/abort.md +173 -0
  116. package/templates/skills/gitflow/phases/cleanup.md +226 -0
  117. package/templates/skills/gitflow/phases/status.md +178 -0
  118. package/templates/skills/gitflow/steps/step-commit.md +255 -0
  119. package/templates/skills/gitflow/steps/step-finish.md +255 -0
  120. package/templates/skills/gitflow/steps/step-init.md +209 -0
  121. package/templates/skills/gitflow/steps/step-merge.md +225 -0
  122. package/templates/skills/gitflow/steps/step-plan.md +208 -0
  123. package/templates/skills/gitflow/steps/step-pr.md +235 -0
  124. package/templates/skills/gitflow/steps/step-start.md +234 -0
  125. package/templates/skills/gitflow/steps/step-sync.md +200 -0
  126. package/templates/skills/gitflow/templates/config.json +53 -0
  127. package/templates/skills/notification/SKILL.md +51 -51
  128. package/templates/skills/ralph-loop/SKILL.md +228 -0
  129. package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
  130. package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
  131. package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
  132. package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
  133. package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
  134. package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
  135. package/templates/skills/review-code/SKILL.md +219 -0
  136. package/templates/skills/review-code/references/clean-code-principles.md +140 -0
  137. package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
  138. package/templates/skills/review-code/references/feedback-patterns.md +149 -0
  139. package/templates/skills/review-code/references/security-checklist.md +127 -0
  140. package/templates/skills/ui-components/SKILL.md +54 -54
  141. package/templates/skills/workflow/SKILL.md +46 -46
  142. package/templates/commands/ai-prompt.md +0 -315
  143. package/templates/commands/apex/1-analyze.md +0 -100
  144. package/templates/commands/apex/2-plan.md +0 -145
  145. package/templates/commands/apex/3-execute.md +0 -171
  146. package/templates/commands/apex/4-examine.md +0 -116
  147. package/templates/commands/apex/5-tasks.md +0 -209
  148. package/templates/commands/apex.md +0 -76
  149. package/templates/commands/application/create.md +0 -362
  150. package/templates/commands/application/templates-backend.md +0 -463
  151. package/templates/commands/application/templates-frontend.md +0 -517
  152. package/templates/commands/application/templates-i18n.md +0 -478
  153. package/templates/commands/application/templates-seed.md +0 -362
  154. package/templates/commands/application.md +0 -303
  155. package/templates/commands/business-analyse/0-orchestrate.md +0 -156
  156. package/templates/commands/business-analyse/1-init.md +0 -99
  157. package/templates/commands/business-analyse/2-discover.md +0 -143
  158. package/templates/commands/business-analyse/3-analyse.md +0 -106
  159. package/templates/commands/business-analyse/4-specify.md +0 -133
  160. package/templates/commands/business-analyse/5-validate.md +0 -132
  161. package/templates/commands/business-analyse/6-handoff.md +0 -157
  162. package/templates/commands/business-analyse/7-doc-html.md +0 -103
  163. package/templates/commands/business-analyse/_shared.md +0 -176
  164. package/templates/commands/business-analyse/bug.md +0 -118
  165. package/templates/commands/business-analyse/change-request.md +0 -144
  166. package/templates/commands/business-analyse/hotfix.md +0 -116
  167. package/templates/commands/business-analyse.md +0 -121
  168. package/templates/commands/controller/create.md +0 -216
  169. package/templates/commands/controller/postman-templates.md +0 -528
  170. package/templates/commands/controller/templates.md +0 -600
  171. package/templates/commands/controller.md +0 -337
  172. package/templates/commands/create/agent.md +0 -138
  173. package/templates/commands/create/command.md +0 -166
  174. package/templates/commands/create/hook.md +0 -234
  175. package/templates/commands/create/plugin.md +0 -329
  176. package/templates/commands/create/project.md +0 -508
  177. package/templates/commands/create/skill.md +0 -199
  178. package/templates/commands/create.md +0 -220
  179. package/templates/commands/documentation/module.md +0 -202
  180. package/templates/commands/documentation/templates.md +0 -432
  181. package/templates/commands/documentation.md +0 -190
  182. package/templates/commands/epct.md +0 -69
  183. package/templates/commands/explain.md +0 -186
  184. package/templates/commands/feature-full.md +0 -267
  185. package/templates/commands/gitflow/1-init.md +0 -188
  186. package/templates/commands/gitflow/10-start.md +0 -190
  187. package/templates/commands/gitflow/11-finish.md +0 -382
  188. package/templates/commands/gitflow/12-cleanup.md +0 -103
  189. package/templates/commands/gitflow/13-sync.md +0 -216
  190. package/templates/commands/gitflow/14-rebase.md +0 -251
  191. package/templates/commands/gitflow/2-status.md +0 -122
  192. package/templates/commands/gitflow/3-commit.md +0 -209
  193. package/templates/commands/gitflow/4-plan.md +0 -174
  194. package/templates/commands/gitflow/5-exec.md +0 -202
  195. package/templates/commands/gitflow/6-abort.md +0 -121
  196. package/templates/commands/gitflow/7-pull-request.md +0 -176
  197. package/templates/commands/gitflow/8-review.md +0 -113
  198. package/templates/commands/gitflow/9-merge.md +0 -157
  199. package/templates/commands/gitflow.md +0 -128
  200. package/templates/commands/implement.md +0 -663
  201. package/templates/commands/init.md +0 -567
  202. package/templates/commands/mcp-integration.md +0 -330
  203. package/templates/commands/notification.md +0 -129
  204. package/templates/commands/oneshot.md +0 -57
  205. package/templates/commands/quickstart.md +0 -154
  206. package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
  207. package/templates/commands/ralph-loop/help.md +0 -126
  208. package/templates/commands/ralph-loop/ralph-loop.md +0 -120
  209. package/templates/commands/review.md +0 -106
  210. package/templates/commands/workflow.md +0 -193
@@ -12,7 +12,7 @@
12
12
  <header class="global-header">
13
13
  <div class="logo">SS</div>
14
14
  <span class="site-title">SmartStack CLI</span>
15
- <span class="version-badge">v1.5.0</span>
15
+ <span class="version-badge">v1.14.0</span>
16
16
  <div class="header-divider"></div>
17
17
  <span class="page-title">Ralph Loop</span>
18
18
  <nav class="breadcrumb">
@@ -12,7 +12,7 @@
12
12
  <header class="global-header">
13
13
  <div class="logo">SS</div>
14
14
  <span class="site-title">SmartStack CLI</span>
15
- <span class="version-badge">v1.5.0</span>
15
+ <span class="version-badge">v1.14.0</span>
16
16
  <div class="header-divider"></div>
17
17
  <span class="page-title">Test Web</span>
18
18
  <nav class="breadcrumb">
package/README.md CHANGED
@@ -41,53 +41,109 @@
41
41
 
42
42
  ## Prerequisites
43
43
 
44
- ### 1. Node.js (v18 or higher)
44
+ ### 1. Git
45
+
46
+ **Download:** https://git-scm.com/downloads
47
+
48
+ Git is **required** for GitFlow workflow and version control.
49
+
50
+ ```powershell
51
+ # Verify installation
52
+ git --version
53
+
54
+ # Configure your identity
55
+ git config --global user.name "Your Name"
56
+ git config --global user.email "your@email.com"
57
+ ```
58
+
59
+ #### Option A: GitHub
60
+
61
+ ```powershell
62
+ # Generate SSH key
63
+ ssh-keygen -t ed25519 -C "your@email.com"
64
+
65
+ # Start SSH agent and add key
66
+ eval "$(ssh-agent -s)"
67
+ ssh-add ~/.ssh/id_ed25519
68
+
69
+ # Copy public key
70
+ cat ~/.ssh/id_ed25519.pub
71
+
72
+ # Test connection
73
+ ssh -T git@github.com
74
+ ```
75
+
76
+ **Add key on GitHub:** https://github.com/settings/keys
77
+
78
+ #### Option B: Azure DevOps
79
+
80
+ ```powershell
81
+ # Git Credential Manager (recommended - included with Git for Windows)
82
+ git config --global credential.helper manager
83
+
84
+ # Clone a repo - credentials will be prompted automatically
85
+ git clone https://dev.azure.com/YourOrg/YourProject/_git/YourRepo
86
+ ```
87
+
88
+ > **Windows Users:** Git Credential Manager handles Azure DevOps authentication automatically. On first clone, a browser window opens for login.
89
+
90
+ ### 2. Node.js (v18 or higher)
45
91
 
46
92
  **Download:** https://nodejs.org/
47
93
 
48
- Verify installation:
49
94
  ```powershell
50
95
  node --version # Should display v18.x.x or higher
51
96
  npm --version # Should display 9.x.x or higher
52
97
  ```
53
98
 
54
- ### 2. .NET SDK (v10.0 or higher)
99
+ ### 3. .NET SDK (v10.0 or higher)
55
100
 
56
101
  **Download:** https://dotnet.microsoft.com/download
57
102
 
58
- Verify installation:
59
103
  ```powershell
60
104
  dotnet --version # Should display 10.x.x or higher
61
105
  ```
62
106
 
63
- ### 3. Visual Studio Code
64
-
65
- **Download:** https://code.visualstudio.com/
66
-
67
- ### 4. Claude Code Extension for VS Code
107
+ ### 4. Visual Studio Code + Claude Code
68
108
 
69
- 1. Open VS Code
70
- 2. Open Extensions panel (`Ctrl+Shift+X`)
71
- 3. Search for "Claude Code"
72
- 4. Click **Install**
109
+ **Download VS Code:** https://code.visualstudio.com/
73
110
 
74
- Or via terminal:
111
+ Install Claude Code extension:
75
112
  ```powershell
76
113
  code --install-extension anthropic.claude-code
77
114
  ```
78
115
 
79
- ### 5. MCP Servers (Recommended)
116
+ Or manually: Open VS Code → Extensions (`Ctrl+Shift+X`) → Search "Claude Code" → Install
80
117
 
81
- MCP servers enhance the development experience:
118
+ ### 5. MCP Servers (Required)
119
+
120
+ MCP servers are **required** for SmartStack advanced features.
121
+
122
+ #### Step A: Download MCP packages
82
123
 
83
124
  ```powershell
84
125
  # SmartStack MCP - Convention validation, scaffolding, API docs
85
- claude mcp add smartstack
126
+ npm install -g @atlashub/smartstack-mcp
86
127
 
87
128
  # Context7 MCP - Library documentation, code examples
88
- claude mcp add context7
129
+ npm install -g @upstash/context7-mcp
89
130
  ```
90
131
 
132
+ #### Step B: Register in Claude Code
133
+
134
+ ```powershell
135
+ # Register SmartStack MCP
136
+ claude mcp add smartstack -- npx @atlashub/smartstack-mcp
137
+
138
+ # Register Context7 MCP
139
+ claude mcp add context7 -- npx @upstash/context7-mcp
140
+
141
+ # Verify installation
142
+ claude mcp list
143
+ ```
144
+
145
+ > **Expected result:** `claude mcp list` should show **smartstack** and **context7** in the active servers list.
146
+
91
147
  ---
92
148
 
93
149
  ## Installation
@@ -112,7 +168,14 @@ ss install
112
168
  ### Step 3: Verify installation
113
169
 
114
170
  ```powershell
171
+ # Check installation status
115
172
  smartstack status --verbose
173
+
174
+ # Run full diagnostic
175
+ smartstack doctor
176
+
177
+ # Verify MCP servers
178
+ smartstack check-mcp
116
179
  ```
117
180
 
118
181
  ### Local Installation (project only)
@@ -553,8 +616,13 @@ smartstack status --verbose
553
616
 
554
617
  **Solution:** Install required MCP servers:
555
618
  ```powershell
556
- claude mcp add smartstack
557
- claude mcp add context7
619
+ # 1. Download packages
620
+ npm install -g @atlashub/smartstack-mcp
621
+ npm install -g @upstash/context7-mcp
622
+
623
+ # 2. Register in Claude Code
624
+ claude mcp add smartstack -- npx @atlashub/smartstack-mcp
625
+ claude mcp add context7 -- npx @upstash/context7-mcp
558
626
  ```
559
627
 
560
628
  Or skip verification:
package/dist/index.js CHANGED
@@ -42080,6 +42080,7 @@ var import_fs_extra3 = __toESM(require_lib());
42080
42080
  var import_path4 = require("path");
42081
42081
  var import_os2 = require("os");
42082
42082
  var import_child_process4 = require("child_process");
42083
+ var TEMPLATES_DIR2 = (0, import_path4.join)((0, import_path4.dirname)(__dirname), "templates", "project");
42083
42084
  function checkPrerequisites() {
42084
42085
  const check = (cmd, args) => {
42085
42086
  try {
@@ -42287,6 +42288,64 @@ function execCommand(command, cwd, dryRun = false) {
42287
42288
  throw new Error(`Command failed: ${command}`);
42288
42289
  }
42289
42290
  }
42291
+ async function loadTemplate(templateName, projectName) {
42292
+ const templatePath = (0, import_path4.join)(TEMPLATES_DIR2, templateName);
42293
+ if (!await import_fs_extra3.default.pathExists(templatePath)) {
42294
+ throw new Error(`Template not found: ${templatePath}`);
42295
+ }
42296
+ let content = await import_fs_extra3.default.readFile(templatePath, "utf-8");
42297
+ content = content.replace(/\{\{ProjectName\}\}/g, projectName);
42298
+ return content;
42299
+ }
42300
+ async function createDualDbContextStructure(projectDir, projectName, dryRun) {
42301
+ if (dryRun) {
42302
+ logger.info("[DRY RUN] Would create Dual-DbContext structure");
42303
+ return;
42304
+ }
42305
+ const srcDir = (0, import_path4.join)(projectDir, "src");
42306
+ const directories = [
42307
+ (0, import_path4.join)(srcDir, `${projectName}.Application`, "Common", "Interfaces"),
42308
+ (0, import_path4.join)(srcDir, `${projectName}.Infrastructure`, "Persistence"),
42309
+ (0, import_path4.join)(srcDir, `${projectName}.Infrastructure`, "Persistence", "Configurations"),
42310
+ (0, import_path4.join)(srcDir, `${projectName}.Infrastructure`, "Services"),
42311
+ (0, import_path4.join)(srcDir, `${projectName}.Domain`, "Entities")
42312
+ ];
42313
+ for (const dir of directories) {
42314
+ await import_fs_extra3.default.ensureDir(dir);
42315
+ }
42316
+ const templateFiles = [
42317
+ {
42318
+ template: "IExtensionsDbContext.cs.template",
42319
+ destination: (0, import_path4.join)(srcDir, `${projectName}.Application`, "Common", "Interfaces", "IExtensionsDbContext.cs")
42320
+ },
42321
+ {
42322
+ template: "DependencyInjection.Application.cs.template",
42323
+ destination: (0, import_path4.join)(srcDir, `${projectName}.Application`, "DependencyInjection.cs")
42324
+ },
42325
+ {
42326
+ template: "ExtensionsDbContext.cs.template",
42327
+ destination: (0, import_path4.join)(srcDir, `${projectName}.Infrastructure`, "Persistence", "ExtensionsDbContext.cs")
42328
+ },
42329
+ {
42330
+ template: "DesignTimeExtensionsDbContextFactory.cs.template",
42331
+ destination: (0, import_path4.join)(srcDir, `${projectName}.Infrastructure`, "Persistence", "DesignTimeExtensionsDbContextFactory.cs")
42332
+ },
42333
+ {
42334
+ template: "DependencyInjection.Infrastructure.cs.template",
42335
+ destination: (0, import_path4.join)(srcDir, `${projectName}.Infrastructure`, "DependencyInjection.cs")
42336
+ }
42337
+ ];
42338
+ for (const { template, destination } of templateFiles) {
42339
+ try {
42340
+ const content = await loadTemplate(template, projectName);
42341
+ await import_fs_extra3.default.writeFile(destination, content);
42342
+ logger.info(`Created: ${(0, import_path4.basename)(destination)}`);
42343
+ } catch (error) {
42344
+ logger.warning(`Could not create ${template}: ${error instanceof Error ? error.message : error}`);
42345
+ }
42346
+ }
42347
+ logger.success("Dual-DbContext structure created");
42348
+ }
42290
42349
  async function createBackendStructure(config, dryRun) {
42291
42350
  const { name } = config;
42292
42351
  const projectDir = (0, import_path4.isAbsolute)(name) ? name : (0, import_path4.join)(process.cwd(), name);
@@ -42327,6 +42386,47 @@ EndGlobal
42327
42386
  if (!dryRun) {
42328
42387
  await import_fs_extra3.default.ensureDir((0, import_path4.join)(apiDir, "wwwroot"));
42329
42388
  }
42389
+ const launchSettings = {
42390
+ $schema: "https://json.schemastore.org/launchsettings.json",
42391
+ profiles: {
42392
+ http: {
42393
+ commandName: "Project",
42394
+ dotnetRunMessages: true,
42395
+ launchBrowser: false,
42396
+ applicationUrl: "http://localhost:5142",
42397
+ environmentVariables: {
42398
+ ASPNETCORE_ENVIRONMENT: "Development"
42399
+ }
42400
+ },
42401
+ https: {
42402
+ commandName: "Project",
42403
+ dotnetRunMessages: true,
42404
+ launchBrowser: false,
42405
+ applicationUrl: "https://localhost:7142;http://localhost:5142",
42406
+ environmentVariables: {
42407
+ ASPNETCORE_ENVIRONMENT: "Development"
42408
+ }
42409
+ }
42410
+ }
42411
+ };
42412
+ if (!dryRun) {
42413
+ await import_fs_extra3.default.ensureDir((0, import_path4.join)(apiDir, "Properties"));
42414
+ await import_fs_extra3.default.writeFile(
42415
+ (0, import_path4.join)(apiDir, "Properties", "launchSettings.json"),
42416
+ JSON.stringify(launchSettings, null, 2)
42417
+ );
42418
+ }
42419
+ if (!dryRun) {
42420
+ for (const { proj, type } of projects) {
42421
+ if (type === "classlib") {
42422
+ const class1Path = (0, import_path4.join)(srcDir, proj, "Class1.cs");
42423
+ if (await import_fs_extra3.default.pathExists(class1Path)) {
42424
+ await import_fs_extra3.default.remove(class1Path);
42425
+ logger.info(`Removed placeholder: ${proj}/Class1.cs`);
42426
+ }
42427
+ }
42428
+ }
42429
+ }
42330
42430
  const refs = [
42331
42431
  { from: `${projectName}.Application`, to: `${projectName}.Domain` },
42332
42432
  { from: `${projectName}.Infrastructure`, to: `${projectName}.Domain` },
@@ -42370,6 +42470,8 @@ EndGlobal
42370
42470
  // Force stable version before SmartStack
42371
42471
  "SmartStack",
42372
42472
  "Microsoft.AspNetCore.Authentication.JwtBearer",
42473
+ "Microsoft.EntityFrameworkCore.Design",
42474
+ // Required for EF Core migrations
42373
42475
  "Swashbuckle.AspNetCore"
42374
42476
  ]
42375
42477
  }
@@ -42379,6 +42481,65 @@ EndGlobal
42379
42481
  execCommand(`dotnet add "${(0, import_path4.join)(srcDir, project)}" package ${pkg2}`, void 0, dryRun);
42380
42482
  }
42381
42483
  }
42484
+ if (!dryRun) {
42485
+ const apiDir2 = (0, import_path4.join)(srcDir, `${projectName}.Api`);
42486
+ let programCs;
42487
+ try {
42488
+ programCs = await loadTemplate("Program.cs.template", projectName);
42489
+ } catch {
42490
+ programCs = `using Microsoft.EntityFrameworkCore;
42491
+ using SmartStack.Api.Extensions;
42492
+ using SmartStack.Infrastructure.Persistence;
42493
+ using ${projectName}.Infrastructure;
42494
+ using ${projectName}.Infrastructure.Persistence;
42495
+ using ${projectName}.Application;
42496
+
42497
+ var builder = WebApplication.CreateBuilder(args);
42498
+
42499
+ // ===================================================================
42500
+ // 1. Add SmartStack Core services (from NuGet package)
42501
+ // ===================================================================
42502
+ builder.Services.AddSmartStack(builder.Configuration, options =>
42503
+ {
42504
+ options.EnableDevSeeding = builder.Environment.IsDevelopment();
42505
+ options.EnableSwagger = builder.Environment.IsDevelopment();
42506
+ });
42507
+
42508
+ // ===================================================================
42509
+ // 2. Add client-specific services (Dual-DbContext pattern)
42510
+ // ===================================================================
42511
+ builder.Services.Add${projectName}Infrastructure(builder.Configuration);
42512
+ builder.Services.Add${projectName}Application();
42513
+
42514
+ var app = builder.Build();
42515
+
42516
+ // ===================================================================
42517
+ // 3. Initialize SmartStack + apply migrations (in correct order!)
42518
+ // ===================================================================
42519
+ await app.InitializeSmartStackAsync();
42520
+
42521
+ // Apply Extensions migrations AFTER Core migrations
42522
+ if (app.Environment.IsDevelopment())
42523
+ {
42524
+ using var scope = app.Services.CreateScope();
42525
+ var extDb = scope.ServiceProvider.GetRequiredService<ExtensionsDbContext>();
42526
+ await extDb.Database.MigrateAsync();
42527
+ }
42528
+
42529
+ // ===================================================================
42530
+ // 4. SmartStack middleware & endpoints
42531
+ // ===================================================================
42532
+ app.UseSmartStack();
42533
+ app.MapSmartStack();
42534
+
42535
+ app.Run();
42536
+ `;
42537
+ }
42538
+ await import_fs_extra3.default.writeFile((0, import_path4.join)(apiDir2, "Program.cs"), programCs);
42539
+ logger.info("Generated Program.cs with Dual-DbContext pattern");
42540
+ }
42541
+ logger.info("Creating Dual-DbContext structure...");
42542
+ await createDualDbContextStructure(projectDir, projectName, dryRun);
42382
42543
  }
42383
42544
  async function createConfigFiles(config, dryRun) {
42384
42545
  const { name } = config;
@@ -42613,7 +42774,7 @@ appsettings.*.Local.json
42613
42774
  },
42614
42775
  env: {
42615
42776
  ASPNETCORE_ENVIRONMENT: "Development",
42616
- ASPNETCORE_URLS: "https://localhost:5001;http://localhost:5000"
42777
+ ASPNETCORE_URLS: "https://localhost:7142;http://localhost:5142"
42617
42778
  }
42618
42779
  },
42619
42780
  {
@@ -42730,7 +42891,7 @@ npm install
42730
42891
  npm run dev
42731
42892
  \`\`\`
42732
42893
 
42733
- The frontend runs on http://localhost:3000 and proxies API calls to https://localhost:5001.
42894
+ The frontend runs on http://localhost:3000 and proxies API calls to http://localhost:5142.
42734
42895
 
42735
42896
  ## Project Structure
42736
42897
 
@@ -42755,7 +42916,7 @@ ${projectName}/
42755
42916
  ## Documentation
42756
42917
 
42757
42918
  - SmartStack: https://docs.smartstack.app
42758
- - API Reference: https://localhost:5001/scalar (when running)
42919
+ - API Reference: http://localhost:5142/scalar (when running)
42759
42920
 
42760
42921
  ---
42761
42922
 
@@ -42827,28 +42988,94 @@ async function createFrontendStructure(config, dryRun) {
42827
42988
  }
42828
42989
  };
42829
42990
  await import_fs_extra3.default.writeFile((0, import_path4.join)(webDir, "package.json"), JSON.stringify(packageJson, null, 2));
42830
- const viteConfig = `import { defineConfig } from 'vite';
42991
+ const envFile = `# =============================================================================
42992
+ # ${projectName} - Frontend Environment Configuration
42993
+ # =============================================================================
42994
+
42995
+ # Application name (displayed in UI)
42996
+ VITE_APP_NAME=${projectName}
42997
+
42998
+ # Backend API URL (used by Vite proxy in development)
42999
+ VITE_API_URL=http://localhost:5142
43000
+
43001
+ # WebSocket URL for SignalR (defaults to VITE_API_URL if not set)
43002
+ # VITE_WS_URL=http://localhost:5142
43003
+
43004
+ # Frontend development server port
43005
+ VITE_PORT=3000
43006
+
43007
+ # Public URL (for production deployment, used in OAuth callbacks)
43008
+ # VITE_PUBLIC_URL=https://myapp.example.com
43009
+
43010
+ # Feature flags
43011
+ # VITE_ENABLE_DEVTOOLS=true
43012
+ `;
43013
+ await import_fs_extra3.default.writeFile((0, import_path4.join)(webDir, ".env"), envFile);
43014
+ const envExampleFile = `# =============================================================================
43015
+ # ${projectName} - Frontend Environment Configuration
43016
+ # =============================================================================
43017
+ # Copy this file to .env and customize for your environment
43018
+ # .env is gitignored and should contain your local/production settings
43019
+
43020
+ # Application name (displayed in UI)
43021
+ VITE_APP_NAME=${projectName}
43022
+
43023
+ # Backend API URL (used by Vite proxy in development)
43024
+ # In production, configure your reverse proxy (nginx, etc.) to route /api to backend
43025
+ VITE_API_URL=http://localhost:5142
43026
+
43027
+ # WebSocket URL for SignalR (defaults to VITE_API_URL if not set)
43028
+ # Useful when WebSocket server runs on different host/port
43029
+ # VITE_WS_URL=http://localhost:5142
43030
+
43031
+ # Frontend development server port
43032
+ VITE_PORT=3000
43033
+
43034
+ # Public URL (for production deployment)
43035
+ # Used for OAuth callbacks and absolute URLs in emails
43036
+ # VITE_PUBLIC_URL=https://myapp.example.com
43037
+
43038
+ # Feature flags (optional)
43039
+ # VITE_ENABLE_DEVTOOLS=true
43040
+ `;
43041
+ await import_fs_extra3.default.writeFile((0, import_path4.join)(webDir, ".env.example"), envExampleFile);
43042
+ const viteConfig = `import { defineConfig, loadEnv } from 'vite';
42831
43043
  import react from '@vitejs/plugin-react';
42832
43044
  import tailwindcss from '@tailwindcss/vite';
42833
43045
 
42834
- export default defineConfig({
42835
- plugins: [react(), tailwindcss()],
42836
- server: {
42837
- port: 3000,
42838
- proxy: {
42839
- '/api': {
42840
- target: 'https://localhost:5001',
42841
- changeOrigin: true,
42842
- secure: false,
42843
- },
42844
- '/hubs': {
42845
- target: 'https://localhost:5001',
42846
- changeOrigin: true,
42847
- secure: false,
42848
- ws: true,
43046
+ export default defineConfig(({ mode }) => {
43047
+ const env = loadEnv(mode, process.cwd(), '');
43048
+
43049
+ // Configuration from environment
43050
+ const apiUrl = env.VITE_API_URL || 'http://localhost:5142';
43051
+ const wsUrl = env.VITE_WS_URL || apiUrl; // WebSocket URL defaults to API URL
43052
+ const port = parseInt(env.VITE_PORT || '3000', 10);
43053
+
43054
+ return {
43055
+ plugins: [react(), tailwindcss()],
43056
+ server: {
43057
+ port,
43058
+ proxy: {
43059
+ // API proxy - REST endpoints
43060
+ '/api': {
43061
+ target: apiUrl,
43062
+ changeOrigin: true,
43063
+ secure: false,
43064
+ },
43065
+ // SignalR WebSocket proxy
43066
+ '/hubs': {
43067
+ target: wsUrl,
43068
+ changeOrigin: true,
43069
+ secure: false,
43070
+ ws: true,
43071
+ },
42849
43072
  },
42850
43073
  },
42851
- },
43074
+ // Make env variables available to the app
43075
+ define: {
43076
+ __APP_NAME__: JSON.stringify(env.VITE_APP_NAME || '${projectName}'),
43077
+ },
43078
+ };
42852
43079
  });
42853
43080
  `;
42854
43081
  await import_fs_extra3.default.writeFile((0, import_path4.join)(webDir, "vite.config.ts"), viteConfig);
@@ -42905,7 +43132,7 @@ import './i18n';
42905
43132
  createRoot(document.getElementById('root')!).render(
42906
43133
  <StrictMode>
42907
43134
  <BrowserRouter>
42908
- <SmartStackProvider apiUrl="/api">
43135
+ <SmartStackProvider config={{ apiUrl: '/api' }}>
42909
43136
  <App />
42910
43137
  </SmartStackProvider>
42911
43138
  </BrowserRouter>
@@ -42913,29 +43140,29 @@ createRoot(document.getElementById('root')!).render(
42913
43140
  );
42914
43141
  `;
42915
43142
  await import_fs_extra3.default.writeFile((0, import_path4.join)(webDir, "src", "main.tsx"), mainTsx);
42916
- const appTsx = `import { Routes, Route } from 'react-router-dom';
42917
- import { ErrorBoundary } from 'react-error-boundary';
42918
- import HomePage from './pages/HomePage';
42919
-
42920
- function ErrorFallback({ error }: { error: Error }) {
42921
- return (
42922
- <div className="min-h-screen flex items-center justify-center bg-red-50">
42923
- <div className="text-center">
42924
- <h1 className="text-2xl font-bold text-red-600">Something went wrong</h1>
42925
- <pre className="mt-4 text-sm text-red-500">{error.message}</pre>
42926
- </div>
42927
- </div>
42928
- );
42929
- }
43143
+ const appTsx = `import { useRoutes, Navigate } from 'react-router-dom';
43144
+ import { smartstackRoutes, mergeRoutes } from '@atlashub/smartstack';
43145
+ import type { RouteConfig } from '@atlashub/smartstack';
43146
+
43147
+ /**
43148
+ * Client-specific routes
43149
+ * Add your custom routes here. Locked SmartStack paths cannot be overridden.
43150
+ */
43151
+ const clientRoutes: RouteConfig[] = [
43152
+ // Redirect root to login page
43153
+ { path: '/', element: <Navigate to="/login" replace /> },
43154
+ // Add your custom routes below:
43155
+ // { path: '/about', element: <AboutPage /> },
43156
+ ];
43157
+
43158
+ /**
43159
+ * Merged routes combining client and SmartStack routes
43160
+ */
43161
+ const routes = mergeRoutes(clientRoutes, smartstackRoutes);
42930
43162
 
42931
43163
  function App() {
42932
- return (
42933
- <ErrorBoundary FallbackComponent={ErrorFallback}>
42934
- <Routes>
42935
- <Route path="/" element={<HomePage />} />
42936
- </Routes>
42937
- </ErrorBoundary>
42938
- );
43164
+ const element = useRoutes(routes);
43165
+ return element;
42939
43166
  }
42940
43167
 
42941
43168
  export default App;
@@ -42944,44 +43171,6 @@ export default App;
42944
43171
  const indexCss = `@import "tailwindcss";
42945
43172
  `;
42946
43173
  await import_fs_extra3.default.writeFile((0, import_path4.join)(webDir, "src", "index.css"), indexCss);
42947
- const homePage = `import { useTranslation } from 'react-i18next';
42948
-
42949
- function HomePage() {
42950
- const { t } = useTranslation();
42951
-
42952
- return (
42953
- <div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100">
42954
- <div className="container mx-auto px-4 py-16">
42955
- <div className="text-center">
42956
- <h1 className="text-4xl font-bold text-gray-900 mb-4">
42957
- {t('welcome', '${projectName}')}
42958
- </h1>
42959
- <p className="text-lg text-gray-600 mb-8">
42960
- {t('description', 'Powered by SmartStack')}
42961
- </p>
42962
- <div className="flex justify-center gap-4">
42963
- <a
42964
- href="https://docs.smartstack.app"
42965
- className="px-6 py-3 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition"
42966
- >
42967
- Documentation
42968
- </a>
42969
- <a
42970
- href="/api/swagger"
42971
- className="px-6 py-3 bg-white text-indigo-600 border border-indigo-600 rounded-lg hover:bg-indigo-50 transition"
42972
- >
42973
- API Reference
42974
- </a>
42975
- </div>
42976
- </div>
42977
- </div>
42978
- </div>
42979
- );
42980
- }
42981
-
42982
- export default HomePage;
42983
- `;
42984
- await import_fs_extra3.default.writeFile((0, import_path4.join)(webDir, "src", "pages", "HomePage.tsx"), homePage);
42985
43174
  const i18nConfig = `import i18n from 'i18next';
42986
43175
  import { initReactI18next } from 'react-i18next';
42987
43176
  import LanguageDetector from 'i18next-browser-languagedetector';
@@ -43113,8 +43302,10 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
43113
43302
  \u2502 \u2022 Context7 MCP: Library documentation and code examples \u2502
43114
43303
  \u2502 \u2502
43115
43304
  \u2502 INSTALLATION: \u2502
43116
- \u2502 \u2192 SmartStack MCP: claude mcp add smartstack \u2502
43117
- \u2502 \u2192 Context7 MCP: claude mcp add context7 \u2502
43305
+ \u2502 1. npm install -g @atlashub/smartstack-mcp \u2502
43306
+ \u2502 2. npm install -g @upstash/context7-mcp \u2502
43307
+ \u2502 3. claude mcp add smartstack -- npx @atlashub/smartstack-mcp \u2502
43308
+ \u2502 4. claude mcp add context7 -- npx @upstash/context7-mcp \u2502
43118
43309
  \u2502 \u2502
43119
43310
  \u2502 Or use --skip-mcp-check to continue without MCP servers. \u2502
43120
43311
  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
@@ -43252,7 +43443,7 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
43252
43443
  "",
43253
43444
  source_default.bold("Documentation:"),
43254
43445
  ` SmartStack: ${source_default.cyan("https://docs.smartstack.app")}`,
43255
- ` API Reference: ${source_default.cyan("https://localhost:5001/scalar")} (when running)`,
43446
+ ` API Reference: ${source_default.cyan("http://localhost:5142/scalar")} (when running)`,
43256
43447
  ` Frontend: ${source_default.cyan("http://localhost:3000")} (when running)`
43257
43448
  ];
43258
43449
  logger.box(summary, "success");
@@ -43449,12 +43640,12 @@ var REQUIRED_MCP_SERVERS = [
43449
43640
  {
43450
43641
  name: "context7",
43451
43642
  description: "Library documentation and code examples",
43452
- installCommand: "claude mcp add context7"
43643
+ installCommand: "npm install -g @upstash/context7-mcp && claude mcp add context7 -- npx @upstash/context7-mcp"
43453
43644
  },
43454
43645
  {
43455
43646
  name: "smartstack",
43456
43647
  description: "SmartStack validation and scaffolding",
43457
- installCommand: "claude mcp add smartstack"
43648
+ installCommand: "npm install -g @atlashub/smartstack-mcp && claude mcp add smartstack -- npx @atlashub/smartstack-mcp"
43458
43649
  }
43459
43650
  ];
43460
43651
  function getInstalledMcpServers() {