Back to list
zadazorg

csharp-run

by zadazorg

0🍴 0📅 Jan 26, 2026

SKILL.md


name: csharp-run description: > Run tests, lint, and build for .NET projects. Executes dotnet test with coverage, dotnet format check, and reports results. Use for "/run", "run tests", "check build", or "lint code". user-invocable: true allowed-tools:

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

Run Tests, Lint & Build

Execute the full quality check pipeline for .NET projects.

Quick Commands

CommandAction
/runFull pipeline: build → test → lint
/run testsOnly run tests
/run lintOnly check formatting
/run buildOnly build

Full Pipeline

Step 1: Build

dotnet build --no-incremental

Check for:

  • Compilation errors
  • Analyzer warnings
  • Nullable warnings

Step 2: Run Tests

dotnet test --no-build --collect:"XPlat Code Coverage"

If tests fail:

  1. Show failed test names
  2. Show assertion messages
  3. Suggest fixes based on test type

Step 3: Check Formatting

dotnet format --verify-no-changes

If fails, suggest:

dotnet format  # Auto-fix

Test Output Analysis

When tests fail, analyze output:

❌ OrderServiceTests.Should_CreateOrder_When_ValidInput
   Expected: OrderStatus.Pending
   Actual:   OrderStatus.Draft

Provide actionable feedback:

  1. Which assertion failed
  2. Expected vs actual values
  3. Likely cause
  4. Suggested fix

Coverage Report

After tests pass, show coverage summary:

# Find coverage file
find . -name "coverage.cobertura.xml" -type f | head -1

# If reportgenerator installed
dotnet tool run reportgenerator \
  -reports:**/coverage.cobertura.xml \
  -targetdir:coverage \
  -reporttypes:TextSummary

Coverage thresholds:

  • Line coverage: Target 80%+
  • Branch coverage: Target 70%+

Lint Checks

Format Check

dotnet format --verify-no-changes

Roslynator Analysis

dotnet roslynator analyze

Auto-Fix

dotnet roslynator fix
dotnet format

Error Handling

Build Errors

Error CS0246: The type or namespace 'OrderId' could not be found

→ Check missing using directive or missing reference.

Test Errors

Test host process exited with error

→ Check for unhandled exceptions in test setup.

Format Errors

/src/OrderService.cs(15,1): warning IDE0055: Fix formatting

→ Run dotnet format to auto-fix.

CI/CD Integration

For CI pipelines:

# Reproducible restore with lock files
dotnet restore --locked-mode

# Build with deterministic output
dotnet build --configuration Release /p:ContinuousIntegrationBuild=true

# Test with coverage
dotnet test --no-build --collect:"XPlat Code Coverage"

# Format check (fail if not formatted)
dotnet format --verify-no-changes

Makefile Integration

If Makefile exists, prefer:

make test    # Runs dotnet test
make lint    # Runs format check
make fix     # Auto-fixes issues

Troubleshooting

Tests Not Found

No test is available in [assembly]

Check:

  1. Test project has <IsTestProject>true</IsTestProject>
  2. Test methods have [Fact] or [Theory] attributes
  3. Test class is public

Coverage Not Generated

Check:

  1. coverlet.collector package is installed
  2. Running with --collect:"XPlat Code Coverage"

Format Hangs

Try with verbosity:

dotnet format --verbosity diagnostic

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