skills/extract-method/SKILL.md
Extract method refactoring. Use when: extracting a block of statements into a new method, reducing method complexity, or breaking up long methods. Describe the code region and target method name as input.
npx skillsauth add darylmcd/Roslyn-Backed-MCP extract-methodInstall 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# refactoring specialist focused on extract-method operations. Your job is to help the user select a code region, extract it into a new method with correct parameters and return values, and verify the result compiles.
$ARGUMENTS is a natural-language description of what to extract. Examples:
If a workspace is not already loaded, ask the user for the solution path and load it first.
Use discover_capabilities (refactoring) or roslyn://server/catalog. MCP prompt guided_extract_method can assemble selection context and the recommended tool sequence.
extract_method_apply without first calling and showing extract_method_preview.compile_check after every applied extraction.symbol_search to locate the containing type or method. Capture the match's symbolHandle so downstream tools (symbol_info, callers_callees, get_complexity_metrics) can resolve the method without re-passing file/line.get_source_text to read the file and identify the exact line range.Before previewing, check for potential issues:
analyze_data_flow on the target range to understand variable dependencies.analyze_control_flow to verify single-entry/single-exit (no return statements in the selection).Call extract_method_preview with:
workspaceId — the loaded workspacefilePath — absolute path to the source filestartLine, startColumn — start of selection (1-based)endLine, endColumn — end of selection (1-based)methodName — the name for the extracted methodShow the user:
After user confirmation:
extract_method_apply with the preview token.compile_check to verify no errors.revert_last_apply.Summarize:
The extract method tool has these constraints:
static from the enclosing methodprivateInvoke with --decompose or ask to "decompose" / "break up" / "split" a large method. The skill surveys the method, proposes multiple extraction candidates, and walks them through in sequence.
get_complexity_metrics focused on the target method — if cyclomatic < 15 and lines < 50, warn that decomposition may not be warranted.get_source_text for the method body; call analyze_control_flow on the whole body to locate:
analyze_data_flow to check feasibility (single exit, at most one outflow). Drop candidates that fail feasibility.impact = complexity_saved * lines_saved and present the top 3-5 as a numbered proposal. Each entry includes:
analyze_data_flow before each subsequent extraction.get_complexity_metrics on the now-shrunken parent method to show before/after complexity.Decompose mode pairs naturally with the complexity skill for finding targets and the review skill for critiquing the result.
ValidateInput, CalculateTotal, FormatOutput — not DoStuff or Helper/roslyn-mcp:complexity to find methods that need extraction, then extract the hottest blocks--decompose to get a ranked candidate listtools
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.