Skip to main content

Build a Task Management Skill

Let’s build a complete skill that manages tasks (create, list, complete, delete).

Step 1: Initialize Project

Follow the prompts to create a new agent.

Step 2: Clean Up Template

Remove unnecessary example files:

Step 3: Create Task Tool

Create src/tools/TaskTool.ts:

Step 4: Create Agent with Skill

Update src/index.ts to use the LuaAgent pattern:
Use LuaAgent to configure your agent with persona, welcome message, and skills in one place.

Step 5: Test Your Tools

Test Individual Tools

Select tools and test:
  • create_task: Create a task to buy milk
  • list_tasks: View all pending tasks
  • complete_task: Mark a task as done
  • search_tasks: Find tasks about “meeting”

Test Conversationally

Try these in the chat:
  • “Create a task to buy milk”
  • “Show me my pending tasks”
  • “Mark the milk task as done”
  • “Find all tasks about meetings”
Your task management skill is now working!

Step 6: Deploy

When you’re satisfied with your skill:

Step 7: Test on Real Channels (Optional)

Want to test your agent on WhatsApp, Facebook, Instagram, or other platforms?

Quick Testing Channels

Link your agent to existing Lua channels for instant testing without channel setup
Example for WhatsApp:
Replace YOUR_AGENT_ID with your agent ID from lua.skill.yaml

What You Built

4 Tools

Create, list, complete, and search tasks

Custom Data

Uses Lua’s Data API for storage

Vector Search

Semantic search for finding tasks

Type Safe

Full TypeScript with Zod validation

Next Steps

1

Add More Features

  • Delete tasks
  • Update task details
  • Set reminders
  • Add tags
2

Improve User Experience

  • Better error messages
  • Confirmation prompts
  • Progress indicators
3

Explore Other Examples

Tool Examples

See 30+ working examples

Common Patterns Used

Pattern: Data Storage

Creates entries with optional vector search indexing.
Finds similar items based on meaning, not just exact matches.

Pattern: CRUD Operations

Pattern: Input Validation

Zod schemas provide runtime validation and TypeScript types.

Troubleshooting

Install dependencies:
Make sure you’re using the correct task ID from the list_tasks response.
  • Lower the score threshold: 0.6 instead of 0.7
  • Check that tasks have searchable text
  • Try broader search terms