
csharp-run
by zadazorg
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
| Command | Action |
|---|---|
/run | Full pipeline: build → test → lint |
/run tests | Only run tests |
/run lint | Only check formatting |
/run build | Only 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:
- Show failed test names
- Show assertion messages
- 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:
- Which assertion failed
- Expected vs actual values
- Likely cause
- 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:
- Test project has
<IsTestProject>true</IsTestProject> - Test methods have
[Fact]or[Theory]attributes - Test class is
public
Coverage Not Generated
Check:
coverlet.collectorpackage is installed- Running with
--collect:"XPlat Code Coverage"
Format Hangs
Try with verbosity:
dotnet format --verbosity diagnostic
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です