Skip to content

[Feature Request] Chatagent support Skill #3711

@fengju0213

Description

@fengju0213

Required prerequisites

Motivation

CAMEL Skills Design (Phase 1)

Goal: add a skills system that mirrors Codex/Claude-style SKILL.md usage, with
an extensible provider layer.

Requirements

  • Support external skills (loaded from configured filesystem roots).
  • Do not persist injected skill messages in memory.
  • Keep skill format compatible with Claude skills repo (SKILL.md + YAML frontmatter).
  • Keep progressive disclosure: load metadata first, load full content on demand.

SkillSpec (format protocol)

SKILL.md with YAML frontmatter:

  • Required:
    • name
    • description
  • Optional:
    • metadata.short-description (kept for compatibility with Codex-style metadata)

Example:


name: pdf-processing
description: Extract tables and forms from PDFs.
metadata:
short-description: PDF parsing and extraction

PDF Processing

[Instructions...]

Data model

SkillMetadata

  • name: str
  • description: str
  • short_description: Optional[str]

SkillDocument

  • meta: SkillMetadata
  • body: str

SkillLoadOutcome

  • skills: list[SkillMetadata]
  • errors: list[SkillError]

SkillError

  • source: str
  • message: str

SkillLoader (progressive disclosure)

Purpose: load only metadata during listing, and load full content only when a
skill is explicitly mentioned.

  • list(cwd) -> SkillLoadOutcome (metadata only)
  • read(meta) -> SkillDocument (full body)

Provider abstraction

Phase 1: only FilesystemSkillProvider is implemented.

SkillProvider (interface)

  • list(cwd) -> list[SkillMetadata]
  • read(meta) -> SkillDocument
  • refresh(cwd) -> None

FilesystemSkillProvider

  • Roots (ordered):
    • repo: /.camel/skills
    • user: ~/.camel/skills
    • system: /etc/camel/skills
  • Recursively scan for SKILL.md files.
  • Skip hidden dirs and symlinks.
  • Parse frontmatter and validate length limits.
  • Dedupe by name with priority: repo > user > system > external.

SkillManager

  • Aggregates providers (Phase 1 only filesystem).
  • Caches per cwd.
  • Resolves explicit mentions in user input.
  • Builds injection messages.

Injection strategy

  • Injected messages are not written to memory.
  • Injected payload is a user message with a stable wrapper:
skill-name /path/to/SKILL.md ...contents...

Skill creator

It is a skill in itself.

reference: SKILL.md

ChatAgent integration

  • Before calling the model in ChatAgent.step:

    1. skills = SkillManager.list(cwd)
    2. mentions = SkillManager.resolve_mentions(user_text, skills)
    3. injection_msgs = SkillManager.build_messages(mentions)
    4. prepend injection_msgs to the message list for this turn
  • Memory filtering:

    • Mark injected messages with meta_dict {"skill": true} and skip these on write.

Error handling

  • Invalid SKILL.md is recorded as a warning (not fatal) and skipped.
  • System-scope errors are suppressed (optional, matches Codex behavior).
  • Read failures during injection create warnings but do not fail the turn.

Directory structure (proposal)

camel/
skills/
init.py
spec.py # SkillSpec parsing/validation
model.py # SkillMetadata, SkillDocument, SkillLoadOutcome, SkillError
loader.py # SkillLoader (list/read)
provider.py # SkillProvider interface
provider_fs.py # FilesystemSkillProvider (phase 1)
manager.py # SkillManager
injection.py # build injection messages

Solution

No response

Alternatives

No response

Additional context

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions