create-spring-boot-java-project

bởi github

Tạo khung dự án Spring Boot 3.4.5 với PostgreSQL, Redis, MongoDB và Docker Compose. Dựng dự án Spring Boot dựa trên Maven với Java 21, bao gồm Lombok, Spring Data JPA, Spring Web, caching và các phụ thuộc validation. Cấu hình sẵn application.properties với thông tin kết nối cho PostgreSQL, Redis và MongoDB, cùng SpringDoc OpenAPI cho tài liệu API. Tạo tệp docker-compose.yaml với các dịch vụ Redis 6, PostgreSQL 17 và MongoDB 8, mỗi dịch vụ có lưu trữ liên tục...

npx skills add https://github.com/github/awesome-copilot --skill create-spring-boot-java-project

Create a Spring Boot Java project

Scaffold a Spring Boot application with start.spring.io, then apply a small set of opinionated defaults. Out of scope for now: front-ends (Vue/React/Angular), cloud deployment (Azure), Git setup, CRaC and AOT images.

Step 0: Detect before you create

  • If the working directory already contains a pom.xml or build.gradle(.kts), this is an existing project: do not regenerate it. Read its Spring Boot, Java and test-framework versions and follow them. Never upgrade versions implicitly; propose an upgrade and wait for the user's decision.
  • Check the tools: java -version (JDK matching the chosen Java version), docker --version (needed for Testcontainers and Compose). On the default path (current Boot via start.spring.io) Maven/Gradle need not be installed: the generated wrapper is used. The Boot 3.5 fallback needs Maven or Gradle installed once to create the wrapper (see versions.md).
  • Ask only for what is missing: project name, group id, package, build tool (default Maven), dependencies (default: web, actuator, validation, devtools; add data-jpa, postgresql, security, docker-compose, testcontainers when a database or auth is needed).

Step 1: Resolve versions

Follow references/versions.md: query https://start.spring.io/metadata/client at run time for the latest stable Spring Boot release, fall back to the documented pinned values if offline. Do not hardcode latest anywhere.

Step 2: Generate the project

Use the start.spring.io HTTP API with explicit, pinned parameters (no piped installers). Replace the values in capitals.

Maven:

curl -fsS https://start.spring.io/starter.zip \
  -d type=maven-project -d language=java -d packaging=jar \
  -d bootVersion=BOOT_VERSION -d javaVersion=JAVA_VERSION \
  -d groupId=com.example -d artifactId=demo -d name=demo \
  -d packageName=com.example.demo -d baseDir=demo \
  -d dependencies=web,actuator,validation,devtools \
  -o demo.zip && unzip -q demo.zip && rm demo.zip

Gradle: same command with -d type=gradle-project (Groovy DSL) or -d type=gradle-project-kotlin (Kotlin DSL; the language stays java).

Inspect the result (ls demo, read the build file) and make sure the wrapper (mvnw or gradlew) is executable. Add -d dependencies=...,data-jpa,postgresql,docker-compose,testcontainers for a database project.

Step 3: Apply the defaults

AreaWhat to doReference
Boot 3 vs 4 differencesStarter names, Jackson 3, test modulesreferences/spring-boot-4.md
Configurationapplication.properties or .yml (match the project), profiles, @ConfigurationProperties, secrets via environmentreferences/configuration.md
DatabasePostgreSQL, Hibernate settings, Compose for dev, Testcontainers for testsreferences/database.md
LoggingSLF4J, parameterized messages, levels, structured loggingreferences/logging.md
SecuritySpring Security basics, secure defaults, Problem Detailsreferences/security.md
DockerJVM image and GraalVM native image Dockerfilesreferences/docker.md
TestingSee the spring-boot-testing skill (slices, Testcontainers, Failsafe)skills/spring-boot-testing
Best practicesSee the java-springboot skill and instructions/springboot.instructions.mdskills/java-springboot

Keep dotfiles minimal: a .gitignore covering target/, build/, .gradle/, IDE folders and .env; never commit .env (commit a .env.sample).

Step 4: Verify

  1. Build and test: ./mvnw verify (Maven) or ./gradlew build (Gradle).
  2. Run: ./mvnw spring-boot:run or ./gradlew bootRun, then curl -fsS localhost:8080/actuator/health must return {"status":"UP"}.
  3. Report the chosen versions and anything that was skipped or deferred.

Provenance

Adapted from the Apache-2.0 skill jdubois/dr-jskill; see references/PROVENANCE.md.

Thêm skills từ github

debugging-workflows
github
Hướng dẫn gỡ lỗi các quy trình tác nhân GitHub - phân tích nhật ký, kiểm tra lần chạy và khắc phục sự cố
go-codemod
github
Triển khai và kiểm thử các codemod Go cho lệnh gh aw fix.
acreadiness-policy
github
Giúp người dùng chọn, viết hoặc áp dụng chính sách AgentRC. Chính sách tùy chỉnh điểm sẵn sàng bằng cách tắt các kiểm tra không liên quan, ghi đè mức độ tác động/cấp độ, thiết lập…
ai-ready
github
Biến bất kỳ kho lưu trữ nào thành sẵn sàng cho AI — phân tích mã nguồn của bạn và tạo ra AGENTS.md, copilot-instructions.md, quy trình CI, mẫu issue, và nhiều hơn nữa. Khai thác đánh giá PR của bạn…
create-oo-component-documentation
github
Tạo tài liệu toàn diện, chuẩn hóa cho các thành phần hướng đối tượng, tuân theo các phương pháp thực hành tốt nhất trong ngành và tiêu chuẩn tài liệu kiến trúc.
dependabot
github
Dependabot là công cụ quản lý phụ thuộc tích hợp sẵn của GitHub với ba khả năng cốt lõi:
doublecheck
github
Quy trình xác minh ba lớp cho đầu ra AI. Trích xuất các tuyên bố có thể kiểm chứng, tìm nguồn hỗ trợ hoặc mâu thuẫn qua tìm kiếm web, thực hiện đánh giá đối kháng…
foundry-agent-sync
github
Tạo và đồng bộ hóa các tác nhân AI dựa trên prompt trực tiếp trong Azure AI Foundry thông qua REST API, từ một tệp kê khai JSON cục bộ. Không giống như các kỹ năng scaffolding chỉ…