Application service implementation

From IntentArchitect/Intent.Modules.NET · View interactive version

Application service implementation is an AI agent skill from the GitHub repository IntentArchitect/Intent.Modules.NET. Implements business logic in traditional (non-CQRS) application services. MUST load before creating or editing a traditional application service class in the Application layer.

How to use this skill

Skill file

Traditional Service Implementation

Implement business logic inside an existing traditional application service file. Keep service implementations aligned with the modeled domain, nearby service patterns, and application-layer boundaries.

Core rules

Workflow

  1. Inspect the existing service class, interface, operation signatures, DTOs, repositories/read services/domain services, and related domain types.
  2. Search for code usages of:
  1. Infer the intended business flow from the operation names, parameters, return types, surrounding domain model, and nearby feature implementations.
  2. Implement the service operation using existing patterns first.
  3. If the service needs missing DAL capabilities, extend the relevant repository/read/application abstraction in an allowed layer instead of introducing infrastructure access into the service.
  4. Add focused private helper methods when the flow becomes easier to read, reuse, or validate.
  5. Ensure cancellation tokens are threaded through async calls where applicable.
  6. Verify the final code preserves layer boundaries, follows surrounding service conventions, and avoids infrastructure leakage.

Service-specific guidance

Traditional services may combine command-style and query-style operations. Prefer patterns like these when supported by the surrounding codebase:

For state-changing operations

For read operations

Repository and abstraction guidance

When a needed capability is missing:

Mapping guidance

Error and result guidance

EF Related Data Loading guidance

Unit of Work guidance

Entity Framework repository guidance

AutoMapper guidance

Example:


public class CustomerDtoProfile : Profile
{
    public CustomerDtoProfile()
    {
        CreateMap<Customer, CustomerDto>();
    }
}

public static class CustomerDtoMappingExtensions
{
    public static CustomerDto MapToCustomerDto(this Customer projectFrom, IMapper mapper) =>
        mapper.Map<CustomerDto>(projectFrom);

    public static List<CustomerDto> MapToCustomerDtoList(this IEnumerable<Customer> projectFrom, IMapper mapper) =>
        projectFrom.Select(x => x.MapToCustomerDto(mapper)).ToList();
}

Output expectations

Produce a concrete code update that:

Review checklist

Before finishing, check that:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.