Skills Manager
Header: claw_skill.h
claw_skill manages user-visible Skills in the model context:
- On disk: a set of Skill files (several
.md) plus a manifest (skills_list.json) describing ids, summaries, and which file backs each Skill. - Per session: a set of “currently activated” Skill ids persisted under the session state directory.
- After activation, the model sees fuller Skill docs and can use
cap_skilltools to activate/deactivate Skills.
How Skills work Skill mechanics and manual or Agent-driven edits to Skills
Init configuration
Section titled “Init configuration”Main fields of claw_skill_config_t:
skills_root_dir: root for Skill files andskills_list.json(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 two context providers:
claw_skill_skills_list_provider: each request renders all Skills fromskills_list.json(id, summary) into the system prompt so the model knows what Skills exist.claw_skill_active_skill_docs_provider: concatenates.mdcontents for Skills activated in the current session.
Activating a Skill therefore adds its .md to the next request; tool descriptions and behavioral contracts come from that document.
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 toggle via
cap_skill’sactivate_skill/deactivate_skill, or you can use the Consoleskillcommands.
Where runtime Skills come from
Section titled “Where runtime Skills come from”The /fatfs/skills/skills_list.json read at runtime is merged from:
application/basic_demo/fatfs_image/skills/: demo-bundled Skill files packaged into the FATFS image in firmware.- Component Skills: each
cap_*/lua_module_*component may ship askills/subtree;tools/sync_component_skills.pymerges them intofatfs_image/skills/at build time before packaging.
Note: files under application/basic_demo/main/skills/ do not participate in that sync and never appear on runtime FATFS—do not put Skill files there.
User-facing interaction
Section titled “User-facing interaction” Console usage Using the skill command in the Console
cap_skill activate_skill / deactivate_skill vs model-visible Skills