On this page
Skills vs Tools
Understand the distinction between Agent Skills (SKILL.md) and Tools (executable functions) in PraisonAI
Skills and Tools are two distinct capability systems in PraisonAI that serve different purposes and operate at different levels.
from praisonaiagents import Agent
agent = Agent(
name="Code Assistant",
instructions="Review code and scan for vulnerabilities",
skills=["./skills/code-review"],
tools=["read_file"],
)
agent.start("Review app.py for security issues")The user submits a task; skills supply knowledge while tools execute concrete actions.
graph LR
subgraph "Skills vs Tools Overview"
User[๐ฑ User Request] --> Router{๐ง Agent Router}
Router --> |"Load context"| Skill[๐ SKILL.md<br/>Declarative Knowledge]
Router --> |"Execute action"| Tool[โ๏ธ Function<br/>Executable Capability]
Skill --> Prompt[๐ System Prompt]
Tool --> Action[๐ฏ Runtime Action]
Prompt --> Response[๐ฌ LLM Response]
Action --> Response
end
classDef skill fill:#6366F1,stroke:#7C90A0,color:#fff
classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff
classDef flow fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef result fill:#10B981,stroke:#7C90A0,color:#fff
class Skill skill
class Tool tool
class Router,User flow
class Prompt,Action,Response resultQuick Start#
- Skills: Load Knowledge
Create a skill to provide specialized knowledge to agents:
python from praisonaiagents import Agent # Create skill directory with SKILL.md agent = Agent( name="Code Assistant", instructions="You help with coding tasks", skills=["./code-review-skill"] # Load declarative knowledge ) agent.start("Review this Python code for security issues") - Tools: Execute Actions
Create a tool to perform runtime actions:
python from praisonaiagents import Agent def search_vulnerabilities(code: str) -> str: """Search for security vulnerabilities in code.""" # Tool implementation return "Found 3 potential SQL injection vulnerabilities" agent = Agent( name="Security Agent", tools=[search_vulnerabilities] # Add executable function ) agent.start("Scan this code for vulnerabilities")
Conceptual Difference#
graph TB
subgraph "Skills: Declarative Knowledge"
S1[๐ SKILL.md] --> S2[๐ Instructions]
S2 --> S3[๐ Progressive Disclosure]
S3 --> S4[๐พ Static Content]
end
subgraph "Tools: Executable Functions"
T1[โ๏ธ Python Function] --> T2[๐ฏ Runtime Execution]
T2 --> T3[๐ Dynamic Results]
T3 --> T4[๐ก Side Effects]
end
classDef skill fill:#6366F1,stroke:#7C90A0,color:#fff
classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff
class S1,S2,S3,S4 skill
class T1,T2,T3,T4 toolComparison Table#
| Dimension | Skills | Tools |
|---|---|---|
| Artifact | SKILL.md file | Python function |
| Purpose | Provide knowledge & context | Execute actions |
| Invocation | Load into system prompt | LLM function calls |
| Timing | Load time (progressive) | Runtime on-demand |
| Cost | Token usage | Execution time |
| Storage | File system | Code registry |
| Safety | Static allowlists | Runtime validation |
| Portability | agentskills.io standard | Framework-specific |
Skills: Declarative Knowledge Packages#
Skills are SKILL.md files that provide specialized knowledge and instructions to agents without bloating the system prompt.
sequenceDiagram
participant Agent
participant SkillManager
participant Skill
Note over SkillManager: Level 1: Metadata (~100 tokens)
Agent->>SkillManager: Load skills
SkillManager->>Skill: Read frontmatter
Note over SkillManager: Level 2: Instructions (<5k tokens)
Agent->>SkillManager: Task matches skill
SkillManager->>Skill: Load full content
Skill-->>Agent: Inject into prompt
Note over SkillManager: Level 3: Resources (on demand)
Agent->>SkillManager: Need scripts/assets
SkillManager->>Skill: Load resourcesSkills in PraisonAI#
from praisonaiagents import Agent
# Direct skill paths
agent = Agent(
name="Code Assistant",
skills=["./skills/code-review", "./skills/testing"]
)
# Directory scanning
agent = Agent(
name="Assistant",
skills_dirs=["./skills"] # Auto-discover SKILL.md files
)
# Auto-discovery from default locations:
# 1. ./.praisonai/skills/ (project)
# 2. ~/.praisonai/skills/ (user)
# 3. /etc/praisonai/skills/ (system)SKILL.md Format#
---
name: code-review
description: Review code for bugs, security issues, and best practices
allowed-tools: read_file write_file # Hint for required tools
---
# Code Review Instructions
When reviewing code:
1. Check for security vulnerabilities
2. Identify potential bugs
3. Suggest improvements
4. Follow language-specific best practicesTools: Executable Functions#
Tools are Python functions that agents can call to perform actions and interact with external systems.
graph LR
subgraph "Tool Execution Flow"
LLM[๐ค LLM] --> Call[๐ tool_calls]
Call --> Function[โ๏ธ Python Function]
Function --> Action[๐ฏ Execute Action]
Action --> Result[๐ Return Result]
Result --> LLM
end
classDef llm fill:#8B0000,stroke:#7C90A0,color:#fff
classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff
classDef result fill:#10B981,stroke:#7C90A0,color:#fff
class LLM llm
class Call,Function,Action tool
class Result resultTools in PraisonAI#
from praisonaiagents import Agent
from typing import List, Dict
def search_code(pattern: str, directory: str = ".") -> List[Dict]:
"""Search for code patterns in files."""
# Tool implementation
return [{"file": "app.py", "line": 42, "match": "vulnerable code"}]
# Assign tools to agents
agent = Agent(
name="Code Scanner",
tools=[search_code] # Executable functions
)
# Tool with built-in capabilities
agent = Agent(
name="Web Researcher",
tools=["tavily", "web_search"] # Built-in tool names
)Tool Categories#
| Category | Examples | Purpose |
|---|---|---|
| Search | tavily, web_search, exa | Find information |
| File Operations | read_file, write_file, list_files | Manage files |
| Code Analysis | ast_grep_search, execute_code | Analyze code |
| Data Processing | pandas_tools, csv_tools | Process data |
| System | shell_tools, execute_command | System operations |
| Screen Control | computer_screenshot, computer_click, computer_type | Take screenshots and drive mouse/keyboard |
PraisonAI Integration Paths#
graph TB
subgraph "Skills Integration"
SD[๐ Skill Discovery] --> SM[๐ฆ SkillManager]
SM --> SP[๐ System Prompt]
SP --> LLM[๐ค LLM]
end
subgraph "Tools Integration"
TR[๐ง Tool Registry] --> TA[โ๏ธ Tool Assignment]
TA --> TC[๐ Tool Calls]
TC --> LLM
end
subgraph "Configuration"
AT[๐ allowed-tools] -.-> |"hints"| TA
SC[๐ง /skill commands] --> SM
TC2[๐ฏ tool_choice] --> TC
end
classDef skill fill:#6366F1,stroke:#7C90A0,color:#fff
classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff
classDef config fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef llm fill:#8B0000,stroke:#7C90A0,color:#fff
class SD,SM,SP skill
class TR,TA,TC tool
class AT,SC,TC2 config
class LLM llmDiscovery & Invocation#
| Feature | Skills | Tools |
|---|---|---|
| Discovery | File system scan | Import registry |
| Activation | /skill slash commands | Agent assignment |
| Execution | Prompt injection | Function calls |
| Control | allowed-tools hints | tool_choice parameter |
CLI Commands#
# Skills management
praisonai skills list
praisonai skills create --name my-skill
praisonai skills validate --path ./skill
# Tools management
praisonai tools list
praisonai tools discover
praisonai tools resolve --name web_searchWhen to Use Each#
graph TB
Question{What do you need?}
Question --> |"Provide knowledge"| UseSkill[๐ Use Skills]
Question --> |"Take actions"| UseTool[โ๏ธ Use Tools]
UseSkill --> SkillEx["โข Code review guidelines<br/>โข Writing templates<br/>โข Domain knowledge<br/>โข Best practices"]
UseTool --> ToolEx["โข Search the web<br/>โข Execute code<br/>โข Read/write files<br/>โข API calls"]
classDef decision fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef skill fill:#6366F1,stroke:#7C90A0,color:#fff
classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff
class Question decision
class UseSkill,SkillEx skill
class UseTool,ToolEx toolUse Skills When:#
- Providing specialized knowledge
- Sharing best practices
- Template instructions
- Domain-specific guidance
- Static reference material
Use Tools When:#
- Executing dynamic actions
- Interacting with APIs
- Processing data
- File operations
- Real-time information
Best Practices#
Skills: Keep Context Focused
Write skills that provide specific, actionable knowledge. Use progressive disclosure – put essential info in SKILL.md, detailed references in references/ folder.
---
name: api-testing
description: Test REST APIs for security and functionality
allowed-tools: http_client json_tools
---
# API Testing Guidelines
## Quick Checks
1. Authentication validation
2. Input sanitization
3. Rate limiting
## Detailed procedures in references/security-checklist.mdTools: Design for Reliability
Create tools with clear interfaces, proper error handling, and type hints. Each tool should have a single responsibility.
def validate_api_endpoint(url: str, method: str = "GET") -> Dict[str, Any]:
"""
Validate API endpoint for security issues.
Args:
url: API endpoint URL
method: HTTP method to test
Returns:
Dict with validation results
"""
try:
# Tool implementation with proper error handling
return {"status": "valid", "issues": []}
except Exception as e:
return {"status": "error", "message": str(e)}Security: Validate Inputs & Outputs
Skills: Don’t put secrets in SKILL.md files. Use environment variables for sensitive data.
Tools: Always validate inputs and sanitize outputs. Use approval decorators for high-risk operations.
from praisonaiagents.approval import require_approval
@require_approval(risk_level="critical")
def execute_shell_command(command: str) -> str:
"""Execute shell command with approval."""
# Implementation with security checks
passRelated#
Full 4-way breakdown: Tools vs Skills vs Connectors vs Plugins
Remote MCP ConnectorsConnect remote SaaS services (GitHub, Linear, Notion, Stripe) with OAuth 2.1
Agent SkillsLoad declarative knowledge from SKILL.md files
ToolsetsAdd callable Python functions as agent tools