Skill examples
Runnable files: agentium-examples/skills. Guide: Skills1. A skill object
2. SKILL.md on disk
Agent.deep() loads skills/*/SKILL.md from the project. Recipe: agentium-examples/skills/skill-md.ts.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Pack tools and extra instructions into a named Skill, then attach it to an agent.
import { Agent, openai, defineTool } from "@agentium/core";
import type { Skill } from "@agentium/core";
import { z } from "zod";
const shippingSkill: Skill = {
name: "shipping",
description: "Rates and tracking",
version: "1.0.0",
tools: [
defineTool({
name: "calculate_shipping",
description: "Cost from weight and destination",
parameters: z.object({
weightKg: z.number(),
destination: z.string(),
express: z.boolean().optional(),
}),
execute: async ({ weightKg, destination, express }) => {
const cost = (weightKg * 2.5 * (express ? 2 : 1)).toFixed(2);
return `Shipping to ${destination}: $${cost}`;
},
}),
],
instructions: "When they ask about cost, call calculate_shipping.",
};
const agent = new Agent({
name: "ShippingAssistant",
model: openai("gpt-4o"),
instructions: "You help with shipping.",
skills: [shippingSkill],
});
await agent.run("How much to ship 5kg to Germany?");
const agent = Agent.deep({
name: "coder",
model: openai("gpt-4o"),
workspace: ".",
});
Agent.deep() loads skills/*/SKILL.md from the project. Recipe: agentium-examples/skills/skill-md.ts.