AAnvio
Reference ArchiveSource Docs

Skills

Reusable capability modules attachable to any agent. A skill adds typed inputs, structured execution steps, and defined outputs to an agent's system prompt — making authoring explicit and composable r

6 min read

This is a migrated reference document from the original Anvio source repo. Content is preserved as-is; canonical documentation lives in the sections above in the sidebar.

Original path: docs/05-skills.md

Reusable capability modules attachable to any agent. A skill adds typed inputs, structured execution steps, and defined outputs to an agent's system prompt — making authoring explicit and composable rather than free-form prose.

Skill format

Skills are Markdown files with YAML frontmatter (or plain .yaml). The minimal form is just name + description + body instructions. The full structured form adds parameters, steps, outputs, and triggers.

Minimal (prose-only)

---
name: Research
description: Deep research and synthesis
---

When researching a topic:
1. Gather sources from multiple angles
2. Cross-check claims
3. Synthesise into a clear summary

Structured (v2 — parameters, steps, outputs, triggers)

---
name: Code Review
description: Structured code review with findings output
version: "2.0.0"
parameters:
  - name: target
    type: string          # string | number | boolean | array | object
    description: File path or PR URL to review
    required: true
  - name: focus
    type: string
    required: false
    enum: [correctness, security, performance, style, all]
    default: "all"
steps:
  - id: gather
    action: Read code changes
    tool: file_read        # gateway tool key
    output: code_content   # stores result as $code_content
  - id: security_scan
    action: Check for OWASP top 10 vulnerabilities
    condition: "focus == 'security' || focus == 'all'"
    output: security_findings
    onError: skip          # fail | skip | retry
  - id: report
    action: Merge and rank findings by severity
    output: final_report
outputs:
  - name: findings
    type: array            # string | number | boolean | array | object | markdown
    description: Review findings with file, line, severity
  - name: summary
    type: markdown
    description: Prioritised review summary
triggers:
  - code review            # string pattern
  - review this PR
  - event: pull_request    # structured event trigger
    channel: github
composable: true           # can be called from other skills
timeout: 120000            # ms
---

When reviewing code:
1. Check correctness and edge cases
2. Identify security vulnerabilities
3. Prioritise findings by severity (critical → error → warning → info)

Schema reference

FieldTypeDescription
parameters[]arrayTyped inputs the agent must collect
parameters[].namestringInput name
parameters[].typeenumstring number boolean array object
parameters[].requiredboolDefault true
parameters[].defaultanyUsed when not required and not provided
parameters[].enumstring[]Allowed values
steps[]arrayOrdered execution steps
steps[].idstringUnique step identifier
steps[].actionstringHuman-readable description of what this step does
steps[].toolstringGateway tool key to call (optional)
steps[].argsobjectTool arguments, supports \{\{param\}\} interpolation
steps[].conditionstringExpression — step skipped when falsy
steps[].onErrorenumfail (default) skip retry
steps[].maxRetriesintUsed with onError: retry
steps[].outputstringVariable name to store step result
outputs[]arrayDefined result values the skill produces
triggers[]arrayString patterns or \{event, condition, channel\} objects
composableboolSkill can be called from other skills
timeoutintMax execution time in ms

Trigger index cache (P1.S8, since v1.27.0)

DefaultAgentRuntime no longer parses every skill YAML per message. It holds one SkillTriggerCache (from @anvio/skills) which:

  • stats every *.yaml in the bundled + workspace catalog directories on each matchAll(message, ctx) call
  • re-parses only files whose mtimeMs changed since the last refresh
  • drops cache entries for files that were deleted
  • prefers workspace over bundled when both define the same slug

Rebuilding the index is O(N) fs.stat calls per message, not O(N) readFile + parseYaml. For a 30-skill catalog the per-message overhead drops from tens of ms to sub-ms. The cache is process-local; multi-process workers each hold their own.

Programmatic use — outside the runtime — via SkillTriggerCache.fromResolver(catalogResolver) or the direct new SkillTriggerCache(\{ bundledDir, workspaceDir \}) constructor.

Bundled skills

Available in configs/skills/ — no install needed:

SkillCategoryv2 structured
code-reviewEngineering✅
architectureEngineering✅
codingEngineering—
debuggingEngineering—
researchKnowledge—
planningProductivity—
documentationKnowledge—
financeDomain—
coachPersonal—
assistantGeneral—
project-managerProductivity—

Attach skills to an agent

---
# workspace/agents/reviewer.md
persona: reviewer
skills:
  - code-review
  - architecture
---
You are a senior code reviewer.

CLI

anvio skill catalog            # list all bundled + workspace skills
anvio skill catalog --source bundled
anvio skill install aws        # install optional skill
anvio skill list               # list installed

Skill resolution order

  1. workspace/skills/\{slug\}.md or .yaml (user override wins)
  2. configs/skills/\{slug\}.yaml (bundled)
  3. Remote catalog (future)

Learning loop

When a session ends and the soul's evolution.allowAutoUpdate is enabled, the learning loop (packages/learning) may auto-draft a skill from the session pattern. Drafts land in workspace/skills/_drafts/ with a slug that includes the source session id (<agent>-<sessionShort>-<timestamp>.md) so a reviewer can trace them back to the run.

Each draft carries lineage under a source: key in its frontmatter — sessionId, agentId, channel, userId, messages (count), and capturedAt. This survives the skill parser (which ignores unknown top-level keys) and stays grepable.

Manage drafts from the CLI:

anvio skill drafts               # list pending drafts (alias of `anvio learning drafts`)
anvio skill promote <slug>       # promote to workspace/skills/ (alias of `anvio learning promote`)

Or from any channel with the shared slash-command router (v2.1.0, ADR-0023):

/drafts               # list pending drafts
/draft <slug>         # show a draft's frontmatter + body
/promote <slug>       # promote a draft (add --force to overwrite)
/discard <slug>       # soft-delete (moves to _drafts/_discarded/)
/capture              # force-extract a draft from the current session

When the learning loop produces a draft during a chat session, the bot now announces it in the channel with the /draft, /promote, and /discard commands prefilled — no CLI trip required.

Force capture and offline transcripts

SkillEvolutionSummarizer.shouldCreate returning false used to drop the session silently. --force on the CLI and /capture in chat bypass that gate:

anvio learning promote-session <sid> --force
anvio learning capture --messages transcript.json --agent tech-lead

The transcript is an array of \{ role, content \} — paste from Slack, an issue thread, or a saved conversation and extract a skill without a running Anvio session.

Capture-on modes

soul.spec.evolution.captureOn governs the auto-draft path:

ModeBehavior
always (default)Draft whenever SkillEvolutionSummarizer.shouldCreate returns true (previous behavior)
mentionOnly draft when the session contains a /capture marker
manualNever draft automatically; only --force / /capture produce drafts

allowAutoUpdate: false still wins — a soul with evolution off never drafts, regardless of captureOn.

Draft housekeeping

anvio learning drafts prune --older-than 7d      # or 24h / 60m / 3600s

Diff-mode promotion

When the promoted skill would overwrite an existing file with different content, promote refuses and prints the diff. Re-run with --force to apply.

See docs/adr/0023-workspace-slash-commands.md for the cross-channel router shape.

Edit on GitHub

Last updated on

On this page