AI Agent Hub
Back to skills
Spring Boot Project Generator icon

Spring Boot Project Generator

Development Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_faca7523/springboot-generator.

About this skill

Problem Addressed

When starting a new Spring Boot service, engineers often repeat the same setup work: creating the directory layout, adding configuration, defining a unified response wrapper, handling exceptions, and wiring logging or caching. springboot-generator targets this repetitive scaffolding by generating a standard Spring Boot structure directly in the current working directory, including pom.xml, application.yml, the bootstrap class, exception handlers, and configuration classes, without creating an extra subdirectory.

Core Capabilities

  • Parameter confirmation: asks for groupId, artifactId, version, springBootVersion, packageName, and author; groupId is required, while artifactId defaults to the current directory name.
  • Version mapping: selects compatible MyBatis Plus, Knife4j, and MySQL Connector versions based on the Spring Boot version.
  • Unified responses and exceptions: generates Result, ResultCode, BizException, and GlobalExceptionHandler, with JSR-303 validation support.
  • Context and pagination: provides UserContext, UserContextInterceptor, and PageResult for request-scoped data and paginated queries.
  • Logging and caching: includes the ShowLog annotation, ShowLogHandler aspect, CacheDataAnnotation, and caching AOP, with Redis serialization configured.
  • API documentation: integrates Knife4j, which can be disabled with knife4j.enable: false.

Boundaries and Notes

  • The generated project targets JDK 17, so the local toolchain must be compatible.
  • It assumes the current directory is already prepared, because output is written directly there.
  • Database settings in application.yml still need to be updated after generation.
  • Redis-related dependencies can be removed if the service does not use Redis.
  • A standard package layout such as com.company.project is recommended to avoid naming conflicts during later refactoring.

Use Cases

  • Create a Spring Boot workspace in an empty project folder with pom.xml, application.yml, bootstrap class, and base configuration classes.
  • Align MyBatis Plus, Knife4j, and MySQL Connector versions for the chosen Spring Boot release before wiring database access.
  • Build REST endpoints with generated unified responses, global exception handling, validation, pagination, and user context support.
  • Add Redis-backed object caching using the generated cache annotation, cache AOP, and Redis serialization configuration.

Best For

  • Engineers starting a new Java backend service who need a standard buildable project layout before writing business logic.
  • Teams maintaining enterprise REST APIs that need unified responses, global exception handling, and validation as baseline constraints.
  • Backend developers integrating MyBatis Plus and Redis who want pagination, caching, and serialization configured upfront.
  • Developers building internal admin consoles who expect logging aspects and Knife4j API docs by default.