用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/rudironsoni/Synaxis --skill dotnet-scaffold-project命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Routes .NET/C# work to domain skills. Loads coding-standards for code paths.
基于 SOC 职业分类
| name | dotnet-scaffold-project |
| description | Creates a new .NET project. Generates solution with CPM, analyzers, editorconfig, SourceLink. |
| license | MIT |
| targets | ["*"] |
| category | developer-experience |
| subcategory | project |
| tags | ["tooling","dotnet","skill","project","scaffolding"] |
| version | 1.0.0 |
| author | dotnet-agent-harness |
| invocable | true |
| related_skills | ["dotnet-project-structure","dotnet-project-analysis","dotnet-version-detection"] |
| claudecode | {"allowed-tools":["Read","Grep","Glob","Bash","Write","Edit"]} |
| codexcli | {"short-description":".NET skill guidance for project tasks"} |
| opencode | {"allowed-tools":["Read","Grep","Glob","Bash","Write","Edit"]} |
| copilot | {} |
| geminicli | {} |
| antigravity | {} |
Scaffolds a new .NET project with all modern best practices applied. Generates the full solution structure including Central Package Management, analyzers, .editorconfig, SourceLink, and deterministic builds.
Prerequisites: Run [skill:dotnet-version-detection] first to determine available SDK version — this affects which features and templates are available.
Cross-references: [skill:dotnet-project-structure] for layout rationale, [skill:dotnet-add-analyzers] for analyzer configuration, [skill:dotnet-add-ci] for adding CI after scaffolding.
Create the directory layout and solution file.
# Create the directory structure
mkdir -p MyApp/src MyApp/tests
# Create solution file
cd MyApp
dotnet new sln -n MyApp
# For .NET 9+ SDK, convert to .slnx
dotnet sln MyApp.sln migrate
```text
### Choose Project Template
Select the appropriate template based on the application type:
| Template | Command | SDK |
|----------|---------|-----|
| Web API (minimal) | `dotnet new webapi -n MyApp.Api -o src/MyApp.Api` | `Microsoft.NET.Sdk.Web` |
| Web API (controllers) | `dotnet new webapi -n MyApp.Api -o src/MyApp.Api --use-controllers` | `Microsoft.NET.Sdk.Web` |
| Console app | `dotnet new console -n MyApp.Cli -o src/MyApp.Cli` | `Microsoft.NET.Sdk` |
| Worker service | `dotnet new worker -n MyApp.Worker -o src/MyApp.Worker` | `Microsoft.NET.Sdk.Worker` |
| Class library | `dotnet new classlib -n MyApp.Core -o src/MyApp.Core` | `Microsoft.NET.Sdk` |
| Blazor web app | `dotnet new blazor -n MyApp.Web -o src/MyApp.Web` | `Microsoft.NET.Sdk.Web` |
| MAUI app | `dotnet new maui -n MyApp.Mobile -o src/MyApp.Mobile` | `Microsoft.Maui.Sdk` |
| xUnit test | `dotnet new xunit -n MyApp.Tests -o tests/MyApp.Tests` | `Microsoft.NET.Sdk` |
```bash
# Example: Web API with class library and tests
dotnet new classlib -n MyApp.Core -o src/MyApp.Core
dotnet new webapi -n MyApp.Api -o src/MyApp.Api
dotnet new xunit -n MyApp.UnitTests -o tests/MyApp.UnitTests
dotnet sln add src/MyApp.Core/MyApp.Core.csproj
dotnet sln add src/MyApp.Api/MyApp.Api.csproj
dotnet sln add tests/MyApp.UnitTests/MyApp.UnitTests.csproj
dotnet add src/MyApp.Api/MyApp.Api.csproj reference src/MyApp.Core/MyApp.Core.csproj
dotnet add tests/MyApp.UnitTests/MyApp.UnitTests.csproj reference src/MyApp.Core/MyApp.Core.csproj
```csharp
---
Pin the SDK version reproducible builds.
```json
{
: {
: ,
:
}
}
```text
Adjust the version to match the output of `dotnet --version`.
---
Create at the repo root to share build settings across all projects.
```xml
<Project>
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>14</LangVersion>
<Nullable></Nullable>
<ImplicitUsings></ImplicitUsings>
<TreatWarningsAsErrors></TreatWarningsAsErrors>
<EnforceCodeStyleInBuild></EnforceCodeStyleInBuild>
<AnalysisLevel>latest-all</AnalysisLevel>
</PropertyGroup>
<!-- Deterministic builds and SourceLink ( libraries) -->
<PropertyGroup>
<PublishRepositoryUrl></PublishRepositoryUrl>
<EmbedUntrackedSources></EmbedUntrackedSources>
<DebugType>embedded</DebugType>
<ContinuousIntegrationBuild Condition=></ContinuousIntegrationBuild>
</PropertyGroup>
<!-- NuGet audit -->
<PropertyGroup>
<NuGetAudit></NuGetAudit>
<NuGetAuditLevel>low</NuGetAuditLevel>
<NuGetAuditMode>all</NuGetAuditMode>
<RestorePackagesWithLockFile></RestorePackagesWithLockFile>
</PropertyGroup>
</Project>
```text
After creating this, **remove** `<TargetFramework>`, `<Nullable>`, and `<ImplicitUsings>` from individual `.csproj` files to avoid duplication.
```xml
<!-- tests/Directory.Build.props -->
<Project>
<Import Project= />
<PropertyGroup>
<IsPackable></IsPackable>
<IsTestProject></IsTestProject>
<!-- Use Microsoft.Testing.Platform v2 runner (requires Microsoft.NET.Test.Sdk 17.13+/18.x) -->
<UseMicrosoftTestingPlatformRunner></UseMicrosoftTestingPlatformRunner>
<!-- Tests donVersion=
Primary approach: Use Serena symbol operations for efficient code navigation:
serena_find_symbol instead of text searchserena_get_symbols_overview for file organizationserena_find_referencing_symbols for impact analysisserena_replace_symbol_body for clean modificationsWhen to use Serena vs traditional tools:
Example workflow:
# Instead of:
Read: src/Services/OrderService.cs
Grep: "public void ProcessOrder"
# Use:
serena_find_symbol: "OrderService/ProcessOrder"
serena_get_symbols_overview: "src/Services/OrderService.cs"