solution-health
Analyze solution structure for orphaned projects, circular dependencies, and TFM inconsistencies
What this skill does
# /dotnet:solution-health
Comprehensive solution health analysis covering structure, dependencies, versioning, and best practices.
## Arguments
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 |
## Health Checks
| 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 |
## Workflow
### Step 1: Locate Solution
Find and parse solution file:
```bash
# 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
```text
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:
```bash
# Find all .csproj files
find . -name "*.csproj" -type f
# Compare against solution references
# Report difference
```
### Circular Dependencies
Build dependency graph from ProjectReference elements:
```xml
<ProjectReference Include="..\Other\Other.csproj" />
```
Detect cycles using DFS traversal.
### TFM Inconsistencies
Parse TargetFramework(s) from all projects:
```bash
grep -h "<TargetFramework" **/*.csproj
```
Report when projects use different TFMs without apparent reason.
### Duplicate Package Versions
Parse PackageReference elements:
```xml
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
```
Group by package, flag different versions.
## Examples
```bash
# 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
| 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:**
- 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
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.