@atlashub/smartstack-cli 1.5.0 → 1.5.2
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 +920 -916
- package/.documentation/apex.html +1022 -1018
- package/.documentation/business-analyse.html +1505 -1501
- package/.documentation/commands.html +684 -680
- package/.documentation/css/styles.css +2168 -2168
- package/.documentation/efcore.html +2509 -2505
- package/.documentation/gitflow.html +2622 -2618
- package/.documentation/hooks.html +417 -413
- package/.documentation/index.html +327 -323
- package/.documentation/init.html +565 -0
- package/.documentation/installation.html +548 -462
- package/.documentation/js/app.js +794 -794
- package/.documentation/ralph-loop.html +534 -530
- package/.documentation/test-web.html +517 -513
- package/config/default-config.json +86 -86
- package/config/settings.json +53 -53
- package/config/settings.local.example.json +16 -16
- package/dist/index.js +18 -8
- package/dist/index.js.map +1 -1
- package/package.json +88 -88
- package/templates/agents/action.md +36 -36
- package/templates/agents/efcore/conflicts.md +84 -84
- package/templates/agents/efcore/db-deploy.md +51 -51
- package/templates/agents/efcore/db-reset.md +59 -59
- package/templates/agents/efcore/db-seed.md +56 -56
- package/templates/agents/efcore/db-status.md +64 -64
- package/templates/agents/efcore/migration.md +85 -85
- package/templates/agents/efcore/rebase-snapshot.md +62 -62
- package/templates/agents/efcore/scan.md +90 -90
- package/templates/agents/efcore/squash.md +67 -67
- package/templates/agents/explore-codebase.md +65 -65
- package/templates/agents/explore-docs.md +97 -97
- package/templates/agents/fix-grammar.md +49 -49
- package/templates/agents/gitflow/abort.md +45 -45
- package/templates/agents/gitflow/cleanup.md +85 -85
- package/templates/agents/gitflow/commit.md +40 -40
- package/templates/agents/gitflow/exec.md +48 -48
- package/templates/agents/gitflow/finish.md +92 -92
- package/templates/agents/gitflow/init.md +139 -139
- package/templates/agents/gitflow/merge.md +62 -62
- package/templates/agents/gitflow/plan.md +42 -42
- package/templates/agents/gitflow/pr.md +78 -78
- package/templates/agents/gitflow/review.md +49 -49
- package/templates/agents/gitflow/start.md +61 -61
- package/templates/agents/gitflow/status.md +32 -32
- package/templates/agents/snipper.md +36 -36
- package/templates/agents/websearch.md +46 -46
- package/templates/commands/_resources/formatting-guide.md +124 -124
- package/templates/commands/ai-prompt.md +315 -315
- package/templates/commands/apex/1-analyze.md +100 -100
- package/templates/commands/apex/2-plan.md +145 -145
- package/templates/commands/apex/3-execute.md +171 -171
- package/templates/commands/apex/4-examine.md +116 -116
- package/templates/commands/apex/5-tasks.md +209 -209
- package/templates/commands/apex.md +76 -76
- package/templates/commands/application/create.md +362 -362
- package/templates/commands/application/templates-backend.md +463 -463
- package/templates/commands/application/templates-frontend.md +517 -517
- package/templates/commands/application/templates-i18n.md +478 -478
- package/templates/commands/application/templates-seed.md +362 -362
- package/templates/commands/application.md +303 -303
- package/templates/commands/business-analyse/0-orchestrate.md +640 -640
- package/templates/commands/business-analyse/1-init.md +269 -269
- package/templates/commands/business-analyse/2-discover.md +520 -520
- package/templates/commands/business-analyse/3-analyse.md +408 -408
- package/templates/commands/business-analyse/4-specify.md +598 -598
- package/templates/commands/business-analyse/5-validate.md +326 -326
- package/templates/commands/business-analyse/6-handoff.md +746 -746
- package/templates/commands/business-analyse/7-doc-html.md +602 -602
- package/templates/commands/business-analyse/bug.md +325 -325
- package/templates/commands/business-analyse/change-request.md +368 -368
- package/templates/commands/business-analyse/hotfix.md +200 -200
- package/templates/commands/business-analyse.md +640 -640
- package/templates/commands/controller/create.md +216 -216
- package/templates/commands/controller/postman-templates.md +528 -528
- package/templates/commands/controller/templates.md +600 -600
- package/templates/commands/controller.md +337 -337
- package/templates/commands/create/agent.md +138 -138
- package/templates/commands/create/command.md +166 -166
- package/templates/commands/create/hook.md +234 -234
- package/templates/commands/create/plugin.md +329 -329
- package/templates/commands/create/project.md +507 -507
- package/templates/commands/create/skill.md +199 -199
- package/templates/commands/create.md +220 -220
- package/templates/commands/debug.md +95 -95
- package/templates/commands/documentation/module.md +202 -202
- package/templates/commands/documentation/templates.md +432 -432
- package/templates/commands/documentation.md +190 -190
- package/templates/commands/efcore/_env-check.md +153 -153
- package/templates/commands/efcore/conflicts.md +186 -186
- package/templates/commands/efcore/db-deploy.md +193 -193
- package/templates/commands/efcore/db-reset.md +426 -426
- package/templates/commands/efcore/db-seed.md +326 -326
- package/templates/commands/efcore/db-status.md +226 -226
- package/templates/commands/efcore/migration.md +400 -400
- package/templates/commands/efcore/rebase-snapshot.md +264 -264
- package/templates/commands/efcore/scan.md +198 -198
- package/templates/commands/efcore/squash.md +298 -298
- package/templates/commands/efcore.md +224 -224
- package/templates/commands/epct.md +69 -69
- package/templates/commands/explain.md +186 -186
- package/templates/commands/explore.md +45 -45
- package/templates/commands/feature-full.md +267 -267
- package/templates/commands/gitflow/1-init.md +1038 -1038
- package/templates/commands/gitflow/10-start.md +768 -768
- package/templates/commands/gitflow/11-finish.md +457 -457
- package/templates/commands/gitflow/12-cleanup.md +276 -276
- package/templates/commands/gitflow/13-sync.md +216 -216
- package/templates/commands/gitflow/14-rebase.md +251 -251
- package/templates/commands/gitflow/2-status.md +277 -277
- package/templates/commands/gitflow/3-commit.md +344 -344
- package/templates/commands/gitflow/4-plan.md +145 -145
- package/templates/commands/gitflow/5-exec.md +147 -147
- package/templates/commands/gitflow/6-abort.md +344 -344
- package/templates/commands/gitflow/7-pull-request.md +453 -355
- package/templates/commands/gitflow/8-review.md +240 -176
- package/templates/commands/gitflow/9-merge.md +451 -365
- package/templates/commands/gitflow.md +128 -128
- package/templates/commands/implement.md +663 -663
- package/templates/commands/init.md +567 -562
- package/templates/commands/mcp-integration.md +330 -330
- package/templates/commands/notification.md +129 -129
- package/templates/commands/oneshot.md +57 -57
- package/templates/commands/quick-search.md +72 -72
- package/templates/commands/ralph-loop/cancel-ralph.md +18 -18
- package/templates/commands/ralph-loop/help.md +126 -126
- package/templates/commands/ralph-loop/ralph-loop.md +18 -18
- package/templates/commands/review.md +106 -106
- package/templates/commands/utils/test-web-config.md +160 -160
- package/templates/commands/utils/test-web.md +151 -151
- package/templates/commands/validate.md +233 -233
- package/templates/commands/workflow.md +193 -193
- package/templates/gitflow/config.json +138 -138
- package/templates/hooks/ef-migration-check.md +139 -139
- package/templates/hooks/hooks.json +25 -25
- package/templates/hooks/stop-hook.sh +177 -177
- package/templates/skills/ai-prompt/SKILL.md +778 -778
- package/templates/skills/application/SKILL.md +563 -563
- package/templates/skills/application/templates-backend.md +450 -450
- package/templates/skills/application/templates-frontend.md +531 -531
- package/templates/skills/application/templates-i18n.md +520 -520
- package/templates/skills/application/templates-seed.md +647 -647
- package/templates/skills/business-analyse/SKILL.md +191 -191
- package/templates/skills/business-analyse/questionnaire.md +283 -283
- package/templates/skills/business-analyse/templates-frd.md +477 -477
- package/templates/skills/business-analyse/templates-react.md +580 -580
- package/templates/skills/controller/SKILL.md +240 -240
- package/templates/skills/controller/postman-templates.md +614 -614
- package/templates/skills/controller/templates.md +1468 -1468
- package/templates/skills/documentation/SKILL.md +133 -133
- package/templates/skills/documentation/templates.md +476 -476
- package/templates/skills/feature-full/SKILL.md +838 -838
- package/templates/skills/notification/SKILL.md +555 -555
- package/templates/skills/ui-components/SKILL.md +870 -870
- package/templates/skills/workflow/SKILL.md +582 -582
- package/templates/test-web/api-health.json +38 -38
- package/templates/test-web/minimal.json +19 -19
- package/templates/test-web/npm-package.json +46 -46
- package/templates/test-web/seo-check.json +54 -54
|
@@ -1,507 +1,507 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Create a full-stack SmartStack project (Clean Architecture .NET + React/Vite/Tailwind)
|
|
3
|
-
argument-hint: <project-name> [description]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Create SmartStack Project
|
|
7
|
-
|
|
8
|
-
Scaffold a complete full-stack project with:
|
|
9
|
-
- **Backend**: .NET 10 Clean Architecture (Domain, Application, Infrastructure, Api)
|
|
10
|
-
- **Frontend**: React 19 + TypeScript + Vite + Tailwind CSS
|
|
11
|
-
|
|
12
|
-
## Arguments
|
|
13
|
-
|
|
14
|
-
Parse from `$ARGUMENTS`:
|
|
15
|
-
- **name** (required): Project name in PascalCase (e.g., `MyProject`)
|
|
16
|
-
- **description** (optional): Project description
|
|
17
|
-
|
|
18
|
-
## Project Structure
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
{ProjectName}/
|
|
22
|
-
├── .gitignore
|
|
23
|
-
├── .claudeignore
|
|
24
|
-
├── README.md
|
|
25
|
-
├── CLAUDE.md
|
|
26
|
-
├── LICENSE
|
|
27
|
-
├── Directory.Build.props
|
|
28
|
-
├── {ProjectName}.sln
|
|
29
|
-
│
|
|
30
|
-
├── src/
|
|
31
|
-
│ ├── {ProjectName}.Domain/
|
|
32
|
-
│ │ ├── {ProjectName}.Domain.csproj
|
|
33
|
-
│ │ ├── Common/
|
|
34
|
-
│ │ │ ├── BaseEntity.cs
|
|
35
|
-
│ │ │ ├── IAuditableEntity.cs
|
|
36
|
-
│ │ │ └── IDomainEvent.cs
|
|
37
|
-
│ │ ├── Entities/
|
|
38
|
-
│ │ ├── Enums/
|
|
39
|
-
│ │ ├── Exceptions/
|
|
40
|
-
│ │ │ └── DomainException.cs
|
|
41
|
-
│ │ └── ValueObjects/
|
|
42
|
-
│ │
|
|
43
|
-
│ ├── {ProjectName}.Application/
|
|
44
|
-
│ │ ├── {ProjectName}.Application.csproj
|
|
45
|
-
│ │ ├── Common/
|
|
46
|
-
│ │ │ ├── Behaviors/
|
|
47
|
-
│ │ │ │ ├── ValidationBehavior.cs
|
|
48
|
-
│ │ │ │ └── LoggingBehavior.cs
|
|
49
|
-
│ │ │ ├── Interfaces/
|
|
50
|
-
│ │ │ │ ├── IApplicationDbContext.cs
|
|
51
|
-
│ │ │ │ └── ICurrentUserService.cs
|
|
52
|
-
│ │ │ └── Models/
|
|
53
|
-
│ │ │ └── Result.cs
|
|
54
|
-
│ │ ├── Features/
|
|
55
|
-
│ │ │ └── .gitkeep
|
|
56
|
-
│ │ └── DependencyInjection.cs
|
|
57
|
-
│ │
|
|
58
|
-
│ ├── {ProjectName}.Infrastructure/
|
|
59
|
-
│ │ ├── {ProjectName}.Infrastructure.csproj
|
|
60
|
-
│ │ ├── Persistence/
|
|
61
|
-
│ │ │ ├── ApplicationDbContext.cs
|
|
62
|
-
│ │ │ ├── Configurations/
|
|
63
|
-
│ │ │ │ └── .gitkeep
|
|
64
|
-
│ │ │ ├── Migrations/
|
|
65
|
-
│ │ │ │ └── .gitkeep
|
|
66
|
-
│ │ │ └── Seeding/
|
|
67
|
-
│ │ │ └── DatabaseSeeder.cs
|
|
68
|
-
│ │ ├── Services/
|
|
69
|
-
│ │ │ └── DateTimeService.cs
|
|
70
|
-
│ │ └── DependencyInjection.cs
|
|
71
|
-
│ │
|
|
72
|
-
│ ├── {ProjectName}.Api.Core/
|
|
73
|
-
│ │ ├── {ProjectName}.Api.Core.csproj
|
|
74
|
-
│ │ ├── Controllers/
|
|
75
|
-
│ │ │ └── BaseApiController.cs
|
|
76
|
-
│ │ ├── Extensions/
|
|
77
|
-
│ │ │ └── ServiceCollectionExtensions.cs
|
|
78
|
-
│ │ ├── Middleware/
|
|
79
|
-
│ │ │ └── ExceptionHandlingMiddleware.cs
|
|
80
|
-
│ │ └── Hubs/
|
|
81
|
-
│ │ └── NotificationHub.cs
|
|
82
|
-
│ │
|
|
83
|
-
│ └── {ProjectName}.Api/
|
|
84
|
-
│ ├── {ProjectName}.Api.csproj
|
|
85
|
-
│ ├── Properties/
|
|
86
|
-
│ │ └── launchSettings.json
|
|
87
|
-
│ ├── appsettings.json
|
|
88
|
-
│ ├── appsettings.Development.json
|
|
89
|
-
│ ├── appsettings.Production.json
|
|
90
|
-
│ └── Program.cs
|
|
91
|
-
│
|
|
92
|
-
├── web/
|
|
93
|
-
│ └── {project-name}-web/
|
|
94
|
-
│ ├── package.json
|
|
95
|
-
│ ├── tsconfig.json
|
|
96
|
-
│ ├── tsconfig.app.json
|
|
97
|
-
│ ├── tsconfig.node.json
|
|
98
|
-
│ ├── vite.config.ts
|
|
99
|
-
│ ├── eslint.config.mjs
|
|
100
|
-
│ ├── tailwind.config.js
|
|
101
|
-
│ ├── postcss.config.js
|
|
102
|
-
│ ├── index.html
|
|
103
|
-
│ ├── .env.example
|
|
104
|
-
│ └── src/
|
|
105
|
-
│ ├── main.tsx
|
|
106
|
-
│ ├── App.tsx
|
|
107
|
-
│ ├── index.css
|
|
108
|
-
│ ├── vite-env.d.ts
|
|
109
|
-
│ ├── components/
|
|
110
|
-
│ │ ├── layout/
|
|
111
|
-
│ │ │ ├── Header.tsx
|
|
112
|
-
│ │ │ ├── Sidebar.tsx
|
|
113
|
-
│ │ │ └── Footer.tsx
|
|
114
|
-
│ │ └── ui/
|
|
115
|
-
│ │ ├── Button.tsx
|
|
116
|
-
│ │ └── Card.tsx
|
|
117
|
-
│ ├── pages/
|
|
118
|
-
│ │ ├── HomePage.tsx
|
|
119
|
-
│ │ └── NotFoundPage.tsx
|
|
120
|
-
│ ├── hooks/
|
|
121
|
-
│ │ └── useApi.ts
|
|
122
|
-
│ ├── contexts/
|
|
123
|
-
│ │ ├── AuthContext.tsx
|
|
124
|
-
│ │ └── ThemeContext.tsx
|
|
125
|
-
│ ├── services/
|
|
126
|
-
│ │ └── api/
|
|
127
|
-
│ │ └── client.ts
|
|
128
|
-
│ ├── types/
|
|
129
|
-
│ │ └── index.ts
|
|
130
|
-
│ ├── utils/
|
|
131
|
-
│ │ └── helpers.ts
|
|
132
|
-
│ └── config/
|
|
133
|
-
│ └── constants.ts
|
|
134
|
-
│
|
|
135
|
-
├── tests/
|
|
136
|
-
│ └── {ProjectName}.Tests/
|
|
137
|
-
│ └── {ProjectName}.Tests.csproj
|
|
138
|
-
│
|
|
139
|
-
└── tools/
|
|
140
|
-
└── .gitkeep
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## Workflow
|
|
144
|
-
|
|
145
|
-
### 1. PARSE & VALIDATE
|
|
146
|
-
|
|
147
|
-
Extract from `$ARGUMENTS`:
|
|
148
|
-
```
|
|
149
|
-
name: PascalCase project name (e.g., "MyProject")
|
|
150
|
-
description: Optional description
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Validate:
|
|
154
|
-
- Name is PascalCase: `^[A-Z][a-zA-Z0-9]*$`
|
|
155
|
-
- Directory doesn't exist
|
|
156
|
-
- Name is not a reserved word
|
|
157
|
-
|
|
158
|
-
### 2. CREATE ROOT STRUCTURE
|
|
159
|
-
|
|
160
|
-
Use Bash to create directories:
|
|
161
|
-
```bash
|
|
162
|
-
mkdir -p {ProjectName}/src
|
|
163
|
-
mkdir -p {ProjectName}/web
|
|
164
|
-
mkdir -p {ProjectName}/tests
|
|
165
|
-
mkdir -p {ProjectName}/tools
|
|
166
|
-
mkdir -p {ProjectName}/scripts
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### 3. GENERATE BACKEND FILES
|
|
170
|
-
|
|
171
|
-
For each backend project, use Write tool to create:
|
|
172
|
-
|
|
173
|
-
#### 3.1 Directory.Build.props
|
|
174
|
-
```xml
|
|
175
|
-
<Project>
|
|
176
|
-
<PropertyGroup>
|
|
177
|
-
<TargetFramework>net10.0</TargetFramework>
|
|
178
|
-
<ImplicitUsings>enable</ImplicitUsings>
|
|
179
|
-
<Nullable>enable</Nullable>
|
|
180
|
-
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
181
|
-
<Version>1.0.0</Version>
|
|
182
|
-
<Authors>{Author}</Authors>
|
|
183
|
-
<Company>{Company}</Company>
|
|
184
|
-
</PropertyGroup>
|
|
185
|
-
</Project>
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
#### 3.2 Solution File ({ProjectName}.sln)
|
|
189
|
-
Use `dotnet new sln` and `dotnet sln add` commands.
|
|
190
|
-
|
|
191
|
-
#### 3.3 Domain Project
|
|
192
|
-
- Create .csproj with MediatR.Contracts
|
|
193
|
-
- Create BaseEntity.cs, IDomainEvent.cs
|
|
194
|
-
- Create folder structure
|
|
195
|
-
|
|
196
|
-
#### 3.4 Application Project
|
|
197
|
-
- Create .csproj with MediatR, FluentValidation
|
|
198
|
-
- Create Result.cs, ValidationBehavior.cs
|
|
199
|
-
- Create DependencyInjection.cs
|
|
200
|
-
|
|
201
|
-
#### 3.5 Infrastructure Project
|
|
202
|
-
- Create .csproj with EF Core, SqlServer
|
|
203
|
-
- Create ApplicationDbContext.cs
|
|
204
|
-
- Create DependencyInjection.cs
|
|
205
|
-
|
|
206
|
-
#### 3.6 Api.Core Project
|
|
207
|
-
- Create .csproj with ASP.NET Core
|
|
208
|
-
- Create BaseApiController.cs
|
|
209
|
-
- Create ExceptionHandlingMiddleware.cs
|
|
210
|
-
|
|
211
|
-
#### 3.7 Api Project
|
|
212
|
-
- Create .csproj as entry point
|
|
213
|
-
- Create Program.cs with full bootstrap
|
|
214
|
-
- Create appsettings.json files
|
|
215
|
-
|
|
216
|
-
### 4. GENERATE FRONTEND FILES
|
|
217
|
-
|
|
218
|
-
#### 4.1 package.json
|
|
219
|
-
```json
|
|
220
|
-
{
|
|
221
|
-
"name": "{project-name}-web",
|
|
222
|
-
"private": true,
|
|
223
|
-
"version": "1.0.0",
|
|
224
|
-
"type": "module",
|
|
225
|
-
"scripts": {
|
|
226
|
-
"dev": "vite",
|
|
227
|
-
"build": "tsc -b && vite build",
|
|
228
|
-
"lint": "eslint .",
|
|
229
|
-
"preview": "vite preview"
|
|
230
|
-
},
|
|
231
|
-
"dependencies": {
|
|
232
|
-
"react": "^19.0.0",
|
|
233
|
-
"react-dom": "^19.0.0",
|
|
234
|
-
"react-router-dom": "^7.0.0",
|
|
235
|
-
"axios": "^1.7.0",
|
|
236
|
-
"@microsoft/signalr": "^8.0.0",
|
|
237
|
-
"lucide-react": "^0.400.0"
|
|
238
|
-
},
|
|
239
|
-
"devDependencies": {
|
|
240
|
-
"@types/react": "^19.0.0",
|
|
241
|
-
"@types/react-dom": "^19.0.0",
|
|
242
|
-
"@vitejs/plugin-react": "^4.3.0",
|
|
243
|
-
"typescript": "~5.6.0",
|
|
244
|
-
"vite": "^6.0.0",
|
|
245
|
-
"tailwindcss": "^4.0.0",
|
|
246
|
-
"@tailwindcss/vite": "^4.0.0",
|
|
247
|
-
"eslint": "^9.0.0"
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
#### 4.2 vite.config.ts
|
|
253
|
-
```typescript
|
|
254
|
-
import { defineConfig } from 'vite'
|
|
255
|
-
import react from '@vitejs/plugin-react'
|
|
256
|
-
import tailwindcss from '@tailwindcss/vite'
|
|
257
|
-
|
|
258
|
-
export default defineConfig({
|
|
259
|
-
plugins: [react(), tailwindcss()],
|
|
260
|
-
server: {
|
|
261
|
-
port: 5173,
|
|
262
|
-
proxy: {
|
|
263
|
-
'/api': 'http://localhost:5000'
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
})
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
#### 4.3 React Components
|
|
270
|
-
- Create App.tsx with router setup
|
|
271
|
-
- Create basic layout components
|
|
272
|
-
- Create context providers
|
|
273
|
-
- Create API client
|
|
274
|
-
|
|
275
|
-
### 5. GENERATE CONFIGURATION FILES
|
|
276
|
-
|
|
277
|
-
#### .gitignore
|
|
278
|
-
```
|
|
279
|
-
# .NET
|
|
280
|
-
bin/
|
|
281
|
-
obj/
|
|
282
|
-
*.user
|
|
283
|
-
*.suo
|
|
284
|
-
appsettings.Local.json
|
|
285
|
-
|
|
286
|
-
# Node
|
|
287
|
-
node_modules/
|
|
288
|
-
dist/
|
|
289
|
-
.env.local
|
|
290
|
-
|
|
291
|
-
# IDE
|
|
292
|
-
.vs/
|
|
293
|
-
.vscode/
|
|
294
|
-
.idea/
|
|
295
|
-
|
|
296
|
-
# OS
|
|
297
|
-
.DS_Store
|
|
298
|
-
Thumbs.db
|
|
299
|
-
|
|
300
|
-
# Logs
|
|
301
|
-
*.log
|
|
302
|
-
logs/
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
#### CLAUDE.md
|
|
306
|
-
```markdown
|
|
307
|
-
# {ProjectName} Architecture Memory
|
|
308
|
-
|
|
309
|
-
## Project Overview
|
|
310
|
-
{description}
|
|
311
|
-
|
|
312
|
-
## Technology Stack
|
|
313
|
-
- Backend: .NET 10, EF Core, Clean Architecture
|
|
314
|
-
- Frontend: React 19, TypeScript, Vite, Tailwind CSS
|
|
315
|
-
- Database: SQL Server
|
|
316
|
-
|
|
317
|
-
## Architecture
|
|
318
|
-
Clean Architecture with CQRS pattern.
|
|
319
|
-
|
|
320
|
-
## Conventions
|
|
321
|
-
- Use MediatR for commands/queries
|
|
322
|
-
- Use FluentValidation for validation
|
|
323
|
-
- Use Result<T> for operation results
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
### 6. INITIALIZE GIT & DOTNET
|
|
327
|
-
|
|
328
|
-
```bash
|
|
329
|
-
cd {ProjectName}
|
|
330
|
-
git init
|
|
331
|
-
dotnet new sln -n {ProjectName}
|
|
332
|
-
dotnet sln add src/{ProjectName}.Domain
|
|
333
|
-
dotnet sln add src/{ProjectName}.Application
|
|
334
|
-
dotnet sln add src/{ProjectName}.Infrastructure
|
|
335
|
-
dotnet sln add src/{ProjectName}.Api.Core
|
|
336
|
-
dotnet sln add src/{ProjectName}.Api
|
|
337
|
-
dotnet restore
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
### 7. DISPLAY SUCCESS
|
|
341
|
-
|
|
342
|
-
```
|
|
343
|
-
╔═══════════════════════════════════════════════════════════════╗
|
|
344
|
-
║ SMARTSTACK PROJECT CREATED ║
|
|
345
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
346
|
-
║ Name: {ProjectName} ║
|
|
347
|
-
║ Location: {full-path} ║
|
|
348
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
349
|
-
║ Backend: ║
|
|
350
|
-
║ ✓ {ProjectName}.Domain (Core entities) ║
|
|
351
|
-
║ ✓ {ProjectName}.Application (CQRS, Use cases) ║
|
|
352
|
-
║ ✓ {ProjectName}.Infrastructure (EF Core, Services) ║
|
|
353
|
-
║ ✓ {ProjectName}.Api.Core (Controllers, Middleware) ║
|
|
354
|
-
║ ✓ {ProjectName}.Api (Entry point) ║
|
|
355
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
356
|
-
║ Frontend: ║
|
|
357
|
-
║ ✓ {project-name}-web (React + Vite + Tailwind) ║
|
|
358
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
359
|
-
║ Next steps: ║
|
|
360
|
-
║ 1. cd {ProjectName} ║
|
|
361
|
-
║ 2. dotnet build ║
|
|
362
|
-
║ 3. cd web/{project-name}-web && npm install ║
|
|
363
|
-
║ 4. Configure appsettings.Local.json ║
|
|
364
|
-
║ 5. dotnet ef database update ║
|
|
365
|
-
║ 6. dotnet run --project src/{ProjectName}.Api ║
|
|
366
|
-
║ 7. npm run dev (in web folder) ║
|
|
367
|
-
╚═══════════════════════════════════════════════════════════════╝
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
## File Templates
|
|
371
|
-
|
|
372
|
-
### Domain/BaseEntity.cs
|
|
373
|
-
```csharp
|
|
374
|
-
namespace {ProjectName}.Domain.Common;
|
|
375
|
-
|
|
376
|
-
public abstract class BaseEntity
|
|
377
|
-
{
|
|
378
|
-
public Guid Id { get; protected set; } = Guid.NewGuid();
|
|
379
|
-
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
380
|
-
public DateTime? UpdatedAt { get; set; }
|
|
381
|
-
public string? CreatedBy { get; set; }
|
|
382
|
-
public string? UpdatedBy { get; set; }
|
|
383
|
-
}
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
### Application/Result.cs
|
|
387
|
-
```csharp
|
|
388
|
-
namespace {ProjectName}.Application.Common.Models;
|
|
389
|
-
|
|
390
|
-
public class Result<T>
|
|
391
|
-
{
|
|
392
|
-
public bool IsSuccess { get; }
|
|
393
|
-
public T? Value { get; }
|
|
394
|
-
public string? Error { get; }
|
|
395
|
-
|
|
396
|
-
private Result(bool isSuccess, T? value, string? error)
|
|
397
|
-
{
|
|
398
|
-
IsSuccess = isSuccess;
|
|
399
|
-
Value = value;
|
|
400
|
-
Error = error;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
public static Result<T> Success(T value) => new(true, value, null);
|
|
404
|
-
public static Result<T> Failure(string error) => new(false, default, error);
|
|
405
|
-
}
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
### Infrastructure/ApplicationDbContext.cs
|
|
409
|
-
```csharp
|
|
410
|
-
using Microsoft.EntityFrameworkCore;
|
|
411
|
-
using {ProjectName}.Application.Common.Interfaces;
|
|
412
|
-
|
|
413
|
-
namespace {ProjectName}.Infrastructure.Persistence;
|
|
414
|
-
|
|
415
|
-
public class ApplicationDbContext : DbContext, IApplicationDbContext
|
|
416
|
-
{
|
|
417
|
-
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
|
|
418
|
-
: base(options)
|
|
419
|
-
{
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
423
|
-
{
|
|
424
|
-
modelBuilder.ApplyConfigurationsFromAssembly(typeof(ApplicationDbContext).Assembly);
|
|
425
|
-
base.OnModelCreating(modelBuilder);
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
### Api/Program.cs
|
|
431
|
-
```csharp
|
|
432
|
-
using {ProjectName}.Application;
|
|
433
|
-
using {ProjectName}.Infrastructure;
|
|
434
|
-
using {ProjectName}.Api.Core.Extensions;
|
|
435
|
-
|
|
436
|
-
var builder = WebApplication.CreateBuilder(args);
|
|
437
|
-
|
|
438
|
-
// Add services
|
|
439
|
-
builder.Services.AddApplication();
|
|
440
|
-
builder.Services.AddInfrastructure(builder.Configuration);
|
|
441
|
-
builder.Services.AddApiCore();
|
|
442
|
-
|
|
443
|
-
builder.Services.AddControllers();
|
|
444
|
-
builder.Services.AddEndpointsApiExplorer();
|
|
445
|
-
builder.Services.AddSwaggerGen();
|
|
446
|
-
builder.Services.AddSignalR();
|
|
447
|
-
|
|
448
|
-
var app = builder.Build();
|
|
449
|
-
|
|
450
|
-
// Configure pipeline
|
|
451
|
-
if (app.Environment.IsDevelopment())
|
|
452
|
-
{
|
|
453
|
-
app.UseSwagger();
|
|
454
|
-
app.UseSwaggerUI();
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
app.UseHttpsRedirection();
|
|
458
|
-
app.UseAuthentication();
|
|
459
|
-
app.UseAuthorization();
|
|
460
|
-
app.MapControllers();
|
|
461
|
-
app.MapHub<NotificationHub>("/hubs/notifications");
|
|
462
|
-
|
|
463
|
-
app.Run();
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
### Frontend/App.tsx
|
|
467
|
-
```tsx
|
|
468
|
-
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
|
469
|
-
import { AuthProvider } from './contexts/AuthContext';
|
|
470
|
-
import { ThemeProvider } from './contexts/ThemeContext';
|
|
471
|
-
import HomePage from './pages/HomePage';
|
|
472
|
-
import NotFoundPage from './pages/NotFoundPage';
|
|
473
|
-
|
|
474
|
-
function App() {
|
|
475
|
-
return (
|
|
476
|
-
<ThemeProvider>
|
|
477
|
-
<AuthProvider>
|
|
478
|
-
<BrowserRouter>
|
|
479
|
-
<Routes>
|
|
480
|
-
<Route path="/" element={<HomePage />} />
|
|
481
|
-
<Route path="*" element={<NotFoundPage />} />
|
|
482
|
-
</Routes>
|
|
483
|
-
</BrowserRouter>
|
|
484
|
-
</AuthProvider>
|
|
485
|
-
</ThemeProvider>
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
export default App;
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
## Execution Rules
|
|
493
|
-
|
|
494
|
-
1. **ALWAYS** create all directories before files
|
|
495
|
-
2. **USE** Write tool for each file (not batch)
|
|
496
|
-
3. **USE** Bash for dotnet commands
|
|
497
|
-
4. **VALIDATE** project name is PascalCase
|
|
498
|
-
5. **NEVER** overwrite existing directories
|
|
499
|
-
6. Create files in this order: root → backend → frontend → config
|
|
500
|
-
|
|
501
|
-
## Priority
|
|
502
|
-
|
|
503
|
-
Correctness > Completeness > Speed
|
|
504
|
-
|
|
505
|
-
---
|
|
506
|
-
|
|
507
|
-
User: $ARGUMENTS
|
|
1
|
+
---
|
|
2
|
+
description: Create a full-stack SmartStack project (Clean Architecture .NET + React/Vite/Tailwind)
|
|
3
|
+
argument-hint: <project-name> [description]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create SmartStack Project
|
|
7
|
+
|
|
8
|
+
Scaffold a complete full-stack project with:
|
|
9
|
+
- **Backend**: .NET 10 Clean Architecture (Domain, Application, Infrastructure, Api)
|
|
10
|
+
- **Frontend**: React 19 + TypeScript + Vite + Tailwind CSS
|
|
11
|
+
|
|
12
|
+
## Arguments
|
|
13
|
+
|
|
14
|
+
Parse from `$ARGUMENTS`:
|
|
15
|
+
- **name** (required): Project name in PascalCase (e.g., `MyProject`)
|
|
16
|
+
- **description** (optional): Project description
|
|
17
|
+
|
|
18
|
+
## Project Structure
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
{ProjectName}/
|
|
22
|
+
├── .gitignore
|
|
23
|
+
├── .claudeignore
|
|
24
|
+
├── README.md
|
|
25
|
+
├── CLAUDE.md
|
|
26
|
+
├── LICENSE
|
|
27
|
+
├── Directory.Build.props
|
|
28
|
+
├── {ProjectName}.sln
|
|
29
|
+
│
|
|
30
|
+
├── src/
|
|
31
|
+
│ ├── {ProjectName}.Domain/
|
|
32
|
+
│ │ ├── {ProjectName}.Domain.csproj
|
|
33
|
+
│ │ ├── Common/
|
|
34
|
+
│ │ │ ├── BaseEntity.cs
|
|
35
|
+
│ │ │ ├── IAuditableEntity.cs
|
|
36
|
+
│ │ │ └── IDomainEvent.cs
|
|
37
|
+
│ │ ├── Entities/
|
|
38
|
+
│ │ ├── Enums/
|
|
39
|
+
│ │ ├── Exceptions/
|
|
40
|
+
│ │ │ └── DomainException.cs
|
|
41
|
+
│ │ └── ValueObjects/
|
|
42
|
+
│ │
|
|
43
|
+
│ ├── {ProjectName}.Application/
|
|
44
|
+
│ │ ├── {ProjectName}.Application.csproj
|
|
45
|
+
│ │ ├── Common/
|
|
46
|
+
│ │ │ ├── Behaviors/
|
|
47
|
+
│ │ │ │ ├── ValidationBehavior.cs
|
|
48
|
+
│ │ │ │ └── LoggingBehavior.cs
|
|
49
|
+
│ │ │ ├── Interfaces/
|
|
50
|
+
│ │ │ │ ├── IApplicationDbContext.cs
|
|
51
|
+
│ │ │ │ └── ICurrentUserService.cs
|
|
52
|
+
│ │ │ └── Models/
|
|
53
|
+
│ │ │ └── Result.cs
|
|
54
|
+
│ │ ├── Features/
|
|
55
|
+
│ │ │ └── .gitkeep
|
|
56
|
+
│ │ └── DependencyInjection.cs
|
|
57
|
+
│ │
|
|
58
|
+
│ ├── {ProjectName}.Infrastructure/
|
|
59
|
+
│ │ ├── {ProjectName}.Infrastructure.csproj
|
|
60
|
+
│ │ ├── Persistence/
|
|
61
|
+
│ │ │ ├── ApplicationDbContext.cs
|
|
62
|
+
│ │ │ ├── Configurations/
|
|
63
|
+
│ │ │ │ └── .gitkeep
|
|
64
|
+
│ │ │ ├── Migrations/
|
|
65
|
+
│ │ │ │ └── .gitkeep
|
|
66
|
+
│ │ │ └── Seeding/
|
|
67
|
+
│ │ │ └── DatabaseSeeder.cs
|
|
68
|
+
│ │ ├── Services/
|
|
69
|
+
│ │ │ └── DateTimeService.cs
|
|
70
|
+
│ │ └── DependencyInjection.cs
|
|
71
|
+
│ │
|
|
72
|
+
│ ├── {ProjectName}.Api.Core/
|
|
73
|
+
│ │ ├── {ProjectName}.Api.Core.csproj
|
|
74
|
+
│ │ ├── Controllers/
|
|
75
|
+
│ │ │ └── BaseApiController.cs
|
|
76
|
+
│ │ ├── Extensions/
|
|
77
|
+
│ │ │ └── ServiceCollectionExtensions.cs
|
|
78
|
+
│ │ ├── Middleware/
|
|
79
|
+
│ │ │ └── ExceptionHandlingMiddleware.cs
|
|
80
|
+
│ │ └── Hubs/
|
|
81
|
+
│ │ └── NotificationHub.cs
|
|
82
|
+
│ │
|
|
83
|
+
│ └── {ProjectName}.Api/
|
|
84
|
+
│ ├── {ProjectName}.Api.csproj
|
|
85
|
+
│ ├── Properties/
|
|
86
|
+
│ │ └── launchSettings.json
|
|
87
|
+
│ ├── appsettings.json
|
|
88
|
+
│ ├── appsettings.Development.json
|
|
89
|
+
│ ├── appsettings.Production.json
|
|
90
|
+
│ └── Program.cs
|
|
91
|
+
│
|
|
92
|
+
├── web/
|
|
93
|
+
│ └── {project-name}-web/
|
|
94
|
+
│ ├── package.json
|
|
95
|
+
│ ├── tsconfig.json
|
|
96
|
+
│ ├── tsconfig.app.json
|
|
97
|
+
│ ├── tsconfig.node.json
|
|
98
|
+
│ ├── vite.config.ts
|
|
99
|
+
│ ├── eslint.config.mjs
|
|
100
|
+
│ ├── tailwind.config.js
|
|
101
|
+
│ ├── postcss.config.js
|
|
102
|
+
│ ├── index.html
|
|
103
|
+
│ ├── .env.example
|
|
104
|
+
│ └── src/
|
|
105
|
+
│ ├── main.tsx
|
|
106
|
+
│ ├── App.tsx
|
|
107
|
+
│ ├── index.css
|
|
108
|
+
│ ├── vite-env.d.ts
|
|
109
|
+
│ ├── components/
|
|
110
|
+
│ │ ├── layout/
|
|
111
|
+
│ │ │ ├── Header.tsx
|
|
112
|
+
│ │ │ ├── Sidebar.tsx
|
|
113
|
+
│ │ │ └── Footer.tsx
|
|
114
|
+
│ │ └── ui/
|
|
115
|
+
│ │ ├── Button.tsx
|
|
116
|
+
│ │ └── Card.tsx
|
|
117
|
+
│ ├── pages/
|
|
118
|
+
│ │ ├── HomePage.tsx
|
|
119
|
+
│ │ └── NotFoundPage.tsx
|
|
120
|
+
│ ├── hooks/
|
|
121
|
+
│ │ └── useApi.ts
|
|
122
|
+
│ ├── contexts/
|
|
123
|
+
│ │ ├── AuthContext.tsx
|
|
124
|
+
│ │ └── ThemeContext.tsx
|
|
125
|
+
│ ├── services/
|
|
126
|
+
│ │ └── api/
|
|
127
|
+
│ │ └── client.ts
|
|
128
|
+
│ ├── types/
|
|
129
|
+
│ │ └── index.ts
|
|
130
|
+
│ ├── utils/
|
|
131
|
+
│ │ └── helpers.ts
|
|
132
|
+
│ └── config/
|
|
133
|
+
│ └── constants.ts
|
|
134
|
+
│
|
|
135
|
+
├── tests/
|
|
136
|
+
│ └── {ProjectName}.Tests/
|
|
137
|
+
│ └── {ProjectName}.Tests.csproj
|
|
138
|
+
│
|
|
139
|
+
└── tools/
|
|
140
|
+
└── .gitkeep
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Workflow
|
|
144
|
+
|
|
145
|
+
### 1. PARSE & VALIDATE
|
|
146
|
+
|
|
147
|
+
Extract from `$ARGUMENTS`:
|
|
148
|
+
```
|
|
149
|
+
name: PascalCase project name (e.g., "MyProject")
|
|
150
|
+
description: Optional description
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Validate:
|
|
154
|
+
- Name is PascalCase: `^[A-Z][a-zA-Z0-9]*$`
|
|
155
|
+
- Directory doesn't exist
|
|
156
|
+
- Name is not a reserved word
|
|
157
|
+
|
|
158
|
+
### 2. CREATE ROOT STRUCTURE
|
|
159
|
+
|
|
160
|
+
Use Bash to create directories:
|
|
161
|
+
```bash
|
|
162
|
+
mkdir -p {ProjectName}/src
|
|
163
|
+
mkdir -p {ProjectName}/web
|
|
164
|
+
mkdir -p {ProjectName}/tests
|
|
165
|
+
mkdir -p {ProjectName}/tools
|
|
166
|
+
mkdir -p {ProjectName}/scripts
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 3. GENERATE BACKEND FILES
|
|
170
|
+
|
|
171
|
+
For each backend project, use Write tool to create:
|
|
172
|
+
|
|
173
|
+
#### 3.1 Directory.Build.props
|
|
174
|
+
```xml
|
|
175
|
+
<Project>
|
|
176
|
+
<PropertyGroup>
|
|
177
|
+
<TargetFramework>net10.0</TargetFramework>
|
|
178
|
+
<ImplicitUsings>enable</ImplicitUsings>
|
|
179
|
+
<Nullable>enable</Nullable>
|
|
180
|
+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
181
|
+
<Version>1.0.0</Version>
|
|
182
|
+
<Authors>{Author}</Authors>
|
|
183
|
+
<Company>{Company}</Company>
|
|
184
|
+
</PropertyGroup>
|
|
185
|
+
</Project>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
#### 3.2 Solution File ({ProjectName}.sln)
|
|
189
|
+
Use `dotnet new sln` and `dotnet sln add` commands.
|
|
190
|
+
|
|
191
|
+
#### 3.3 Domain Project
|
|
192
|
+
- Create .csproj with MediatR.Contracts
|
|
193
|
+
- Create BaseEntity.cs, IDomainEvent.cs
|
|
194
|
+
- Create folder structure
|
|
195
|
+
|
|
196
|
+
#### 3.4 Application Project
|
|
197
|
+
- Create .csproj with MediatR, FluentValidation
|
|
198
|
+
- Create Result.cs, ValidationBehavior.cs
|
|
199
|
+
- Create DependencyInjection.cs
|
|
200
|
+
|
|
201
|
+
#### 3.5 Infrastructure Project
|
|
202
|
+
- Create .csproj with EF Core, SqlServer
|
|
203
|
+
- Create ApplicationDbContext.cs
|
|
204
|
+
- Create DependencyInjection.cs
|
|
205
|
+
|
|
206
|
+
#### 3.6 Api.Core Project
|
|
207
|
+
- Create .csproj with ASP.NET Core
|
|
208
|
+
- Create BaseApiController.cs
|
|
209
|
+
- Create ExceptionHandlingMiddleware.cs
|
|
210
|
+
|
|
211
|
+
#### 3.7 Api Project
|
|
212
|
+
- Create .csproj as entry point
|
|
213
|
+
- Create Program.cs with full bootstrap
|
|
214
|
+
- Create appsettings.json files
|
|
215
|
+
|
|
216
|
+
### 4. GENERATE FRONTEND FILES
|
|
217
|
+
|
|
218
|
+
#### 4.1 package.json
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"name": "{project-name}-web",
|
|
222
|
+
"private": true,
|
|
223
|
+
"version": "1.0.0",
|
|
224
|
+
"type": "module",
|
|
225
|
+
"scripts": {
|
|
226
|
+
"dev": "vite",
|
|
227
|
+
"build": "tsc -b && vite build",
|
|
228
|
+
"lint": "eslint .",
|
|
229
|
+
"preview": "vite preview"
|
|
230
|
+
},
|
|
231
|
+
"dependencies": {
|
|
232
|
+
"react": "^19.0.0",
|
|
233
|
+
"react-dom": "^19.0.0",
|
|
234
|
+
"react-router-dom": "^7.0.0",
|
|
235
|
+
"axios": "^1.7.0",
|
|
236
|
+
"@microsoft/signalr": "^8.0.0",
|
|
237
|
+
"lucide-react": "^0.400.0"
|
|
238
|
+
},
|
|
239
|
+
"devDependencies": {
|
|
240
|
+
"@types/react": "^19.0.0",
|
|
241
|
+
"@types/react-dom": "^19.0.0",
|
|
242
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
243
|
+
"typescript": "~5.6.0",
|
|
244
|
+
"vite": "^6.0.0",
|
|
245
|
+
"tailwindcss": "^4.0.0",
|
|
246
|
+
"@tailwindcss/vite": "^4.0.0",
|
|
247
|
+
"eslint": "^9.0.0"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
#### 4.2 vite.config.ts
|
|
253
|
+
```typescript
|
|
254
|
+
import { defineConfig } from 'vite'
|
|
255
|
+
import react from '@vitejs/plugin-react'
|
|
256
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
257
|
+
|
|
258
|
+
export default defineConfig({
|
|
259
|
+
plugins: [react(), tailwindcss()],
|
|
260
|
+
server: {
|
|
261
|
+
port: 5173,
|
|
262
|
+
proxy: {
|
|
263
|
+
'/api': 'http://localhost:5000'
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
})
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### 4.3 React Components
|
|
270
|
+
- Create App.tsx with router setup
|
|
271
|
+
- Create basic layout components
|
|
272
|
+
- Create context providers
|
|
273
|
+
- Create API client
|
|
274
|
+
|
|
275
|
+
### 5. GENERATE CONFIGURATION FILES
|
|
276
|
+
|
|
277
|
+
#### .gitignore
|
|
278
|
+
```
|
|
279
|
+
# .NET
|
|
280
|
+
bin/
|
|
281
|
+
obj/
|
|
282
|
+
*.user
|
|
283
|
+
*.suo
|
|
284
|
+
appsettings.Local.json
|
|
285
|
+
|
|
286
|
+
# Node
|
|
287
|
+
node_modules/
|
|
288
|
+
dist/
|
|
289
|
+
.env.local
|
|
290
|
+
|
|
291
|
+
# IDE
|
|
292
|
+
.vs/
|
|
293
|
+
.vscode/
|
|
294
|
+
.idea/
|
|
295
|
+
|
|
296
|
+
# OS
|
|
297
|
+
.DS_Store
|
|
298
|
+
Thumbs.db
|
|
299
|
+
|
|
300
|
+
# Logs
|
|
301
|
+
*.log
|
|
302
|
+
logs/
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
#### CLAUDE.md
|
|
306
|
+
```markdown
|
|
307
|
+
# {ProjectName} Architecture Memory
|
|
308
|
+
|
|
309
|
+
## Project Overview
|
|
310
|
+
{description}
|
|
311
|
+
|
|
312
|
+
## Technology Stack
|
|
313
|
+
- Backend: .NET 10, EF Core, Clean Architecture
|
|
314
|
+
- Frontend: React 19, TypeScript, Vite, Tailwind CSS
|
|
315
|
+
- Database: SQL Server
|
|
316
|
+
|
|
317
|
+
## Architecture
|
|
318
|
+
Clean Architecture with CQRS pattern.
|
|
319
|
+
|
|
320
|
+
## Conventions
|
|
321
|
+
- Use MediatR for commands/queries
|
|
322
|
+
- Use FluentValidation for validation
|
|
323
|
+
- Use Result<T> for operation results
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### 6. INITIALIZE GIT & DOTNET
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
cd {ProjectName}
|
|
330
|
+
git init
|
|
331
|
+
dotnet new sln -n {ProjectName}
|
|
332
|
+
dotnet sln add src/{ProjectName}.Domain
|
|
333
|
+
dotnet sln add src/{ProjectName}.Application
|
|
334
|
+
dotnet sln add src/{ProjectName}.Infrastructure
|
|
335
|
+
dotnet sln add src/{ProjectName}.Api.Core
|
|
336
|
+
dotnet sln add src/{ProjectName}.Api
|
|
337
|
+
dotnet restore
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### 7. DISPLAY SUCCESS
|
|
341
|
+
|
|
342
|
+
```
|
|
343
|
+
╔═══════════════════════════════════════════════════════════════╗
|
|
344
|
+
║ SMARTSTACK PROJECT CREATED ║
|
|
345
|
+
╠═══════════════════════════════════════════════════════════════╣
|
|
346
|
+
║ Name: {ProjectName} ║
|
|
347
|
+
║ Location: {full-path} ║
|
|
348
|
+
╠═══════════════════════════════════════════════════════════════╣
|
|
349
|
+
║ Backend: ║
|
|
350
|
+
║ ✓ {ProjectName}.Domain (Core entities) ║
|
|
351
|
+
║ ✓ {ProjectName}.Application (CQRS, Use cases) ║
|
|
352
|
+
║ ✓ {ProjectName}.Infrastructure (EF Core, Services) ║
|
|
353
|
+
║ ✓ {ProjectName}.Api.Core (Controllers, Middleware) ║
|
|
354
|
+
║ ✓ {ProjectName}.Api (Entry point) ║
|
|
355
|
+
╠═══════════════════════════════════════════════════════════════╣
|
|
356
|
+
║ Frontend: ║
|
|
357
|
+
║ ✓ {project-name}-web (React + Vite + Tailwind) ║
|
|
358
|
+
╠═══════════════════════════════════════════════════════════════╣
|
|
359
|
+
║ Next steps: ║
|
|
360
|
+
║ 1. cd {ProjectName} ║
|
|
361
|
+
║ 2. dotnet build ║
|
|
362
|
+
║ 3. cd web/{project-name}-web && npm install ║
|
|
363
|
+
║ 4. Configure appsettings.Local.json ║
|
|
364
|
+
║ 5. dotnet ef database update ║
|
|
365
|
+
║ 6. dotnet run --project src/{ProjectName}.Api ║
|
|
366
|
+
║ 7. npm run dev (in web folder) ║
|
|
367
|
+
╚═══════════════════════════════════════════════════════════════╝
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## File Templates
|
|
371
|
+
|
|
372
|
+
### Domain/BaseEntity.cs
|
|
373
|
+
```csharp
|
|
374
|
+
namespace {ProjectName}.Domain.Common;
|
|
375
|
+
|
|
376
|
+
public abstract class BaseEntity
|
|
377
|
+
{
|
|
378
|
+
public Guid Id { get; protected set; } = Guid.NewGuid();
|
|
379
|
+
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
380
|
+
public DateTime? UpdatedAt { get; set; }
|
|
381
|
+
public string? CreatedBy { get; set; }
|
|
382
|
+
public string? UpdatedBy { get; set; }
|
|
383
|
+
}
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### Application/Result.cs
|
|
387
|
+
```csharp
|
|
388
|
+
namespace {ProjectName}.Application.Common.Models;
|
|
389
|
+
|
|
390
|
+
public class Result<T>
|
|
391
|
+
{
|
|
392
|
+
public bool IsSuccess { get; }
|
|
393
|
+
public T? Value { get; }
|
|
394
|
+
public string? Error { get; }
|
|
395
|
+
|
|
396
|
+
private Result(bool isSuccess, T? value, string? error)
|
|
397
|
+
{
|
|
398
|
+
IsSuccess = isSuccess;
|
|
399
|
+
Value = value;
|
|
400
|
+
Error = error;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
public static Result<T> Success(T value) => new(true, value, null);
|
|
404
|
+
public static Result<T> Failure(string error) => new(false, default, error);
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### Infrastructure/ApplicationDbContext.cs
|
|
409
|
+
```csharp
|
|
410
|
+
using Microsoft.EntityFrameworkCore;
|
|
411
|
+
using {ProjectName}.Application.Common.Interfaces;
|
|
412
|
+
|
|
413
|
+
namespace {ProjectName}.Infrastructure.Persistence;
|
|
414
|
+
|
|
415
|
+
public class ApplicationDbContext : DbContext, IApplicationDbContext
|
|
416
|
+
{
|
|
417
|
+
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
|
|
418
|
+
: base(options)
|
|
419
|
+
{
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
423
|
+
{
|
|
424
|
+
modelBuilder.ApplyConfigurationsFromAssembly(typeof(ApplicationDbContext).Assembly);
|
|
425
|
+
base.OnModelCreating(modelBuilder);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
### Api/Program.cs
|
|
431
|
+
```csharp
|
|
432
|
+
using {ProjectName}.Application;
|
|
433
|
+
using {ProjectName}.Infrastructure;
|
|
434
|
+
using {ProjectName}.Api.Core.Extensions;
|
|
435
|
+
|
|
436
|
+
var builder = WebApplication.CreateBuilder(args);
|
|
437
|
+
|
|
438
|
+
// Add services
|
|
439
|
+
builder.Services.AddApplication();
|
|
440
|
+
builder.Services.AddInfrastructure(builder.Configuration);
|
|
441
|
+
builder.Services.AddApiCore();
|
|
442
|
+
|
|
443
|
+
builder.Services.AddControllers();
|
|
444
|
+
builder.Services.AddEndpointsApiExplorer();
|
|
445
|
+
builder.Services.AddSwaggerGen();
|
|
446
|
+
builder.Services.AddSignalR();
|
|
447
|
+
|
|
448
|
+
var app = builder.Build();
|
|
449
|
+
|
|
450
|
+
// Configure pipeline
|
|
451
|
+
if (app.Environment.IsDevelopment())
|
|
452
|
+
{
|
|
453
|
+
app.UseSwagger();
|
|
454
|
+
app.UseSwaggerUI();
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
app.UseHttpsRedirection();
|
|
458
|
+
app.UseAuthentication();
|
|
459
|
+
app.UseAuthorization();
|
|
460
|
+
app.MapControllers();
|
|
461
|
+
app.MapHub<NotificationHub>("/hubs/notifications");
|
|
462
|
+
|
|
463
|
+
app.Run();
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
### Frontend/App.tsx
|
|
467
|
+
```tsx
|
|
468
|
+
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
|
469
|
+
import { AuthProvider } from './contexts/AuthContext';
|
|
470
|
+
import { ThemeProvider } from './contexts/ThemeContext';
|
|
471
|
+
import HomePage from './pages/HomePage';
|
|
472
|
+
import NotFoundPage from './pages/NotFoundPage';
|
|
473
|
+
|
|
474
|
+
function App() {
|
|
475
|
+
return (
|
|
476
|
+
<ThemeProvider>
|
|
477
|
+
<AuthProvider>
|
|
478
|
+
<BrowserRouter>
|
|
479
|
+
<Routes>
|
|
480
|
+
<Route path="/" element={<HomePage />} />
|
|
481
|
+
<Route path="*" element={<NotFoundPage />} />
|
|
482
|
+
</Routes>
|
|
483
|
+
</BrowserRouter>
|
|
484
|
+
</AuthProvider>
|
|
485
|
+
</ThemeProvider>
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export default App;
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
## Execution Rules
|
|
493
|
+
|
|
494
|
+
1. **ALWAYS** create all directories before files
|
|
495
|
+
2. **USE** Write tool for each file (not batch)
|
|
496
|
+
3. **USE** Bash for dotnet commands
|
|
497
|
+
4. **VALIDATE** project name is PascalCase
|
|
498
|
+
5. **NEVER** overwrite existing directories
|
|
499
|
+
6. Create files in this order: root → backend → frontend → config
|
|
500
|
+
|
|
501
|
+
## Priority
|
|
502
|
+
|
|
503
|
+
Correctness > Completeness > Speed
|
|
504
|
+
|
|
505
|
+
---
|
|
506
|
+
|
|
507
|
+
User: $ARGUMENTS
|