loader
loader
¶
Skill loader — load and verify skill manifests from TOML files.
Classes¶
Functions¶
load_skill
¶
load_skill(path: str | Path, *, verify_signature: bool = False, public_key: Optional[bytes] = None, scan_for_injection: bool = False) -> SkillManifest
Load a skill manifest from a TOML file.
Expected format:
[skill]
name = "research_and_summarize"
version = "0.1.0"
description = "Search web and summarize results"
author = "openjarvis"
required_capabilities = ["network:fetch"]
signature = ""
[[skill.steps]]
tool_name = "web_search"
arguments_template = '{"query": "{query}"}'
output_key = "search_results"
[[skill.steps]]
tool_name = "think"
arguments_template = '{"thought": "Summarize: {search_results}"}'
output_key = "summary"
Source code in src/openjarvis/skills/loader.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
load_skill_markdown
¶
load_skill_markdown(path: str | Path) -> SkillManifest
Load a skill manifest from a SKILL.md file via SkillParser.
Parses YAML frontmatter (between --- delimiters) and the markdown
body, then runs them through :class:SkillParser for strict validation
and tolerant field mapping.
Source code in src/openjarvis/skills/loader.py
load_skill_directory
¶
load_skill_directory(path: str | Path) -> SkillManifest
Load a skill from a directory containing skill.toml and/or SKILL.md.
- If only
skill.tomlis present the manifest is loaded from TOML. - If only
SKILL.mdis present the manifest is loaded from markdown. - If both are present the TOML manifest takes precedence for structured
fields and
markdown_contentis merged in from the markdown file. - If neither is present a
FileNotFoundErroris raised.
Source code in src/openjarvis/skills/loader.py
discover_skills
¶
discover_skills(directory: str | Path) -> list[SkillManifest]
Scan a directory for skill definitions and load them.
Handles three layouts:
- Flat *.toml files directly inside directory.
- Skill directories: <directory>/<name>/{skill.toml,SKILL.md}.
- Sourced layout: <directory>/<source>/<name>/{skill.toml,SKILL.md}.