Overview
LuaSkill is the main class for defining a skill - a collection of related tools that your AI agent can use.
Constructor
new LuaSkill(config)
Creates a new skill instance.LuaSkillConfig
required
Skill configuration object
Configuration Parameters
string
default:"unnamed-skill"
Unique identifier for the skillFormat: lowercase, alphanumeric, hyphens onlyExamples:
"weather-skill", "product-catalog-skill"string
required
Brief description (1-2 sentences) of what the skill doesThis appears in skill listings and helps users understand the skill’s purpose.
string | { base?: string; voice?: string; text?: string }
required
Detailed instructions for the AI on when and how to use the tools.String form (recommended):
- Critical for proper tool selection
- Write it like instructions to a smart assistant
base— Always rendered, on every channelvoice— Appended tobaseon voice channels, ignored on texttext— Appended tobaseon text channels (web, WhatsApp, SMS), ignored on voice
LuaTool[]
Array of tool instances to include in the skillCan be empty initially and tools added later with
addTool() or addTools().function
true to expose it, false to hide it.When it returns false the skill disappears completely: its tools can’t be called and its name, its context, and its tool names are left out of the agent’s prompt. The agent doesn’t know the capability exists.See Conditional Skills.Conditional Skills
Usecondition when a whole capability should be invisible to some users — tiering, entitlements, per-customer features.
check_points tool to refuse, and no loyalty context to leak.
How it behaves:
- Evaluated on every message, for the current user. Results are not cached between turns, so the gate always reflects current state.
- Runs like your tool code. Has access to all Platform APIs (
User,Data,Lua,Products, etc.). - Absent condition means always on. Existing skills are unaffected.
- Skill-level short-circuits tool-level. If the skill is hidden, its tools’ own
conditionfunctions never run.
LuaSkill subclass rather than a config object, declare condition as a class field or method — the semantics are identical.
Fail-closed behavior: If your condition function throws an error or times out (30s), the skill is hidden. Design for that — a flaky third-party call inside a condition will hide the capability from users who should have it. Prefer a flag you already store on the user record over a live external lookup on every message.
Skill condition vs tool condition
Both gates take the same shape. They differ in what the agent still knows about.
Gate individual tools with
LuaTool.condition when the rest of the skill still applies — for example, hiding cancel_order while track_order stays available.
Methods
addTool()
Adds a single tool to the skill.LuaTool
required
Tool instance to add
- Tool name must be unique within the skill
- Tool name must only contain:
a-z,A-Z,0-9,-,_ - Throws error if validation fails
addTools()
Adds multiple tools to the skill at once.LuaTool[]
required
Array of tool instances to add
- All tools validated before adding
- Atomic operation (all or nothing)
- Throws error if any validation fails
Examples
Basic Skill
Weather Skill
E-commerce Skill
Adding Tools Dynamically
Writing Good Context
Thecontext field is critical for AI tool selection. Follow these guidelines:
Structure
Good Context Example
Poor Context Example
Best Practices
Use Descriptive Names
Use Descriptive Names
Write Clear Descriptions
Write Clear Descriptions
Provide Detailed Context
Provide Detailed Context
The context field should include:
- Overview of skill purpose
- When to use each tool
- Important guidelines
- Edge cases to handle
Multi-Skill Projects
You can define multiple skills in one project:skillId in lua.skill.yaml and can be deployed independently.
Type Definitions
Next Steps
LuaTool Interface
Learn how to implement tools
Build Your First Skill
Follow a complete tutorial
Template Guide
Explore the example project
Skills & Tools Concept
Understand the architecture

