skills/dotnet-architecture-checklist/SKILL.md
Checklist executor for .NET Blazor architecture reviews using CQRS patterns (FreeMediator/Mapster). Use when asked to review architecture, audit code quality, assess technical debt, evaluate Blazor projects, check for anti-patterns, review .NET solutions, validate FreeMediator/Mapster usage, run architecture checklist, or grade a .NET project. Triggers on phrases like "review this project", "architecture checklist", "audit this code", "check for issues", "evaluate this solution", "review CQRS patterns", "check handlers", "check framework version", "shared kernel review", "run checklist", "grade this architecture".
npx skillsauth add michaelalber/ai-toolkit dotnet-architecture-checklistInstall 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.
"Architecture is the decisions you wish you could get right early in a project, but that you are not necessarily more likely to get right than any other." -- Ralph Johnson
"A checklist cannot fly a plane, but a pilot cannot fly safely without one." -- Atul Gawande
This skill is a checklist executor, not a Socratic coach. Where architecture-review asks open-ended questions, this skill validates specific .NET patterns against a concrete, enumerated checklist and produces a graded report with prioritized findings.
The distinction matters: architecture-review builds architectural judgment. This skill applies it mechanically and reproducibly across .NET Blazor projects with CQRS patterns using FreeMediator and Mapster. It detects the framework version and hosting model first, then runs every checklist item in references/review-checklist.md, flags violations from references/red-flags.md, validates CQRS patterns from references/cqrs-patterns.md, and assesses framework health from references/framework-detection.md.
Non-negotiable constraints:
references/review-checklist.md is executed; skipping requires explicit justification.| # | Principle | Description | Priority |
|---|-----------|-------------|----------|
| 1 | Vertical Slice Compliance | Features organized by business capability, not technical layer. Each feature folder contains commands, queries, handlers, validators, and DTOs. Cross-feature imports are violations. | Critical |
| 2 | CQRS Handler Isolation | Each handler is a standalone class implementing IRequestHandler<TRequest, TResponse>. No shared base handlers, no handler-to-handler calls, no business logic in controllers. | Critical |
| 3 | FreeMediator Pipeline | FreeMediator (Apache 2.0) is preferred. Pipeline behaviors for validation, logging, exception handling, and transactions registered in order. MediatR usage flagged for migration. | Critical |
| 4 | Mapster Mapping Discipline | TypeAdapterConfig.GlobalSettings configured at startup. Queries use ProjectToType<>() instead of ToList().Adapt(). Mapping profiles centralized in dedicated config classes. | High |
| 5 | Blazor Hosting Model Detection | Server, WASM, and Interactive Auto each require different checklist sections. Server requires SignalR circuit and backplane checks. WASM requires IL trimming and bundle security review. | Critical |
| 6 | Shared Kernel Usage | Projects must use official shared packages, maintain version consistency, and avoid duplicate entity definitions. | High |
| 7 | EF Core Patterns | DbContext must be scoped correctly for the hosting model. Async all the way down. N+1 query patterns caught. Singleton DbContext is a critical finding. | Critical |
| 8 | Framework Version Awareness | EOL frameworks (.NET Core 3.1, .NET 5, .NET 7) are flagged as critical. .NET Framework 4.x requires upgrade path assessment. | Critical |
| 9 | Anti-Corruption Layers | Boundaries between the application and external systems must be explicit. No domain entities leak across API boundaries. | High |
| 10 | Configuration Patterns | No hardcoded secrets. Configuration uses IOptions<T> or IOptionsSnapshot<T>. WASM bundles must not contain secrets. | High |
| Query | When to Call |
|-------|--------------|
| search_knowledge("Blazor CQRS FreeMediator vertical slice architecture .NET") | At DETECT phase — confirms architectural patterns and checklist applicability |
| search_knowledge("EF Core DbContext scoped singleton Blazor circuit") | During EF Core section — authoritative DbContext lifetime patterns for Blazor |
| search_knowledge("ASP.NET Core dependency injection IOptions configuration") | When reviewing configuration patterns |
| search_knowledge("Mapster ProjectTo query projection EF Core") | During Mapster section — confirms ProjectTo vs Adapt patterns |
| search_knowledge(".NET target framework EOL SDK style csproj") | During framework detection — EOL status and SDK-style migration guidance |
Search at the start of each checklist section (DETECT, SCAN). Cite the source path in every finding.
The checklist lifecycle flows: DETECT → SCAN → REPORT → RECOMMEND; unknown framework or blocked items pause for user clarification.
Determine the full project context before running any checklist items.
.csproj for <TargetFramework>. Categorize by EOL status.grep -r "<TargetFramework" --include="*.csproj" | grep -oE "net[0-9]+\.[0-9]+|netcoreapp[0-9]+\.[0-9]+|net4[0-9]+" | sort -u
grep -r "FreeMediator\|MediatR\|Mapster\|AutoMapper" --include="*.csproj"
grep -r "TelerikRootComponent\|MudThemeProvider\|RadzenLayout" --include="*.razor" | head -5
grep -rE "YourOrg\.SharedKernel\." --include="*.csproj"
find . -name "*.csproj" -exec grep -L "Sdk=" {} \;
Execute every section of references/review-checklist.md and every pattern in references/red-flags.md. For each item: run the detection command, record PASS/FAIL/WARN/SKIP, capture file and line reference, cross-reference CQRS items with references/cqrs-patterns.md.
Checklist execution order:
Count findings by severity. Calculate grade. Identify top 3 critical failure points. Generate the anti-patterns table, quick wins list, and technical debt register.
Grading Formula:
Filter all recommendations against the detected target framework version. Prioritize: Critical findings → quick wins → modernization. Group by effort level (small/medium/large). Provide migration paths for framework upgrades.
<dotnet-checklist-state>
mode: [DETECT | SCAN | REPORT | RECOMMEND | COMPLETE]
target_framework: [net48 | net6.0 | net8.0 | net10.0 | mixed | unknown]
hosting_model: [server | wasm | auto | non-blazor | unknown]
cqrs_compliant: [true | false | partial | not-applicable]
freemediator_version: [version | mediatr-detected | none]
issues_found: [critical:N high:N medium:N low:N]
last_action: [what was just done]
next_action: [what should happen next]
</dotnet-checklist-state>
Example:
<dotnet-checklist-state>
mode: SCAN
target_framework: net8.0
hosting_model: server
cqrs_compliant: partial
freemediator_version: mediatr-detected
issues_found: critical:1 high:3 medium:5 low:2
last_action: Completed sections 0-6 of review checklist
next_action: Execute sections 7-11, cross-reference red-flags
</dotnet-checklist-state>
## Architecture Checklist: [Solution Name]
**Framework**: [version] | **Hosting**: [Server/WASM/Auto] | **CQRS**: [FreeMediator/MediatR/None]
**Mapster**: [yes/no] | **Telerik**: [yes/no] | **Projects**: [count]
| Section | Items | Pass | Fail | Warn |
|---------|-------|------|------|------|
| 0 Framework | 8 | 6 | 1 | 1 |
| 1 Structure / 1a CQRS / 1b Mapster | ... | ... | ... | ... |
### Grade: [A-F]
**Critical failure points**: 1. [scenario] 2. [scenario] 3. [scenario]
| Severity | Location | Finding | Recommendation |
|----------|----------|---------|----------------|
| CRITICAL | file:line | [pattern] | [fix] |
**Quick Wins**: [low-effort high-impact fixes]
**Technical Debt**: [item | priority | effort | impact]
Full templates (Session Opening, Checklist Results Table, Finding Details, Session Closing with Roadmap): references/review-checklist.md.
Always detect framework first. Recommending InteractiveAutoRenderMode to a .NET 6 project produces invalid findings. Run framework detection (grep <TargetFramework> in all .csproj) before any checklist item. If framework cannot be determined, ask the user — never assume .NET 10.
Never assume the hosting model. Server, WASM, and Interactive Auto have fundamentally different architectural concerns. Detect from Program.cs, project configuration, and component render modes before applying hosting-specific checklist items. Running the wrong section produces false positives.
Check handler isolation before patterns. Verify no base handler classes and no cross-handler calls (grep -r "class.*Handler.*:.*Base" --include="*.cs") before assessing naming conventions or folder structure. A codebase with well-named handlers that all inherit from BaseCrudHandler<T> has a critical structural problem that must be reported first.
Validate Mapster configs exist. If the project uses Mapster, verify TypeAdapterConfig is configured at startup (grep -r "TypeAdapterConfig\|IRegister" --include="*.cs"). Relying on convention-based mapping silently produces incomplete DTOs when entity shapes change — this is a high-severity finding.
Never mix architectural styles in recommendations. If the codebase uses vertical slices with CQRS, never recommend repository pattern or layered architecture improvements. If recommending a style change, flag it as a separate migration initiative with an effort estimate.
Handlers must be isolated and sealed. Shared base handlers with injected fields create hidden coupling between unrelated features. Each handler must be a standalone sealed class implementing IRequestHandler<TRequest, TResponse> directly, with its own private dependencies. Flag any shared base handler as critical.
Endpoints must be thin. An endpoint that contains validation logic, business rules, or persistence calls is untestable and defeats the CQRS pipeline. Endpoints call only mediator.Send(). All business logic lives in handlers. Flag fat endpoints as a high-severity finding.
Version-gate all recommendations. Before suggesting any API, pattern, or feature, verify it exists in the detected .NET version. If it requires a newer version, note the minimum required version and frame it as a post-upgrade opportunity.
| Anti-Pattern | Why It's Wrong | Correct Approach |
|--------------|----------------|------------------|
| Reviewing without framework detection | Applying .NET 10 patterns to .NET 4.8 produces irrelevant findings | Always run DETECT phase first |
| Applying .NET 10 patterns to .NET Framework | APIs like Minimal APIs and Interactive Auto don't exist in 4.x | Detect version; recommend upgrade path from references/framework-detection.md |
| Ignoring shared kernel conventions | Duplicating entities creates drift and maintenance burden | Flag duplicate entity definitions; verify version consistency |
| Mixing CQRS with repository pattern | Repositories between handlers and DbContext add indirection without benefit | Handlers access DbContext directly; extract specifications for reuse |
| Fat controllers with business logic | Cannot be tested without HTTP infrastructure | Controllers call only mediator.Send() |
| Grading without evidence | Subjective assessments cannot be verified or acted upon | Every finding includes file path, evidence string, and checklist section |
| Assuming Blazor Server for all Blazor projects | WASM and Auto have completely different architectural concerns | Detect hosting model before applying hosting-specific checklist items |
| Recommending framework upgrade without complexity assessment | "Upgrade to .NET 10" without assessing System.Web deps is irresponsible | Use references/framework-detection.md to assess upgrade complexity |
| Skipping Telerik-specific checks for Telerik projects | Grid with Data on large datasets causes full-data loading; missing version alignment causes runtime errors | Always run Section 11 when Telerik UI is detected |
| Singleton DbContext in Blazor Server | Long-lived circuits cause connection exhaustion, stale data, thread-safety violations | DbContext must be scoped; use OwningComponentBase or IDbContextFactory<T> |
Unknown framework version: Check global.json and Directory.Build.props for centrally set framework. Inspect NuGet package versions as a proxy (Microsoft.AspNetCore.Components version maps to .NET version). If still unknown, ask the user directly. Record "unknown" in the state block and note which checklist items were skipped.
Mixed CQRS and repository patterns: Do NOT recommend removing repositories immediately. Report the inconsistency as HIGH. Recommend: new features use CQRS exclusively; existing repository features migrate incrementally. Flag any handlers that inject repositories (double indirection) as a separate finding.
Legacy code without tests: Report as HIGH (not critical). Recommend "test-forward" strategy: all new features and bug fixes include tests. Identify highest-risk handlers as priority candidates for retroactive testing. Reference tdd-cycle for methodology.
Blazor Interactive Auto with unclear render mode boundaries: Flag components without explicit @rendermode directives as MEDIUM. Identify components accessing server-only resources (DbContext, file system) — these must be Server-rendered. Recommend explicit @rendermode InteractiveServer or @rendermode InteractiveWebAssembly on every interactive component.
dotnet-vertical-slice -- When the checklist identifies structural violations (cross-feature imports, fat controllers, missing pipeline behaviors), reference this skill for correct implementation patterns.ef-migration-manager -- When the checklist identifies EF Core issues (singleton DbContext, N+1 queries, connection pooling), reference this skill for lifecycle management.architecture-review -- When the checklist produces a grade of D or F, recommend a full architecture review. The checklist identifies what is wrong; architecture-review helps the team understand why.legacy-migration-analyzer -- When the checklist detects .NET Framework 4.x or EOL frameworks, reference this skill for comprehensive migration analysis and phased upgrade plan.dotnet-security-review -- When the checklist identifies security findings, reference this skill for deeper security posture assessment.Reference files: Review Checklist | CQRS Patterns | Framework Detection | Red Flags
development
Federal / government security overlay applied ON TOP OF a base language security review (dotnet/python/php/rust/react). Language-agnostic: adds NIST SP 800-53 control mapping, FIPS 140-2/3 cryptographic compliance (with a per-language crypto table), CUI handling, EO 14028 supply-chain requirements, and DOE Order 205.1B, and emits POA&M-ready findings with FIPS 199 impact levels. Use for federal/DOE/DOD/national-laboratory systems. Triggers on "federal security review", "NIST compliance", "NIST 800-53", "FISMA", "CUI", "FIPS audit", "DOE security", "POA&M", "ATO review". Do NOT use alone — run the matching <lang>-security-review FIRST; this overlay maps and extends it.
tools
OWASP-based security review of React / TypeScript front-end applications. Detects the framework (Vite/CRA/Next), entry points, and data flows, scans against the OWASP Top 10 (2025) mapped to React client-side patterns (XSS via raw HTML, URL/protocol injection, secrets in the bundle, insecure token storage, dependency CVEs, missing CSP, open redirects), and produces a manager-friendly executive summary plus a graded technical findings table. Use to audit React code for vulnerabilities. Triggers on "react security review", "frontend security audit", "audit react for vulnerabilities", "owasp react", "react xss", "react security posture", "npm audit review". For federal / gov / DOE / NIST / FIPS / CUI context, run security-review-federal after this base review. Do NOT use to grade architecture/structure — use react-architecture-checklist.
tools
Analyzes legacy React codebases and produces actionable modernization plans. Primary migration paths include class components to function components + hooks, Create React App to Vite, React 16/17 to 18 to 19, JavaScript to TypeScript, Enzyme to React Testing Library, legacy Redux to Redux Toolkit / Zustand / Context, and deprecated lifecycle/API removal. Does NOT perform the migration — assesses, quantifies risk, and plans. Triggers on phrases like "modernize react", "class to hooks", "upgrade react", "migrate CRA to vite", "react legacy migration", "react 17 to 18", "react js to typescript", "react technical debt", "enzyme to RTL".
development
Scaffolds feature-based React / TypeScript architecture using feature folders, presentational + container components, custom hooks, a typed data layer, and structural CQRS (query hooks vs mutation hooks). React analog of dotnet-vertical-slice and python-feature-slice — no DI framework; uses props/context for dependency injection and a query cache for server state. Use when creating feature-based React projects, adding React features, organizing components by feature rather than by technical type, or scaffolding a feature's data layer. Triggers on phrases like "scaffold react feature", "create react slice", "react feature folder", "react vertical slice", "add react feature", "react feature architecture", "organize react by feature".