Creating Skill Extensions
Skills are specialized capabilities that the AI can automatically invoke when relevant to the user’s request. Unlike commands (which users explicitly call), skills are model-invoked based on their descriptions and the current context.What are Skills?
Skills are:- Capabilities the AI automatically uses when appropriate
- Defined in
SKILL.mdfiles with YAML frontmatter - Discovered automatically by the AI
- Useful for adding domain-specific expertise
- Available via
/skillscommand to view/manage
Skill vs Command vs Agent
Skill:- AI decides when to use it
- Single-purpose capability
- No conversation context
- Provides instructions/guidance
- User explicitly invokes with
/command - Can be multi-step workflow
- Immediate execution
- User explicitly invokes
- Multi-turn conversation
- Complex, stateful interactions
- Has tool access
Skill File Format
Skills are Markdown files with YAML frontmatter:Frontmatter Fields
Required:name- Unique identifier (lowercase, dashes)description- When and why to use this skill (crucial for AI discovery)
license- License information
Description is Critical
Thedescription field determines when the AI invokes your skill. Make it specific and context-rich:
Extension Structure
Place skill files in askills/ directory:
SKILL.md file.
Configure in Manifest
Updateqwen-extension.json:
skills field specifies the directory (defaults to "skills" if not specified).
Example: Synonyms Skill
From the built-in examples:Example: Code Analyzer Skill
Example: Performance Profiler Skill
Medium Impact
[Similar format]Low Impact
[Similar format] Trade-offs:- [Optimization]: [benefit] vs [cost]
Best Practices
- Measure before optimizing
- Focus on actual bottlenecks
- Consider maintainability vs performance
- Provide complexity analysis
- Show concrete improvements
- Mention trade-offs
- [Security concern]
- [Performance consideration]
- [Scalability note]
Best Practices
- Version APIs:
/v1/resources - Use HTTPS only
- Implement rate limiting
- Provide clear error messages
- Document thoroughly
- Follow HATEOAS when appropriate
- Consider caching headers
2. Rich Descriptions
Help the AI understand when to use your skill:3. Clear Instructions
Provide step-by-step guidance:4. Include Examples
Show expected inputs and outputs:5. Output Structure
Define consistent output format:Skill Discovery
Users can view available skills:Testing Skills
During development:- Link your extension:
qwen extensions link . - Restart Qwen Code
- Ask questions that should trigger your skill
- Verify the AI uses the skill appropriately
- Refine description and instructions based on results
Multiple Skills
You can include multiple related skills:Next Steps
- Creating Extensions - Build a complete extension
- Agents - Create specialized AI assistants
- Commands - Add custom commands
- Best Practices - Extension development guidelines
