trading_agent.skills.skill_importer
¶
Imports skills into the user's installed skills, from a folder, a zip file or a git repository.
Every folder in the source that holds a SKILL.md is imported as one skill, so a whole collection, such as a Hermes skills folder, can be imported at once. Each skill is checked before it is copied, and an existing skill of the same name is kept unless replacing is asked for.
Typical usage example:
results = SkillImporter(installed_directory).import_source('~/.hermes/skills/research', replace=False)
SkillImportError
¶
Bases: RuntimeError
The source could not be read, cloned or unpacked.
ImportResult
dataclass
¶
What happened to one skill folder in the source.
Attributes:
| Name | Type | Description |
|---|---|---|
source |
Path
|
The folder in the source. |
name |
str | None
|
The skill's name, or None when its SKILL.md could not be read. |
outcome |
str
|
"imported", "replaced", "skipped" or "invalid". |
detail |
str
|
Why it was skipped or invalid, or an empty string. |
warnings |
tuple[str, ...]
|
Passages that look like prompt injection, as "file, line: what it looks like". |
SkillImporter
¶
Copies skills into the installed skills folder.
Creates the importer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
installed_directory
|
Path
|
workspace/shared/skills/installed. |
required |
Source code in src/trading_agent/skills/skill_importer.py
import_source
¶
Imports every skill found in a folder, zip file or git URL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
The folder, the .zip file, or a git URL. |
required |
replace
|
bool
|
Whether to replace installed skills of the same name. |
required |
Returns:
| Type | Description |
|---|---|
list[ImportResult]
|
One result per skill folder found. |
Raises:
| Type | Description |
|---|---|
SkillImportError
|
The source does not exist, cannot be unpacked or cloned, or holds no SKILL.md. |