Skills Manager
Header: claw_skill.hcomponents/claw_modules/claw_skill/include/claw_skill.h
claw_skill manages user-visible Skills in the model context:
- On disk: a set of
skills/<skill_id>/SKILL.mdfiles whose JSON frontmatter describes the Skill id, summary, manage mode, and capability groups. - Per session: a set of “currently activated” Skill ids persisted under the session state directory.
- After activation,
cap_skillinjects the complete Skill document into conversation history through the tool result, so the model can read the detailed documentation for that Skill.
Init configuration
Section titled “Init configuration”Main fields of claw_skill_config_t:
skills_root_dir: root for the Skills tree (demo:/fatfs/skills).session_state_root_dir: where per-session activation state files live (demo shares the same root as session history).max_file_bytes: maximum bytes read from a single Skill document file (guards against huge files filling the context).
Wiring into claw_core
Section titled “Wiring into claw_core”claw_skill plugs into claw_core as one context provider:
claw_skill_skills_list_provider: each request rendersnameanddescriptionfrom everySKILL.mdfrontmatter into the system prompt so the model knows what Skills exist.
Complete documents for activated Skills are no longer injected into the system prompt through a context provider. Instead, the activate_skill tool from cap_skill injects them into conversation history as tool results during activation. This keeps the system prompt stable and improves LLM API prompt-cache hit rates.
Activation state
Section titled “Activation state”Activation is isolated per session:
- Session A activating
weatherdoes not affect session B. - State is persisted as files under
session_state_root_dirand survives reboot. - The model can operate through
cap_skill’sactivate_skilltool, or you can use the Consoleskillcommands.
Where runtime Skills come from
Section titled “Where runtime Skills come from”The /fatfs/skills tree read at runtime is assembled in the build staging image under build/fatfs_image/skills:
- skillsapplication/edge_agent/fatfs_image/skills/: app-bundled factory Skills laid out as
skills/<skill_id>/SKILL.md, copied into the build staging image. - Component Skills: each
cap_*/lua_module_*/lua_driver_*component may shipskills/<skill_id>/SKILL.md; skill_buildercomponents/common/skill_builder/ syncs them intobuild/fatfs_image/skills/before packaging.
Note: fatfs_imageapplication/edge_agent/fatfs_image/ is source input. application/edge_agent/build/fatfs_image/ is generated staging output and is recreated during the build.