スキル一覧に戻る
zadazorg

csharp-init

by zadazorg

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

SKILL.md


name: csharp-init description: > Initialize .NET project with C# 14 standards configuration. Creates Directory.Build.props, Directory.Packages.props, .editorconfig, BannedSymbols.txt, and Makefile. Use for "/init" or "setup project". user-invocable: true allowed-tools:

  • Read
  • Write
  • Bash
  • Glob
  • AskUserQuestion metadata: author: csharp-standards version: "3.0.0"

Project Initialization

Initialize a .NET project with modern C# 14 / .NET 10 standards configuration.

Files Created

FilePurpose
Directory.Build.propsBuild settings, analyzers, nullability
Directory.Packages.propsCentral Package Management (CPM)
.editorconfigCode style rules (K&R braces, naming)
BannedSymbols.txtForbidden APIs list
MakefileStandard build targets

Workflow

Step 1: Check Existing Files

ls -la Directory.Build.props Directory.Packages.props .editorconfig BannedSymbols.txt Makefile 2>/dev/null

If files exist, ask user whether to overwrite or skip.

Step 2: Copy Templates

Templates are in templates/ directory. Copy each file to repository root.

# Example for each file
cp templates/Directory.Build.props ./
cp templates/Directory.Packages.props ./
cp templates/.editorconfig ./
cp templates/BannedSymbols.txt ./
cp templates/Makefile ./

Step 3: Restore and Build

dotnet restore
dotnet build

Step 4: Commit Changes (if requested)

git add Directory.Build.props Directory.Packages.props .editorconfig BannedSymbols.txt Makefile
git commit -m "feat: add C# 14 standards configuration"

Template Overview

Directory.Build.props

Key settings applied to ALL projects:

<!-- C# Language -->
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

<!-- Strict Analysis -->
<AnalysisLevel>latest-all</AnalysisLevel>
<AnalysisMode>All</AnalysisMode>
<WarningLevel>9999</WarningLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>

<!-- AOT-Readiness -->
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>

<!-- Unified Output -->
<UseArtifactsOutput>true</UseArtifactsOutput>

<!-- NuGet Security -->
<NuGetAudit>true</NuGetAudit>
<NuGetAuditLevel>moderate</NuGetAuditLevel>

<!-- Reproducible Builds -->
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>

Analyzers included:

  • Roslynator.Analyzers
  • SonarAnalyzer.CSharp
  • Microsoft.CodeAnalysis.BannedApiAnalyzers
  • Microsoft.VisualStudio.Threading.Analyzers

Directory.Packages.props

Central Package Management (CPM) for version control:

<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>

Pre-configured versions for:

  • Analyzers
  • Testing (xUnit, Shouldly, NSubstitute)
  • Microsoft.Extensions.*
  • EF Core
  • ErrorOr

.editorconfig

Code style enforcement:

  • K&R brace style (csharp_new_line_before_open_brace = none)
  • File-scoped namespaces
  • var for obvious types
  • Naming conventions (PascalCase, _camelCase for fields)

BannedSymbols.txt

Forbidden APIs:

  • DateTime.Now → use TimeProvider
  • DateTime.UtcNow → use TimeProvider
  • Thread.Sleep → use Task.Delay
  • Task.Result → use await
  • Task.Wait → use await

Makefile

Standard targets:

  • make build — build solution
  • make test — run tests
  • make lint — check formatting
  • make fix — auto-fix issues
  • make up — docker compose up
  • make down — docker compose down

Post-Init Checklist

After initialization, verify:

  1. dotnet build succeeds with no errors
  2. dotnet format --verify-no-changes passes
  3. All projects use CPM (no Version= in PackageReference)
  4. packages.lock.json files generated and committed

Customization

Add Project-Specific Packages

Edit Directory.Packages.props:

<ItemGroup Label="MyProject">
  <PackageVersion Include="SomePackage" Version="1.0.0" />
</ItemGroup>

Suppress Specific Warnings

Edit .editorconfig:

# Suppress specific warning in specific files
[**/Migrations/*.cs]
dotnet_diagnostic.CA1062.severity = none

スコア

総合スコア

50/100

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

SKILL.md

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

+20
LICENSE

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

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

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

0/5
Issue管理

オープンIssueが50未満

+5
言語

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

+5
タグ

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

0/5

レビュー

💬

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