Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt

Use this file to discover all available pages before exploring further.

Skills สอน agent ว่าควรใช้เครื่องมืออย่างไรและเมื่อใด skill แต่ละรายการคือไดเรกทอรี ที่มีไฟล์ SKILL.md พร้อม YAML frontmatter และคำแนะนำแบบ markdown สำหรับวิธีโหลดและจัดลำดับความสำคัญของ Skills โปรดดู Skills

สร้าง skill แรกของคุณ

1

สร้างไดเรกทอรีของ skill

Skills อยู่ใน workspace ของคุณ สร้างโฟลเดอร์ใหม่:
mkdir -p ~/.openclaw/workspace/skills/hello-world
2

เขียน SKILL.md

สร้าง SKILL.md ภายในไดเรกทอรีนั้น frontmatter จะกำหนด metadata และเนื้อหา markdown จะมีคำแนะนำสำหรับ agent
---
name: hello-world
description: A simple skill that says hello.
---

# Hello World Skill

When the user asks for a greeting, use the `echo` tool to say
"Hello from your custom skill!".
ใช้รูปแบบ hyphen-case ด้วยตัวอักษรพิมพ์เล็ก ตัวเลข และยัติภังค์สำหรับ name ของ skill ให้ชื่อโฟลเดอร์และ name ใน frontmatter ตรงกัน
3

เพิ่มเครื่องมือ (ไม่บังคับ)

คุณสามารถกำหนด schema ของเครื่องมือแบบกำหนดเองใน frontmatter หรือสั่งให้ agent ใช้เครื่องมือระบบที่มีอยู่ (เช่น exec หรือ browser) Skills ยังสามารถ มากับ plugins พร้อมกับเครื่องมือที่มันจัดทำเอกสารประกอบได้ด้วย
4

โหลด skill

เริ่มเซสชันใหม่เพื่อให้ OpenClaw ตรวจพบ skill:
# From chat
/new

# Or restart the gateway
openclaw gateway restart
ตรวจสอบว่าโหลด skill แล้ว:
openclaw skills list
5

ทดสอบ

ส่งข้อความที่ควรกระตุ้น skill:
openclaw agent --message "give me a greeting"
หรือเพียงแค่แชทกับ agent แล้วขอคำทักทาย

ข้อมูลอ้างอิง metadata ของ skill

YAML frontmatter รองรับฟิลด์เหล่านี้:
ฟิลด์จำเป็นคำอธิบาย
nameใช่ตัวระบุเฉพาะที่ใช้ตัวอักษรพิมพ์เล็ก ตัวเลข และยัติภังค์
descriptionใช่คำอธิบายหนึ่งบรรทัดที่แสดงให้ agent เห็น
metadata.openclaw.osไม่ตัวกรอง OS (["darwin"], ["linux"] ฯลฯ)
metadata.openclaw.requires.binsไม่ไบนารีที่จำเป็นต้องมีบน PATH
metadata.openclaw.requires.configไม่คีย์ config ที่จำเป็น

แนวทางปฏิบัติที่ดี

  • กระชับ — สั่ง model ว่าต้องทำ อะไร ไม่ใช่ว่าต้องเป็น AI อย่างไร
  • ความปลอดภัยมาก่อน — หาก skill ของคุณใช้ exec ให้แน่ใจว่า prompt ไม่อนุญาตให้มีการแทรกคำสั่งโดยอำเภอใจจากอินพุตที่ไม่น่าเชื่อถือ
  • ทดสอบในเครื่อง — ใช้ openclaw agent --message "..." เพื่อทดสอบก่อนแชร์
  • ใช้ ClawHub — เรียกดูและร่วมเพิ่ม skills ได้ที่ ClawHub

Skills อยู่ที่ไหน

ตำแหน่งลำดับความสำคัญขอบเขต
\<workspace\>/skills/สูงสุดต่อ agent
\<workspace\>/.agents/skills/สูงagent ต่อ workspace
~/.agents/skills/ปานกลางโปรไฟล์ agent ที่แชร์
~/.openclaw/skills/ปานกลางแชร์ (agent ทั้งหมด)
รวมมาในชุด (มาพร้อมกับ OpenClaw)ต่ำทั่วทั้งระบบ
skills.load.extraDirsต่ำสุดโฟลเดอร์ที่แชร์แบบกำหนดเอง

ที่เกี่ยวข้อง