Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

spring-boot-project-creatorSpring Boot 项目创建者

Agent Skill

用于辅助 Java 项目开发、面向对象设计、Spring 生态、Maven 或 Gradle 依赖和后端工程实践。它适合让 Agent 分析类结构、设计接口、整理服务分层、生成测试或检查常见代码坏味道。使用时需要结合项目已有架构、包结构和依赖版本,不应只按通用教程改代码;涉及数据库、事务、并发或框架配置时,应先确认运行环境和回归测试范围。

总安装

10,372

周安装

441

GitHub Stars

229

下载量

3,634
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:spring-boot-project-creator(Spring Boot 项目创建者)
来源仓库:https://github.com/giuseppe-trisciuoglio/developer-kit
仓库路径:skills/spring-boot-project-creator
安装命令:
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill spring-boot-project-creator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill spring-boot-project-creator

简介

自动化生成标准化 Spring Boot 项目目录结构的工具。

  • 适用于新项目初始化与团队脚手架统一管理的需求。
  • 支持按业务域划分模块与选择主流技术栈组合。spring-boot-project-creator 属于前端设计类 Skill,可作为该场景下的辅助能力补充。
  • 自定义模板需经过多轮迭代验证通用性与扩展性。
  • 生成的 pom.xml 或 build.gradle 应人工复核依赖范围。

SKILL.md

Spring Boot Project Creator

Overview

Generates a fully configured Spring Boot project from scratch using the Spring Initializr API. The skill walks the user through selecting project parameters, choosing an architecture style (DDD or Layered), configuring data stores, and setting up Docker Compose for local development. The result is a build-ready project with standardized structure, dependency management, and configuration.

When to Use

  • Bootstrap a new Spring Boot 3.x or 4.x project with a standard structure.
  • Initialize a backend microservice with JPA, SpringDoc OpenAPI, and Docker Compose.
  • Scaffold a project following either DDD (Domain-Driven Design) or Layered (Controller/Service/Repository/Model) architecture.
  • Set up local development infrastructure with PostgreSQL, Redis, and/or MongoDB via Docker Compose.
  • Trigger phrases: "create spring boot project", "new spring boot app", "bootstrap java project", "scaffold spring boot microservice", "initialize spring boot backend", "generate spring boot project".

Prerequisites

Before starting, ensure the following tools are installed:

  • Java Development Kit (JDK): Version 17+ (Java 21 recommended for Spring Boot 3.x/4.x)
  • Apache Maven: Build tool (Spring Initializr generates Maven projects by default)
  • Docker and Docker Compose: For running local infrastructure services
  • curl and unzip: For downloading and extracting the project from Spring Initializr

Instructions

Follow these steps to create a new Spring Boot project.

1. Gather Project Configuration

Ask the user for the following project parameters using AskUserQuestion. Provide sensible defaults:

ParameterDefaultOptions
Group IDcom.exampleAny valid Java package name
Artifact IDdemoKebab-case identifier
Package NameSame as Group IDValid Java package
Spring Boot Version3.4.53.4.x, 4.0.x (check start.spring.io for latest)
Java Version2117, 21
ArchitectureUser choiceDDD or Layered
Docker ServicesUser choicePostgreSQL, Redis, MongoDB (multi-select)
Build Toolmavenmaven, gradle

2. Generate Project with Spring Initializr

Use curl to download the project scaffold from start.spring.io.

Base dependencies (always included):

  • web — Spring Web MVC
  • validation — Jakarta Bean Validation
  • data-jpa — Spring Data JPA
  • testcontainers — Testcontainers support

Conditional dependencies (based on Docker Services selection):

  • PostgreSQL selected → add postgresql
  • Redis selected → add data-redis
  • MongoDB selected → add data-mongodb
# Example for Spring Boot 3.4.5 with PostgreSQL only
curl -s https://start.spring.io/starter.zip \
  -d type=maven-project \
  -d language=java \
  -d bootVersion=3.4.5 \
  -d groupId=com.example \
  -d artifactId=demo \
  -d packageName=com.example \
  -d javaVersion=21 \
  -d packaging=jar \
  -d dependencies=web,data-jpa,postgresql,validation,testcontainers \
  -o starter.zip

unzip -o starter.zip -d ./demo
rm starter.zip
cd demo

3. Add Additional Dependencies

Edit pom.xml to add SpringDoc OpenAPI and ArchUnit for architectural testing.

