Back to list
zadazorg

csharp-upgrade

by zadazorg

0🍴 0📅 Jan 26, 2026

SKILL.md


name: csharp-upgrade description: > Upgrade project configuration to latest C# standards. Compares Directory.Build.props, .editorconfig, analyzers with templates. Shows diff and optionally applies updates. Use for "/upgrade". user-invocable: true allowed-tools:

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

Project Configuration Upgrade

Upgrade your .NET project to the latest C# 14 standards configuration.

Files to Check

FilePurpose
Directory.Build.propsBuild settings, analyzers, strict mode
Directory.Packages.propsCentral Package Management versions
.editorconfigCode style rules (K&R, file-scoped namespaces)
BannedSymbols.txtForbidden APIs (DateTime.Now, etc.)
MakefileStandard targets (lint, fix, test)

Workflow

Step 1: Scan Existing Files

# Find all config files
ls -la Directory.Build.props Directory.Packages.props .editorconfig BannedSymbols.txt Makefile 2>/dev/null

Step 2: Compare with Templates

For each file that exists, compare with template:

# Show differences
diff -u Directory.Build.props templates/Directory.Build.props
diff -u Directory.Packages.props templates/Directory.Packages.props
diff -u .editorconfig templates/.editorconfig
diff -u BannedSymbols.txt templates/BannedSymbols.txt
diff -u Makefile templates/Makefile

Step 3: Generate Report

Create a summary table:

┌─────────────────────────┬──────────┬─────────────────────────┐
│ File                    │ Status   │ Action                  │
├─────────────────────────┼──────────┼─────────────────────────┤
│ Directory.Build.props   │ Outdated │ 3 properties missing    │
│ Directory.Packages.props│ MISSING  │ Create new              │
│ .editorconfig           │ OK       │ Up to date              │
│ BannedSymbols.txt       │ Outdated │ 2 bans missing          │
│ Makefile                │ OK       │ Up to date              │
└─────────────────────────┴──────────┴─────────────────────────┘

Status meanings:

  • OK — File matches template (or has all required settings)
  • Outdated — File exists but missing new settings
  • MISSING — File does not exist

Step 4: Ask User What to Update

Use AskUserQuestion:

What would you like to update?
○ All files (recommended)
○ Select individually
○ Skip — just show report

Step 5: Apply Updates

For each selected file:

# If MISSING — copy template
cp templates/Directory.Packages.props ./

# If Outdated — show diff and ask to replace or merge
# For props files, prefer full replacement to avoid conflicts

Step 6: Verify

dotnet restore
dotnet build

Key Properties to Check

Directory.Build.props

Must have these settings:

<!-- 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 (v2.3.0+) -->
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
<EnableRequestDelegateGenerator>true</EnableRequestDelegateGenerator>

<!-- Unified Output (v2.3.1+) -->
<UseArtifactsOutput>true</UseArtifactsOutput>

<!-- NuGet Security (v2.4.0+) -->
<NuGetAudit>true</NuGetAudit>
<NuGetAuditLevel>moderate</NuGetAuditLevel>
<NuGetAuditMode>all</NuGetAuditMode>

<!-- Lock Files (v2.4.0+) -->
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>

Must have these analyzers:

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

Directory.Packages.props

Must have:

<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>

Check for outdated package versions with:

dotnet outdated

.editorconfig

Key settings:

csharp_new_line_before_open_brace = none
csharp_style_namespace_declarations = file_scoped:warning
csharp_prefer_simple_using_statement = true:warning

BannedSymbols.txt

Must ban:

  • DateTime.Now
  • DateTime.UtcNow
  • Thread.Sleep
  • Task.Result
  • Task.Wait

After Upgrade

# Review changes
git diff

# Run tests
dotnet test

# Commit
git add -A
git commit -m "chore: upgrade to csharp-standards v3.0.0"

Templates Reference

Full templates are in templates/ directory:

  • templates/Directory.Build.props
  • templates/Directory.Packages.props
  • templates/.editorconfig
  • templates/BannedSymbols.txt
  • templates/Makefile

Score

Total Score

50/100

Based on repository quality metrics

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

Reviews

💬

Reviews coming soon