hertzbeat-ai/src/main/resources/skills/README.md
The AI SOP (Standard Operating Procedure) Engine enables defining and executing automated workflows through YAML configuration.
tool (call HertzBeat tools), llm (AI reasoning)SopResultCreate skills/my_skill.yml:
name: my_skill
description: "My custom skill"
version: "1.0"
output:
type: report # report/simple/data/action
format: markdown
language: zh # zh/en
steps:
- id: get_data
type: tool
tool: queryMonitors
args:
status: 9
- id: analyze
type: llm
prompt: |
Analyze: ${get_data}
# Streaming (SSE)
POST /api/ai/sop/execute/{skillName}
# Sync (JSON)
POST /api/ai/sop/execute/{skillName}/sync
# AI Format (Text)
POST /api/ai/sop/execute/{skillName}/ai
| Type | Use Case |
|---|---|
report | Daily inspection, analysis |
simple | Restart, clear cache |
data | Query, statistics |
action | Pending confirmation |
YAML Definition → SkillRegistry → SopEngine → Executors → SopResult
↓
ToolExecutor / LlmExecutor
↓
ToolRegistry (auto-discover @Tool methods)
Just add @Tool annotation to your method - no other code changes needed:
@Tool(name = "myNewTool", description = "...")
public String myNewTool(@ToolParam(...) Long param) {
// implementation
}
ToolRegistry auto-discovers all @Tool methods at runtime.