Skill

solution-health

Analyze solution structure for orphaned projects, circular dependencies, and TFM inconsistencies

From dotnet
Install
1
Run in your terminal
$
npx claudepluginhub melodic-software/claude-code-plugins --plugin dotnet
Tool Access

This skill is limited to using the following tools:

BashReadGlobGrep
Skill Content

/dotnet:solution-health

Comprehensive solution health analysis covering structure, dependencies, versioning, and best practices.

Arguments

Parse arguments from $ARGUMENTS:

FlagDescriptionDefault
--solution <path>Target solution (fuzzy matching)Auto-detect
--check <category>Run specific check onlyAll checks
--fix-suggestionsInclude actionable fix commandstrue

Health Checks

CheckCategoryDescription
Orphaned projectsstructureProjects in folder but not in .sln
Missing referencesdependenciesReferenced projects that don't exist
Circular dependenciesdependenciesA -> B -> A cycles
TFM inconsistenciesversioningMixed target frameworks
Duplicate packagespackagesSame package, different versions
Central package managementpackagesDirectory.Packages.props status
Build propsconfigDirectory.Build.props presence
EditorConfigconfig.editorconfig presence
Git ignored artifactshygienebin/obj in git

Workflow

Step 1: Locate Solution

Find and parse solution file:

# Find .sln files
find . -name "*.sln" -maxdepth 2

# Parse solution for project references
grep "Project(" *.sln

Step 2: Run Health Checks

Execute each check and collect findings.

Step 3: Generate Report

Output Format

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)

Check Details

Orphaned Projects

Projects found in filesystem but not referenced in .sln:

# Find all .csproj files
find . -name "*.csproj" -type f

# Compare against solution references
# Report difference

Circular Dependencies

Build dependency graph from ProjectReference elements:

<ProjectReference Include="..\Other\Other.csproj" />

Detect cycles using DFS traversal.

TFM Inconsistencies

Parse TargetFramework(s) from all projects:

grep -h "<TargetFramework" **/*.csproj

Report when projects use different TFMs without apparent reason.

Duplicate Package Versions

Parse PackageReference elements:

<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />

Group by package, flag different versions.

Examples

# 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

Health Score Calculation

CategoryMax PointsCriteria
Structure20No orphaned projects, no missing refs
Dependencies20No circular deps, clean graph
Versioning20Consistent TFMs, global.json present
Packages20No duplicates, CPM enabled, no vulnerabilities
Configuration20Build.props, editorconfig, gitignore

Score Interpretation:

  • 90-100: Excellent - Well-maintained solution
  • 70-89: Good - Minor improvements recommended
  • 50-69: Fair - Several issues to address
  • Below 50: Needs attention - Significant technical debt
Stats
Parent Repo Stars40
Parent Repo Forks6
Last CommitFeb 15, 2026