From dotnet
Analyzes .NET solutions for orphaned projects, circular dependencies, TFM inconsistencies, duplicate packages, and config hygiene issues like missing Directory.Build.props.
npx claudepluginhub melodic-software/claude-code-plugins --plugin dotnetThis skill is limited to using the following tools:
Comprehensive solution health analysis covering structure, dependencies, versioning, and best practices.
Navigating .NET solution structure or build configuration. Analyzes .sln, .csproj, CPM.
Provides .NET solution structure conventions with .slnx format, Directory.Build.props for shared properties, Directory.Packages.props for central package management, global usings, src/tests layout, and naming rules. Use for new solutions or project reconfiguration.
Runs Roslynator CLI for C# static analysis, auto-fixes diagnostics, formats code, detects unused code, and enforces standards in .NET projects. Use for linting, cleanup, or quality tasks.
Share bugs, ideas, or general feedback.
Comprehensive solution health analysis covering structure, dependencies, versioning, and best practices.
Parse arguments from $ARGUMENTS:
| Flag | Description | Default |
|---|---|---|
--solution <path> | Target solution (fuzzy matching) | Auto-detect |
--check <category> | Run specific check only | All checks |
--fix-suggestions | Include actionable fix commands | true |
| Check | Category | Description |
|---|---|---|
| Orphaned projects | structure | Projects in folder but not in .sln |
| Missing references | dependencies | Referenced projects that don't exist |
| Circular dependencies | dependencies | A -> B -> A cycles |
| TFM inconsistencies | versioning | Mixed target frameworks |
| Duplicate packages | packages | Same package, different versions |
| Central package management | packages | Directory.Packages.props status |
| Build props | config | Directory.Build.props presence |
| EditorConfig | config | .editorconfig presence |
| Git ignored artifacts | hygiene | bin/obj in git |
Find and parse solution file:
# Find .sln files
find . -name "*.sln" -maxdepth 2
# Parse solution for project references
grep "Project(" *.sln
Execute each check and collect findings.
Solution Health Report
Solution: MyApp.sln
Location: D:\repos\myapp
Projects: 12
Generated: 2026-01-18 11:00:00 UTC
═══════════════════════════════════════════════════════════════
HEALTH SCORE: 78/100
═══════════════════════════════════════════════════════════════
┌─────────────────────────────────────────────────────────────┐
│ Category Status Issues Score │
├─────────────────────────────────────────────────────────────┤
│ Structure Warning 1 15/20 │
│ Dependencies Pass 0 20/20 │
│ Versioning Warning 2 12/20 │
│ Packages Warning 3 16/20 │
│ Configuration Pass 0 15/20 │
└─────────────────────────────────────────────────────────────┘
───────────────────────────────────────────────────────────────
STRUCTURE CHECKS
───────────────────────────────────────────────────────────────
[WARNING] Orphaned Projects Found
Projects in filesystem but not in solution:
- tools/CodeGen/CodeGen.csproj
- experimental/Prototype/Prototype.csproj
Fix: Add to solution or delete if unused
dotnet sln add tools/CodeGen/CodeGen.csproj
dotnet sln add experimental/Prototype/Prototype.csproj
[PASS] No Missing Project References
All referenced projects exist and are resolvable.
[PASS] No Circular Dependencies
Dependency graph is acyclic.
───────────────────────────────────────────────────────────────
VERSIONING CHECKS
───────────────────────────────────────────────────────────────
[WARNING] Inconsistent Target Frameworks
Most projects: net10.0 (10 projects)
Outliers:
- src/Legacy/Legacy.csproj: net8.0
- tests/Integration/Integration.csproj: net9.0
Recommendation: Standardize TFMs across solution
Run: /dotnet:update-dotnet-version --check-only
[WARNING] LangVersion Not Standardized
Projects without explicit LangVersion: 4
Projects with LangVersion: 8
Recommendation: Set LangVersion in Directory.Build.props
[INFO] SDK Version
global.json: 10.0.100 (rollForward: latestPatch)
Installed: 10.0.100
───────────────────────────────────────────────────────────────
PACKAGE CHECKS
───────────────────────────────────────────────────────────────
[WARNING] Duplicate Package Versions
Newtonsoft.Json:
- 13.0.1 in src/MyApp.Core
- 13.0.3 in src/MyApp.Api
- 12.0.3 in src/Legacy
Microsoft.Extensions.Logging:
- 8.0.0 in 3 projects
- 10.0.0 in 7 projects
Fix: Consolidate versions or enable Central Package Management
[WARNING] Central Package Management Not Enabled
You have 12 projects with package references.
Central Package Management would consolidate version management.
Enable:
1. Create Directory.Packages.props
2. Add <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
3. Move versions from .csproj to Directory.Packages.props
[PASS] No Vulnerable Packages
Run 'dotnet list package --vulnerable' returned no results.
───────────────────────────────────────────────────────────────
CONFIGURATION CHECKS
───────────────────────────────────────────────────────────────
[PASS] Directory.Build.props Found
Location: D:\repos\myapp\Directory.Build.props
Contents:
- TreatWarningsAsErrors: true
- Nullable: enable
- ImplicitUsings: enable
[PASS] .editorconfig Found
Location: D:\repos\myapp\.editorconfig
Enforcing: 45 rules
[PASS] .gitignore Configured
bin/ and obj/ are properly ignored.
───────────────────────────────────────────────────────────────
RECOMMENDATIONS
───────────────────────────────────────────────────────────────
Priority fixes to improve health score:
1. [EASY] Add orphaned projects to solution
Impact: +5 points
Command: dotnet sln add tools/CodeGen/CodeGen.csproj
2. [MEDIUM] Standardize target frameworks
Impact: +8 points
Command: /dotnet:update-dotnet-version
3. [MEDIUM] Enable Central Package Management
Impact: +5 points
Creates: Directory.Packages.props
4. [EASY] Consolidate Newtonsoft.Json versions
Impact: +2 points
Command: Update all to 13.0.3
───────────────────────────────────────────────────────────────
PROJECT DEPENDENCY GRAPH
───────────────────────────────────────────────────────────────
MyApp.Api
└── MyApp.Core
└── MyApp.Infrastructure
└── MyApp.Core
└── MyApp.Domain
└── MyApp.Domain
MyApp.Tests
└── MyApp.Api
└── MyApp.Core
(No circular dependencies detected)
Projects found in filesystem but not referenced in .sln:
# Find all .csproj files
find . -name "*.csproj" -type f
# Compare against solution references
# Report difference
Build dependency graph from ProjectReference elements:
<ProjectReference Include="..\Other\Other.csproj" />
Detect cycles using DFS traversal.
Parse TargetFramework(s) from all projects:
grep -h "<TargetFramework" **/*.csproj
Report when projects use different TFMs without apparent reason.
Parse PackageReference elements:
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Group by package, flag different versions.
# Full health check
/dotnet:solution-health
# Check specific category only
/dotnet:solution-health --check dependencies
# Check specific solution
/dotnet:solution-health --solution MyApp.sln
# Quick check without fix suggestions
/dotnet:solution-health --fix-suggestions false
| Category | Max Points | Criteria |
|---|---|---|
| Structure | 20 | No orphaned projects, no missing refs |
| Dependencies | 20 | No circular deps, clean graph |
| Versioning | 20 | Consistent TFMs, global.json present |
| Packages | 20 | No duplicates, CPM enabled, no vulnerabilities |
| Configuration | 20 | Build.props, editorconfig, gitignore |
Score Interpretation: