Skip to content

ema / skills / Skill

Abstract Class: Skill

Defined in: packages/ema/src/skills/base.ts:16

Base class for all skills.

A skill lives in a directory (skillDir) and exposes description, parameters (JSON Schema), and an async execute entry point. Concrete skills should extend this class and implement their own behaviour.

Constructors

Constructor

ts
new Skill(skillsDir, name): Skill;

Defined in: packages/ema/src/skills/base.ts:20

Parameters

skillsDir

string

name

string

Returns

Skill

Properties

description

ts
abstract description: string;

Defined in: packages/ema/src/skills/base.ts:26

Returns a one-line human-readable description of the skill.


name

ts
readonly name: string;

Defined in: packages/ema/src/skills/base.ts:17


parameters

ts
abstract parameters: Record<string, any>;

Defined in: packages/ema/src/skills/base.ts:29

Returns the JSON Schema describing the arguments the skill accepts.


skillDir

ts
readonly skillDir: string;

Defined in: packages/ema/src/skills/base.ts:18

Accessors

metadata

Get Signature

ts
get metadata(): Record<string, string>;

Defined in: packages/ema/src/skills/base.ts:39

Returns minimal metadata used for listing in prompts/UI.

Returns

Record<string, string>

Methods

execute()

ts
abstract execute(args, context?): Promise<ToolResult>;

Defined in: packages/ema/src/skills/base.ts:36

Executes the skill.

Parameters

args

unknown

Arguments object that should satisfy parameters.

context?

ToolContext

Optional tool context (e.g. actor scope).

Returns

Promise<ToolResult>


getPlaybook()

ts
getPlaybook(): Promise<string>;

Defined in: packages/ema/src/skills/base.ts:50

Loads the SKILL.md playbook (strips frontmatter) and appends parameter hints. Returns empty string when the playbook file does not exist.

Returns

Promise<string>