OpenParable
Skip to content
← Back to skills

Common Spring Boot Init

Development
common-spring-boot-init

Common Spring Boot Init is an Agent Skill for development published in the bage2014/study repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

快速创建 Spring Boot 项目结构,支持多种数据库和依赖配置

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/bage2014/study/blob/HEAD/study-ai-skills/skills/common-spring-boot-init/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/common-spring-boot-init, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Spring Boot 项目初始化技能

功能描述

快速创建 Spring Boot 项目结构,支持多种数据库和依赖配置。

何时使用

  • 创建新的 Spring Boot 项目
  • 快速搭建项目骨架
  • 标准化项目结构

核心功能

  • 生成标准项目结构
  • 配置 pom.xml 依赖
  • 创建启动类
  • 配置 application.yml
  • 支持多种数据库(H2/MySQL/PostgreSQL)
  • 集成 Spring AI

输入参数

参数类型必填说明
projectNameString是项目名称
groupIdString是Maven Group ID
artifactIdString是Maven Artifact ID
javaVersionString否Java 版本(默认 21)
databaseString否数据库类型(h2/mysql/postgresql,默认 h2)
dependenciesArray否额外依赖(spring-web, spring-data-jpa, spring-ai等)

输出格式

{
  "status": "SUCCESS",
  "projectName": "my-spring-app",
  "groupId": "com.example",
  "artifactId": "my-spring-app",
  "javaVersion": "21",
  "database": "h2",
  "filesCreated": [
    "pom.xml",
    "src/main/java/com/example/MySpringAppApplication.java",
    "src/main/resources/application.yml",
    "src/main/resources/schema.sql",
    "src/test/java/com/example/MySpringAppApplicationTests.java"
  ],
  "nextSteps": [
    "cd my-spring-app",
    "mvn spring-boot:run"
  ]
}

使用流程

  1. 指定项目基本信息
  2. 选择数据库类型(开发环境默认 H2)
  3. 添加所需依赖
  4. 生成项目结构

最佳实践

  • 开发环境使用 H2 内存数据库
  • 生产环境切换为 MySQL/PostgreSQL
  • 按需添加依赖,避免冗余

配置要求

application.yml 示例

server:
  port: 8080

spring:
  datasource:
    url: jdbc:h2:mem:example_db
    driver-class-name: org.h2.Driver
    username: sa
    password:
  h2:
    console:
      enabled: true
  jpa:
    hibernate:
      ddl-auto: update
    show-sql: true

扩展指南

支持添加自定义依赖模板和项目模板。

触发条件