mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-02-16 08:16:06 +08:00
Skills Directory
This directory contains skills for the COW agent system. Skills are markdown files that provide specialized instructions for specific tasks.
What are Skills?
Skills are reusable instruction sets that help the agent perform specific tasks more effectively. Each skill:
- Provides context-specific guidance
- Documents best practices
- Includes examples and usage patterns
- Can have requirements (binaries, environment variables, etc.)
Skill Structure
Each skill is a markdown file (SKILL.md) in its own directory with frontmatter:
---
name: skill-name
description: Brief description of what the skill does
metadata: {"cow":{"emoji":"🎯","requires":{"bins":["tool"]}}}
---
# Skill Name
Detailed instructions and examples...
Available Skills
- calculator: Mathematical calculations and expressions
- web-search: Search the web for current information
- file-operations: Read, write, and manage files
Creating Custom Skills
To create a new skill:
- Create a directory:
skills/my-skill/ - Create
SKILL.mdwith frontmatter and content - Restart the agent to load the new skill
Frontmatter Fields
name: Skill name (must match directory name)description: Brief description (required)metadata: JSON object with additional configurationemoji: Display emojialways: Always include this skill (default: false)primaryEnv: Primary environment variable neededos: Supported operating systems (e.g., ["darwin", "linux"])requires: Requirements objectbins: Required binariesenv: Required environment variablesconfig: Required config paths
disable-model-invocation: If true, skill won't be shown to model (default: false)user-invocable: If false, users can't invoke directly (default: true)
Example Skill
---
name: my-tool
description: Use my-tool to process data
metadata: {"cow":{"emoji":"🔧","requires":{"bins":["my-tool"],"env":["MY_TOOL_API_KEY"]}}}
---
# My Tool Skill
Use this skill when you need to process data with my-tool.
## Prerequisites
- Install my-tool: `pip install my-tool`
- Set `MY_TOOL_API_KEY` environment variable
## Usage
\`\`\`python
# Example usage
my_tool_command("input data")
\`\`\`
Skill Loading
Skills are loaded from multiple locations with precedence:
- Workspace skills (highest):
workspace/skills/- Project-specific skills - Managed skills:
~/.cow/skills/- User-installed skills - Bundled skills (lowest): Built-in skills
Skills with the same name in higher-precedence locations override lower ones.
Skill Requirements
Skills can specify requirements that determine when they're available:
- OS requirements: Only load on specific operating systems
- Binary requirements: Only load if required binaries are installed
- Environment variables: Only load if required env vars are set
- Config requirements: Only load if config values are set
Best Practices
- Clear descriptions: Write clear, concise skill descriptions
- Include examples: Provide practical usage examples
- Document prerequisites: List all requirements clearly
- Use appropriate metadata: Set correct requirements and flags
- Keep skills focused: Each skill should have a single, clear purpose
Workspace Skills
You can create workspace-specific skills in your agent's workspace:
workspace/
skills/
custom-skill/
SKILL.md
These skills are only available when working in that specific workspace.