Back to list
zadazorg

csharp-release

by zadazorg

0🍴 0📅 Jan 26, 2026

SKILL.md


name: csharp-release description: > Pre-release validation for .NET projects. Validates config, dependencies, lock files, vulnerabilities. Use for "/release", "prepare release", "check before merge". user-invocable: true allowed-tools:

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

Pre-Release Validation

Comprehensive validation before release or merge to main.

Checklist Overview

CheckCommandCritical
Config filesValidate against templatesYes
DependenciesLicense + vulnerability scanYes
Lock filespackages.lock.json existsYes
Builddotnet build succeedsYes
Testsdotnet test passesYes
Formatdotnet format cleanYes

Workflow

Step 1: Configuration Validation

Check all required files exist:

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

Verify CPM is enabled:

grep -q "ManagePackageVersionsCentrally" Directory.Packages.props && echo "CPM: OK" || echo "CPM: MISSING"

Check no versions in .csproj files:

grep -rn "Version=" --include="*.csproj" | grep -v "TargetFramework\|LangVersion" || echo "No inline versions"

Step 2: Dependency Validation

License Check

dotnet list package

Verify no forbidden packages:

  • FluentAssertions (commercial)
  • AutoMapper (forbidden)
  • Serilog.* (forbidden)
  • FluentValidation (forbidden)

Vulnerability Scan

dotnet list package --vulnerable

If vulnerabilities found — BLOCK RELEASE.

Outdated Packages

dotnet outdated

Report outdated packages but don't block.

Step 3: Lock Files

Verify packages.lock.json exists for each project:

find . -name "*.csproj" -not -path "*/obj/*" | while read proj; do
  dir=$(dirname "$proj")
  if [ -f "$dir/packages.lock.json" ]; then
    echo "OK: $proj"
  else
    echo "MISSING: $proj"
  fi
done

If missing, run:

dotnet restore --force-evaluate

Lock files MUST be committed to git.

Step 4: Build Validation

dotnet build --no-incremental -warnaserror

All warnings treated as errors for release.

Step 5: Test Validation

dotnet test --no-build

All tests must pass.

Step 6: Format Check

dotnet format --verify-no-changes

Code must be properly formatted.

Report Format

## Pre-Release Validation Report

### Configuration
| File | Status |
|------|--------|
| Directory.Build.props | OK |
| Directory.Packages.props | OK |
| .editorconfig | OK |
| BannedSymbols.txt | OK |
| Makefile | **MISSING** |

### Central Package Management
| Check | Status |
|-------|--------|
| CPM enabled | OK |
| No inline versions | OK |

### Dependencies
| Check | Status |
|-------|--------|
| Forbidden packages | OK |
| Vulnerabilities | OK |
| Outdated | 3 packages (minor) |

### Lock Files
| Project | Status |
|---------|--------|
| MyApp.csproj | OK |
| MyApp.Tests.csproj | **MISSING** |

### Quality Gates
| Gate | Status |
|------|--------|
| Build | PASS |
| Tests | PASS |
| Format | PASS |

### Summary
- Critical: 2
- Warnings: 3
- **RELEASE STATUS: BLOCKED**

### Required Actions
1. Create Makefile
2. Generate lock file for MyApp.Tests

Forbidden Packages

PackageReasonAlternative
FluentAssertionsCommercial licenseShouldly
AutoMapperForbidden by ConstitutionManual mapping
Serilog.*Forbidden by ConstitutionMicrosoft.Extensions.Logging
NLogForbidden by ConstitutionMicrosoft.Extensions.Logging
FluentValidationForbidden by ConstitutionData Annotations + Value Objects

Quick Fix Commands

# Generate all lock files
dotnet restore --force-evaluate

# Update outdated packages (interactive)
dotnet outdated -u

# Fix formatting
dotnet format

# Regenerate lock files after package changes
dotnet restore --force-evaluate

CI/CD Integration

For CI pipelines, ensure:

- name: Restore with lock files
  run: dotnet restore --locked-mode

- name: Build
  run: dotnet build --no-restore -warnaserror

- name: Test
  run: dotnet test --no-build

- name: Format Check
  run: dotnet format --verify-no-changes

Release Blockers

The following BLOCK release:

  1. Missing config files — Run /init to create
  2. Vulnerabilities — Update affected packages
  3. Build errors — Fix compilation issues
  4. Test failures — Fix failing tests
  5. Format violations — Run dotnet format
  6. Missing lock files — Run dotnet restore --force-evaluate
  7. Forbidden packages — Remove and use alternatives

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