Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The service includes comprehensive user data collection capabilities for various
* [Installation](#installation)
* [Run LCS locally](#run-lcs-locally)
* [Configuration](#configuration)
* [Agentic Capabilities](#agentic-capabilities)
* [LLM Compatibility](#llm-compatibility)
* [Set LLM provider and model](#set-llm-provider-and-model)
* [Selecting provider and model](#selecting-provider-and-model)
Expand Down Expand Up @@ -50,6 +51,7 @@ The service includes comprehensive user data collection capabilities for various
* [System Prompt Literal](#system-prompt-literal)
* [Custom Profile](#custom-profile)
* [Control model/provider overrides via authorization](#control-modelprovider-overrides-via-authorization)
* [Agent Skills](#agent-skills)
* [Safety Shields](#safety-shields)
* [Authentication](#authentication)
* [CORS](#cors)
Expand Down Expand Up @@ -196,6 +198,19 @@ To quickly get hands on LCS, we can run it using the default configurations prov

# Configuration

## Agentic Capabilities

Lightspeed Core Stack supports the following agentic features:

| Capability | Status | Description |
|------------|--------|-------------|
| MCP Tools | Supported | External tool integration via [Model Context Protocol](https://modelcontextprotocol.io) servers |
| RAG | Supported | Retrieval-Augmented Generation with vector stores ([RAG Guide](docs/rag_guide.md)) |
| A2A Protocol (Client) | Supported | Agent-to-Agent communication as client ([A2A Protocol](docs/a2a_protocol.md)) |
| Conversation History | Supported | Persistent conversation context across requests |
| Human-in-the-Loop | Upcoming (Q2) | Interactive approval or confirmation steps |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that this is actually planned for Q2

| Agent Skills | Upcoming (Q2) | Domain-specific instructions loaded on demand ([Agent Skills Guide](docs/skills_guide.md)) |

Comment thread
are-ces marked this conversation as resolved.
## LLM Compatibility

Lightspeed Core Stack (LCS) provides support for Large Language Model providers. The models listed in the table below represent specific examples that have been tested within LCS.
Expand Down Expand Up @@ -712,6 +727,15 @@ customization:

By default, clients may specify `model` and `provider` in `/v1/query` and `/v1/streaming_query`. Override is permitted only to callers granted the `MODEL_OVERRIDE` action via the authorization rules. Requests that include `model` or `provider` without this permission are rejected with HTTP 403.

## Agent Skills (Upcoming)

> [!NOTE]
> Agent Skills is an upcoming feature. The documentation below describes the planned design.

Agent Skills will allow product teams to extend Lightspeed Core with specialized instructions and domain knowledge that the LLM can load on demand. Skills follow the [Agent Skills open standard](https://agentskills.io) and are packaged as portable directories containing a `SKILL.md` file.

For the planned configuration guide, skill authoring instructions, and examples, see the [Agent Skills Guide](docs/skills_guide.md).

## Safety Shields

A single Llama Stack configuration file can include multiple safety shields, which are utilized in agent
Expand Down
252 changes: 252 additions & 0 deletions docs/skills_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
# Agent Skills Guide

> [!NOTE]
> Agent Skills is an upcoming feature. This guide describes the planned design and will be updated when the feature is available.

This guide covers how to configure Agent Skills in Lightspeed Core Stack and how to author your own skills.

---

- [Introduction](#introduction)
- [Configuration](#configuration)
- [Option A: Directory of Skills](#option-a-directory-of-skills)
- [Option B: Individual Skill Paths](#option-b-individual-skill-paths)
- [Skill Directory Structure](#skill-directory-structure)
- [SKILL.md Format](#skillmd-format)
- [Frontmatter Fields](#frontmatter-fields)
- [Body Content](#body-content)
- [Creating a Skill](#creating-a-skill)
- [How Skills Work at Runtime](#how-skills-work-at-runtime)
- [Limitations](#limitations)
- [References](#references)

---

# Introduction

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).

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.

> [!IMPORTANT]
> 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.

# Configuration

Skills are configured in `lightspeed-stack.yaml` by specifying paths to skill directories. Two forms are supported.

## Option A: Directory of Skills

Point to a parent directory containing skill subdirectories. Each subdirectory with a `SKILL.md` file is loaded as a skill.

```yaml
skills:
paths:
- "/var/skills/"
```

This loads all skills found under `/var/skills/`:

```
/var/skills/
├── openshift-troubleshooting/
│ ├── SKILL.md
│ └── references/
│ └── common-errors.md
├── code-review/
│ └── SKILL.md
└── ansible-playbooks/
├── SKILL.md
└── references/
└── module-reference.md
```
Comment thread
are-ces marked this conversation as resolved.

## Option B: Individual Skill Paths

Point directly to specific skill directories for fine-grained control over which skills are loaded.

```yaml
skills:
paths:
- "/var/skills/openshift-troubleshooting/"
- "/var/skills/code-review/"
```

> [!TIP]
> Option A is recommended for most deployments. Use Option B when you need to selectively include specific skills from a larger collection.

See [examples/lightspeed-stack-skills.yaml](../examples/lightspeed-stack-skills.yaml) for a complete configuration example.

# Skill Directory Structure

Each skill is a directory containing, at minimum, a `SKILL.md` file:

```
skill-name/
├── SKILL.md # Required: metadata + instructions
└── references/ # Optional: additional documentation
├── guide.md
└── troubleshooting.md
```

- **`SKILL.md`** (required): Contains YAML frontmatter with metadata and Markdown body with instructions.
- **`references/`** (optional): Contains additional documentation files that the LLM can load on demand when the skill instructions reference them.

> [!NOTE]
> Script execution (`scripts/` subdirectory) is not supported. Only `SKILL.md` and `references/` files are used at runtime.

# SKILL.md Format

The `SKILL.md` file must contain YAML frontmatter (between `---` delimiters) followed by Markdown content.

## Frontmatter Fields

| Field | Required | Description |
|-----------------|----------|-------------|
| `name` | Yes | Skill identifier. Max 64 characters. Lowercase letters, numbers, and hyphens only. Must match the parent directory name. |
| `description` | Yes | What the skill does and when to use it. Max 1024 characters. |

### `name` rules

- 1-64 characters
- Lowercase letters (`a-z`), numbers (`0-9`), and hyphens (`-`) only
- Must not start or end with a hyphen
- Must not contain consecutive hyphens (`--`)
- Must match the parent directory name

**Valid names**: `openshift-troubleshooting`, `code-review`, `data-analysis`

**Invalid names**: `OpenShift-Troubleshooting` (uppercase), `-code-review` (starts with hyphen), `code--review` (consecutive hyphens)

### `description` guidance

The description should include both **what** the skill does and **when** to use it. Include specific keywords that help the LLM identify relevant tasks.

```yaml
# Good: specific about what and when
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.

# Poor: too vague
description: Helps with OpenShift.
```

## Body Content

The Markdown body after the frontmatter contains the skill instructions. There are no format restrictions. Write whatever helps the LLM perform the task effectively.

Recommended sections:
- Step-by-step instructions
- Examples of inputs and outputs
- Common edge cases and how to handle them

> [!TIP]
> Keep `SKILL.md` under 500 lines. Move detailed reference material to files in the `references/` subdirectory and reference them from the main instructions.

# Creating a Skill

Follow these steps to create a new skill:

**1. Create the skill directory**

The directory name must match the `name` field in `SKILL.md`.

```bash
mkdir -p /var/skills/my-skill
```

**2. Create the `SKILL.md` file**

```markdown
---
name: my-skill
description: A brief description of what this skill does and when to use it.
---

# My Skill

## When to use this skill

Use this skill when:
- Condition A applies
- The user asks about topic B

## Instructions

1. First, do X
2. Then check Y
3. If Z occurs, see [the reference guide](references/guide.md)
```

**3. (Optional) Add reference files**

```bash
mkdir -p /var/skills/my-skill/references
```

Add documentation files that the skill instructions reference:

```markdown
# references/guide.md

Detailed reference content goes here...
```

**4. Add the skill path to configuration**

Add the path to your `lightspeed-stack.yaml`:

```yaml
skills:
paths:
- "/var/skills/" # If using a directory of skills
```

**5. Restart the service**

Skills are loaded at startup. Restart Lightspeed Core Stack to pick up new or modified skills.

See [examples/skills/](../examples/skills/) for complete working examples.

# How Skills Work at Runtime

Skills use a progressive disclosure pattern with three LLM tools:

1. **`list_skills`** — The LLM calls this to discover available skills. Returns the name and description of each skill.
2. **`activate_skill`** — When a task matches a skill's description, the LLM calls this to load the full instructions from `SKILL.md`.
3. **`load_skill_resource`** — If the skill instructions reference files in `references/`, the LLM calls this to load them on demand.

```
User question
LLM calls list_skills → sees skill catalog (name + description)
▼ (if task matches a skill)
LLM calls activate_skill → loads full SKILL.md instructions
▼ (if instructions reference a file)
LLM calls load_skill_resource → loads file from references/
LLM follows skill instructions to answer
```

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.

> [!NOTE]
> 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.

# Limitations

- **No script execution**: The `scripts/` subdirectory from the agentskills.io spec is not supported. Skills provide instructions only; they do not execute code.
- **Read-only**: Skills are loaded from the filesystem at startup and are read-only at runtime.
- **No remote loading**: Skills must be present on the local filesystem. Loading from URLs or registries is not supported.
- **Duplicate names**: Skill names must be unique across all configured paths. Duplicate names cause a startup error.

# References

- [Agent Skills Specification](https://agentskills.io/specification) — the open standard for skill format
- [Agent Skills Implementation Guide](https://agentskills.io/client-implementation/adding-skills-support) — client implementation guidance
- [Feature Design Document](design/agent-skills/agent-skills.md) — internal design spec for the Lightspeed Core implementation
- [Example Skills](../examples/skills/) — working example skills
- [Example Configuration](../examples/lightspeed-stack-skills.yaml) — example `lightspeed-stack.yaml` with skills configured
32 changes: 32 additions & 0 deletions examples/lightspeed-stack-skills.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lightspeed Core Service (LCS)
service:
host: localhost
port: 8080
auth_enabled: false
workers: 1
color_log: true
access_log: true
llama_stack:
use_as_library_client: false
url: http://localhost:8321
api_key: xyzzy
user_data_collection:
feedback_enabled: true
feedback_storage: "/tmp/data/feedback"
transcripts_enabled: true
transcripts_storage: "/tmp/data/transcripts"
authentication:
module: "noop"
# Agent Skills configuration
# Skills provide domain-specific instructions that the LLM can load on demand.
# Each path points to either:
# - A directory containing a SKILL.md file (single skill)
# - A directory containing subdirectories with SKILL.md files (multiple skills)
skills:
paths:
- "/var/skills/" # Directory containing skill subdirectories
# Alternative: specify individual skill paths for fine-grained control
# skills:
# paths:
# - "/var/skills/openshift-troubleshooting/"
# - "/var/skills/code-review/"
54 changes: 54 additions & 0 deletions examples/skills/code-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: code-review
description: Review code changes for quality, security, and maintainability. Use when a user asks for a code review, wants feedback on their code, or asks about best practices for a code change.
---

# Code Review

## When to use this skill

Use this skill when:
- A user asks you to review code or a diff
- A user wants feedback on code quality
- A user asks about best practices for a specific change

## Review checklist

### Correctness
- Does the code do what it claims to do?
- Are edge cases handled (empty inputs, null values, boundary conditions)?
- Are error conditions handled appropriately?

### Security
- Is user input validated and sanitized?
- Are secrets hardcoded or properly managed via environment variables?
- Are SQL queries parameterized (no string concatenation)?
- Are file paths validated to prevent directory traversal?

### Maintainability
- Are variable and function names descriptive?
- Is the code structured for readability (appropriate function length, single responsibility)?
- Are there comments explaining non-obvious logic?
- Is there unnecessary complexity that could be simplified?

### Performance
- Are there obvious performance issues (N+1 queries, unnecessary loops, missing indexes)?
- Are large data sets handled efficiently (pagination, streaming)?
- Are expensive operations cached where appropriate?

### Testing
- Are there tests for new functionality?
- Do tests cover edge cases and error conditions?
- Are tests readable and well-structured?

Comment thread
are-ces marked this conversation as resolved.
## Review format

Structure your review as follows:

1. **Summary**: One sentence describing the overall change
2. **Strengths**: What the code does well (be specific)
3. **Issues**: Problems that should be fixed, ordered by severity
- **Critical**: Bugs, security issues, data loss risks
- **Major**: Logic errors, missing error handling
- **Minor**: Style, naming, documentation
4. **Suggestions**: Optional improvements that are not blocking
Loading
Loading