Skip to content

Commit fb8eab9

Browse files
committed
addressed comments (configuration)
1 parent 1afd720 commit fb8eab9

2 files changed

Lines changed: 139 additions & 108 deletions

File tree

docs/design/agent-skills/agent-skills-spike.md

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
**The problem**: Lightspeed Core has no mechanism for extending agent capabilities with specialized instructions or domain knowledge. Users cannot package reusable workflows, troubleshooting guides, or domain expertise into portable, discoverable units that the LLM can use on demand.
66

7-
**The recommendation**: Implement the [Agent Skills open standard](https://agentskills.io) with a config-based discovery model. Skills are defined in `lightspeed-stack.yaml` pointing to directories containing `SKILL.md` files. The LLM sees a skill catalog (name + description) in the system prompt and can request full instructions on demand via a dedicated tool.
7+
**The recommendation**: Implement the [Agent Skills open standard](https://agentskills.io) with filesystem-based discovery. Config specifies paths to skill directories; skill metadata (name, description) is read from `SKILL.md` frontmatter at startup. The LLM sees a skill catalog (name + description) in the system prompt and can request full instructions on demand via a dedicated tool.
88

99
**PoC validation**: Not applicable for this spike. The feature is well-defined by the agentskills.io specification and has been implemented by 30+ agent products including Claude Code, GitHub Copilot, Cursor, and OpenAI Codex.
1010

@@ -20,20 +20,20 @@ These are the high-level decisions that determine scope, approach, and cost. Eac
2020
| B | Product team-defined only (LS app teams like RHEL Lightspeed define their own skills) |
2121
| C | Both built-in and product team-defined |
2222

23-
**Recommendation**: **B** (Product team-defined only). This allows LS app teams (e.g., RHEL Lightspeed, Ansible Lightspeed) to extend Lightspeed with domain-specific skills without requiring changes to Lightspeed Core. Product teams ship skills alongside the lightspeed-stack container by mounting skill directories via configmaps or container volumes, then pointing to them in `lightspeed-stack.yaml`. Built-in skills can be added to Lightspeed Core later if common patterns emerge.
23+
**Recommendation**: **B** (Product team-defined only). This allows LS app teams (e.g., RHEL Lightspeed, Ansible Lightspeed) to extend Lightspeed with domain-specific skills without requiring changes to Lightspeed Core. Product teams ship skills alongside the lightspeed-stack container by mounting skill directories via ConfigMaps or container volumes, then specifying the paths in `lightspeed-stack.yaml`. Skill content is read from `SKILL.md` files at startup. Built-in skills can be added to Lightspeed Core later if common patterns emerge.
2424

2525
**Note**: End users of LS app products do NOT have the ability to add skills, similar to how they cannot add MCP servers. Skill configuration is controlled by product teams at deployment time.
2626

2727
### Decision 2: Discovery mechanism?
2828

2929
| Option | Description |
3030
|--------|-------------|
31-
| A | Filesystem-based (scan configured directories for `SKILL.md` files) |
32-
| B | Config-based (define skills in `lightspeed-stack.yaml`) |
31+
| A | Filesystem-based (config specifies paths, skill metadata read from `SKILL.md` files) |
32+
| B | Config-based (full skill definitions inlined in `lightspeed-stack.yaml`) |
3333
| C | API-based (skills registered/managed via REST API) |
3434
| D | Hybrid (built-in via config, product team-defined via filesystem or API) |
3535

36-
**Recommendation**: **B** (Config-based). Skills are defined in `lightspeed-stack.yaml` similar to `mcp_servers`. This provides explicit control over which skills are available, integrates with existing configuration patterns, and avoids filesystem scanning complexity.
36+
**Recommendation**: **A** (Filesystem-based). Config specifies paths to skill directories (or a single directory containing multiple skills). Skill metadata (name, description) is read from `SKILL.md` frontmatter at startup. This keeps config lightweight, avoids bloating the config CR in k8s deployments, and allows skill content to be updated independently of config changes. Skills can be mounted via ConfigMaps, volumes, or any standard filesystem mechanism.
3737

3838
### Decision 3: Script execution support?
3939

@@ -85,24 +85,30 @@ This keeps the base context small while giving the LLM access to specialized kno
8585

8686
### Decision 7: Configuration structure
8787

88-
Skills are configured as a list in `lightspeed-stack.yaml`, following the `mcp_servers` pattern:
88+
Skills are configured by specifying paths to skill directories in `lightspeed-stack.yaml`. Two forms are supported:
8989

90+
**Option A: Directory of skills** (recommended for most deployments)
9091
```yaml
9192
skills:
92-
- name: "code-review"
93-
description: "Review code for best practices and security issues."
94-
path: "/var/skills/code-review"
95-
- name: "troubleshooting"
96-
description: "Diagnose and fix OpenShift deployment issues."
97-
path: "/var/skills/troubleshooting"
93+
paths:
94+
- "/var/skills/" # Directory containing skill subdirectories
9895
```
9996
100-
Each skill entry specifies:
101-
- `name`: Unique identifier (validated against `SKILL.md` frontmatter)
102-
- `description`: What the skill does and when to use it
103-
- `path`: Absolute path to directory containing `SKILL.md`
97+
**Option B: Individual skill paths** (for fine-grained control)
98+
```yaml
99+
skills:
100+
paths:
101+
- "/var/skills/code-review/"
102+
- "/var/skills/troubleshooting/"
103+
```
104+
105+
Each path points to either:
106+
- A directory containing a `SKILL.md` file (single skill)
107+
- A directory containing subdirectories, each with a `SKILL.md` file (multiple skills)
108+
109+
Skill metadata (`name`, `description`) is read from the `SKILL.md` frontmatter at startup. This keeps config minimal and allows skill content to be managed independently.
104110

105-
**Recommendation**: Approved. This structure is consistent with existing config patterns and provides explicit control.
111+
**Recommendation**: Approved. This structure keeps the config CR lightweight and decouples skill content from configuration.
106112

107113
## Proposed JIRAs
108114

@@ -112,21 +118,23 @@ Each JIRA includes an agentic tool instruction pointing to the spec doc.
112118
<!-- key: LCORE-???? -->
113119
### LCORE-???? Add skill configuration model
114120

115-
**Description**: Add the `SkillConfiguration` Pydantic model and `skills` list to the main configuration. This enables defining skills in `lightspeed-stack.yaml`.
121+
**Description**: Add the `SkillsConfiguration` Pydantic model to the main configuration. This enables specifying skill directory paths in `lightspeed-stack.yaml`.
116122

117123
**Scope**:
118124

119-
- Create `SkillConfiguration` class in `src/models/config.py`
120-
- Add `skills: list[SkillConfiguration]` field to `Configuration` class
121-
- Add validation: path exists, contains `SKILL.md`, name matches frontmatter
122-
- Parse `SKILL.md` frontmatter on startup (extract name, description)
125+
- Create `SkillsConfiguration` class in `src/models/config.py` with `paths: list[str]` field
126+
- Add `skills: Optional[SkillsConfiguration]` field to `Configuration` class
127+
- Implement startup scanning: resolve paths, find `SKILL.md` files, parse frontmatter
128+
- Add validation: paths exist, contain valid `SKILL.md` files with required frontmatter
129+
- Store parsed skill metadata (name, description, path) for runtime use
123130

124131
**Acceptance criteria**:
125132

126-
- Skills can be defined in `lightspeed-stack.yaml` using the documented format
127-
- Startup fails with clear error if skill path doesn't exist or lacks `SKILL.md`
128-
- Startup fails if configured `name` doesn't match `SKILL.md` frontmatter `name`
129-
- Unit tests cover validation scenarios
133+
- Skill paths can be configured in `lightspeed-stack.yaml` using the documented format
134+
- Startup scans configured paths and discovers all valid skills
135+
- Startup fails with clear error if path doesn't exist or lacks valid `SKILL.md`
136+
- Duplicate skill names across paths are detected and rejected
137+
- Unit tests cover path scanning and validation scenarios
130138

131139
**Agentic tool instruction**:
132140

@@ -334,7 +342,7 @@ OpenAI's SDK already includes `LocalSkill` and `Skill` types in its responses mo
334342

335343
**Path restrictions**: The `activate_skill` tool and reference file access are restricted to configured skill directories. The LLM cannot access arbitrary filesystem paths through skills.
336344

337-
**Trust model**: Skills are configured by LS app teams (e.g., RHEL Lightspeed) at deployment time, not by end users. Product teams mount skill directories into the container via configmaps or volumes and reference them in `lightspeed-stack.yaml`. This mirrors the MCP server trust model — end users cannot add arbitrary skills, only use the skills their product team has deployed.
345+
**Trust model**: Skills are configured by LS app teams (e.g., RHEL Lightspeed) at deployment time, not by end users. Product teams mount skill directories into the container via ConfigMaps or volumes and specify the paths in `lightspeed-stack.yaml`. This mirrors the MCP server trust model — end users cannot add arbitrary skills, only use the skills their product team has deployed.
338346

339347
## Appendix A: Existing approaches research
340348

@@ -349,7 +357,7 @@ OpenAI's SDK already includes `LocalSkill` and `Skill` types in its responses mo
349357

350358
### Alternative designs considered
351359

352-
**Filesystem scanning**: Rejected in favor of config-based discovery. Filesystem scanning adds complexity, requires directory configuration anyway, and could inadvertently load untrusted skills from cloned repositories.
360+
**Full config-based definitions**: Rejected in favor of filesystem-based with config paths. Inlining full skill definitions (name, description, instructions) in `lightspeed-stack.yaml` would bloat the config CR in k8s deployments and couple skill content updates to config changes. Instead, config specifies paths and skill metadata is read from `SKILL.md` files.
353361

354362
**Inline content**: Rejected in favor of path-based. Inline content would clutter the YAML config for multi-skill deployments and doesn't support reference files.
355363

0 commit comments

Comments
 (0)