Skip to content

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_skill tools to activate/deactivate Skills.

Main fields of claw_skill_config_t:

  • skills_root_dir: root for Skill files and skills_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).

claw_skill plugs into claw_core as two context providers:

  1. claw_skill_skills_list_provider: each request renders all Skills from skills_list.json (id, summary) into the system prompt so the model knows what Skills exist.
  2. claw_skill_active_skill_docs_provider: concatenates .md contents 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 is isolated per session:

  • Session A activating weather does not affect session B.
  • State is persisted as files under session_state_root_dir and survives reboot.
  • The model can toggle via cap_skill’s activate_skill / deactivate_skill, or you can use the Console skill commands.

The /fatfs/skills/skills_list.json read at runtime is merged from:

  1. application/basic_demo/fatfs_image/skills/: demo-bundled Skill files packaged into the FATFS image in firmware.
  2. Component Skills: each cap_* / lua_module_* component may ship a skills/ subtree; tools/sync_component_skills.py merges them into fatfs_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.