1a9f8d047a0e63703c1e71e2af179b81c8a36278
- 添加 TodoWriteTool 用于 Agent 任务分解和进度管理 - 实现 TodoUpdateEvent 事件发布机制 - 添加 TodoProgressListener 监听器实时显示任务进度 - 支持任务状态转换:pending → in_progress → completed - 在控制台显示任务进度百分比和状态图标 参考示例: spring-ai-agent-util-examples/todo-demo Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Skills Demo
A focused demonstration of the SkillsTool system for building custom AI agent capabilities.
Overview
This demo shows how to create and use AI agent skills - specialized capabilities defined in Markdown files that can include helper scripts, reference documentation, and custom tool restrictions.
Features
- ai-tutor skill - Creates educational PDF tutorials explaining technical concepts
- pdf skill - Generates PDF documents from content
- YouTube transcript integration for research-based content
- Classpath-based skill loading for packaged applications
- Python helper scripts for extended functionality
Quick Start
Prerequisites
- Java 17+
- Maven 3.6+
- AI provider API key (Anthropic, OpenAI, or Google)
- Python 3.9+ (for YouTube transcript fetching)
Setup
- Set your API key:
export ANTHROPIC_API_KEY=your-key-here
# Or use OpenAI: export OPENAI_API_KEY=your-key-here
# Or use Google: export GOOGLE_CLOUD_PROJECT=your-project-id
- Optional - for web search:
export BRAVE_API_KEY=your-brave-key
- Run the demo:
mvn spring-boot:run
How It Works
The demo executes a single prompt that:
- Requests an explanation of a technical concept (reinforcement learning)
- References a YouTube video for supporting content
- Automatically invokes the ai-tutor skill
- Fetches the YouTube transcript using Python
- Generates an educational explanation
- Can create a PDF tutorial
Example Code
var answer = chatClient.prompt("""
Explain reinforcement learning in simple terms and use.
Use required skills.
Then use the Youtube video https://youtu.be/vXtfdGphr3c transcript
to support your answer.
""").call().content();
Skills Configuration
Skills are loaded from classpath resources in src/main/resources/.claude/skills/:
src/main/resources/.claude/skills/
├── ai-tutor/
│ ├── SKILL.md # Skill definition
│ ├── REFERENCE.md # Supporting documentation
│ └── scripts/
│ └── get_youtube_transcript.py
└── pdf/
├── SKILL.md
└── scripts/
Configure in application.properties:
agent.skills.dirs=classpath:/.claude/skills
Creating Your Own Skills
- Create a directory under
.claude/skills/ - Add a
SKILL.mdwith YAML frontmatter:
---
name: my-skill
description: What the skill does and when to use it
allowed-tools: Read, Bash, Grep
model: claude-sonnet-4-5-20250929
---
# Skill Instructions
Your detailed prompt for the AI agent...
- Optionally add helper scripts and reference files
Architecture
The demo uses:
- SkillsTool - Loads and manages agent skills
- ShellTools - Executes shell commands (for running Python scripts)
- FileSystemTools - Reads/writes files (for PDF generation)
- SmartWebFetchTool - Fetches web content
- BraveWebSearchTool - Web search capabilities
Switching AI Providers
Update pom.xml and application.properties to use different providers:
Anthropic Claude (default):
spring.ai.anthropic.api-key=${ANTHROPIC_API_KEY}
spring.ai.anthropic.chat.options.model=claude-sonnet-4-5-20250929
OpenAI:
spring.ai.openai-sdk.api-key=${OPENAI_API_KEY}
spring.ai.openai-sdk.chat.options.model=gpt-5-mini-2025-08-07
Google Gemini:
spring.ai.google.genai.project-id=${GOOGLE_CLOUD_PROJECT}
spring.ai.google.genai.chat.options.model=gemini-3-pro-preview
Learn More
License
Apache License 2.0
Languages
Java
42.3%
JavaScript
27.6%
CSS
15.9%
HTML
10.1%
Python
4.1%