lens-aspnet-structure

Enforce 5-layer architecture and dependency rules in LENS ASP.NET Core services.

Updated May 7, 2026
One-click install
npx skills add https://github.com/tmalcolm-0607/mad-council-claw --skill lens-aspnet-structure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lens-aspnet-structure
Source: https://github.com/tmalcolm-0607/mad-council-claw/tree/main/.claude/skills/lens-aspnet-structure
Command: npx skills add https://github.com/tmalcolm-0607/mad-council-claw --skill lens-aspnet-structure

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

LENS ASP.NET Core services require strict adherence to a 5-layer architecture with unidirectional dependencies, specific design patterns (handler, repository, DI registration), and anti-pattern avoidance to maintain governance compliance, reduce technical debt, and ensure consistent, maintainable codebases. Without enforced standards, teams introduce layer violations, business logic in incorrect layers, and inconsistent wiring that creates fragile, hard-to-debug services.

Core Features & Use Cases

  • Layer Boundary Enforcement: Validates and scaffolds the canonical 5-layer LENS structure (API, BusinessLogic, DataAccess, Common, DependencyInjection) with strict dependency rules, preventing layer skipping and circular references.
  • Pattern Compliance & Anti-Pattern Detection: Identifies violations like business logic in controllers, missing handler patterns, incorrect DI registration, and infrastructure exceptions leaking across layer boundaries, with explicit fixes for each issue.
  • Migration Planning: Generates phased, minimum-disruption remediation plans for existing non-compliant LENS services, prioritizing structural fixes before code quality improvements to avoid wasted refactoring work.
  • Use Case Example: A team onboarding to the LENS governance model can use this skill to scaffold a new service with correct project structure and wiring from day one, while a team maintaining a legacy LENS service can use it to audit all architectural violations and produce a step-by-step fix plan aligned with LENS standards.

Quick Start

Invoke the lens-aspnet-structure skill to analyze your LENS ASP.NET Core service codebase, identify all architectural violations, and generate a phased migration plan to align with LENS structure standards.

Frequently Asked Questions about lens-aspnet-structure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce ASP.NET Core service layer boundaries and prevent structural violations?

You enforce layer boundaries by validating codebases against a canonical 5-layer architecture with unidirectional dependencies, preventing layer skipping and circular references. This eliminates structural technical debt by ensuring strict separation between API, BusinessLogic, DataAccess, Common, and DependencyInjection layers.

What is the correct dependency injection registration pattern for ASP.NET Core services?

Correct dependency injection registration requires standardizing DI wiring within the dedicated DependencyInjection layer. This ensures consistent service architecture, prevents fragile hard-to-debug wiring, and satisfies governance compliance by centralizing all dependency registration across the ASP.NET Core project structure.

How do I migrate an existing C# ASP.NET Core codebase to a compliant service architecture?

Migrating an existing C# ASP.NET Core codebase involves generating a phased, minimum-disruption remediation plan that prioritizes structural fixes before code quality improvements. This approach audits all architectural violations and produces a step-by-step fix plan aligned with unidirectional layer boundaries and governance standards.

How do I detect business logic in controllers and other ASP.NET Core anti-patterns?

Detecting business logic in controllers requires pattern compliance analysis that identifies violations like missing handler patterns, incorrect DI registration, and infrastructure exceptions leaking across layer boundaries. The analysis provides explicit fixes for each detected anti-pattern to restore compliant service architecture.

Can I scaffold a new ASP.NET Core service with correct project structure and wiring from the start?

Yes, you can scaffold a new ASP.NET Core service with correct project structure and wiring from day one. New service scaffolding applies the canonical 5-layer structure, enforces handler patterns, and standardizes dependency injection registration to ensure governance compliance and maintainable codebases immediately.

Why does infrastructure exception handling leak across layer boundaries in C# services?

Infrastructure exceptions leak across layer boundaries when exception boundary validation is missing, allowing data access errors to propagate directly to the API layer. Enforcing strict unidirectional dependencies and handler pattern compliance prevents this by catching and translating exceptions at proper architectural boundaries.