<!-- SpringDoc OpenAPI -->
<dependency>
    <groupId>org.springdoc</groupId>
    <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
    <version>2.8.15</version>
</dependency>

<!-- ArchUnit for architecture tests -->
<dependency>
    <groupId>com.tngtech.archunit</groupId>
    <artifactId>archunit-junit5</artifactId>
    <version>1.4.1</version>
    <scope>test</scope>
</dependency>

4. Create Architecture Structure

Based on the user's choice, create the package structure under src/main/java/<packagePath>/.

Option A: Layered Architecture

src/main/java/com/example/
├── controller/        # REST controllers (@RestController)
├── service/           # Business logic (@Service)
├── repository/        # Data access (@Repository, Spring Data interfaces)
├── model/             # JPA entities (@Entity)
│   └── dto/           # Request/Response DTOs (Java records)
├── config/            # Configuration classes (@Configuration)
└── exception/         # Custom exceptions and @ControllerAdvice

Create placeholder classes for each layer:

  • config/OpenApiConfig.java — SpringDoc OpenAPI configuration bean
  • exception/GlobalExceptionHandler.java@RestControllerAdvice with standard error handling
  • model/dto/ErrorResponse.java — Standard error response record

Option B: DDD (Domain-Driven Design) Architecture

src/main/java/com/example/
├── domain/                 # Core domain (framework-free)
│   ├── model/              # Entities, Value Objects, Aggregates
│   ├── repository/         # Repository interfaces (ports)
│   └── exception/          # Domain exceptions
├── application/            # Use cases / Application services
│   ├── service/            # @Service orchestration
│   └── dto/                # Input/Output DTOs (records)
├── infrastructure/         # External adapters
│   ├── persistence/        # JPA entities, Spring Data repos
│   └── config/             # Spring @Configuration
└── presentation/           # REST API layer
    ├── controller/         # @RestController
    └── exception/          # @RestControllerAdvice

Create placeholder classes for each layer:

  • infrastructure/config/OpenApiConfig.java — SpringDoc OpenAPI configuration bean
  • presentation/exception/GlobalExceptionHandler.java@RestControllerAdvice with standard error handling
  • application/dto/ErrorResponse.java — Standard error response record

5. Configure Application Properties

Create src/main/resources/application.properties with the selected services.

Always include:

# Application
spring.application.name=${artifactId}

# SpringDoc OpenAPI
springdoc.swagger-ui.doc-expansion=none
springdoc.swagger-ui.operations-sorter=alpha
springdoc.swagger-ui.tags-sorter=alpha

If PostgreSQL is selected:

# PostgreSQL / JPA
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/${POSTGRES_DB:postgres}
spring.datasource.username=${POSTGRES_USER:postgres}
spring.datasource.password=${POSTGRES_PASSWORD:changeme}
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true

If Redis is selected:

# Redis
spring.data.redis.host=localhost
spring.data.redis.port=6379
spring.data.redis.password=${REDIS_PASSWORD:changeme}

If MongoDB is selected:

# MongoDB
spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.authentication-database=admin
spring.data.mongodb.username=${MONGO_USER:root}
spring.data.mongodb.password=${MONGO_PASSWORD:changeme}
spring.data.mongodb.database=${MONGO_DB:test}

6. Set Up Docker Compose

Create docker-compose.yaml at the project root with only the services the user selected.

services:
  # Include if PostgreSQL selected
  postgresql:
    image: postgres:17
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-postgres}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
      POSTGRES_DB: ${POSTGRES_DB:-postgres}
    volumes:
      - ./postgres_data:/var/lib/postgresql/data

  # Include if Redis selected
  redis:
    image: redis:7
    ports:
      - "6379:6379"
    command: redis-server --requirepass ${REDIS_PASSWORD:-changeme}
    volumes:
      - ./redis_data:/data

  # Include if MongoDB selected
  mongodb:
    image: mongo:8
    ports:
      - "27017:27017"
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER:-root}
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:-changeme}
    volumes:
      - ./mongo_data:/data/db

7. Create .env File for Docker Compose

Create a .env file at the project root with default credentials for local development:

# PostgreSQL
POSTGRES_USER=postgres
POSTGRES_PASSWORD=changeme
POSTGRES_DB=postgres

# Redis
REDIS_PASSWORD=changeme

