---
phase: 01-architecture-foundation
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
- ChatAgent.sln
- src/ChatAgent.Client/ChatAgent.Client.csproj
- src/ChatAgent.Client/Program.cs
- src/ChatAgent.Client/App.razor
- src/ChatAgent.Client/_Imports.razor
- src/ChatAgent.Client/wwwroot/index.html
- src/ChatAgent.Client/Properties/launchSettings.json
- src/ChatAgent.Api/ChatAgent.Api.csproj
- src/ChatAgent.Api/Program.cs
- src/ChatAgent.Api/Properties/launchSettings.json
- src/ChatAgent.Api/appsettings.json
- src/ChatAgent.Api/appsettings.Development.json
- src/ChatAgent.Shared/ChatAgent.Shared.csproj
- .gitignore
autonomous: true
requirements:
- CODE-02
must_haves:
truths:
- "Running `dotnet build ChatAgent.sln` from repo root succeeds with zero errors"
- "Solution contains exactly three projects: ChatAgent.Client, ChatAgent.Api, ChatAgent.Shared"
- "Both Client and Api projects reference ChatAgent.Shared"
- "Client runs on https://localhost:5200, API runs on https://localhost:7100"
artifacts:
- path: "ChatAgent.sln"
provides: "Solution file at repo root"
contains: "ChatAgent.Client"
- path: "src/ChatAgent.Client/ChatAgent.Client.csproj"
provides: "Blazor WASM client project"
contains: "ChatAgent.Shared"
- path: "src/ChatAgent.Api/ChatAgent.Api.csproj"
provides: "ASP.NET Core Web API project"
contains: "ChatAgent.Shared"
- path: "src/ChatAgent.Shared/ChatAgent.Shared.csproj"
provides: "Shared class library"
contains: "net9.0"
key_links:
- from: "src/ChatAgent.Client/ChatAgent.Client.csproj"
to: "src/ChatAgent.Shared/ChatAgent.Shared.csproj"
via: "ProjectReference"
pattern: "ProjectReference.*ChatAgent\\.Shared"
- from: "src/ChatAgent.Api/ChatAgent.Api.csproj"
to: "src/ChatAgent.Shared/ChatAgent.Shared.csproj"
via: "ProjectReference"
pattern: "ProjectReference.*ChatAgent\\.Shared"
---
Create the three-project .NET 9 solution scaffold with Blazor WASM client, ASP.NET Core Web API, and shared class library. Configure predictable development ports and project references.
Purpose: Establish the architectural skeleton that all subsequent phases build on. Phase 1's concept is "solution structure and project boundaries" (per CODE-02). No feature code -- just the verified scaffold.
Output: A buildable solution with three projects, shared references, and aligned port configuration.
@/home/ys/family-repo/AgenticCode/.claude/get-shit-done/workflows/execute-plan.md
@/home/ys/family-repo/AgenticCode/.claude/get-shit-done/templates/summary.md
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/01-architecture-foundation/01-CONTEXT.md
@.planning/phases/01-architecture-foundation/01-RESEARCH.md
Task 1: Create solution and three projects with references
ChatAgent.sln,
src/ChatAgent.Client/ChatAgent.Client.csproj,
src/ChatAgent.Api/ChatAgent.Api.csproj,
src/ChatAgent.Shared/ChatAgent.Shared.csproj
.planning/phases/01-architecture-foundation/01-RESEARCH.md (Standard Stack and Installation sections),
.planning/phases/01-architecture-foundation/01-CONTEXT.md (D-01 through D-03 decisions),
CLAUDE.md
Run the following commands from the repo root (`/home/ys/family-repo/AgenticCode`). Per D-01, D-02, D-03:
1. Create the solution file at repo root:
```
dotnet new sln -n ChatAgent
```
2. Create the three projects targeting net9.0:
```
dotnet new blazorwasm -n ChatAgent.Client --framework net9.0 -o src/ChatAgent.Client
dotnet new webapi -n ChatAgent.Api --framework net9.0 --use-controllers -o src/ChatAgent.Api
dotnet new classlib -n ChatAgent.Shared --framework net9.0 -o src/ChatAgent.Shared
```
3. Add all three projects to the solution:
```
dotnet sln ChatAgent.sln add src/ChatAgent.Client/ChatAgent.Client.csproj
dotnet sln ChatAgent.sln add src/ChatAgent.Api/ChatAgent.Api.csproj
dotnet sln ChatAgent.sln add src/ChatAgent.Shared/ChatAgent.Shared.csproj
```
4. Add Shared reference to both Client and Api:
```
dotnet add src/ChatAgent.Client/ChatAgent.Client.csproj reference src/ChatAgent.Shared/ChatAgent.Shared.csproj
dotnet add src/ChatAgent.Api/ChatAgent.Api.csproj reference src/ChatAgent.Shared/ChatAgent.Shared.csproj
```
5. Delete the template-generated placeholder files that are not needed:
- `src/ChatAgent.Shared/Class1.cs` (will be replaced by Models/ directory in Plan 02)
- `src/ChatAgent.Api/Controllers/WeatherForecastController.cs` (template default, replaced by HealthController in Plan 02)
- `src/ChatAgent.Api/WeatherForecast.cs` (template default model)
6. Create a `.gitignore` at repo root if one does not already exist. Include standard .NET ignores:
```
bin/
obj/
*.user
*.suo
.vs/
.idea/
*.swp
**/wwwroot/_framework/
```
7. Run `dotnet build ChatAgent.sln` to verify the scaffold compiles.
cd /home/ys/family-repo/AgenticCode && dotnet build ChatAgent.sln --nologo 2>&1 | tail -5
- `ChatAgent.sln` exists at `/home/ys/family-repo/AgenticCode/ChatAgent.sln`
- `ChatAgent.sln` contains the string `ChatAgent.Client`
- `ChatAgent.sln` contains the string `ChatAgent.Api`
- `ChatAgent.sln` contains the string `ChatAgent.Shared`
- `src/ChatAgent.Client/ChatAgent.Client.csproj` contains `ProjectReference` with `ChatAgent.Shared`
- `src/ChatAgent.Api/ChatAgent.Api.csproj` contains `ProjectReference` with `ChatAgent.Shared`
- All three `.csproj` files contain `net9.0` as TargetFramework
- `dotnet build ChatAgent.sln` exits with code 0
- `src/ChatAgent.Shared/Class1.cs` does NOT exist
- `src/ChatAgent.Api/Controllers/WeatherForecastController.cs` does NOT exist
- `.gitignore` exists at repo root and contains `bin/` and `obj/`
Three-project solution builds successfully from repo root with shared references wired in both directions.
Task 2: Configure predictable dev ports and clean up template defaults
src/ChatAgent.Client/Properties/launchSettings.json,
src/ChatAgent.Api/Properties/launchSettings.json,
src/ChatAgent.Api/appsettings.json,
src/ChatAgent.Api/appsettings.Development.json,
src/ChatAgent.Client/wwwroot/appsettings.json
src/ChatAgent.Client/Properties/launchSettings.json,
src/ChatAgent.Api/Properties/launchSettings.json,
src/ChatAgent.Api/appsettings.json,
.planning/phases/01-architecture-foundation/01-RESEARCH.md (Pitfall 1: port alignment, Pattern 4: base URL config)
Per the research (Pitfall 1), template-generated ports are random and cause CORS mismatches. Set predictable ports:
1. Edit `src/ChatAgent.Client/Properties/launchSettings.json`:
- Set the HTTPS URL to `https://localhost:5200`
- Set the HTTP URL to `http://localhost:5100`
- Apply to both the profile used by `dotnet run` and any IIS Express profile
- Keep the `"inspectUri"` setting if present (needed for Blazor WASM debugging)
2. Edit `src/ChatAgent.Api/Properties/launchSettings.json`:
- Set the HTTPS URL to `https://localhost:7100`
- Set the HTTP URL to `http://localhost:7000`
- Remove the `"launchBrowser": true` setting if present (API has no browser UI)
3. Create `src/ChatAgent.Client/wwwroot/appsettings.json` with the API base URL:
```json
{
"ApiBaseUrl": "https://localhost:7100"
}
```
This file is PUBLIC (served to the browser). Never put secrets here.
4. Verify `src/ChatAgent.Api/appsettings.json` exists (template-generated). Remove any Swagger/OpenAPI configuration if present (not needed for this project). Ensure it has a clean structure:
```json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
```
5. Ensure `src/ChatAgent.Api/appsettings.Development.json` exists with dev logging:
```json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
```
6. Run `dotnet build ChatAgent.sln` again to confirm nothing broke.
cd /home/ys/family-repo/AgenticCode && grep -c "5200" src/ChatAgent.Client/Properties/launchSettings.json && grep -c "7100" src/ChatAgent.Api/Properties/launchSettings.json && grep -c "ApiBaseUrl" src/ChatAgent.Client/wwwroot/appsettings.json && dotnet build ChatAgent.sln --nologo 2>&1 | tail -3
- `src/ChatAgent.Client/Properties/launchSettings.json` contains `5200`
- `src/ChatAgent.Api/Properties/launchSettings.json` contains `7100`
- `src/ChatAgent.Client/wwwroot/appsettings.json` contains `"ApiBaseUrl": "https://localhost:7100"`
- `src/ChatAgent.Api/appsettings.json` does NOT contain `swagger` or `Swagger` (cleaned up)
- `dotnet build ChatAgent.sln` exits with code 0
Both projects configured with predictable ports (Client: 5200, API: 7100), client has API base URL in public config, build still passes.
From repo root:
1. `dotnet build ChatAgent.sln` completes with 0 errors
2. Solution has exactly 3 projects (grep for `.csproj` in sln file)
3. Both Client and Api reference Shared (grep for ProjectReference in both .csproj files)
4. Port 5200 appears in Client launchSettings, port 7100 in API launchSettings
5. Client wwwroot/appsettings.json has ApiBaseUrl pointing to API port
- Three-project solution builds from `dotnet build ChatAgent.sln` with zero errors
- Projects are in `src/` subdirectories per D-02
- Solution file is at repo root per D-03
- Shared library is referenced by both Client and Api
- Ports are predictable and aligned (Client: 5200, API: 7100)
- Template boilerplate (WeatherForecast) is removed