Guide for creating effective Agent Skills. Use when users want to create a new skill (or update an existing skill) that extends an AI agent's capabilities with specialized knowledge, workflows, or tool integrations. Covers skill structure, YAML frontmatter, trigger configuration, and the 500-line rule.
Instrucciones de origen · Vista previa de solo lectura
name
skill-creator
description
Guide for creating effective Agent Skills. Use when users want to create a new skill (or update an existing skill) that extends an AI agent's capabilities with specialized knowledge, workflows, or tool integrations. Covers skill structure, YAML frontmatter, trigger configuration, and the 500-line rule.
Skills are modular, self-contained packages that extend AI agent capabilities by providing specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific domains or tasks—they transform a general-purpose agent into a specialized agent equipped with procedural knowledge that no model can fully possess.
What Skills Provide
Specialized workflows - Multi-step procedures for specific domains
Tool integrations - Instructions for working with specific file formats or APIs
Domain expertise - Company-specific knowledge, schemas, business logic
Bundled resources - Scripts, references, and assets for complex and repetitive tasks
Core Principles
Concise is Key
The context window is a public good. Skills share the context window with everything else the agent needs: system prompt, conversation history, other skills' metadata, and the actual user request.
Default assumption: The agent is already very smart. Only add context it doesn't already have. Challenge each piece of information: "Does the agent really need this explanation?" and "Does this paragraph justify its token cost?"
Prefer concise examples over verbose explanations.
Set Appropriate Degrees of Freedom
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.
Anatomy of a Skill
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)
│ │ └── metadata.triggers: (optional, for auto-activation)
│ └── 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.)
SKILL.md Frontmatter
Every SKILL.md must have YAML frontmatter with required and optional fields:
Field
Required
Description
name
Yes
Max 64 chars. Lowercase letters, numbers, hyphens only. Must match directory name.
description
Yes
Max 1024 chars. Describes what the skill does and when to use it.
license
No
License name or reference to a bundled license file.
compatibility
No
Max 500 chars. Environment requirements (intended product, system packages, etc.).
metadata
No
Arbitrary key-value mapping for additional metadata.
allowed-tools
No
Space-delimited list of pre-approved tools. (Experimental)
Trigger Configuration (metadata.triggers)
Skills can define auto-activation triggers in the metadata.triggers field:
metadata:triggers:type:domain# "domain" (advisory) or "guardrail" (enforced)enforcement:suggest# "suggest", "warn", or "block"priority:high# "critical", "high", "medium", or "low"keywords:# Exact substring matches (case-insensitive)-error-Result-error-stackintent-patterns:# Regex patterns for intent detection-"\\b(handle|create)\\b.*?\\berror\\b"-"\\berror\\b.*?\\bhandling\\b"files:# Optional: file-based triggersinclude:-"**/src/**/*.rs"exclude:-"**/*.test.rs"content:-"use error_stack"
Trigger Types:
keywords: Case-insensitive substring matching in user's prompt
intent-patterns: Regex patterns to detect user intent (use \\b for word boundaries, .*? for non-greedy matching)
files.include: Glob patterns for file paths
files.exclude: Glob patterns to exclude (e.g., test files)
files.content: Regex patterns to match file content
Enforcement Levels:
suggest: Skill suggestion appears but doesn't block execution
warn: Shows warning but allows proceeding
block: Requires skill to be used before proceeding (guardrail)
Bundled Resources (optional)
Scripts (scripts/)
Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
When to include: When the same code is being rewritten repeatedly or deterministic reliability is needed
Example: scripts/rotate_pdf.py for PDF rotation tasks
Benefits: Token efficient, deterministic, may be executed without loading into context
References (references/)
Documentation and reference material intended to be loaded as needed into context.
When to include: For documentation that the agent should reference while working
Examples: references/finance.md for financial schemas, references/api_docs.md for API specifications
Best practice: If files are large (>10k words), include grep search patterns in SKILL.md
Assets (assets/)
Files not intended to be loaded into context, but rather used within the output.
When to include: When the skill needs files that will be used in the final output
Examples: assets/logo.png for brand assets, assets/template.pptx for templates
Progressive Disclosure Design Principle
Skills use a three-level loading system to manage context efficiently:
Metadata (name + description) - Always in context (~100 words)
SKILL.md body - When skill triggers (<5k words recommended)
Bundled resources - As needed (unlimited)
Keep SKILL.md body under 500 lines. Split content into separate files when approaching this limit.
Pattern: High-level guide with references
# PDF Processing## Quick start
Extract text with pdfplumber: [code example]
## Advanced features-**Form filling**: See [FORMS.md](references/FORMS.md) for complete guide
-**API reference**: See [REFERENCE.md](references/REFERENCE.md) for all methods