> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentium.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Skill examples

> Pack tools and extra instructions into a named Skill, then attach it to an agent.

# Skill examples

Runnable files: [agentium-examples/skills](https://github.com/agentiumOS/agentium-examples/tree/main/skills).

Guide: [Skills](/skills/overview)

***

## 1. A skill object

```typescript theme={null}
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?");
```

***

## 2. SKILL.md on disk

```typescript theme={null}
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](https://github.com/agentiumOS/agentium-examples/blob/main/skills/skill-md.ts).
