A guide for creating effective Agent Skills that follow the agentskills.io specification. Use this when you want to create a new skill or update an existing one that extends an AI agent's capabilities with specialized knowledge, workflows, or tool integrations. Applicable to GitHub Copilot, Claude, and other AI assistants.
Guide for creating Agent Skills—modular packages of procedural knowledge, workflows, and tools that extend AI agents beyond what any model inherently knows.
Skills share the context window with system prompts, conversation history, and other skills. Only add context the agent doesn't already have—challenge each paragraph's token cost. Prefer concise examples over verbose explanations.
Match the level of specificity to the task's fragility and variability:
High freedom (text-based instructions): Use when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.
Medium freedom (pseudocode or scripts with parameters): Use when a preferred pattern exists, some variation is acceptable, or configuration affects behavior.
Low freedom (specific scripts, few parameters): Use when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.
Every skill consists of a required SKILL.md file and optional bundled resources:
skill-name/
├── SKILL.md (required)
│ ├── YAML frontmatter metadata (required)
│ │ ├── name: (required)
│ │ ├── description: (required)
│ │ └── compatibility: (optional, rarely needed)
│ └── Markdown instructions (required)
└── Bundled Resources (optional)
├── scripts/ - Executable code (Python/Bash/etc.)
├── references/ - Documentation intended to be loaded into context as needed
└── assets/ - Files used in output (templates, icons, fonts, etc.)
Every SKILL.md consists of:
name and description fields (required), plus optional fields like license, metadata, compatibility, and allowed-tools. Only name and description are read by the AI agent to determine when the skill triggers, so be clear and comprehensive about what the skill is and when it should be used. The compatibility field is for noting environment requirements (target product, system packages, etc.) but most skills don't need it.scripts/)Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten. Can be executed without loading into context. Scripts may still need to be read for patching or environment-specific adjustments.
Python scripts: Use PEP 723 inline script metadata so dependencies are declared in the script itself, then run with uv run for zero-install execution:
# /// script
# requires-python = ">=3.12"
# dependencies = ["pdfplumber", "Pillow"]
# ///
Run via uv run script.py — no virtual environment or pip install needed.
references/)Documentation loaded as needed into context (schemas, API docs, domain knowledge, policies).
assets/)Files used in the agent's output but not loaded into context (templates, images, icons, boilerplate, fonts).
Exclude auxiliary files (README, CHANGELOG, installation guides, etc.). Only include files the agent needs to do the job.
Skills use a three-level loading system to manage context efficiently:
Keep SKILL.md body to the essentials to minimize context bloat (~5000 tokens, roughly 400-500 lines of mixed content). Split content into separate files when approaching this limit. When splitting out content into other files, it is very important to reference them from SKILL.md and describe clearly when to read them, to ensure the agent knows they exist and when to use them.
Key principle: When a skill supports multiple variations, frameworks, or options, keep only the core workflow and selection guidance in SKILL.md. Move variant-specific details (patterns, examples, configuration) into separate reference files.
Pattern: High-level guide with references
# PDF Processing
## Quick start
Extract text with pdfplumber: [code example]
## Advanced features
- **Form filling**: See [references/FORMS.md](references/FORMS.md) for complete guide
- **API reference**: See [references/REFERENCE.md](references/REFERENCE.md) for all methods
The agent loads reference files only when needed. This same pattern applies to domain-specific splits (e.g., references/finance.md, references/sales.md) and conditional details (linking to advanced topics only when relevant).
Guidelines:
Skill creation involves these steps:
Follow these steps in order, skipping only if there is a clear reason why they are not applicable.
Skip when the skill's usage patterns are already clearly understood.
Gather concrete examples of how the skill will be used—from the user directly or by generating examples and validating them. Ask focused questions like: "What functionality should this skill support?" and "What would a user say to trigger it?"
Avoid asking too many questions at once. Conclude when the skill's scope is clear.
For each concrete example, analyze: (1) how to execute it from scratch, and (2) what would be helpful to have pre-built for repeated execution.
Example: A pdf-editor skill for "Help me rotate this PDF" → repeated code → add scripts/rotate_pdf.py. A frontend-webapp-builder → repeated boilerplate → add assets/hello-world/ template. A big-query skill → repeated schema discovery → add references/schema.md.
Produce a list of reusable resources (scripts, references, assets) to include.
Create the skill directory with a SKILL.md template and example scripts/, references/, assets/ directories. Customize or remove generated example files as needed.
When editing the (newly-generated or existing) skill, remember that the skill is being created for an AI agent to use. Include information that would be beneficial and non-obvious to the agent. Consider what procedural knowledge, domain-specific details, or reusable assets would help an AI agent execute these tasks more effectively.
Implement the resources identified in Step 2. This may require user input (e.g., brand assets, documentation to store).
Writing Guidelines: Use imperative/infinitive form.
Write the YAML frontmatter with required and optional fields:
Required fields:
name: The skill name (1-64 characters, lowercase alphanumeric and hyphens only, must match parent directory name)description: Primary triggering mechanism (1-1024 characters). Include what the skill does AND when to use it. This is the only field read before the body loads.
:) — colons break YAML parsing. Rewrite to eliminate them (e.g., "Use when" instead of "Use for: when"). If a colon is unavoidable, wrap the entire value in double quotes.Optional fields:
license: License name or reference to a bundled license file (e.g., "Apache-2.0" or "Proprietary. LICENSE.txt has complete terms")compatibility: Environment requirements (1-500 characters) - intended product, necessary system packages, network access needs, etc.metadata: Arbitrary key-value mapping for additional metadata (e.g., author, version)allowed-tools: Space-delimited list of pre-approved tools (experimental, support varies between agent implementations)Write instructions the agent needs to execute the skill. Structure based on skill type:
Keep each section focused on one idea. Use code blocks for commands and examples, lists for options, and prose only for reasoning the agent needs. Reference bundled resources by relative path with a brief note on when to read them.
Run these checks before finalizing any skill to ensure optimal agent performance.
Scan SKILL.md for patterns that degrade agent performance:
description field — negative routing ("DO NOT use for…") in descriptions is encouraged for skill disambiguation.Verify the description uses procedural language—action verbs ("deploy", "configure", "create", "analyze") and procedure keywords ("step", "then", "workflow", "process", "sequence"). In our testing, procedural language in descriptions improved skill activation rates across models.
Validate the description field against the frontmatter guidelines in Step 4 — confirm it starts with an action verb, contains no unquoted colons, and is concise (~100 tokens or fewer).
After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.
Iteration workflow:
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer