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
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import io.swagger.v3.oas.annotations.Operation;
@RestControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(BookNotFoundException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
@Operation(hidden = true)
public ErrorResponse handleBookNotFound(BookNotFoundException ex) {
return new ErrorResponse("BOOK_NOT_FOUND", ex.getMessage());
}
@ExceptionHandler(ValidationException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
@Operation(hidden = true)
public ErrorResponse handleValidation(ValidationException ex) {
return new ErrorResponse("VALIDATION_ERROR", ex.getMessage());
}
@ExceptionHandler(AccessDeniedException.class)
@ResponseStatus(HttpStatus.FORBIDDEN)
@Operation(hidden = true)
public ErrorResponse handleAccessDenied(AccessDeniedException ex) {
return new ErrorResponse("ACCESS_DENIED", "Insufficient permissions");
}
@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@Operation(hidden = true)
public ErrorResponse handleGeneric(Exception ex) {
return new ErrorResponse("INTERNAL_ERROR", "An unexpected error occurred");
}
}import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "Standard error response")
public record ErrorResponse(
@Schema(description = "Error code", example = "BOOK_NOT_FOUND")
String code,
@Schema(description = "Human-readable error message", example = "Book with ID 123 not found")
String message,
@Schema(description = "Additional error details")
List<ValidationError> details,
@Schema(description = "Error timestamp", example = "2024-01-15T10:30:00Z")
LocalDateTime timestamp,
@Schema(description = "Request path that caused the error", example = "/api/books/123")
String path
) {
public ErrorResponse(String code, String message) {
this(code, message, List.of(), LocalDateTime.now(), "");
}
@Schema(description = "Validation error detail")
public record ValidationError(
@Schema(description = "Field name", example = "title")
String field,
@Schema(description = "Error message", example = "Title is required")
String message
) {}
}@Operation(
summary = "Get book by ID",
responses = {
@ApiResponse(
responseCode = "200",
description = "Book found",
content = @Content(schema = @Schema(implementation = Book.class))
),
@ApiResponse(
responseCode = "404",
description = "Book not found",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
),
@ApiResponse(
responseCode = "401",
description = "Unauthorized",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
),
@ApiResponse(
responseCode = "500",
description = "Internal server error",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
)
}
)
@GetMapping("/{id}")
public Book getBook(@PathVariable Long id) {
return repository.findById(id).orElseThrow(() -> new BookNotFoundException(id));
}@Operation(
summary = "Create book",
responses = {
@ApiResponse(
responseCode = "201",
description = "Book created"
),
@ApiResponse(
responseCode = "400",
description = "Validation failed",
content = @Content(
schema = @Schema(implementation = ErrorResponse.class),
examples = @ExampleObject(
value = """
{
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{"field": "title", "message": "Title is required"},
{"field": "isbn", "message": "Invalid ISBN format"}
],
"timestamp": "2024-01-15T10:30:00Z",
"path": "/api/books"
}
"""
)
)
)
}
)
@PostMapping
public Book createBook(@Valid @RequestBody Book book) {
return repository.save(book);
}@Schema(description = "RFC 7807 Problem Details")
public record ProblemDetail(
@Schema(description = "Problem type URI", example = "https://example.com/probs/book-not-found")
String type,
@Schema(description = "Short problem title", example = "Book Not Found")
String title,
@Schema(description = "HTTP status code", example = "404")
int status,
@Schema(description = "Detailed problem description", example = "Book with ID 123 does not exist")
String detail,
@Schema(description = "Instance identifier", example = "/api/books/123")
String instance
) {}
@RestControllerAdvice
public class ProblemDetailExceptionHandler {
@ExceptionHandler(BookNotFoundException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
@Operation(hidden = true)
public ProblemDetail handleNotFound(BookNotFoundException ex) {
return new ProblemDetail(
"https://example.com/probs/book-not-found",
"Book Not Found",
HttpStatus.NOT_FOUND.value(),
ex.getMessage(),
"/api/books/" + ex.getId()
);
}
}@Schema(description = "Constraint violation detail")
public record ConstraintViolation(
@Schema(description = "Invalid field", example = "title")
String field,
@Schema(description = "Constraint that failed", example = "NotBlank")
String constraint,
@Schema(description = "Error message", example = "must not be blank")
String message,
@Schema(description = "Invalid value", example = "null")
String rejectedValue
) {}
@Schema(description = "Validation error response")
public record ValidationErrorResponse(
@Schema(description = "Error code", example = "VALIDATION_FAILED")
String code,
@Schema(description = "Validation errors")
List<ConstraintViolation> violations,
@Schema(description = "Total number of violations", example = "2")
int violationCount,
@Schema(description = "Timestamp", example = "2024-01-15T10:30:00Z")
LocalDateTime timestamp
) {}public class InsufficientStockException extends RuntimeException {
private final Long bookId;
private final int requested;
private final int available;
public InsufficientStockException(Long bookId, int requested, int available) {
super(String.format("Insufficient stock for book %d: requested=%d, available=%d",
bookId, requested, available));
this.bookId = bookId;
this.requested = requested;
this.available = available;
}
// Getters...
}
@ExceptionHandler(InsufficientStockException.class)
@ResponseStatus(HttpStatus.CONFLICT)
@Operation(hidden = true)
public ErrorResponse handleInsufficientStock(InsufficientStockException ex) {
return new ErrorResponse(
"INSUFFICIENT_STOCK",
String.format("Only %d copies available, %d requested", ex.getAvailable(), ex.getRequested()),
Map.of(
"bookId", ex.getBookId(),
"requested", ex.getRequested(),
"available", ex.getAvailable()
)
);
}@Operation(hidden = true)@ApiResponse@Schema(description = "Error response with request tracking")
public record ErrorResponse(
String code,
String message,
Object details,
LocalDateTime timestamp,
String path,
@Schema(description = "Request ID for support", example = "abc-123-xyz")
String requestId
) {}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