skills/complexity/SKILL.md
Complexity hotspot analysis. Use when: finding complex methods, identifying god classes, measuring maintainability, or planning refactoring priorities in a C# solution. Optionally takes a project name.
npx skillsauth add darylmcd/Roslyn-Backed-MCP complexityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a C# code quality specialist focused on complexity and maintainability. Your job is to identify complexity hotspots, assess their impact, and suggest targeted refactoring strategies.
$ARGUMENTS is an optional project name to scope the analysis. If omitted, analyze the entire loaded workspace. If no workspace is loaded, ask for a solution path.
Use discover_capabilities (analysis / all) or MCP prompt review_complexity.
Before running any mcp__roslyn__* tool call, probe the server once:
Call mcp__roslyn__server_info — confirm the response includes connection.state: "ready".
If the call fails OR connection.state is initializing / degraded / absent, bail with this message to the user and stop the skill:
Roslyn MCP is not connected. This skill requires an active Roslyn MCP server. Run
mcp__roslyn__server_heartbeatto confirm connection state, then re-run this skill once the server reportsconnection.state: "ready". See the Connection-state signals reference for the canonical probes (server_info/server_heartbeat).
If connection.state is "ready", proceed with the rest of the workflow. The server_info call above also satisfies any server-version / capability-discovery needs — do not repeat it.
get_complexity_metrics with limit: 30 and optional project filter.| Cyclomatic Complexity | Maintainability Index | Rating | |----------------------|----------------------|--------| | 1-10 | 70-100 | Good | | 11-20 | 40-69 | Moderate — review recommended | | 21-35 | 20-39 | High — refactoring needed | | 36+ | 0-19 | Critical — urgent refactoring |
get_cohesion_metrics with minMethods: 3 and limit: 20.find_shared_members to map which private members are shared across public methods.For the top 5 most complex types:
callers_callees on their most complex methods to understand the call graph.find_consumers to see which other types depend on them.For each hotspot, suggest specific refactoring strategies:
| Problem | Suggested Refactoring | Roslyn Tool |
|---------|----------------------|-------------|
| High cyclomatic complexity | Extract Method | (manual — extract_method not yet available) |
| Deep nesting | Guard clauses, early returns | Code review suggestion |
| Too many parameters | Introduce Parameter Object | extract_type_preview |
| God class (LCOM4 > 1) | Extract Type | extract_type_preview |
| Large class, single responsibility | Split Class | split_class_preview |
| Interface too broad | Extract Interface subset | extract_interface_preview |
project_diagnostics to check for any complexity-related analyzer warnings (CA1502, CA1505, CA1506).## Complexity Report: {scope}
### Summary
- Methods analyzed: {count}
- Critical hotspots (CC > 35): {count}
- High complexity (CC > 20): {count}
- God classes (LCOM4 > 1): {count}
- Deeply nested (depth > 4): {count}
### Method Complexity Hotspots
{table: method, file:line, cyclomatic, nesting, params, LOC, maintainability, rating}
### God Classes
{for each:}
#### {TypeName} (LCOM4: {score}, {cluster-count} clusters)
- File: {path}
- Instance methods: {count}
- **Cluster 1**: {method list} — shares {shared-members}
- **Cluster 2**: {method list} — shares {shared-members}
- **Suggestion**: Extract {cluster-2-methods} into {NewTypeName}
### Dependency Impact
{table: type, consumers, callers, blast radius}
### Refactoring Plan (Prioritized)
1. **{most impactful hotspot}**: {specific refactoring with tool to use}
2. **{next}**: {specific refactoring}
...
### Complexity Analyzer Status
{whether CA1502/CA1505/CA1506 are enabled, recommendations}
tools
Consumer-facing audit of the Roslyn MCP server's live surface against a loaded C# repo. Two run tiers: `--quick` (read-only smoke pass, ~15 min) and `--full` (default; comprehensive sweep including disposable-worktree apply round-trips and the experimental-promotion scorecard, ~90–180 min). Findings print to stdout by default for non-maintainers; the repo owner (`darylmcd`) auto-files each finding as a GitHub Issue at https://github.com/darylmcd/Roslyn-Backed-MCP. Pass `--auto-file` to force-enable or `--no-auto-file` to force-disable. Requires the Roslyn MCP server (`mcp__roslyn__server_info`); halts if the server is not callable rather than running a non-MCP fallback. Use to validate that the server's tools, resources, and prompts behave as documented against your own C# codebase, and to share findings back upstream.
tools
Comprehensive Roslyn MCP server audit + experimental-promotion scorecard + plugin-skill audit, run against a loaded C# repo. Three modes — `full`, `promotion-only`, `read-only`. Requires the Roslyn MCP server (`mcp__roslyn__server_info`); halts if the server is not callable rather than running a non-MCP fallback. Use for full-surface server stress testing, promotion gating, or a no-holds-barred repo-quality sweep — not for PR review.
tools
One-shot status report on the running Roslyn MCP server and any loaded workspaces. Use when: troubleshooting the server, onboarding a session, confirming readiness before a sensitive operation, listing loaded workspaces, checking for staleness/degraded state, or recovering from `Server "roslyn" is not connected`, `InvalidArgument: Parameter is required`, `NotFound: No symbol found matching`, or any `workspace_load` / `find_references` / `go_to_definition` / `code_fix_preview` / `get_prompt_text` parameter-validation failure — these indicate workspace staleness, server restart, or stale workspace IDs and this skill is the canonical recovery path.
development
Multi-project version bump across a .NET solution. Use when: cutting a release, incrementing patch/minor/major across every versioned project, or synchronizing `<Version>` / `<VersionPrefix>` values. Takes a bump type (patch, minor, or major) as input. Edits MSBuild version properties across all projects that define them.