← Documentation home

Build a Skill

A Skill adds tools that the AI agent can discover and call. It does not modify the Agent Code UI or replace application services.

1. Skill folder structure

~/.local/share/agent-code/skills/
└── hello_world/
    ├── skill.py
    └── skill.md

For compatibility with the project-local migration, legacy skills may also be found in a project's skills/ folder. The current global user location is preferred.

2. Required Python exports

The loader imports skill.py and reads these exports:

3. Minimal working example

"""A tiny Agent Code skill."""

SKILL = {
    "name": "hello_world",
    "description": "Returns a friendly greeting.",
}

def greet(name: str = "there") -> str:
    return f"Hello, {name}!"

TOOL_SCHEMAS = [{
    "type": "function",
    "function": {
        "name": "hello_world_greet",
        "description": "Greet a person by name.",
        "parameters": {
            "type": "object",
            "properties": {
                "name": {"type": "string", "description": "Name to greet"}
            },
            "required": [],
        },
    },
}]

TOOL_CALLABLES = {
    "hello_world_greet": greet,
}

4. Schema and callable rules

5. Optional commands

def configure(args, log):
    # args is a list of words after the command.
    log("Configuration command received", "dim")

COMMANDS = {
    "configure": {
        "handler": configure,
        "description": "Configure this skill",
        "aliases": ["hello configure"],
    }
}

A slash command is invoked as /configure if its name is not already reserved by another command. Natural aliases are dispatched only when the phrase matches the registered alias; they are not sent to the shell. Use clear, non-conflicting command names. Add-on commands are separately namespaced (for example /addon-name:status).

6. Optional skill.md metadata and help

---
name: hello_world
description: A sample greeting skill
version: 1.0.0
author: Your Name
---

# Hello World

Use this skill to greet a person by name.

The text after the YAML-like frontmatter is shown as the skill's help page. The current loader parses simple key/value frontmatter; do not rely on advanced YAML features.

7. Test locally

  1. Create the skill folder in the user Skills directory.
  2. Run python -m py_compile skill.py from that folder.
  3. Run agent-code skills list to see bundled skills (this command does not list every installed custom skill).
  4. Launch Agent Code and use the Skills interface to enable/reload it.
  5. Use /skills in chat to inspect loaded skills and commands.
  6. Ask the agent to use the tool for a small harmless task.

8. Package and share a Skill

cd ~/.local/share/agent-code/skills
zip -r hello_world-1.0.0.zip hello_world \
  -x '*/__pycache__/*' '*.pyc'

Include only the skill folder, documentation and required assets. Document external dependencies and installation steps. Do not include API keys, tokens, personal data, virtual environments or caches.

9. Security and runtime

Important: Skills are imported as Python modules by the local Agent Code process. Their code runs with the current user's operating-system permissions. The shell Podman sandbox does not automatically sandbox Skill Python code. A Skill that needs remote execution must implement that transport itself and clearly identify where its code and data run.

10. Current contract boundaries

Native Skills support SKILL, TOOL_SCHEMAS, TOOL_CALLABLES, optional COMMANDS, and optional HELP. This guide documents the loader contract implemented in this release; it does not promise an automatic dependency installer or per-Skill Local/Sandbox/SSH routing.

Next: Build an Add-on →