Anvia
Skills

Local Skills

Load local skill packages into Anvia agents.

Skills are local capability packages. They let an agent discover focused instructions, reference files, and executable scripts only when that skill is relevant.

1. Create a Skills Directory

skills/
  code-review/
    SKILL.md
    references/
      checklist.md
    scripts/
      lint.sh

Each skill lives in its own folder. The folder name must match the name field in SKILL.md.

2. Load Local Skills

import { loadSkills, skill } from "@anvia/core";

const skillSet = await loadSkills(skill.local("./skills"));

skill.local("./skills") scans child directories that contain SKILL.md. You can also point directly at one skill directory.

const skillSet = await loadSkills(skill.local("./skills/code-review"));

3. Attach Skills to an Agent

const agent = new AgentBuilder("developer-assistant", model)
  .instructions("Help with repository maintenance.")
  .skills(skillSet)
  .defaultMaxTurns(3)
  .build();

.skills(skillSet) adds the skill summary instructions and registers the skill tools on the agent.

4. Let the Agent Load Details On Demand

The agent receives a compact skill list first. It can then call skill tools to load the full instructions, reference files, or scripts only when needed.

const response = await agent
  .prompt("Review this pull request for correctness.")
  .send();

Use skills for optional capabilities. Put always-on behavior in normal agent instructions.