Skip to main content

Overview

You can define multiple skills in one project to organize tools logically, then add them all to your agent.
import { LuaAgent, LuaSkill } from 'lua-cli';

// Single project, multiple skills
const catalogSkill = new LuaSkill({...});
const cartSkill = new LuaSkill({...});
const orderSkill = new LuaSkill({...});

// Configure agent with all skills (v3.0.0)
export const agent = new LuaAgent({
  name: "ecommerce-agent",
  persona: "You are a helpful shopping assistant...",
  skills: [catalogSkill, cartSkill, orderSkill]
});

When to Use Multiple Skills

✅ Tools serve different purposes✅ Different teams own different skills✅ Skills need different deployment schedules✅ Clear logical separation

Example: E-commerce Platform

import { LuaAgent, LuaSkill } from "lua-cli";
import {
  SearchProductsTool,
  GetProductTool
} from "./tools/ProductTools";
import {
  CreateBasketTool,
  AddItemTool
} from "./tools/BasketTools";
import {
  CreateOrderTool,
  TrackOrderTool
} from "./tools/OrderTools";

// Skill 1: Product Catalog
const catalogSkill = new LuaSkill({
  name: "catalog-skill",
  description: "Product browsing and search",
  context: `
    Use search_products when users want to find items.
    Use get_product for detailed product information.
  `,
  tools: [
    new SearchProductsTool(),
    new GetProductTool()
  ]
});

// Skill 2: Shopping Cart
const cartSkill = new LuaSkill({
  name: "cart-skill",
  description: "Shopping cart management",
  context: `
    Use create_basket to start shopping.
    Use add_item to add products to cart.
  `,
  tools: [
    new CreateBasketTool(),
    new AddItemTool()
  ]
});

// Skill 3: Order Management
const orderSkill = new LuaSkill({
  name: "order-skill",
  description: "Order creation and tracking",
  context: `
    Use create_order to finalize purchase.
    Use track_order for delivery status.
  `,
  tools: [
    new CreateOrderTool(),
    new TrackOrderTool()
  ]
});

// Configure agent with all skills (v3.0.0)
export const agent = new LuaAgent({
  name: "ecommerce-assistant",
  
  persona: `You are a helpful e-commerce shopping assistant.
  
Your role:
- Help customers find products
- Assist with shopping cart management
- Process orders and track deliveries

Communication style:
- Friendly and professional
- Proactive with suggestions
- Clear about pricing and availability`,

  
  skills: [catalogSkill, cartSkill, orderSkill]
});

Benefits

Logical Organization

Group related tools together

Independent Versions

Version each skill separately

Clear Ownership

Different teams maintain different skills

Flexible Deployment

Deploy skills independently

How It Works

Configuration

lua.skill.yaml tracks all skills:
agent:
  agentId: agent_abc123
  orgId: org_xyz789

skills:
  - name: catalog-skill
    version: 1.0.0
    skillId: skill_abc123
  - name: cart-skill
    version: 1.0.0
    skillId: skill_def456
  - name: order-skill
    version: 1.0.0
    skillId: skill_ghi789

Deployment

All skills push and deploy together:
lua push    # Uploads all 3 skills
lua deploy  # Deploys all 3 skills

Real-World Examples

Customer Service Platform

import { LuaAgent, LuaSkill } from 'lua-cli';

// FAQ & Knowledge Base
const knowledgeSkill = new LuaSkill({
  name: "knowledge-skill",
  tools: [
    new SearchArticlesTool(),
    new GetArticleTool()
  ]
});

// Ticket Management
const ticketSkill = new LuaSkill({
  name: "ticket-skill",
  tools: [
    new CreateTicketTool(),
    new UpdateTicketTool(),
    new GetTicketStatusTool()
  ]
});

// Account Management
const accountSkill = new LuaSkill({
  name: "account-skill",
  tools: [
    new GetAccountTool(),
    new UpdateAccountTool(),
    new ResetPasswordTool()
  ]
});

// Configure support agent (v3.0.0)
export const agent = new LuaAgent({
  name: "support-agent",
  persona: "You are a customer support specialist. Help users with their questions, create tickets when needed, and manage accounts.",
  skills: [knowledgeSkill, ticketSkill, accountSkill]
});

Restaurant Management

import { LuaAgent, LuaSkill } from 'lua-cli';

// Menu & Orders
const menuSkill = new LuaSkill({
  name: "menu-skill",
  tools: [
    new ShowMenuTool(),
    new CreateOrderTool()
  ]
});

// Reservations
const reservationSkill = new LuaSkill({
  name: "reservation-skill",
  tools: [
    new MakeReservationTool(),
    new CheckAvailabilityTool(),
    new CancelReservationTool()
  ]
});

// Loyalty Program
const loyaltySkill = new LuaSkill({
  name: "loyalty-skill",
  tools: [
    new CheckPointsTool(),
    new RedeemRewardTool()
  ]
});

// Configure restaurant agent (v3.0.0)
export const agent = new LuaAgent({
  name: "restaurant-assistant",
  persona: "You are a friendly restaurant assistant. Help with menu questions, take orders, manage reservations, and handle loyalty rewards.",
  skills: [menuSkill, reservationSkill, loyaltySkill]
});

Best Practices

Each skill should have a clear, single purpose:✅ Good: “product-catalog-skill”, “order-management-skill”❌ Bad: “general-skill”, “everything-skill”
Keep skills manageable:
  • Small: 2-5 tools
  • Medium: 6-10 tools
  • Large: 11-20 tools
  • Too large: > 20 tools (consider splitting)
Each skill is versioned independently in lua.skill.yaml:
skills:
  - name: skill-1
    version: "2.0.0"  # Major update
    skillId: "..."
  - name: skill-2
    version: "1.0.1"  # Bug fix only
    skillId: "..."
Use services for shared logic:
// services/ApiClient.ts
export class ApiClient {
  // Shared API logic
}

// Use in multiple skills
import { ApiClient } from '../services/ApiClient';

Migration Strategies

From Single to Multiple Skills

1

Identify Groups

Group related tools together
2

Create New Skills

Define new LuaSkill instances
3

Move Tools

Assign tools to appropriate skills
4

Update Context

Write specific context for each skill
5

Test

Test all skills together
6

Deploy

Push and deploy as usual

Example Migration

Before (Single Skill):
const allInOne = new LuaSkill({
  name: "all-in-one",
  tools: [
    new SearchProductsTool(),
    new CreateBasketTool(),
    new CreateOrderTool(),
    // 20 more tools...
  ]
});
After (Multiple Skills with v3.0.0):
import { LuaAgent, LuaSkill } from 'lua-cli';

const productsSkill = new LuaSkill({
  name: "products",
  tools: [new SearchProductsTool(), ...]
});

const cartSkill = new LuaSkill({
  name: "cart",
  tools: [new CreateBasketTool(), ...]
});

const orderSkill = new LuaSkill({
  name: "orders",
  tools: [new CreateOrderTool(), ...]
});

// Configure agent with organized skills
export const agent = new LuaAgent({
  name: "ecommerce-agent",
  persona: "You are a helpful shopping assistant...",
  skills: [productsSkill, cartSkill, orderSkill]
});

Next Steps