Skip to main content
Incubating Status GitHubMaven Central

Overview

Spring AI Agent Utils brings Claude Code-inspired tools and agent skills to Spring AI applications. This library reimplements core Claude Code capabilities as Spring AI tools, enabling sophisticated agentic workflows with file operations, shell execution, web access, task management, and extensible agent skills.
Version: 0.4.0 • Requires Spring AI 2.0.0-SNAPSHOT or 2.0.0-M2

Tool Categories

File System Tools

Read, write, and edit files with precise control

Shell Tools

Execute commands with timeout, background processes, and output filtering

Search Tools

Grep and Glob for fast code search and file pattern matching

Web Tools

AI-powered web fetch with caching and Brave search integration

Task Management

Todo tracking and multi-agent task orchestration

Sub-Agent System

Extensible sub-agents with A2A protocol support

Agent Skills

Reusable knowledge modules in Markdown with YAML front-matter

Quick Start

Add Dependency

Configure Your Agent

Core Tools

FileSystemTools

Read, write, and edit files with precise control:
Operations: readFile, writeFile, editFile, listDirectory

ShellTools

Execute shell commands with timeout control and background process management:
Features: timeout control, background execution, regex output filtering

GrepTool

Pure Java grep implementation for code search:
Features: regex patterns, glob filtering, multiple output modes (content, files, count)

GlobTool

Fast file pattern matching:
Supports patterns like **/*.java, src/**/*.ts

SmartWebFetchTool

AI-powered web content summarization with caching:

BraveWebSearchTool

Web search with domain filtering:

User Interaction

AskUserQuestionTool

Ask users clarifying questions during agent execution:
Supports multiple-choice options and free-form input.

Task Management

TodoWriteTool

Structured task management with state tracking:
Track tasks with states: pending, in_progress, completed

TaskTools (Sub-Agents)

Extensible sub-agent system for delegating complex tasks to specialized agents:
Features:
  • Multi-model routing - Use different models for different sub-agents
  • Pluggable backends - Claude-style, A2A protocol, or custom implementations
  • Background task execution - Run sub-agents asynchronously
  • Task output retrieval - Get results from background tasks

A2A Protocol Support

The sub-agent architecture supports the A2A (Agent-to-Agent) protocol for interoperability with external agents:
The extensible architecture uses three interfaces:
  • SubagentResolver - Discovers and loads sub-agent definitions
  • SubagentExecutor - Executes tasks on sub-agents
  • SubagentDefinition - Describes a sub-agent’s capabilities

Agent Skills

Extend AI capabilities with reusable knowledge modules:
Load skills from directories:

AgentEnvironment

Dynamic context utility for system prompts:
Provides: working directory, platform info, git status, model information

Examples

Requirements

  • Java 17+
  • Spring Boot 3.x / 4.x
  • Spring AI 2.0.0-SNAPSHOT or 2.0.0-M2

Resources

GitHub Repository

Source code, examples, and detailed documentation

Claude Code Docs

Original Claude Code documentation (inspiration)

License

This project is licensed under the Apache License 2.0.