Skip to content

Agent Zero AI framework

skills polishing and fixing

frdel1b4946705f36
diff --git a/prompts/agent.system.tool.skills.md b/prompts/agent.system.tool.skills.md
index d88e98047..605ecc956 100644
--- a/prompts/agent.system.tool.skills.md
+++ b/prompts/agent.system.tool.skills.md
@@ -1,63 +1,39 @@
### skills_tool
-manage and use agent skills for specialized capabilities
-skills are composable bundles of instructions context and executable code
-use progressive disclosure: metadata → full content → referenced files
-use "method" arg to specify operation: "list" "load" "read_file" "search"
+#### overview
-## Overview
+skills are folders with instructions scripts files
+give agent extra capabilities
+agentskills.io standard
-Skills system provides three-level progressive disclosure:
-- Level 1: Metadata (name + description) loaded in system prompt at startup
-- Level 2: Full SKILL.md content loaded when relevant to task
-- Level 3+: Referenced files loaded on-demand
+#### workflow
+1. skill list titles descriptions in system prompt section available skills
+2. use skills_tool:load to get full skill instructions and context
+4. use code_execution_tool to run scripts or read files
-When to use skills:
-- Task matches skill description from available skills list
-- Need specialized procedures or domain knowledge
-- Task requires bundled scripts or automation
-- Need step-by-step guidance for complex operations
+#### examples
-Progressive workflow:
-1. Check available skills metadata already in your context
-2. Use "search" if looking for specific capability
-3. Use "load" to get full skill instructions and context
-4. Use "read_file" to load additional reference documents
-5. Use code_execution_tool to run any scripts referenced by the skill
+##### skills_tool:list
-## Operations
-
-### 1. list available skills
-
-Lists all available skills with metadata
-Shows name, version, description, tags, and author
-Use when: exploring available capabilities or confirming skill exists
+list all skills with metadata name version description tags author
+only use when details needed
~~~json
{
"thoughts": [
- "Need to see what skills are available",
- "User asked about available capabilities"
+ "Need find skills of certain properties...",
],
"headline": "Listing all available skills",
- "tool_name": "skills_tool",
- "tool_args": {
- "method": "list"
- }
+ "tool_name": "skills_tool:list",
}
~~~
-Response format:
-- Skill name and version
-- Brief description
-- Tags for categorization
-- Author attribution
-
-### 2. load full skill content
+##### skills_tool:load
-Loads complete SKILL.md content with instructions and procedures
-Returns metadata, full content, and list of referenced files
-Use when: identified relevant skill and need detailed instructions
+loads complete SKILL.md content instructions procedures
+returns metadata content file tree
+use when potential skill identified and want usage instructions
+use again when no longer in history
~~~json
{
@@ -67,65 +43,19 @@ Use when: identified relevant skill and need detailed instructions
"Loading full skill content"
],
"headline": "Loading PDF editing skill",
- "tool_name": "skills_tool",
+ "tool_name": "skills_tool:load",
"tool_args": {
- "method": "load",
"skill_name": "pdf_editing"
}
}
~~~
-Required args:
-- skill_name: exact name from metadata or list
-
-Response includes:
-- Skill metadata (name, version, description, tags)
-- Full markdown content with instructions
-- List of referenced files available to load
-- Code examples and procedures
-
-### 3. read skill reference file
-
-Reads additional reference files from skill directory
-Files referenced in SKILL.md can be loaded progressively
-Use when: need detailed documentation or examples from skill references
-
-~~~json
-{
- "thoughts": [
- "Skill mentioned forms.md for form filling details",
- "Need specific form field handling instructions",
- "Loading reference file"
- ],
- "headline": "Reading PDF forms reference documentation",
- "tool_name": "skills_tool",
- "tool_args": {
- "method": "read_file",
- "skill_name": "pdf_editing",
- "file_path": "forms.md"
- }
-}
-~~~
-
-Required args:
-- skill_name: name of skill containing file
-- file_path: relative path within skill directory (e.g. "reference.md" or "examples/example1.md")
-
-Security:
-- Path validation prevents directory traversal
-- Only files within skill directory accessible
-- Supports markdown, text, code files
+##### executing skill scripts
-
-## Running skill scripts
-
-When a skill includes scripts (listed under its files), use code_execution_tool with runtime terminal directly to run them.
-The skill's "load" output shows the skill directory path and lists available scripts.
-Use read_file to inspect a script before running it if needed.
-
-Example: running a Python script from a skill
-1. Load the skill to get its path and script list
-2. Use code_execution_tool with runtime="python" to run the script
+use skills_tool:load identify skill script files and instructions
+use code_execution_tool runtime terminal to execute
+write command and parameters as instructed
+use full paths or cd to skill directory
~~~json
{
@@ -143,72 +73,10 @@ Example: running a Python script from a skill
}
~~~
-## Best Practices
-
-### When to use skills vs other tools
-
-Use skills when:
-- Task requires specialized domain knowledge
-- Need structured procedures or step-by-step guidance
-- Complex multi-step operations with best practices
-
-Use code_execution_tool directly when:
-- Running skill scripts (load skill first to get paths)
-- Simple file operations
-- General computation
-
-Use other tools when:
-- Web search (use search_engine)
-- Memory operations (use memory tools)
-
-### Progressive disclosure workflow
-
-1. Start with metadata (already in context)
- - Check available skills list in system prompt
- - Match task to skill description
-
-2. Load full content when relevant
- - Use "load" to get complete instructions
- - Review procedures and examples
-
-3. Load references as needed
- - Use "read_file" for detailed documentation
- - Load only files relevant to current subtask
-
-4. Execute scripts via code_execution_tool
- - Use skill path from "load" output
- - Run scripts directly with code_execution_tool
-
-### Common patterns
-
-Pattern: Using a skill for first time
-1. Identify skill from metadata
-2. Load full skill content
-3. Follow instructions in content
-4. Load reference files if mentioned
-5. Run scripts via code_execution_tool using paths from load output
-
-Pattern: Exploring capabilities
-1. Search with query terms
-2. Review matches
-3. Load most relevant skill
-
-## Error Handling
-
-Common errors:
-- "Skill not found": Check spelling, use list or search to find correct name
-- "File not found": Verify file_path matches referenced files from load output
-
-When skill loading fails:
-- Verify skill exists using list method
-- Check for typos in skill_name
-- Ensure skill system is enabled in settings
-## Notes
-
-- Skills metadata already loaded in your system prompt
-- Skills cache after first load for efficiency
-- Referenced files listed in load response
-- Use code_execution_tool to run any scripts provided by skills
-- All operations return formatted text responses
-- Skills follow the open SKILL.md standard (cross-platform compatible)
-- Use skills for structured procedures and contextual expertise
+#### skills guide
+use skills when relevant for task
+load skill before use
+read / execute files with code_execution_tool
+follow instructions in skill
+mind relative paths
+conversation history discards old messages use skills_tool:load again when lost
\ No newline at end of file
diff --git a/python/helpers/history.py b/python/helpers/history.py
index b77a26989..e796d4cb8 100644
--- a/python/helpers/history.py
+++ b/python/helpers/history.py
@@ -15,7 +15,7 @@ CURRENT_TOPIC_RATIO = 0.5
HISTORY_TOPIC_RATIO = 0.3
HISTORY_BULK_RATIO = 0.2
TOPIC_COMPRESS_RATIO = 0.65
-LARGE_MESSAGE_TO_TOPIC_RATIO = 0.25
+LARGE_MESSAGE_TO_TOPIC_RATIO = 0.5
RAW_MESSAGE_OUTPUT_TEXT_TRIM = 100
diff --git a/python/helpers/skills.py b/python/helpers/skills.py
index a462bd0b2..092cd233c 100644
--- a/python/helpers/skills.py
+++ b/python/helpers/skills.py
@@ -384,8 +384,8 @@ def validate_skill(skill: Skill) -> List[str]:
issues.append("name must not start or end with a hyphen")
if "--" in name:
issues.append("name must not contain consecutive hyphens")
- if skill.path and _normalize_name(skill.path.name) != _normalize_name(name):
- issues.append("name should match the parent directory name")
+ # if skill.path and _normalize_name(skill.path.name) != _normalize_name(name):
+ # issues.append("name should match the parent directory name")
if not desc:
issues.append("Missing required field: description")
diff --git a/python/helpers/tool.py b/python/helpers/tool.py
index 2613f1c5d..7f68b1234 100644
--- a/python/helpers/tool.py
+++ b/python/helpers/tool.py
@@ -57,7 +57,7 @@ class Tool:
heading = f"icon://construction {self.agent.agent_name}: Using tool '{self.name}:{self.method}'"
else:
heading = f"icon://construction {self.agent.agent_name}: Using tool '{self.name}'"
- return self.agent.context.log.log(type="tool", heading=heading, content="", kvps=self.args)
+ return self.agent.context.log.log(type="tool", heading=heading, content="", kvps=self.args, _tool_name=self.name)
def nice_key(self, key:str):
words = key.split('_')
diff --git a/python/tools/skills_tool.py b/python/tools/skills_tool.py
index 653093fbf..2463e9b9d 100644
--- a/python/tools/skills_tool.py
+++ b/python/tools/skills_tool.py
@@ -5,7 +5,7 @@ from typing import List
from python.helpers.tool import Tool, Response
from python.helpers import projects, files, file_tree
-from python.helpers import skills as skills_helper
+from python.helpers import skills as skills_helper, runtime
class SkillsTool(Tool):
@@ -134,8 +134,8 @@ class SkillsTool(Tool):
lines: List[str] = []
lines.append(f"Skill: {skill.name}")
- lines.append(f"Path: {rel_skill_dir}")
- lines.append(f"Runtime path: {runtime_path}")
+ # lines.append(f"Path: {rel_skill_dir}")
+ lines.append(f"Path: {runtime_path}")
if skill.version:
lines.append(f"Version: {skill.version}")
if skill.author:
@@ -203,9 +203,9 @@ class SkillsTool(Tool):
def _list_skill_files(self, skill_dir: Path, *, max_files: int = 80) -> str:
if not skill_dir.exists():
- return []
+ return ""
- tree = file_tree.file_tree(
+ tree = str(file_tree.file_tree(
str(skill_dir),
max_depth=10,
folders_first=True,
@@ -214,5 +214,11 @@ class SkillsTool(Tool):
output_mode="string",
max_lines=300,
ignore=files.read_file("conf/skill.default.gitignore"),
- )
- return tree
+ ))
+
+ # replace absolute path with runtime path (for dev env only)
+ if tree and runtime.is_development():
+ runtime_path = files.normalize_a0_path(str(skill_dir))
+ tree = tree.replace(str(skill_dir), runtime_path)
+
+ return str(tree)
diff --git a/webui/js/messages.js b/webui/js/messages.js
index b89628d7f..034bf42a1 100644
--- a/webui/js/messages.js
+++ b/webui/js/messages.js
@@ -940,10 +940,43 @@ export function drawMessageTool({
agentno = 0,
...additional
}) {
+
+ const tool_name = kvps?._tool_name || "";
+
+ if(!tool_name){
+ return drawMessageToolSimple({ ...arguments[0] });
+ } else if (kvps._tool_name === "skills_tool") {
+ return drawMessageToolSimple({ ...arguments[0], code: "SKL" });
+ } else if (kvps._tool_name === "vision_load") {
+ return drawMessageToolSimple({ ...arguments[0], code: "EYE" });
+ } else if (kvps._tool_name === "search_engine") {
+ return drawMessageToolSimple({ ...arguments[0], code: "WEB" });
+ } else if (kvps._tool_name === "browser_agent") {
+ return drawMessageToolSimple({ ...arguments[0], code: "WWW" });
+ } else if (kvps._tool_name.startsWith("memory_")) {
+ return drawMessageToolSimple({ ...arguments[0], code: "MEM" });
+ } else {
+ return drawMessageToolSimple({ ...arguments[0] });
+ }
+
+}
+
+export function drawMessageToolSimple({
+ id,
+ type,
+ heading,
+ content,
+ kvps = null,
+ timestamp = null,
+ agentno = 0,
+ code,
+ displayKvps,
+ ...additional
+}) {
const title = cleanStepTitle(heading);
- let displayKvps = { ...kvps };
+ displayKvps = displayKvps || { ...kvps };
const headerLabels = [
- kvps?.tool_name && { label: kvps.tool_name, class: "tool-name-badge" },
+ kvps?._tool_name && { label: kvps._tool_name, class: "tool-name-badge" },
].filter(Boolean);
const contentText = String(content ?? "");
const actionButtons = contentText.trim()
@@ -961,7 +994,7 @@ export function drawMessageTool({
return drawProcessStep({
id,
title,
- code: "USE",
+ code: code || "USE",
classes: null,
kvps: displayKvps,
content,