java-spring-service
Creates complete Spring Boot services following best practices and layered architecture. Use when building REST APIs, creating Spring services, setting up controllers, implementing repositories, adding Spring Boot applications, configuring dependency injection, creating RESTful endpoints, adding OpenAPI documentation, or building microservices. Works with Spring Boot 2.x and 3.x, Spring Data JPA, Spring Web, and Spring Security.
What this skill does
# Spring Boot Service Generator
## Table of Contents
- [Purpose](#purpose)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Instructions](#instructions)
- [Examples](#examples)
- [Requirements](#requirements)
- [Best Practices Checklist](#best-practices-checklist)
- [Output Format](#output-format)
- [Error Handling](#error-handling)
## Purpose
Generates complete, production-ready Spring Boot services following industry best practices: proper layered architecture (Controller/Service/Repository), dependency injection, exception handling with @ControllerAdvice, OpenAPI/Swagger documentation, configuration management, and comprehensive logging.
## When to Use
Use this skill when you need to:
- Create new Spring Boot REST APIs
- Generate CRUD services with JPA repositories
- Set up layered architecture (Controller/Service/Repository)
- Implement RESTful endpoints with proper HTTP methods
- Add OpenAPI/Swagger documentation
- Configure Spring Data JPA entities and repositories
- Create DTOs and mappers for API contracts
- Implement global exception handling with @ControllerAdvice
- Set up dependency injection with constructor injection
- Generate complete Spring Boot microservices
- Add pagination and sorting to endpoints
- Configure database migrations with Flyway
- Bootstrap new Spring Boot projects with best practices
## Quick Start
Describe the service you need and get a complete implementation:
```bash
# Create a complete CRUD service
Create a Spring Boot service for User management with CRUD operations
# Create a specific endpoint
Create a Spring Boot REST endpoint for processing orders
```
## Instructions
### Step 1: Understand Service Requirements
Identify what needs to be created:
- Entity/domain model (JPA entity)
- Repository layer (Spring Data)
- Service layer (business logic)
- Controller layer (REST API)
- DTOs (request/response objects)
- Exception handling
- Configuration
- API documentation
### Step 2: Generate Domain Model (Entity)
Create JPA entity with proper annotations:
```java
@Entity
@Table(name = "users")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, length = 100)
private String name;
@Column(nullable = false, unique = true, length = 255)
private String email;
@Column(name = "phone_number", length = 20)
private String phoneNumber;
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private UserStatus status;
@CreatedDate
@Column(nullable = false, updatable = false)
private LocalDateTime createdAt;
@LastModifiedDate
@Column(nullable = false)
private LocalDateTime updatedAt;
@Version
private Long version;
}
```
**Key Annotations:**
- @Entity, @Table - JPA entity mapping
- @Id, @GeneratedValue - Primary key generation
- @Column - Column constraints and naming
- @Enumerated - Enum mapping
- @CreatedDate, @LastModifiedDate - Audit fields
- @Version - Optimistic locking
- @Data (Lombok) - Getters, setters, toString, equals, hashCode
- @Builder (Lombok) - Builder pattern
### Step 3: Create DTOs (Data Transfer Objects)
Separate internal models from API contracts:
```java
// Request DTO
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CreateUserRequest {
@NotBlank(message = "Name is required")
@Size(min = 2, max = 100, message = "Name must be between 2 and 100 characters")
private String name;
@NotBlank(message = "Email is required")
@Email(message = "Email must be valid")
private String email;
@Pattern(regexp = "^\\+?[1-9]\\d{1,14}$",
message = "Phone number must be in E.164 format")
private String phoneNumber;
}
// Response DTO
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UserResponse {
private Long id;
private String name;
private String email;
private String phoneNumber;
private UserStatus status;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
// Mapper
@Component
public class UserMapper {
public User toEntity(CreateUserRequest request) {
return User.builder()
.name(request.getName())
.email(request.getEmail())
.phoneNumber(request.getPhoneNumber())
.status(UserStatus.ACTIVE)
.build();
}
public UserResponse toResponse(User user) {
return UserResponse.builder()
.id(user.getId())
.name(user.getName())
.email(user.getEmail())
.phoneNumber(user.getPhoneNumber())
.status(user.getStatus())
.createdAt(user.getCreatedAt())
.updatedAt(user.getUpdatedAt())
.build();
}
}
```
### Step 4: Create Repository Layer
Use Spring Data JPA for data access:
```java
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
Optional<User> findByEmail(String email);
List<User> findByStatus(UserStatus status);
@Query("SELECT u FROM User u WHERE u.name LIKE %:searchTerm% OR u.email LIKE %:searchTerm%")
Page<User> searchUsers(@Param("searchTerm") String searchTerm, Pageable pageable);
boolean existsByEmail(String email);
@Modifying
@Query("UPDATE User u SET u.status = :status WHERE u.id = :id")
int updateUserStatus(@Param("id") Long id, @Param("status") UserStatus status);
}
```
**Key Features:**
- Extends JpaRepository for CRUD operations
- Custom query methods (findByEmail, findByStatus)
- @Query for complex queries
- Pagination support with Pageable
- @Modifying for update/delete queries
### Step 5: Create Service Layer
Implement business logic with transactions:
```java
@Service
@RequiredArgsConstructor
@Slf4j
public class UserService {
private final UserRepository userRepository;
private final UserMapper userMapper;
private final ApplicationEventPublisher eventPublisher;
@Transactional(readOnly = true)
public UserResponse getUserById(Long id) {
log.debug("Fetching user with id: {}", id);
User user = userRepository.findById(id)
.orElseThrow(() -> new UserNotFoundException(id));
return userMapper.toResponse(user);
}
@Transactional(readOnly = true)
public Page<UserResponse> getAllUsers(Pageable pageable) {
log.debug("Fetching all users: page={}, size={}",
pageable.getPageNumber(), pageable.getPageSize());
return userRepository.findAll(pageable)
.map(userMapper::toResponse);
}
@Transactional
public UserResponse createUser(CreateUserRequest request) {
log.info("Creating user: email={}", request.getEmail());
if (userRepository.existsByEmail(request.getEmail())) {
throw new DuplicateEmailException(request.getEmail());
}
User user = userMapper.toEntity(request);
User savedUser = userRepository.save(user);
eventPublisher.publishEvent(new UserCreatedEvent(savedUser));
log.info("User created successfully: id={}", savedUser.getId());
return userMapper.toResponse(savedUser);
}
@Transactional
public UserResponse updateUser(Long id, UpdateUserRequest request) {
log.info("Updating user: id={}", id);
User user = userRepository.findById(id)
.orElseThrow(() -> new UserNotFoundException(id));
updateUserFields(user, request);
User updatedUser = userRepository.save(user);
log.info("User updated successfully: id={}", id);
return userMapper.toResponse(updatedUser);
}
@Transactional
public void deleteUser(Long id) {
log.info("Deleting user: id={}", id);
if (!userRepository.existsById(id)) {
throw new UserNotFoundException(id);
}
userRepository.deleteById(id);
log.info("User deleted successfully: id={}", id);
}
pRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.