|
| 1 | +# Agent Skills Guide |
| 2 | + |
| 3 | +This guide covers how to configure Agent Skills in Lightspeed Core Stack and how to author your own skills. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +- [Introduction](#introduction) |
| 8 | +- [Configuration](#configuration) |
| 9 | + - [Option A: Directory of Skills](#option-a-directory-of-skills) |
| 10 | + - [Option B: Individual Skill Paths](#option-b-individual-skill-paths) |
| 11 | +- [Skill Directory Structure](#skill-directory-structure) |
| 12 | +- [SKILL.md Format](#skillmd-format) |
| 13 | + - [Frontmatter Fields](#frontmatter-fields) |
| 14 | + - [Body Content](#body-content) |
| 15 | +- [Creating a Skill](#creating-a-skill) |
| 16 | +- [How Skills Work at Runtime](#how-skills-work-at-runtime) |
| 17 | +- [Limitations](#limitations) |
| 18 | +- [Error Reference](#error-reference) |
| 19 | +- [References](#references) |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +# Introduction |
| 24 | + |
| 25 | +Agent Skills allow product teams (e.g., RHEL Lightspeed, Ansible Lightspeed) to extend Lightspeed Core with specialized instructions and domain knowledge. Skills are packaged as portable directories following the [Agent Skills open standard](https://agentskills.io). |
| 26 | + |
| 27 | +A skill is a `SKILL.md` file containing metadata and instructions that the LLM can load on demand. For example, a troubleshooting skill might contain step-by-step diagnostic procedures for a specific product, while a code review skill might contain a checklist and best practices. |
| 28 | + |
| 29 | +> [!IMPORTANT] |
| 30 | +> Skills are configured by **product teams at deployment time**. End users of LS app products do not have the ability to add skills, similar to how they cannot add MCP servers. |
| 31 | +
|
| 32 | +# Configuration |
| 33 | + |
| 34 | +Skills are configured in `lightspeed-stack.yaml` by specifying paths to skill directories. Two forms are supported. |
| 35 | + |
| 36 | +## Option A: Directory of Skills |
| 37 | + |
| 38 | +Point to a parent directory containing skill subdirectories. Each subdirectory with a `SKILL.md` file is loaded as a skill. |
| 39 | + |
| 40 | +```yaml |
| 41 | +skills: |
| 42 | + paths: |
| 43 | + - "/var/skills/" |
| 44 | +``` |
| 45 | +
|
| 46 | +This loads all skills found under `/var/skills/`: |
| 47 | + |
| 48 | +``` |
| 49 | +/var/skills/ |
| 50 | +├── openshift-troubleshooting/ |
| 51 | +│ ├── SKILL.md |
| 52 | +│ └── references/ |
| 53 | +│ └── common-errors.md |
| 54 | +├── code-review/ |
| 55 | +│ └── SKILL.md |
| 56 | +└── ansible-playbooks/ |
| 57 | + ├── SKILL.md |
| 58 | + └── references/ |
| 59 | + └── module-reference.md |
| 60 | +``` |
| 61 | +
|
| 62 | +## Option B: Individual Skill Paths |
| 63 | +
|
| 64 | +Point directly to specific skill directories for fine-grained control over which skills are loaded. |
| 65 | +
|
| 66 | +```yaml |
| 67 | +skills: |
| 68 | + paths: |
| 69 | + - "/var/skills/openshift-troubleshooting/" |
| 70 | + - "/var/skills/code-review/" |
| 71 | +``` |
| 72 | + |
| 73 | +> [!TIP] |
| 74 | +> Option A is recommended for most deployments. Use Option B when you need to selectively include specific skills from a larger collection. |
| 75 | +
|
| 76 | +See [examples/lightspeed-stack-skills.yaml](../examples/lightspeed-stack-skills.yaml) for a complete configuration example. |
| 77 | + |
| 78 | +# Skill Directory Structure |
| 79 | + |
| 80 | +Each skill is a directory containing, at minimum, a `SKILL.md` file: |
| 81 | + |
| 82 | +``` |
| 83 | +skill-name/ |
| 84 | +├── SKILL.md # Required: metadata + instructions |
| 85 | +└── references/ # Optional: additional documentation |
| 86 | + ├── guide.md |
| 87 | + └── troubleshooting.md |
| 88 | +``` |
| 89 | + |
| 90 | +- **`SKILL.md`** (required): Contains YAML frontmatter with metadata and Markdown body with instructions. |
| 91 | +- **`references/`** (optional): Contains additional documentation files that the LLM can load on demand when the skill instructions reference them. |
| 92 | + |
| 93 | +> [!NOTE] |
| 94 | +> Script execution (`scripts/` subdirectory) is not supported. Only `SKILL.md` and `references/` files are used at runtime. |
| 95 | +
|
| 96 | +# SKILL.md Format |
| 97 | + |
| 98 | +The `SKILL.md` file must contain YAML frontmatter (between `---` delimiters) followed by Markdown content. |
| 99 | + |
| 100 | +## Frontmatter Fields |
| 101 | + |
| 102 | +| Field | Required | Description | |
| 103 | +|-----------------|----------|-------------| |
| 104 | +| `name` | Yes | Skill identifier. Max 64 characters. Lowercase letters, numbers, and hyphens only. Must match the parent directory name. | |
| 105 | +| `description` | Yes | What the skill does and when to use it. Max 1024 characters. | |
| 106 | + |
| 107 | +### `name` rules |
| 108 | + |
| 109 | +- 1-64 characters |
| 110 | +- Lowercase letters (`a-z`), numbers (`0-9`), and hyphens (`-`) only |
| 111 | +- Must not start or end with a hyphen |
| 112 | +- Must not contain consecutive hyphens (`--`) |
| 113 | +- Must match the parent directory name |
| 114 | + |
| 115 | +**Valid names**: `openshift-troubleshooting`, `code-review`, `data-analysis` |
| 116 | + |
| 117 | +**Invalid names**: `OpenShift-Troubleshooting` (uppercase), `-code-review` (starts with hyphen), `code--review` (consecutive hyphens) |
| 118 | + |
| 119 | +### `description` guidance |
| 120 | + |
| 121 | +The description should include both **what** the skill does and **when** to use it. Include specific keywords that help the LLM identify relevant tasks. |
| 122 | + |
| 123 | +```yaml |
| 124 | +# Good: specific about what and when |
| 125 | +description: Diagnose and fix common OpenShift deployment issues including pod failures, networking problems, and resource constraints. Use when users report deployment failures or application issues on OpenShift. |
| 126 | + |
| 127 | +# Poor: too vague |
| 128 | +description: Helps with OpenShift. |
| 129 | +``` |
| 130 | +
|
| 131 | +## Body Content |
| 132 | +
|
| 133 | +The Markdown body after the frontmatter contains the skill instructions. There are no format restrictions. Write whatever helps the LLM perform the task effectively. |
| 134 | +
|
| 135 | +Recommended sections: |
| 136 | +- Step-by-step instructions |
| 137 | +- Examples of inputs and outputs |
| 138 | +- Common edge cases and how to handle them |
| 139 | +
|
| 140 | +> [!TIP] |
| 141 | +> Keep `SKILL.md` under 500 lines. Move detailed reference material to files in the `references/` subdirectory and reference them from the main instructions. |
| 142 | + |
| 143 | +# Creating a Skill |
| 144 | + |
| 145 | +Follow these steps to create a new skill: |
| 146 | + |
| 147 | +**1. Create the skill directory** |
| 148 | + |
| 149 | +The directory name must match the `name` field in `SKILL.md`. |
| 150 | + |
| 151 | +```bash |
| 152 | +mkdir -p /var/skills/my-skill |
| 153 | +``` |
| 154 | + |
| 155 | +**2. Create the `SKILL.md` file** |
| 156 | + |
| 157 | +```markdown |
| 158 | +--- |
| 159 | +name: my-skill |
| 160 | +description: A brief description of what this skill does and when to use it. |
| 161 | +--- |
| 162 | +
|
| 163 | +# My Skill |
| 164 | +
|
| 165 | +## When to use this skill |
| 166 | +
|
| 167 | +Use this skill when: |
| 168 | +- Condition A applies |
| 169 | +- The user asks about topic B |
| 170 | +
|
| 171 | +## Instructions |
| 172 | +
|
| 173 | +1. First, do X |
| 174 | +2. Then check Y |
| 175 | +3. If Z occurs, see [the reference guide](references/guide.md) |
| 176 | +``` |
| 177 | + |
| 178 | +**3. (Optional) Add reference files** |
| 179 | + |
| 180 | +```bash |
| 181 | +mkdir -p /var/skills/my-skill/references |
| 182 | +``` |
| 183 | + |
| 184 | +Add documentation files that the skill instructions reference: |
| 185 | + |
| 186 | +```markdown |
| 187 | +# references/guide.md |
| 188 | +
|
| 189 | +Detailed reference content goes here... |
| 190 | +``` |
| 191 | + |
| 192 | +**4. Add the skill path to configuration** |
| 193 | + |
| 194 | +Add the path to your `lightspeed-stack.yaml`: |
| 195 | + |
| 196 | +```yaml |
| 197 | +skills: |
| 198 | + paths: |
| 199 | + - "/var/skills/" # If using a directory of skills |
| 200 | +``` |
| 201 | + |
| 202 | +**5. Restart the service** |
| 203 | + |
| 204 | +Skills are loaded at startup. Restart Lightspeed Core Stack to pick up new or modified skills. |
| 205 | + |
| 206 | +See [examples/skills/](../examples/skills/) for complete working examples. |
| 207 | + |
| 208 | +# How Skills Work at Runtime |
| 209 | + |
| 210 | +Skills use a progressive disclosure pattern with three LLM tools: |
| 211 | + |
| 212 | +1. **`list_skills`** — The LLM calls this to discover available skills. Returns the name and description of each skill. |
| 213 | +2. **`activate_skill`** — When a task matches a skill's description, the LLM calls this to load the full instructions from `SKILL.md`. |
| 214 | +3. **`load_skill_resource`** — If the skill instructions reference files in `references/`, the LLM calls this to load them on demand. |
| 215 | + |
| 216 | +``` |
| 217 | +User question |
| 218 | + │ |
| 219 | + ▼ |
| 220 | +LLM calls list_skills → sees skill catalog (name + description) |
| 221 | + │ |
| 222 | + ▼ (if task matches a skill) |
| 223 | +LLM calls activate_skill → loads full SKILL.md instructions |
| 224 | + │ |
| 225 | + ▼ (if instructions reference a file) |
| 226 | +LLM calls load_skill_resource → loads file from references/ |
| 227 | + │ |
| 228 | + ▼ |
| 229 | +LLM follows skill instructions to answer |
| 230 | +``` |
| 231 | +
|
| 232 | +The system prompt contains behavioral instructions telling the LLM how to use these tools. When no skills are configured, the tools and instructions are omitted entirely. |
| 233 | +
|
| 234 | +> [!NOTE] |
| 235 | +> Skills are tracked per conversation. If a skill is already loaded in a conversation, re-activating it returns a note instead of re-injecting the content. |
| 236 | +
|
| 237 | +# Limitations |
| 238 | +
|
| 239 | +- **No script execution**: The `scripts/` subdirectory from the agentskills.io spec is not supported. Skills provide instructions only; they do not execute code. |
| 240 | +- **Read-only**: Skills are loaded from the filesystem at startup and are read-only at runtime. |
| 241 | +- **No remote loading**: Skills must be present on the local filesystem. Loading from URLs or registries is not supported. |
| 242 | +- **Duplicate names**: Skill names must be unique across all configured paths. Duplicate names cause a startup error. |
| 243 | +
|
| 244 | +# References |
| 245 | +
|
| 246 | +- [Agent Skills Specification](https://agentskills.io/specification) — the open standard for skill format |
| 247 | +- [Agent Skills Implementation Guide](https://agentskills.io/client-implementation/adding-skills-support) — client implementation guidance |
| 248 | +- [Feature Design Document](design/agent-skills/agent-skills.md) — internal design spec for the Lightspeed Core implementation |
| 249 | +- [Example Skills](../examples/skills/) — working example skills |
| 250 | +- [Example Configuration](../examples/lightspeed-stack-skills.yaml) — example `lightspeed-stack.yaml` with skills configured |
0 commit comments