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.

python
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.

Diagram

Progressive Loading

skill triggered

needs resource

📋 Level 1\nMetadata ~100 tokens

📄 Level 2\nInstructions on activate

📦 Level 3\nScripts & assets on demand

🤖 Agent

Quick Start

  1. 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")
  2. With Configuration

    Use SkillsConfig for 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

Diagram
SKILL.mdSkillManagerAgentUserSKILL.mdSkillManagerAgentUserstart(“Extract from report.pdf”)get metadata (Level 1)name + description (~100 tokens)detect skill match in promptactivate “pdf-processing” (Level 2)read instructionsfull instructionsinject into contextresponse using skill instructions

Skills use three levels of progressive disclosure:

LevelWhat LoadsTokens
1 — MetadataName + description (at startup)~100
2 — InstructionsFull SKILL.md body (when activated)under 5,000
3 — ResourcesScripts, 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
markdown
---
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 structure

Required Fields

FieldConstraints
name1–64 chars, lowercase, hyphens only, matches directory name
description1–1024 chars — tells the agent when to use this skill

Optional Fields

FieldDescription
licenseLicense identifier (e.g., Apache-2.0, MIT)
compatibilityCompatibility notes (max 500 chars)
metadataKey-value map for custom properties
allowed-toolsSpace-delimited list of tools the skill requires

Configuration Options

SkillsConfig SDK Reference

Full parameter reference for SkillsConfig

The most common options at a glance:

OptionTypeDefaultDescription
pathsList[str][]Direct skill directory paths to load
dirsList[str][]Directories to scan for skill subdirectories
auto_discoverboolFalseAuto-discover from default locations (~/.praisonai/skills/, etc.)

Default Discovery Locations

Skills auto-discovered (in order of precedence):

  1. ./.praisonai/skills/ or ./.claude/skills/
  2. ~/.praisonai/skills/
  3. ~/.praisonai/cache/remote-skills/*/current/ (populated by praisonai skills sync — see Remote Skill Sources)
  4. /etc/praison/skills/

Common Patterns

Single Skill

python
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

python
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

bash
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.

python
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:

Diagram
SkillManagerAgent._merge_plugin_subsystemsPluginManagerSKILL PluginSkillManagerAgent._merge_plugin_subsystemsPluginManagerSKILL Pluginget_skills() → [“./skills/pdf-processing”]get_all_skills()[“./skills/pdf-processing”]append to _skills (skip if already present)load path as SKILL.md source

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 via Path(...).
  • Duplicate paths are de-duplicated on merge (the append checks if skill not in current).
SituationBehaviour
Plugin returns a string pathAppended to _skills and loaded by SkillManager.
Plugin returns a non-string entrySkipped with a warning.
Path already in _skillsSilently de-duplicated.
Plugin declared PluginType.HOOK (not SKILL)Not collected — get_skills() output is ignored.
Plugin disabledNot collected — enabled-only iteration under the manager lock.
get_skills() raisesWarning 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.

python
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:

yaml
name: backend-dev
description: Everything a backend engineer needs
skills:
  - pdf-processing
  - sql-runner
  - repo-search

See Skill Bundles for the full guide.


Related