Skip to main content

Crate kernex_skills

Crate kernex_skills 

Source
Expand description

Skill and project loader for Kernex.

Scans {data_dir}/skills/*/SKILL.md and {data_dir}/projects/*/ROLE.md for definitions and exposes them to the system prompt so the AI knows what tools and contexts are available.

Structs§

Permissions
Permission categories that a skill can request.
Project
A loaded project definition.
RiskDetector
High-risk permission patterns that trigger warnings.
RiskWarning
A warning about a risky permission.
Skill
A loaded skill definition.
SkillContext
Output of build_skill_prompt: the prompt text plus an optional model override.

Enums§

RiskCategory
Categories of permission risks.
TrustLevel
Trust level assigned to a skill based on its source.

Constants§

DEFAULT_TRUSTED_ORGS
Trusted organizations whose skills can be auto-approved.

Functions§

build_skill_prompt
Build the skill block appended to the system prompt.
determine_trust_level
Determine trust level based on skill source.
ensure_projects_dir
Create {data_dir}/projects/ if it doesn’t exist.
get_project_instructions
Find a project by name and return its instructions.
get_toolboxes_for_skill
Return the toolboxes declared by a named skill.
lazy_skill_directory
Build a compact listing of available lazy skills for prompt injection.
load_projects
Scan {data_dir}/projects/*/ROLE.md and return all valid projects.
load_skills
Scan {data_dir}/skills/*/SKILL.md and return all valid skill definitions.
match_skill_toolboxes
Match user message against skill triggers and return activated toolboxes.
match_skill_triggers
Match user message against skill triggers and return activated MCP servers.
migrate_flat_skills
Migrate legacy flat skill files ({data_dir}/skills/*.md) to the directory-per-skill layout ({data_dir}/skills/{name}/SKILL.md).
skill_search_toolbox
Return the Toolbox definition for the virtual skill_search tool.