Your XXXService and XXXRepository classes will likely violate the SOLID principles (such as SRP, OCP, and ISP). Try hiding business logic and repository logic behind generic abstractions as can be learned here and here. This makes it easy to add cross-cutting concerns to these classes and allows you to register each group in a single line of code:
builder.RegisterAssemblyTypes(assemblies)
.As(t => t.GetInterfaces()
.Where(a => a.IsClosedTypeOf(typeof(ICommandHandler<>))));
builder.RegisterAssemblyTypes(assemblies)
.As(t => t.GetInterfaces()
.Where(a => a.IsClosedTypeOf(typeof(IQueryHandler<>))));
builder.RegisterAssemblyTypes(assemblies)
.As(t => t.GetInterfaces()
.Where(a => a.IsClosedTypeOf(typeof(IRepository<>))));