← 返回
开发者工具

Skill to Agent Converter: Convert a Skill into an OpenClaw Agent

Convert OpenClaw skills into properly configured agents with correct workspace setup, binding, and orchestration. Solves common agent creation failures (thre...
将OpenClaw技能转换为配置正确的智能体,包含工作区设置、绑定与编排,解决常见的智能体创建失败问题。
drafthead
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 677
下载
💾 5
安装
1
版本
#latest

概述

Skill-to-Agent

Transform any OpenClaw skill into a fully functional agent with proper workspace configuration and session management. Solves common failures like thread=true is unavailable and mode="session" requires thread=true.

Quick Start

  1. Analyze skill - Read SKILL.md to understand requirements
  2. Prepare workspace - Create agent directory in ~/.openclaw/agents/
  3. Configure agent - Set up identity, tools, and memory strategy
  4. Spawn with correct binding - Choose appropriate mode based on channel

Workflow

Phase 1: Skill Analysis

  • Extract metadata from SKILL.md (name, description, triggers)
  • Identify required tools and dependencies
  • Determine agent type: isolated, thread-bound, or run-mode

Phase 2: Workspace Setup

  • Create agent directory with proper structure
  • Copy skill files (references/, scripts/)
  • Configure AGENTS.md, TOOLS.md, USER.md

Phase 3: Agent Configuration

  • Create SOUL.md and IDENTITY.md with skill personality
  • Map skill tools to agent capabilities
  • Set up memory strategy (MEMORY.md, memory/ directory)

Phase 4: Agent Registration

  • Add agent to OpenClaw's agents.list configuration
  • Use gateway tool with config.patch action
  • Include agent ID, name, workspace, and agentDir
  • Gateway will restart to apply configuration

Phase 5: Session Spawning

  • Choose spawn strategy based on channel capabilities
  • Execute with correct binding (thread-bound, isolated, run-mode)
  • CRITICAL: Always set cwd to agent workspace directory
  • Verify agent activation and tool access

Reference Materials

For detailed guidance, refer to:

Scripts

  • scripts/skill_to_agent.js - Main conversion script

Binding Strategies

ScenarioModeThreadBest For
----------------------------------
Discord/TelegramsessiontrueGroup discussions
WebChat/Control UIrunfalseOne-shot tasks
Isolated ProcessingsessionfalseBackground work
Cron/ScheduledrunfalseAutomated tasks

Decision Tree:

  • Channel supports threads? → Yes → thread=true, mode=session
  • Isolated processing needed? → Yes → thread=false, mode=session
  • Otherwise → thread=false, mode=run

Common Errors & Solutions

Error 1: thread=true is unavailable

  • Solution: Use mode="run" without thread binding
  • Check channel capabilities first

Error 2: mode="session" requires thread=true

  • Solution: Use isolated session mode
  • mode="session", thread=false, runtime="subagent"

Error 3: Agent lacks tool access

  • Solution: Verify tools in TOOLS.md
  • Update workspace configuration

Error 4: Workspace files not accessible

  • Solution: Set cwd parameter when spawning agent
  • Agent workspace must be at path specified in cwd
  • Ensure agent has read/write permissions to workspace

Error 5: Agent can't find its identity files

  • Solution: Always set cwd to agent workspace directory
  • Agent reads IDENTITY.md, SOUL.md, etc. from current directory
  • Test file access with simple read commands

Error 6: Agent not recognized by OpenClaw system

  • Solution: Register agent in agents.list configuration
  • Use gateway tool with config.patch action
  • Gateway restart required for configuration changes
  • Verify agent appears in configured agents list

Critical: Workspace Directory (cwd)

When spawning an agent, ALWAYS set the cwd parameter to the agent's workspace directory:

sessions_spawn({
  task: "Agent instructions...",
  label: "agent-name",
  runtime: "subagent",
  mode: "session", // or "run"
  cwd: "/Users/nimbletenthousand/.openclaw/agents/agent-name",
  timeoutSeconds: 300
});

Without cwd, the agent cannot find its identity files (IDENTITY.md, SOUL.md, etc.) and will fail to function properly.

Critical: Agent Registration

After creating an agent workspace, register it in OpenClaw's configuration:

gateway({
  action: "config.patch",
  raw: JSON.stringify({
    agents: {
      list: [
        {
          id: "agent-name",
          name: "Agent Display Name",
          workspace: "/Users/nimbletenthousand/.openclaw/workspace",
          agentDir: "/Users/nimbletenthousand/.openclaw/agents/agent-name"
        }
      ]
    }
  }),
  note: "Added [agent-name] to agents configuration"
});

The gateway will restart automatically to apply the configuration. Without registration, the agent won't be recognized as a configured agent in the system.

Quick Commands

# Check skill structure
node scripts/skill_to_agent.js --analyze --skill /path/to/skill

# Create agent workspace
node scripts/skill_to_agent.js --create --skill /path/to/skill --agent agent-name

# Spawn agent with correct binding
node scripts/skill_to_agent.js --spawn --agent agent-name --mode session --cwd /path/to/agent-workspace

Best Practices

  1. Keep it lean - Only copy essential skill files
  2. Test binding first - Verify channel capabilities
  3. Monitor agent health - Check sessions_list regularly
  4. Clean up properly - Remove unused agent workspaces
  5. Document conversions - Save configuration for future reference

Next Steps

After creating an agent:

  1. Verify it appears in sessions_list
  2. Test tool accessibility
  3. Configure heartbeat if needed
  4. Set up orchestration with parent agent

For advanced usage and complete examples, see the reference files.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 06:18 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Proposal and Cover Letter Interviewer & Improver (Continuous Questions and Memory for Better Proposals/Cover Letters by Getting to Know You)

drafthead
通过结构化访谈挖掘个人经历,生成可复用且经认可的陈述,用于提案和求职信,以此创建个性化内容。
★ 0 📥 643
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,218
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,807