Comprehensive developer toolkit providing reusable skills for Java/Spring Boot, TypeScript/NestJS/React/Next.js, Python, PHP, AWS CloudFormation, AI/RAG, DevOps, and more.
90
90%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
Specific patterns for implementing Clean Architecture in Java 21+ applications.
Java records provide immutability and automatic equals/hashCode implementation.
// Value object with validation
public record Email(String value) {
private static final Pattern PATTERN = Pattern.compile("^[A-Za-z0-9+_.-]+@(.+)$");
public Email {
if (value == null || !PATTERN.matcher(value).matches()) {
throw new IllegalArgumentException("Invalid email: " + value);
}
}
public String domain() {
return value.substring(value.indexOf('@') + 1);
}
}
// Complex value object with multiple fields
public record Address(
String street,
String city,
String postalCode,
String country
) {
public Address {
Objects.requireNonNull(street, "Street is required");
Objects.requireNonNull(city, "City is required");
}
public String formatted() {
return String.format("%s, %s %s, %s", street, city, postalCode, country);
}
}Use sealed classes to control event inheritance.
public sealed interface DomainEvent {
Instant occurredAt();
String aggregateId();
}
public record OrderCreatedEvent(
OrderId orderId,
Money total,
Instant occurredAt
) implements DomainEvent {
public OrderCreatedEvent {
Objects.requireNonNull(orderId);
Objects.requireNonNull(total);
Objects.requireNonNull(occurredAt);
}
@Override
public String aggregateId() {
return orderId.value().toString();
}
}
public record OrderConfirmedEvent(
OrderId orderId,
Instant confirmedAt
) implements DomainEvent {}Prevent ID confusion with type-safe wrappers.
public record OrderId(UUID value) {
public OrderId {
Objects.requireNonNull(value, "OrderId cannot be null");
}
public static OrderId generate() {
return new OrderId(UUID.randomUUID());
}
public static OrderId fromString(String id) {
return new OrderId(UUID.fromString(id));
}
}
public record CustomerId(UUID value) {
public CustomerId {
Objects.requireNonNull(value);
}
}Centralize creation logic and enforce invariants.
public class Product {
private final ProductId id;
private String name;
private String description;
private Money price;
private Stock stock;
// Private constructor - use factory methods
private Product(ProductId id, String name, Money price) {
this.id = id;
this.name = name;
this.price = price;
this.stock = Stock.zero();
}
public static Product create(String name, Money price) {
validateName(name);
validatePrice(price);
return new Product(ProductId.generate(), name, price);
}
public static Product reconstitute(ProductId id, String name, Money price, Stock stock) {
Product product = new Product(id, name, price);
product.stock = stock;
return product;
}
private static void validateName(String name) {
if (name == null || name.isBlank() || name.length() > 100) {
throw new DomainException("Product name must be 1-100 characters");
}
}
public void updatePrice(Money newPrice) {
if (newPrice.amount().compareTo(BigDecimal.ZERO) <= 0) {
throw new DomainException("Price must be positive");
}
this.price = newPrice;
}
}Explicit handling of success/failure without exceptions.
public sealed interface Result<T, E> {
record Success<T, E>(T value) implements Result<T, E> {}
record Failure<T, E>(E error) implements Result<T, E> {}
default boolean isSuccess() {
return this instanceof Success;
}
default Optional<T> getValue() {
return this instanceof Success<T, E> s ? Optional.of(s.value()) : Optional.empty();
}
}
// Usage in domain
public Result<Order, OrderError> confirm() {
if (status != OrderStatus.PENDING) {
return new Result.Failure<>(OrderError.ALREADY_CONFIRMED);
}
if (items.isEmpty()) {
return new Result.Failure<>(OrderError.EMPTY_ORDER);
}
this.status = OrderStatus.CONFIRMED;
return new Result.Success<>(this);
}public class Order {
private final OrderId id;
private final CustomerId customerId;
private final List<OrderItem> items;
private ShippingAddress shippingAddress;
private PaymentMethod paymentMethod;
private Order(Builder builder) {
this.id = builder.id;
this.customerId = builder.customerId;
this.items = List.copyOf(builder.items);
this.shippingAddress = builder.shippingAddress;
this.paymentMethod = builder.paymentMethod;
}
public static Builder builder(CustomerId customerId) {
return new Builder(customerId);
}
public static class Builder {
private OrderId id = OrderId.generate();
private final CustomerId customerId;
private List<OrderItem> items = new ArrayList<>();
private ShippingAddress shippingAddress;
private PaymentMethod paymentMethod;
private Builder(CustomerId customerId) {
this.customerId = Objects.requireNonNull(customerId);
}
public Builder withItem(ProductId product, int quantity, Money price) {
items.add(new OrderItem(product, quantity, price));
return this;
}
public Builder shippingTo(ShippingAddress address) {
this.shippingAddress = address;
return this;
}
public Builder paidWith(PaymentMethod method) {
this.paymentMethod = method;
return this;
}
public Order build() {
if (items.isEmpty()) {
throw new DomainException("Order must have at least one item");
}
return new Order(this);
}
}
}
// Usage
Order order = Order.builder(customerId)
.withItem(product1, 2, new Money("29.99", EUR))
.withItem(product2, 1, new Money("49.99", EUR))
.shippingTo(new ShippingAddress("123 Main St", "City", "12345"))
.paidWith(PaymentMethod.CREDIT_CARD)
.build();When logic doesn't belong to a single entity.
// Domain service interface
public interface PricingService {
Money calculateTotal(List<OrderItem> items, CustomerType customerType);
}
// Domain service implementation (still framework-free)
public class StandardPricingService implements PricingService {
private static final BigDecimal VIP_DISCOUNT = new BigDecimal("0.90");
@Override
public Money calculateTotal(List<OrderItem> items, CustomerType customerType) {
Money subtotal = items.stream()
.map(OrderItem::getSubtotal)
.reduce(Money.zero(), Money::add);
return customerType == CustomerType.VIP
? subtotal.multiply(VIP_DISCOUNT)
: subtotal;
}
}Encapsulate business rules as composable objects.
public interface Specification<T> {
boolean isSatisfiedBy(T candidate);
default Specification<T> and(Specification<T> other) {
return candidate -> this.isSatisfiedBy(candidate) && other.isSatisfiedBy(candidate);
}
default Specification<T> not() {
return candidate -> !this.isSatisfiedBy(candidate);
}
}
// Usage
public class OrderSpecifications {
public static Specification<Order> isPending() {
return order -> order.getStatus() == OrderStatus.PENDING;
}
public static Specification<Order> hasMinimumValue(Money minimum) {
return order -> order.getTotal().amount().compareTo(minimum.amount()) >= 0;
}
public static Specification<Order> isEligibleForAutoApproval() {
return isPending().and(hasMinimumValue(new Money("1000.00", EUR))).not();
}
}public abstract class AggregateRoot {
private final List<DomainEvent> domainEvents = new CopyOnWriteArrayList<>();
protected void registerEvent(DomainEvent event) {
domainEvents.add(event);
}
public List<DomainEvent> getDomainEvents() {
return List.copyOf(domainEvents);
}
public void clearDomainEvents() {
domainEvents.clear();
}
}docs
plugins
developer-kit-ai
developer-kit-aws
agents
docs
skills
aws
aws-cli-beast
aws-cost-optimization
aws-drawio-architecture-diagrams
aws-sam-bootstrap
aws-cloudformation
aws-cloudformation-auto-scaling
aws-cloudformation-bedrock
aws-cloudformation-cloudfront
aws-cloudformation-cloudwatch
aws-cloudformation-dynamodb
aws-cloudformation-ec2
aws-cloudformation-ecs
aws-cloudformation-elasticache
references
aws-cloudformation-iam
references
aws-cloudformation-lambda
aws-cloudformation-rds
aws-cloudformation-s3
aws-cloudformation-security
aws-cloudformation-task-ecs-deploy-gh
aws-cloudformation-vpc
references
developer-kit-core
agents
commands
skills
developer-kit-devops
developer-kit-java
agents
commands
docs
skills
aws-lambda-java-integration
aws-rds-spring-boot-integration
aws-sdk-java-v2-bedrock
aws-sdk-java-v2-core
aws-sdk-java-v2-dynamodb
aws-sdk-java-v2-kms
aws-sdk-java-v2-lambda
aws-sdk-java-v2-messaging
aws-sdk-java-v2-rds
aws-sdk-java-v2-s3
aws-sdk-java-v2-secrets-manager
clean-architecture
graalvm-native-image
langchain4j-ai-services-patterns
references
langchain4j-mcp-server-patterns
references
langchain4j-rag-implementation-patterns
references
langchain4j-spring-boot-integration
langchain4j-testing-strategies
langchain4j-tool-function-calling-patterns
langchain4j-vector-stores-configuration
references
qdrant
references
spring-ai-mcp-server-patterns
spring-boot-actuator
spring-boot-cache
spring-boot-crud-patterns
spring-boot-dependency-injection
spring-boot-event-driven-patterns
spring-boot-openapi-documentation
spring-boot-project-creator
spring-boot-resilience4j
spring-boot-rest-api-standards
spring-boot-saga-pattern
spring-boot-security-jwt
assets
references
scripts
spring-boot-test-patterns
spring-data-jpa
references
spring-data-neo4j
references
unit-test-application-events
unit-test-bean-validation
unit-test-boundary-conditions
unit-test-caching
unit-test-config-properties
references
unit-test-controller-layer
unit-test-exception-handler
references
unit-test-json-serialization
unit-test-mapper-converter
references
unit-test-parameterized
unit-test-scheduled-async
references
unit-test-service-layer
references
unit-test-utility-methods
unit-test-wiremock-rest-api
references
developer-kit-php
developer-kit-project-management
developer-kit-python
developer-kit-specs
commands
docs
hooks
test-templates
tests
skills
developer-kit-tools
developer-kit-typescript
agents
docs
hooks
rules
skills
aws-cdk
aws-lambda-typescript-integration
better-auth
clean-architecture
drizzle-orm-patterns
dynamodb-toolbox-patterns
references
nestjs
nestjs-best-practices
nestjs-code-review
nestjs-drizzle-crud-generator
nextjs-app-router
nextjs-authentication
nextjs-code-review
nextjs-data-fetching
nextjs-deployment
nextjs-performance
nx-monorepo
react-code-review
react-patterns
shadcn-ui
tailwind-css-patterns
tailwind-design-system
references
turborepo-monorepo
typescript-docs
typescript-security-review
zod-validation-utilities
references
github-spec-kit