---
name: skill-builder
description: "Guide the user through creating a new lean skill — collect name, description, behaviour rules, and references, then save the skill to memory."
---

# Skill Builder

A deterministic walkthrough for creating new lean skills. Follow each step in order. Be conversational — one question at a time.

## When to Activate

The admin requests a new skill, asks to "create a skill", "add a skill", or "teach you something new".

## Before Starting

Load `references/lean-pattern.md` for the template and examples. Use it throughout as your reference for correct structure.

## Step 1: Understand the Purpose

Ask: **"What should this skill do?"**

Listen for:
- What capability it adds (scheduling, quoting, inventory, etc.)
- When it should activate (what triggers it)
- What tools or data it needs (memory, web search, file access, etc.)

Clarify until you can describe the skill in one sentence. This becomes the `description` in frontmatter.

## Step 2: Choose a Name

Propose a name based on the purpose. Names must be:
- Lowercase
- Hyphen-separated (e.g. `inventory-management`)
- Short and descriptive

Confirm with the user.

## Step 3: Define Behaviour

Ask what rules the agent should follow when using this skill:
- **Tone and style** — formal, casual, WhatsApp-short?
- **Activation conditions** — when exactly should the agent use this skill?
- **Hard boundaries** — what should the agent never do?
- **Data sources** — where does the skill's knowledge live? (memory, external API, files)
- **Escalation** — when should it hand off to admin?

Not every skill needs all of these. Only include what's relevant.

If the skill involves generating PDFs or print-ready documents, load `references/pdf-generation.md` for the constraints on HTML layout and the `browser_pdf_save` rendering path.

## Step 4: Decide on References

If the skill has detailed procedures, templates, or data formats, those belong in `references/` files — not inline in SKILL.md.

Ask: **"Are there any detailed procedures, templates, or formats this skill needs?"**

For each reference file:
- Give it a descriptive filename (e.g. `event-format.md`, `quoting-rules.md`)
- Collect the content from the user — they can dictate, paste, or describe it and you draft it

If the skill is simple enough to fit in SKILL.md alone (under ~30 lines of instructions), skip references.

## Step 5: Choose an Icon

Ask: **"Would you like to pick an icon for this skill?"**

Icons give skills a visual identity. They use [Lucide](https://lucide.dev) icon names. Offer a few suggestions that match the skill's purpose — the reference file `references/lean-pattern.md` has a curated list.

If the user picks one, note it as part of the skill record. If they skip this, omit it — it's optional.

## Step 6: Compose the Skill

Using the lean pattern from `references/lean-pattern.md`, compose:

1. **SKILL.md** — frontmatter (`name`, `description`) + activation conditions + behaviour rules + references index
2. **Reference files** — one per detailed topic

Show the user the complete SKILL.md content and each reference file. Ask them to review.

## Step 7: Save to Memory

Use `memory-write` to save the composed skill to the knowledge graph:

```
memory-write({
  labels: ["CreativeWork"],
  properties: {
    title: "Skill: {name}",
    abstract: "{full SKILL.md content including frontmatter}"
  }
})
```

If the skill has reference files, save each as a separate `CreativeWork` node:

```
memory-write({
  labels: ["CreativeWork"],
  properties: {
    title: "Skill Reference: {name}/{filename}",
    abstract: "{full reference file content}"
  }
})
```

## Step 8: Confirm

Tell the user:

> "Your skill has been saved to memory. I can recall it when the situation matches. You can update it at any time — just ask me to edit the skill."

---

**Remember:** Be conversational. Don't dump all questions at once. Guide through each step one at a time.
