> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Skills System

> Extend Agent capabilities with reusable Skills

Skills are reusable instruction sets that extend your Agent's capabilities. Load skills for code review, data analysis, writing, and more - without modifying the Agent's core instructions.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    Agent[Agent] --> Skills[Skills]

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff

    class Agent agent
    class Skills tool
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff
```

## Quick Start

**1. Simple Usage**

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { Agent, createSkillManager } from 'praisonai';

const skillManager = createSkillManager({
  paths: ['./skills']
});

// Discover available skills
await skillManager.discover();

// Create Agent with skills
const agent = new Agent({
  name: 'Skilled Agent',
  instructions: 'You are a helpful assistant.',
  skills: skillManager.list(['code-review', 'security-audit'])
});

// Agent now has code review and security audit capabilities
const response = await agent.chat('Review this code for issues: function add(a,b) { return a+b }');
```

**2. With Configuration**

Load skills from disk or a manager — see sections below.

***

## Creating Skills for Agents

Skills are defined in SKILL.md files:

```markdown theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
---
name: code-review
description: Review code for best practices, bugs, and security issues
license: MIT
compatibility: TypeScript, JavaScript, Python
allowed-tools: Read Grep
metadata:
  author: your-team
  version: "1.0"
---

# Code Review Skill

When reviewing code, follow these steps:

1. **Security Check**: Look for SQL injection, XSS, and auth issues
2. **Error Handling**: Verify try/catch blocks and error messages
3. **Type Safety**: Check for proper typing and null checks
4. **Performance**: Identify N+1 queries, memory leaks
5. **Best Practices**: Follow language conventions

Always provide specific line numbers and actionable suggestions.
```

## Agent with Multiple Skills

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { Agent, createSkillManager } from 'praisonai';

const skillManager = createSkillManager({
  paths: ['./skills'],
  includeProject: true
});

await skillManager.discover();

// Agent with multiple specialized skills
const devAgent = new Agent({
  name: 'Developer Assistant',
  instructions: 'You help developers with code tasks.',
  skills: skillManager.list(['code-review', 'refactoring', 'testing', 'documentation'])
});

// Agent applies relevant skills based on the task
await devAgent.chat('Write unit tests for this function');  // Uses testing skill
await devAgent.chat('Refactor this class for better readability');  // Uses refactoring skill
```

## Dynamic Skill Loading

Load skills based on context:

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { Agent, createSkillManager } from 'praisonai';

const skillManager = createSkillManager({ paths: ['./skills'] });
await skillManager.discover();

async function createContextualAgent(taskType: string) {
  // Select skills based on task
  const skillNames = {
    'code': ['code-review', 'debugging', 'testing'],
    'writing': ['grammar', 'style-guide', 'seo'],
    'data': ['data-analysis', 'visualization', 'statistics']
  }[taskType] || [];
  
  return new Agent({
    name: `${taskType} Agent`,
    instructions: `You specialize in ${taskType} tasks.`,
    skills: skillManager.list(skillNames)
  });
}

const codeAgent = await createContextualAgent('code');
const writingAgent = await createContextualAgent('writing');
```

## Multi-Agent with Specialized Skills

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { Agent, Agents, createSkillManager } from 'praisonai';

const skillManager = createSkillManager({ paths: ['./skills'] });
await skillManager.discover();

// Each Agent has different skills
const securityAgent = new Agent({
  name: 'Security Expert',
  instructions: 'You focus on security analysis.',
  skills: skillManager.list(['security-audit', 'vulnerability-scan', 'penetration-testing'])
});

const performanceAgent = new Agent({
  name: 'Performance Expert',
  instructions: 'You optimize for performance.',
  skills: skillManager.list(['profiling', 'optimization', 'caching-strategies'])
});

const architectAgent = new Agent({
  name: 'Architect',
  instructions: 'You design system architecture.',
  skills: skillManager.list(['system-design', 'scalability', 'microservices'])
});

const agents = new AgentTeam({
  agents: [securityAgent, performanceAgent, architectAgent],
  tasks: [
    { agent: securityAgent, description: 'Audit security of: {code}' },
    { agent: performanceAgent, description: 'Analyze performance issues' },
    { agent: architectAgent, description: 'Recommend architectural improvements' }
  ]
});

await agents.start({ code: 'application source code...' });
```

## Agent Skill Injection

Inject skills into Agent prompts:

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { Agent, createSkillManager } from 'praisonai';

const skillManager = createSkillManager({ paths: ['./skills'] });
await skillManager.discover();

const agent = new Agent({
  name: 'Flexible Agent',
  instructions: 'You are a helpful assistant.'
});

// Inject skills dynamically per request
async function chatWithSkills(message: string, skillNames: string[]) {
  const skillPrompt = skillManager.generatePrompt(skillNames);
  
  return await agent.chat(`
${skillPrompt}

User Request: ${message}
  `);
}

// Different skills for different requests
await chatWithSkills('Review this code', ['code-review']);
await chatWithSkills('Write documentation', ['documentation', 'technical-writing']);
```

## Skill Discovery Paths

Skills are discovered from multiple locations:

| Location | Path | Priority |
| - | - | - |
| **Project** | `./.praison/skills/` | Highest |
| **Project** | `./.claude/skills/` | High |
| **User** | `~/.praisonai/skills/` | Medium |
| **System** | `/etc/praison/skills/` | Lowest |

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
const skillManager = createSkillManager({
  includeProject: true,   // .praison/skills/, .claude/skills/
  includeUser: true,      // ~/.praisonai/skills/
  includeSystem: false,   // /etc/praison/skills/
  paths: ['./custom-skills']  // Additional paths
});
```

## Skill Validation

Validate skills before using with Agents:

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
const skillManager = createSkillManager({ paths: ['./skills'] });

const skill = await skillManager.loadSkill('./my-skill/SKILL.md');
const validation = skillManager.validate(skill);

if (!validation.valid) {
  console.log('Skill errors:', validation.errors);
} else {
  // Safe to use with Agent
  const agent = new Agent({
    name: 'Agent',
    skills: [skill]
  });
}
```

## Related

> [card] [Tools](https://praison.ai/docs/js/tools.md)
>
> Executable capabilities

> [card] [Workflows](https://praison.ai/docs/js/workflows.md)
>
> Orchestrate agents


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.