Skills
Skill Instructions
Convert loaded skills into prompt instructions.
Skill instructions are split into two layers: a compact skill list that is always added to the agent, and full SKILL.md guidance that the model loads only when needed.
1. Inspect the Generated Summary
const skillSet = await loadSkills(skill.local("./skills"));
console.log(skillSet.instructions);The summary tells the model:
- which skills are available
- each skill description
- which reference files are available
- which scripts are available
- which skill tools can load details
2. Add Skills After Base Instructions
const agent = new AgentBuilder("assistant", model)
.instructions("Be concise and verify repository facts before answering.")
.skills(skillSet)
.build();Anvia appends skill instructions after your base instructions. Keep base instructions for behavior that always applies. Keep skill details inside SKILL.md.
3. Load Full Instructions On Demand
During a run, the model can call:
get_skill_instructions({
skillName: "code-review",
});That returns the body of skills/code-review/SKILL.md, without the frontmatter.
4. Keep SKILL.md Focused
Good skill instructions explain:
| Include | Avoid |
|---|---|
| when to use the skill | general agent behavior |
| exact review or workflow rules | unrelated background |
| required output shape | large reference content |
| when to load references or scripts | secrets or environment-specific data |
Put large supporting material in references/ so it can be loaded separately.