# MongoDB
MONGO_USER=root
MONGO_PASSWORD=changeme
MONGO_DB=test

Include only the variables for the services the user selected. Docker Compose automatically loads this file.

8. Update.gitignore

Append Docker Compose volume directories and the .env file to .gitignore:

# Docker Compose
.env
postgres_data/
redis_data/
mongo_data/

9. Verify the Build

Run the Maven build to confirm the project compiles and tests pass:

./mvnw clean verify

If the build succeeds, inform the user. If it fails, diagnose and fix the issue before proceeding.

10. Present Summary to User

Display a summary of the created project:

Project Created Successfully

  Artifact:      <artifactId>
  Spring Boot:   <version>
  Java:          <javaVersion>
  Architecture:  <DDD | Layered>
  Build Tool:    Maven
  Docker:        <services list>

  Directory:     ./<artifactId>/

  Next Steps:
    1. cd <artifactId>
    2. docker compose up -d
    3. ./mvnw spring-boot:run
    4. Open http://localhost:8080/swagger-ui.html

Architecture Patterns

Layered Architecture

Traditional three-tier architecture with clear separation of concerns:

LayerPackageResponsibility
Presentationcontroller/HTTP endpoints, request/response mapping
Businessservice/Business logic, transaction management
Data Accessrepository/Database operations via Spring Data
Domainmodel/JPA entities and DTOs

Best for: Simple CRUD applications, small-to-medium services, teams new to Spring Boot.

DDD Architecture

Domain-Driven Design with hexagonal boundaries:

LayerPackageResponsibility
Domaindomain/Entities, value objects, domain services (framework-free)
Applicationapplication/Use cases, orchestration, DTO mapping
Infrastructureinfrastructure/JPA adapters, external integrations, configuration
Presentationpresentation/REST controllers, error handling

Best for: Complex business domains, microservices with rich logic, long-lived projects.

Examples

Example 1: Simple REST API with PostgreSQL (Layered)

User request: "Create a Spring Boot project for a REST API with PostgreSQL"

curl -s https://start.spring.io/starter.zip \
  -d type=maven-project \
  -d bootVersion=3.4.5 \
  -d groupId=com.example \
  -d artifactId=my-api \
  -d packageName=com.example.myapi \
  -d javaVersion=21 \
  -d dependencies=web,data-jpa,postgresql,validation,testcontainers \
  -o starter.zip

Result: Layered project with controller/, service/, repository/, model/ packages, PostgreSQL Docker Compose, and SpringDoc OpenAPI.

Example 2: Microservice with DDD and Multiple Stores

User request: "Bootstrap a Spring Boot 3 microservice with DDD, PostgreSQL and Redis"

curl -s https://start.spring.io/starter.zip \
  -d type=maven-project \
  -d bootVersion=3.4.5 \
  -d groupId=com.acme \
  -d artifactId=order-service \
  -d packageName=com.acme.order \
  -d javaVersion=21 \
  -d dependencies=web,data-jpa,postgresql,data-redis,validation,testcontainers \
  -o starter.zip

Result: DDD project with domain/, application/, infrastructure/, presentation/ packages, PostgreSQL + Redis Docker Compose, and SpringDoc OpenAPI.

Best Practices

  • Always use Spring Initializr for project generation to get the correct dependency management and parent POM.
  • Use Java records for DTOs — they are immutable and concise.
  • Keep domain layer framework-free in DDD architecture — no Spring annotations in domain/.
  • Use environment variables for sensitive configuration in production (database passwords, etc.).
  • Pin Docker image versions in docker-compose.yaml to avoid unexpected breaking changes.
  • Run ./mvnw clean verify after setup to ensure everything compiles and tests pass.
  • Add Testcontainers for integration tests instead of relying on Docker Compose.

Constraints and Warnings

  • Spring Initializr requires internet access — this skill cannot work offline.
  • Spring Boot 4.x availability depends on the current release cycle — check start.spring.io for latest versions.
  • Docker Compose credentials are loaded from .env file (git-ignored) — never commit secrets to version control.
  • The spring.jpa.hibernate.ddl-auto=update setting is for development only — use Flyway or Liquibase in production.
  • ArchUnit version must be compatible with the JUnit 5 version bundled with Spring Boot.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.3%
按下载量换算1,355

Claude

29.38%
按下载量换算1,068

Cursor

17.31%
按下载量换算629

Gemini CLI

9.42%
按下载量换算342

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills