
csharp-release
by zadazorg
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
| Check | Command | Critical |
|---|---|---|
| Config files | Validate against templates | Yes |
| Dependencies | License + vulnerability scan | Yes |
| Lock files | packages.lock.json exists | Yes |
| Build | dotnet build succeeds | Yes |
| Tests | dotnet test passes | Yes |
| Format | dotnet format clean | Yes |
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
| Package | Reason | Alternative |
|---|---|---|
| FluentAssertions | Commercial license | Shouldly |
| AutoMapper | Forbidden by Constitution | Manual mapping |
| Serilog.* | Forbidden by Constitution | Microsoft.Extensions.Logging |
| NLog | Forbidden by Constitution | Microsoft.Extensions.Logging |
| FluentValidation | Forbidden by Constitution | Data 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:
- Missing config files — Run
/initto create - Vulnerabilities — Update affected packages
- Build errors — Fix compilation issues
- Test failures — Fix failing tests
- Format violations — Run
dotnet format - Missing lock files — Run
dotnet restore --force-evaluate - Forbidden packages — Remove and use alternatives
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です