Generated banner for Create Spring Boot Java Project
Generated logo for Create Spring Boot Java Project

Create Spring Boot Java Project

GitHubOfficialFirst committed by wuwen5Distributed by GitHub

  • Skill
  • Workflow
  • Software development
  • MIT
  • Low risk

From the author

Create a new Spring Boot Java project (Maven or Gradle) from start.spring.io with sensible defaults for configuration, PostgreSQL, logging, security, testing and Docker. Use when asked to scaffold, bootstrap or generate a Spring Boot application. Detects existing project versions and never upgrades implicitly.
— the description by wuwen5

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill automates the creation of Spring Boot applications by interacting with the start.spring.io API. It provides a structured approach to bootstrapping projects using either Maven or Gradle, while applying opinionated defaults for configuration, database connectivity, logging, security, and containerization. The skill includes logic to detect existing project structures to prevent accidental overwrites or unauthorized version upgrades, ensuring consistency across the development lifecycle.

What it does

  • Generates new Spring Boot projects via start.spring.io API
  • Supports both Maven and Gradle build systems
  • Applies standardized configurations for PostgreSQL, logging, and security
  • Detects existing project files to avoid regeneration
  • Provides Dockerfile templates for JVM and native images
  • Verifies project setup through build and health check commands

When to use it

  • When you need to bootstrap a new Spring Boot application
  • When you require a consistent project structure with standard dependencies
  • When you need to integrate PostgreSQL, Testcontainers, or Docker support
  • When you need to ensure configuration best practices like externalized secrets

Advantages

  • Ensures consistent project structure and dependency management
  • Prevents accidental version upgrades in existing projects
  • Automates the setup of essential development and testing tools
  • Reduces manual configuration effort for standard Spring Boot features

Usage examples

“Create a new Spring Boot project named my-app using Maven.”
The agent will generate a new Spring Boot project structure in a directory named my-app using Maven, including default dependencies and configuration files.
“Bootstrap a Spring Boot application with PostgreSQL and security.”
The agent will scaffold a project with the necessary dependencies for JPA, PostgreSQL, and Spring Security, and configure the initial application properties.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/github/create-spring-boot-java-project/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip create-spring-boot-java-project.zip -d .agents/skills

Documentation by wuwen5

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.

Files

references/database.md

Database (PostgreSQL)

Defaults: PostgreSQL (image postgres:18-alpine, see versions.md), Spring Data JPA, Hibernate, HikariCP. Dependencies: data-jpa, postgresql, docker-compose, testcontainers.

Configuration

spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/mydb}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME:user}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:password}

spring.jpa.hibernate.ddl-auto=update
spring.jpa.open-in-view=false
spring.jpa.show-sql=false

The driver class is detected from the URL; do not set it. The defaults above are for local development only: production credentials come from the environment (see configuration.md).

Schema management (ddl-auto)

Follow the schema management rule of the java-hibernate-jpa skill (prototype/local, production with Flyway/Liquibase, or externally managed). The table and setup below apply it to Spring Boot.

ValueBehaviourUse for
updateAdds missing tables/columns, never dropsLocal development / prototypes
validateFails at startup if schema and entities differProduction
create / create-dropRecreates schema at startup (and drops at shutdown)Throw-away tests
noneHibernate does nothingSchema managed elsewhere

Hibernate's update is convenient but cannot rename, drop or migrate data. For production schema evolution, Flyway or Liquibase are optional but recommended: add the starter: on Boot 4 spring-boot-starter-flyway plus org.flywaydb:flyway-database-postgresql (or spring-boot-starter-liquibase), because Boot 4 auto-configuration lives in the starter; on Boot 3 add org.flywaydb:flyway-core plus flyway-database-postgresql (or liquibase-core) directly. Put migrations in src/main/resources/db/migration (V1__init.sql), and set ddl-auto=validate. Add them when the user wants versioned migrations or the app is headed to production.

Entities

Keep entities annotated precisely (@Table, @Column(length=..., nullable=...), @Index) so generated or validated DDL is accurate. Use GenerationType.IDENTITY or a sequence, Instant for timestamps, and avoid exposing entities in the API (use DTOs/records).

Local development: Docker Compose

With spring-boot-docker-compose, Spring Boot starts compose.yaml automatically and wires the datasource (no URL needed):

services:
  postgres:
    image: postgres:18-alpine
    environment:
      POSTGRES_DB: mydb
      POSTGRES_USER: user
      POSTGRES_PASSWORD: password
    ports:
      - "5432"
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "user", "-d", "mydb"]
      interval: 10s
      timeout: 5s
      retries: 5

Tests

Use Testcontainers with @ServiceConnection; see the spring-boot-testing skill (references/testcontainers-jdbc.md). Pin the image tag; never latest. start.spring.io generates postgres:latest in compose.yaml and TestcontainersConfiguration: replace both with postgres:18-alpine (verified).

Performance and production

  • HikariCP is the default pool; tune spring.datasource.hikari.maximum-pool-size and connection-timeout.

  • Avoid N+1 queries: JOIN FETCH or @EntityGraph; use DTO projections for read models.

  • Keep open-in-view=false and @Transactional on services.

  • Index foreign keys and filtered/sorted columns; check plans with EXPLAIN ANALYZE.

Requirements and compatibility

Written for: GitHub Copilot

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs network access

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

First committed by
GitHub avatar of wuwen5wuwen5
Publisher
GitHub (Official)
Distributed by
GitHub
Source
github/awesome-copilot · skills/create-spring-boot-java-project · commit 797337f
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
jdubois, wuwen5

AutoGineer is not affiliated with or endorsed by wuwen5 or GitHub.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download create-spring-boot-java-project.zip