Skip to content
Back to skills

Custom Skills

ASecurity

"Guides PandasAI custom function skills, @pai.skill decorators,

  • 247 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 8, 2026
documentationpythongobashtestingapisecuritydocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill custom-skills --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Custom Skills?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Custom Skills
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-custom-skills/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-custom-skills)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: custom-skills
description: "Guides PandasAI custom function skills, @pai.skill decorators,
  SkillType validation, global registry management, and skill-related
  troubleshooting."
disable-model-invocation: true
metadata:
  disco-role: operating
license: NOASSERTION
---

# Custom Skills

Use this sub-skill when a user wants PandasAI to make custom Python functions
available to generated analysis code through `@pai.skill()` or the
`pandasai.ee.skills` registry.

PandasAI custom skills are runtime functions for PandasAI-generated code. They
are not DisCo Agent Skills and are not `SKILL.md` directories.

## Fast route

1. Define a normal Python function with type hints and a useful docstring.
2. Decorate it with `@pai.skill()` or `@pai.skill("custom_name")`.
3. Configure the LLM and run PandasAI chat as usual.
4. If testing registry behavior, clear `SkillsManager` between tests to avoid
   duplicate-name leakage.
5. If the task is about using those functions during chat, route back to
   [`../conversational-analysis/SKILL.md`](../conversational-analysis/SKILL.md)
   after registration is correct.

```python
import pandasai as pai

@pai.skill()
def format_currency(amount: float) -> str:
    """Format a numeric amount as US dollars."""
    return f"${amount:,.2f}"
```

## Read next

- [`references/api-reference.md`](references/api-reference.md) for `SkillType`,
  decorator forms, and `SkillsManager` methods.
- [`references/workflows.md`](references/workflows.md) for defining, naming,
  testing, and clearing custom skills.
- [`references/troubleshooting.md`](references/troubleshooting.md) for missing
  docstrings, duplicate registry names, lambda functions, and terminology
  confusion.
- [`scripts/skill_registry_smoke.py`](scripts/skill_registry_smoke.py) for a
  no-LLM registry behavior smoke.

## Boundaries

- Route dataframe chat, generated-code response handling, and LLM configuration
  to [`../conversational-analysis/SKILL.md`](../conversational-analysis/SKILL.md).
- Route sandbox/security choices to
  [`../sandbox-and-security/SKILL.md`](../sandbox-and-security/SKILL.md).
- Do not create or modify DisCo repo-skill files when the user asks about
  PandasAI `@pai.skill`; these are unrelated skill systems.

## Enterprise note

PandasAI documentation marks custom skills as an Enterprise feature for
production use. For local experimentation and tests, the decorator and registry
exist in the package. For production deployments, warn the user to confirm their
PandasAI license/plan.

## Safe validation

```bash
python sub-skills/custom-skills/scripts/skill_registry_smoke.py
```

The helper registers a small skill, verifies duplicate-name protection, verifies
no-docstring failure behavior, and prints JSON. It does not need a real LLM or
provider key.

## Common gotchas

- A function must have a docstring unless `SkillType(..., description=...)` is
  used directly.
- Duplicate skill names in the global registry raise `ValueError`.
- Decorated functions are replaced by `SkillType` objects, but remain callable.
- Registry state is global; clear it in tests before registering predictable
  names.
- Lambdas need an explicit name and description when wrapped directly.

Files in this skill

  • SKILL.md3.1 KB
  • references/api-reference.md2.6 KB
  • references/troubleshooting.md2.1 KB
  • references/workflows.md1.8 KB
  • scripts/skill_registry_smoke.py2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.