Skip to content

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.md files 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_skill injects the complete Skill document into conversation history through the tool result, so the model can read the detailed documentation for that Skill.
How Skills work Skill mechanics and manual or Agent-driven edits to Skills

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).

claw_skill plugs into claw_core as one context provider:

  • claw_skill_skills_list_provider: each request renders name and description from every SKILL.md frontmatter 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 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 operate through cap_skill’s activate_skill tool, or you can use the Console skill commands.

The /fatfs/skills tree read at runtime is assembled in the build staging image under build/fatfs_image/skills:

  1. skillsapplication/edge_agent/fatfs_image/skills/: app-bundled factory Skills laid out as skills/<skill_id>/SKILL.md, copied into the build staging image.
  2. Component Skills: each cap_* / lua_module_* / lua_driver_* component may ship skills/<skill_id>/SKILL.md; skill_buildercomponents/common/skill_builder/ syncs them into build/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.

Console usage Using the skill command in the Console
cap_skill activate_skill tool and cache-friendly document injection