Agent Skills
Give agents modular, reusable capabilities through SKILL.md files — load specialised knowledge on demand
Skills extend agents with specialised knowledge and instructions loaded on demand, keeping context lean until the skill is needed.
from praisonaiagents import Agent
agent = Agent(
name="PDF Assistant",
instructions="You are a helpful assistant.",
skills=["./skills/pdf-processing"],
)
agent.start("Extract the main findings from report.pdf")The user asks about a document; the agent loads the matching skill only when the task needs it.
Quick Start
- Simple Usage
Pass skill directory paths to
skills:python from praisonaiagents import Agent agent = Agent( name="PDF Assistant", instructions="You are a helpful assistant.", skills=["./skills/pdf-processing"] ) result = agent.start("Extract the main findings from report.pdf") - With Configuration
Use
SkillsConfigfor auto-discovery from multiple directories:python from praisonaiagents import Agent, SkillsConfig agent = Agent( name="Multi-Skill Agent", instructions="You are a versatile assistant.", skills=SkillsConfig( paths=["./skills/pdf-processing"], dirs=["./skills"], auto_discover=True, ) ) result = agent.start("Process the quarterly report")
How It Works
Skills use three levels of progressive disclosure:
| Level | What Loads | Tokens |
|---|---|---|
| 1 — Metadata | Name + description (at startup) | ~100 |
| 2 — Instructions | Full SKILL.md body (when activated) | under 5,000 |
| 3 — Resources | Scripts, references, assets (on demand) | Variable |
SKILL.md Format
Each skill is a directory containing a SKILL.md file:
pdf-processing/
├── SKILL.md # Required
├── scripts/ # Optional
├── references/ # Optional
└── assets/ # Optional---
name: pdf-processing
description: Process and extract information from PDF documents. Use this skill when the user asks to read, analyze, or extract data from PDF files.
license: Apache-2.0
---
# PDF Processing Skill
## Instructions
1. Verify the PDF file exists
2. Read the PDF content
3. Extract text while preserving structureRequired Fields
| Field | Constraints |
|---|---|
name | 1–64 chars, lowercase, hyphens only, matches directory name |
description | 1–1024 chars — tells the agent when to use this skill |
Optional Fields
| Field | Description |
|---|---|
license | License identifier (e.g., Apache-2.0, MIT) |
compatibility | Compatibility notes (max 500 chars) |
metadata | Key-value map for custom properties |
allowed-tools | Space-delimited list of tools the skill requires |
Configuration Options
SkillsConfig SDK ReferenceFull parameter reference for SkillsConfig
The most common options at a glance:
| Option | Type | Default | Description |
|---|---|---|---|
paths | List[str] | [] | Direct skill directory paths to load |
dirs | List[str] | [] | Directories to scan for skill subdirectories |
auto_discover | bool | False | Auto-discover from default locations (~/.praisonai/skills/, etc.) |
Default Discovery Locations
Skills auto-discovered (in order of precedence):
./.praisonai/skills/or./.claude/skills/~/.praisonai/skills/~/.praisonai/cache/remote-skills/*/current/(populated bypraisonai skills sync— see Remote Skill Sources)/etc/praison/skills/
Common Patterns
Single Skill
from praisonaiagents import Agent
agent = Agent(
name="Code Reviewer",
instructions="You are a code review expert.",
skills=["./skills/code-review"]
)
result = agent.start("Review this Python function for potential bugs")Multiple Skills from Directory
from praisonaiagents import Agent
agent = Agent(
name="Multi-Expert",
instructions="You are an expert assistant.",
skills=SkillsConfig(dirs=["./company-skills"])
)
result = agent.start("Summarize the latest sales data from report.pdf")Creating a SKILL.md
praisonai skills create --name my-skill --description "My custom capability"This creates the directory structure and template SKILL.md you can fill in.
Skills from Plugins
A plugin declared PluginType.SKILL that returns filesystem path strings from get_skills() has those paths appended to the Agent’s _skills. SkillManager then loads them as real SKILL.md sources — the same as user-configured skill dirs.
from praisonaiagents import Agent, Plugin, PluginInfo, PluginType
from praisonaiagents.plugins import get_plugin_manager
class PdfSkillPlugin(Plugin):
@property
def info(self):
return PluginInfo(name="pdf_skill", plugin_type=PluginType.SKILL)
def get_skills(self):
return ["./skills/pdf-processing"] # a dir containing SKILL.md
get_plugin_manager().register(PdfSkillPlugin())
get_plugin_manager().enable("pdf_skill")
agent = Agent(name="PDF Assistant", instructions="You are a helpful assistant.")
# ./skills/pdf-processing is now on agent._skills — no skills= parameter needed.
agent.start("Extract the main findings from report.pdf")On Agent.__init__, _merge_plugin_subsystems() calls PluginManager.get_all_skills() and appends each string path to self._skills:
Rules
- Entries must be string paths to skill directories (each containing
SKILL.md). Non-string entries (e.g. objects) are logged and skipped —SkillManager.add_skill(path)resolves each entry viaPath(...). - Duplicate paths are de-duplicated on merge (the append checks
if skill not in current).
| Situation | Behaviour |
|---|---|
| Plugin returns a string path | Appended to _skills and loaded by SkillManager. |
| Plugin returns a non-string entry | Skipped with a warning. |
Path already in _skills | Silently de-duplicated. |
Plugin declared PluginType.HOOK (not SKILL) | Not collected — get_skills() output is ignored. |
| Plugin disabled | Not collected — enabled-only iteration under the manager lock. |
get_skills() raises | Warning logged, other plugins keep loading, Agent construction succeeds. |
See Typed Plugins (Guardrail / Policy / Skill) for the full plugin-side reference.
Best Practices
Write trigger-aware descriptions
The description field tells the agent when to activate the skill. Write it as a trigger sentence: “Use this skill when the user asks to process PDF files” — not just “Handles PDFs”.
Keep instructions focused
Level 2 instructions inject into the agent’s context. Keep them under 5,000 tokens and focused on the specific task — don’t repeat general knowledge the LLM already has.
Put heavy content in resources
Reference documentation, example data, and large scripts belong in references/ or scripts/ (Level 3). They load only when explicitly needed, keeping context lean.
Match directory name to skill name
The directory name must exactly match the name field in SKILL.md. Use praisonai skills validate --path ./my-skill to catch mismatches before deploying.
Group Skills into Bundles
Bundle multiple skills into a named set and select them with a single @name selector.
from praisonaiagents import Agent
agent = Agent(
name="Backend Dev",
instructions="Help with backend engineering tasks.",
skills=["@backend-dev"],
)
agent.start("Refactor the users table migration.")Create a bundles/backend-dev.yaml in your skills directory to define the bundle:
name: backend-dev
description: Everything a backend engineer needs
skills:
- pdf-processing
- sql-runner
- repo-searchSee Skill Bundles for the full guide.
Related
Group skills into named bundles and select with @name
Skill InvocationSlash commands, argument substitution, and invocation policy
Skill ManageLet agents create and edit skills with human approval
Skills vs ToolsWhen to use SKILL.md knowledge vs executable tools
Remote Skill SourcesDistribute skills from a git URL that stay synced automatically
KnowledgeGive agents access to documents and vector search