SpringAI Agent 开发实战:利用 Skills 构建代码评审工具
SpringAI 已迅速支持 Claude Skills 概念,Java 开发者也能高效利用 Agent Skills 构建智能应用。本文通过构建一个 Code Reviewer,演示如何将 SpringAI 和 Skills 结合使用。
一、项目创建
1. 基础环境要求
体验 SpringAI & Skills,需升级至 SpringAI 2.x 版本,SpringBoot 4.x。
- SpringAI: 2.0.0-M2
- JDK: 21
- SpringBoot: 4.0.1
选择支持 Function Tool 的大模型作为核心,此处选用智谱大模型 GLM-4.5-Flash。
2. 项目依赖
在 pom.xml 中配置基础版本及核心依赖:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>4.0.1</version>
</parent>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-ai.version>2.0.0-M2</spring-ai.version>
</properties>
<dependencyManagement>
<dependencies>
org.springframework.ai
spring-ai-bom
${spring-ai.version}
pom
import
org.springaicommunity
spring-ai-agent-utils
0.4.1
org.springframework.ai
spring-ai-starter-model-zhipuai


