feat: 优化系统提示词,强调优先使用 Skill 工具
- 修改 Application.java 中的系统提示词,明确工具优先级 - 强调对于任何用户任务都应优先检查并使用匹配的 Skill - 移除 AskUserQuestionTool 以解决启动错误 - 添加项目文档 CLAUDE.md - 更新前端界面和交互逻辑 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
5f998d1f24
commit
6b602f5cd0
11 files changed
+1250
-230
No files matched your search
@@ -4,6 +4,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springaicommunity.agent.tools.FileSystemTools;
|
||||
import org.springaicommunity.agent.tools.GlobTool;
|
||||
import org.springaicommunity.agent.tools.GrepTool;
|
||||
import org.springaicommunity.agent.tools.ShellTools;
|
||||
import org.springaicommunity.agent.tools.SkillsTool;
|
||||
import org.springaicommunity.agent.tools.TodoWriteTool;
|
||||
@@ -92,8 +94,17 @@ public class Application {
|
||||
applicationEventPublisher.publishEvent(new TodoUpdateEvent(this, event.todos())))
|
||||
.build())
|
||||
|
||||
// 添加 System Prompt 指导 TodoWrite 工具的正确使用
|
||||
// 添加 System Prompt 指导工具的正确使用
|
||||
.defaultSystem("""
|
||||
IMPORTANT: When the user requests any task, you MUST first check if there is an available Skill that matches the task.
|
||||
Skills provide specialized capabilities and domain knowledge for specific tasks.
|
||||
|
||||
Tool Priority:
|
||||
1. FIRST: Check available Skills and use the Skill tool if a matching skill exists
|
||||
2. SECOND: Use other built-in tools (Bash, FileSystem, Glob, Grep, etc.) only if no suitable Skill is available
|
||||
|
||||
Always prioritize Skills over other tools when a relevant Skill is available for the user's request.
|
||||
|
||||
When using the TodoWrite tool, you MUST provide the todos parameter as an object with a "todos" array, not a direct array.
|
||||
|
||||
Correct format:
|
||||
@@ -113,10 +124,14 @@ public class Application {
|
||||
|
||||
// Built-in tools
|
||||
.defaultTools(
|
||||
//Bash execution tool
|
||||
ShellTools.builder().build(),// built-in shell tools
|
||||
// Bash execution tool
|
||||
ShellTools.builder().build(),
|
||||
// Read, Write and Edit files tool
|
||||
FileSystemTools.builder().build())// built-in file system tools
|
||||
FileSystemTools.builder().build(),
|
||||
// Glob file pattern matching tool
|
||||
GlobTool.builder().build(),
|
||||
// Grep content search tool
|
||||
GrepTool.builder().build())
|
||||
|
||||
// MCP tools (通过 Spring AI 自动配置注入)
|
||||
.defaultToolCallbacks(mcpToolCallbackProvider.getToolCallbacks())
|
||||
|
||||
Reference in new issue
Block a user