Skip to content

Skills

A skill is a named block of domain know-how that is injected into the agent's system prompt when it becomes active. Skills are organised into skill domains — maps of a broader task area that tell the agent which skills exist and when each applies.

The agent resolves skills at runtime via a BaseSkillStore. The default implementation, LocalSkillStore, loads skills from local filesystem directories.

Built-in skills

The library ships with built-in skills and skill domains covering data science, machine learning, deep learning, competitive data science, quantitative analysis, and data science education. They are loaded automatically; no configuration is needed.

Custom skills

Add your own skills by pointing OpenDataSciConfig.skills_directory (or the SKILLS_DIRECTORY env var) at a directory of .md files:

my_skills/
    finance.md          # standalone skill, keyed "finance"
    trading/
        execution.md    # domain skill, keyed "trading::execution"
        risk.md         # domain skill, keyed "trading::risk"
from opendatasci import create_agent, OpenDataSciConfig

config = OpenDataSciConfig(skills_directory="my_skills/")

async with create_agent("data.csv", config=config) as agent:
    ...

Custom skills are merged with the built-in set; a custom file with the same name as a built-in overrides it.

Custom skill store

Subclass BaseSkillStore to load skills from any source (a database, remote store, etc.) and pass the instance to Agent:

from opendatasci.skills.base import BaseSkillStore, Skill, SkillDomain
from opendatasci.agents.agents import Agent
from opendatasci import LocalWorkspace, OpenDataSciConfig

class RemoteSkillStore(BaseSkillStore):
    def load(self, name: str) -> Skill | None:
        # fetch from a remote store …
        ...

    def load_domain(self, name: str) -> SkillDomain | None: ...
    def list_skills(self) -> dict[str, Skill]: ...
    def list_domains(self) -> dict[str, SkillDomain]: ...

async with Agent(
    workspace=LocalWorkspace("data.csv"),
    skill_store=RemoteSkillStore(),
    config=OpenDataSciConfig(),
) as agent:
    ...

Reference

Skill dataclass

Skill(name: str, content: str)

Know-how for carrying out a specific task or subtask.

A skill is where domain information lives — methodologies, idioms, defaults, conventions for a focused piece of work. It is injected into the agent's system prompt when active.

Attributes:

Name Type Description
name str

Unique skill identifier. Either a bare name for a standalone skill (e.g. "machine_learning") or a "<domain>::<skill>" qualified name for a skill that belongs to a skill domain (e.g. "competitive_data_science::reconnaissance").

content str

The prompt text injected into the agent's system prompt when this skill is active.


SkillDomain dataclass

SkillDomain(name: str, content: str)

A collection of skills scoped to a broad task domain.

A skill domain does not itself contain task-execution know-how — it is the map of a domain: which skills exist under it and when each applies. The agent loads a skill domain to orient itself, then loads the specific skill(s) it points to for the actual how-to.

Attributes:

Name Type Description
name str

Unique skill domain identifier (e.g. "competitive_data_science").

content str

The skill domain prompt text (pointers to the skills it covers), injected into the agent's system prompt when this skill domain is active.


BaseSkillStore

Bases: ABC

Registry of named skills and skill domains available to the agent.

load abstractmethod

load(name: str) -> Skill | None

Return the :class:Skill for name, or None if not found.

name is either a bare standalone-skill name or a "<domain>::<skill>" qualified name.

load_domain abstractmethod

load_domain(name: str) -> SkillDomain | None

Return the :class:SkillDomain for name, or None if not found.

list_skills abstractmethod

list_skills() -> dict[str, Skill]

Return all available skills keyed by name.

Standalone skills are keyed by their bare name; skills that belong to a skill domain are keyed by their "<domain>::<skill>" qualified name.

list_domains abstractmethod

list_domains() -> dict[str, SkillDomain]

Return all available skill domains keyed by name.


LocalSkillStore

LocalSkillStore(paths: list[Path] | None = None, domain_paths: list[Path] | None = None)

Bases: BaseSkillStore

Loads skills and skill domains from local filesystem directories.

Layout convention:

  • A skills directory may contain standalone .md skill files directly (<skills_dir>/<skill_name>.md) and/or subdirectories that group the skills belonging to a skill domain (<skills_dir>/<domain_name>/<skill_name>.md). Skills that belong to a skill domain are keyed by the qualified name "<domain_name>::<skill_name>".
  • A skill domain directory contains one subdirectory per domain, each holding a manifest.md file (<domains_dir>/<domain_name>/manifest.md).

Directories are scanned in order; later directories override earlier ones when names clash. Files with extensions other than .md are silently skipped. When paths / domain_paths is None, only the built-in directories are scanned.

Parameters:

Name Type Description Default
paths list[Path] | None

Ordered list of skills directories to scan. None loads only the built-in skills bundled with the package.

None
domain_paths list[Path] | None

Ordered list of skill-domain directories to scan. None loads only the built-in domains bundled with the package.

None

load_user_defined

load_user_defined() -> dict[str, Skill]

Return skills from all directories except the built-in skills directory.