スキル一覧に戻る
Kadajett

csharp-dotnet

by Kadajett

Claude Code Bootstrapper skills to help claude bootstrap applications with the latest and greatest versions and best practices.

1🍴 0📅 2026年1月13日
GitHubで見るManusで実行

SKILL.md


name: csharp-dotnet description: Bootstrap C# .NET projects with modern tooling. Use when creating .NET applications, Web APIs, console apps, Blazor apps, or when the user wants to set up a C# development environment.

C# .NET Project Bootstrapper

Creates production-ready .NET 8+ projects with modern C# features and best practices.

Prerequisites

# Check .NET SDK (8.0+ recommended)
dotnet --version
dotnet --list-sdks

Install .NET SDK

Linux (Ubuntu/Debian):

wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y dotnet-sdk-8.0

macOS:

brew install --cask dotnet-sdk

Project Templates

TemplateCommandDescription
Console Appdotnet new consoleCommand-line application
Web APIdotnet new webapiREST API with controllers
Minimal APIdotnet new webLightweight HTTP API
Blazor Serverdotnet new blazorserverServer-side Blazor app
Blazor WebAssemblydotnet new blazorwasmClient-side Blazor app
Class Librarydotnet new classlibReusable library
xUnit Testsdotnet new xunitUnit test project
Worker Servicedotnet new workerBackground service

Create Projects

Console Application

dotnet new console -n MyApp -o MyApp
cd MyApp
dotnet new web -n MyApi -o MyApi
cd MyApi

Solution with Multiple Projects

dotnet new sln -n MySolution
dotnet new web -n MyApi -o src/MyApi
dotnet new classlib -n MyCore -o src/MyCore
dotnet new xunit -n MyTests -o tests/MyTests
dotnet sln add src/MyApi src/MyCore tests/MyTests
dotnet add src/MyApi reference src/MyCore
dotnet add tests/MyTests reference src/MyCore

Project Structure

MySolution/
├── MySolution.sln
├── src/
│   ├── MyApi/
│   │   ├── MyApi.csproj
│   │   └── Program.cs
│   └── MyCore/
│       └── MyCore.csproj
├── tests/
│   └── MyTests/
│       └── MyTests.csproj
├── .editorconfig
├── Directory.Build.props
└── Directory.Packages.props

Modern .csproj Configuration

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <AnalysisLevel>latest-recommended</AnalysisLevel>
    <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
  </PropertyGroup>
</Project>

Directory.Build.props

Create at solution root:

<Project>
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <AnalysisLevel>latest-recommended</AnalysisLevel>
  </PropertyGroup>
</Project>

Minimal API Example

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}

app.MapGet("/", () => "Hello World!");
app.MapGet("/items/{id}", (int id) => new Item(id, $"Item {id}"));
app.MapPost("/items", (Item item) => Results.Created($"/items/{item.Id}", item));

app.Run();

record Item(int Id, string Name);

Common NuGet Packages

dotnet add package Serilog.AspNetCore
dotnet add package FluentValidation.AspNetCore
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package xunit
dotnet add package Moq
dotnet add package FluentAssertions

Development Commands

dotnet restore
dotnet build
dotnet run
dotnet watch run          # Hot reload
dotnet test
dotnet format
dotnet publish -c Release -o ./publish

GitHub Actions CI

name: CI
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 8.0.x
      - run: dotnet restore
      - run: dotnet build --no-restore -c Release
      - run: dotnet test --no-build -c Release

Post-Setup Checklist

  1. Create solution and project structure
  2. Configure Directory.Build.props
  3. Add .editorconfig for code style
  4. Configure logging (Serilog)
  5. Set up dependency injection
  6. Add unit test project
  7. Configure CI/CD pipeline

スコア

総合スコア

70/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です