Validate .NET API project structure follows Clean Architecture with proper layer separation and dependencies
Validates .NET API projects for Clean Architecture compliance by checking layer separation, dependency rules, and entity patterns. Use after creating or refactoring APIs to ensure proper structure and prevent architectural violations.
/plugin marketplace add usmanali4073/stylemate-plugins/plugin install stylemate-architecture@stylemate-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Use this skill to validate that a .NET API project follows StyleMate's Clean Architecture standards with proper layer separation and dependencies.
Checks for required directories:
Domain/ (no dependencies)Application/ (depends on Domain only)Infrastructure/ (implements interfaces)Controllers/ (orchestration layer)Validates that:
Ensures Domain entities:
Validates Application services:
Checks Infrastructure layer:
Please validate the staff-api project structure to ensure it follows Clean Architecture.
The project is located at ./staff/staff-api/
// WRONG: Domain referencing DbContext
using Infrastructure.Data;
public class Employee
{
public void Save(AppDbContext context) { } // ❌
}
// CORRECT: Domain with no dependencies
public class Employee
{
public Guid Id { get; private set; }
public string Name { get; private set; }
// Business logic only
public void UpdateName(string newName)
{
if (string.IsNullOrWhiteSpace(newName))
throw new ArgumentException("Name required");
Name = newName;
}
}
// WRONG: Exposing domain entities
[HttpGet]
public async Task<Employee> Get(Guid id) // ❌
{
return await _service.GetEmployee(id);
}
// CORRECT: Returning DTOs
[HttpGet]
public async Task<EmployeeDto> Get(Guid id) // ✓
{
return await _service.GetEmployee(id);
}
When violations found:
Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.