skills/architecture-review/SKILL.md
Layering and Dependency-Inversion-Principle audit of a C# solution. Use when: auditing layering, detecting cycles, checking DIP compliance, or finding cross-layer leaks. Takes an optional project or namespace filter as input.
npx skillsauth add darylmcd/Roslyn-Backed-MCP architecture-reviewInstall 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# architecture auditor. Your job is to audit a loaded solution for layering violations, dependency cycles, DIP compliance, composition-root health, and cross-layer symbol leaks, then produce a prioritized, evidence-backed violations report.
$ARGUMENTS is an optional scope filter — either a project name or a namespace prefix (e.g. Contoso.Billing or Contoso.Billing.Domain). If omitted, audit the entire solution.
If a workspace is not already loaded, ask the user for the solution path and load it first.
When the tool list or workflows are unclear, call server_info, read the server_catalog resource (roslyn://server/catalog), or use MCP prompt discover_capabilities with category analysis or all.
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.
Execute these steps in order. Use the Roslyn MCP tools — do not shell out for analysis.
workspace_load with the solution/project path (or confirm via workspace_status if already loaded).workspaceId for all subsequent calls.workspace_status to confirm the workspace loaded successfully and note any load-time warnings.project_graph.project_graph to get the full project dependency topology.For each in-scope project:
get_namespace_dependencies to get the within-project namespace graph.Use the layering heuristics (see below) to assign every project and namespace a layer rank (higher rank = higher-level / policy; lower rank = lower-level / mechanism).
For each edge where caller.rank > callee.rank is violated (i.e. a lower-level layer depends on a higher-level layer, or a peer layer reaches across an illegal boundary):
symbol_relationships against the offending namespace (or, when feasible, the specific type) to get granular symbol-level edges.find_references on any concrete leak (e.g. a low-level project referencing a high-level DTO) to produce specific file/line evidence.get_di_registrations to enumerate the DI container registrations across the solution.type_hierarchy on the bound concrete type to confirm whether a matching abstraction already exists that the caller should depend on instead.find_reflection_usages across the solution (or the filtered scope).Activator.CreateInstance on an infrastructure type from a domain project").Combine all findings from Steps 2 – 6. Deduplicate violations that share the same caller/callee edge. Rank strictly by severity (Critical → High → Medium → Low) and within a severity tier by the number of distinct references (more references = higher priority).
The skill infers "high vs low layer" in this order; stop at the first rule that yields a rank:
.Domain → 4.Application / .UseCases → 3.Infrastructure / .Persistence / .Integration → 2.Web / .Api / .Host / .Cli / composition roots → 1.Tests, .IntegrationTests, etc.) are exempt from downward-reference checks but still participate in cycle detection.Always surface the heuristic used per project in the report so the user can override it on a follow-up run.
Present a structured report with these sections:
## Architecture & Layering Review: {solution-name}
### Summary
- Projects audited: {count}
- Scope filter: {filter or "whole solution"}
- Violations: {critical} Critical, {high} High, {medium} Medium, {low} Low
- Layering heuristic mix: {suffix-convention: N projects, namespace-convention: M, graph-fallback: P}
### Critical — Project Dependency Cycles
{table: cycle id, participating projects, closing edge(s), suggested cut}
### High — Namespace Dependency Cycles
{table: project, participating namespaces, representative symbol edges}
### Medium — Improper Downward References (DIP violations)
{table: caller symbol (project/namespace/type), callee symbol, caller-rank > callee-rank detail, file:line evidence, suggested abstraction}
### Medium — DI Composition-Root Issues
{table: registration (interface → concrete), composition root, issue (wrong-layer binding / duplicate / missing abstraction), suggested fix}
### Low — Reflection Usages
{table: file:line, symbol, reflection API, why it matters}
### Recommendations
{prioritized list of the top 5–10 actionable items, each pointing at a specific violation row above}
Each row in the Critical / High / Medium tables MUST include at least one concrete file:line reference produced via find_references or symbol_relationships — no unsupported assertions.
Stop the skill and tell the user which condition tripped if any of the following are true:
workspace_load returned an error, or workspace_status reports an unrecoverable load failure. Ask the user to fix the solution path or underlying build error and re-run.project_graph returned an empty project list (nothing to audit). Confirm the path points at a real .sln / .slnx / .csproj that contains at least one project.After producing the final report, emit a summary:
summary: { semanticCalls: N, classificationApplied: <repo-stack> }
Determine classificationApplied:
*.slnx, *.sln, *.csproj → if any found: "csharp""unknown"Determine semanticCalls: count of Roslyn semantic tool calls made during this session (e.g. project_graph, get_namespace_dependencies, symbol_relationships, find_references, get_di_registrations, type_hierarchy, find_reflection_usages, etc.). Do NOT count workspace_load, workspace_list, workspace_status, or server_info — those are infrastructure calls, not semantic calls.
If classificationApplied == "csharp" AND semanticCalls == 0:
Warning: This session operated on a C# repository but made zero Roslyn semantic tool calls. The architecture review may be incomplete. The following Steps were each expected to use specific Roslyn tools that were not called:
- Step 2 (
project_graph) — project dependency topology and cycle detection- Step 3 (
get_namespace_dependencies) — namespace-level cycle detection per project- Step 4 (
symbol_relationships,find_references) — improper downward references and DIP violations- Step 5 (
get_di_registrations,type_hierarchy) — DI composition-root audit- Step 6 (
find_reflection_usages) — reflection escape pointsConsider re-running with
mcp__roslyn__workspace_loadto enable semantic analysis for all steps.
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.