Agent Skills
Agent Skills is an open standard for extending AI agent capabilities with specialized knowledge and workflows. PraisonAI Agents fully supports the Agent Skills specification, enabling agents to load and use modular capabilities through SKILL.md files.Overview
Skills provide a way to give agents specialized knowledge and instructions without bloating the main system prompt. They use progressive disclosure to efficiently manage context:- Level 1 - Metadata (~100 tokens): Name and description loaded at startup
- Level 2 - Instructions (<5000 tokens): Full SKILL.md body loaded when activated
- Level 3 - Resources (as needed): Scripts, references, and assets loaded on demand
Quick Start
Using Skills with an Agent
Using SkillManager Directly
SKILL.md Format
Each skill is a directory containing aSKILL.md file with YAML frontmatter:
Required Fields
| Field | Description | Constraints |
|---|---|---|
name | Skill identifier | 1-64 chars, lowercase, hyphens only |
description | What the skill does and when to use it | 1-1024 chars |
Optional Fields
| Field | Description |
|---|---|
license | License for the skill (e.g., Apache-2.0, MIT) |
compatibility | Compatibility information (max 500 chars) |
metadata | Key-value pairs for custom properties |
allowed-tools | Space-delimited list of tools the skill requires |
Directory Structure
Skill Discovery Locations
PraisonAI searches for skills in these locations (in order of precedence):- Project:
./.praison/skills/or./.claude/skills/ - User:
~/.praison/skills/ - System:
/etc/praison/skills/
CLI Commands
List Available Skills
Validate a Skill
Create a New Skill
Generate Prompt XML
API Reference
SkillManager
The main class for managing skills.SkillLoader
For progressive loading of skills.Validation
Compatibility
PraisonAI’s Agent Skills implementation follows the open standard, ensuring compatibility with:- Claude Code (
.claude/skills/) - GitHub Copilot (
.github/skills/) - Cursor (Agent Skills support)
- OpenAI Codex CLI
.praison/skills/ and .claude/skills/ for maximum compatibility.
Performance
Agent Skills are designed for zero performance impact when not in use:- Lazy Loading: Skills are only loaded when explicitly accessed
- No Auto-discovery: Discovery runs only when requested
- Minimal Memory: Skills not in use consume no memory
- Progressive Disclosure: Only load what’s needed
Direct API Integration Examples
OpenAI API (gpt-4o-mini)
Complete flat file implementation showing how skills work with OpenAI’s API:Anthropic Claude API
Complete flat file implementation showing how skills work with Claude:Key Differences Between OpenAI and Claude
| Aspect | OpenAI | Claude |
|---|---|---|
| System Prompt | Message with role: "system" | Separate system parameter |
| Response Access | response.choices[0].message.content | response.content[0].text |
| Token Usage | response.usage.total_tokens | response.usage.input_tokens + output_tokens |
| Max Tokens | Optional | Required parameter |
Examples
See the examples/skills/ directory for complete examples:basic_skill_usage.py- Basic skill discovery and usagecustom_skill_example.py- Creating custom skills programmaticallypdf-processing/- Example skill directory
Compliance Verification
✅ FULLY COMPLIANT with agentskills.io Specification
PraisonAI’s Agent Skills implementation is fully compliant with the official agentskills.io specification.Core Requirements
| Requirement | Spec | PraisonAI Implementation | Status |
|---|---|---|---|
| SKILL.md file | Required in skill directory | find_skill_md() in parser.py | ✅ |
| YAML frontmatter | Must start with --- | parse_frontmatter() validates this | ✅ |
name field | Required, max 64 chars, lowercase, hyphens only | _validate_name() enforces all rules | ✅ |
description field | Required, max 1024 chars | _validate_description() enforces | ✅ |
license field | Optional | Supported in SkillProperties | ✅ |
compatibility field | Optional, max 500 chars | _validate_compatibility() enforces | ✅ |
metadata field | Optional key-value map | Supported in SkillProperties | ✅ |
allowed-tools field | Optional, experimental | Supported as allowed_tools | ✅ |
| Directory name match | Must match name field | _validate_name() checks this | ✅ |
| No consecutive hyphens | -- not allowed | Validated in _validate_name() | ✅ |
| No leading/trailing hyphens | Cannot start/end with - | Validated in _validate_name() | ✅ |
✅ Progressive Disclosure (3-Level Loading)
| Level | Spec | PraisonAI Implementation | Status |
|---|---|---|---|
| Level 1: Metadata | ~100 tokens at startup | SkillMetadata with name, description, location | ✅ |
| Level 2: Instructions | <5k tokens when triggered | SkillLoader.activate() loads SKILL.md body | ✅ |
| Level 3: Resources | As needed | load_scripts(), load_references(), load_assets() | ✅ |
✅ XML Prompt Generation
The spec requires this format for Claude models:prompt.py:
✅ Skill Discovery
| Feature | Spec | PraisonAI | Status |
|---|---|---|---|
| Project-level | ./.praison/skills/ or ./.claude/skills/ | Both supported | ✅ |
| User-level | ~/.praison/skills/ | Supported | ✅ |
| System-level | /etc/praison/skills/ | Supported | ✅ |
| Custom directories | User-specified | discover_skills(skill_dirs) | ✅ |
✅ Directory Structure Support
✅ Agent Integration
Agentclass acceptsskillsandskills_dirsparameters- Lazy loading via
skill_managerproperty (zero performance impact) get_skills_prompt()returns XML for system prompt injection
✅ CLI Commands
| Command | Purpose | Status |
|---|---|---|
praisonai skills list | List available skills | ✅ |
praisonai skills validate --path | Validate skill directory | ✅ |
praisonai skills create --name | Create skill from template | ✅ |
praisonai skills prompt | Generate XML prompt | ✅ |
✅ Test Coverage
7 comprehensive test files covering all components:test_parser.py- Frontmatter parsingtest_validator.py- All validation rulestest_discovery.py- Skill discoverytest_loader.py- Progressive loadingtest_manager.py- SkillManagertest_prompt.py- XML generationtest_models.py- Data models
🔍 Implementation Details
Files Verified: praisonaiagents/skills/:__init__.py- Lazy loading exportsmodels.py-SkillProperties,SkillMetadataparser.py- Frontmatter parsingvalidator.py- All validation rules per specdiscovery.py- Directory scanningloader.py- Progressive disclosure (3 levels)prompt.py- XML generationmanager.py-SkillManagerclass
skills.py- CLI handler with list/validate/create/prompt commands
Minor Observations (No Changes Required)
-
Allowed fields validation: PraisonAI rejects unexpected fields in frontmatter, which is stricter than the spec (spec allows arbitrary fields in
metadata). This is actually better for catching errors. -
Case-insensitive SKILL.md: PraisonAI accepts both
SKILL.mdandskill.md, which is more flexible than the spec. -
HTML escaping: XML output properly escapes special characters via
html.escape().
✅ Conclusion
PraisonAI’s Agent Skills implementation is fully compliant with the agentskills.io specification. The implementation correctly follows:- ✅ SKILL.md format with YAML frontmatter
- ✅ All field validation rules (name, description, compatibility limits)
- ✅ Progressive disclosure (3-level loading)
- ✅ XML prompt generation format
- ✅ Skill discovery from standard directories
- ✅ Zero performance impact when skills not used (lazy loading)
- ✅ CLI tools for skill management

