One of Sonars' most powerful features is Custom Skills—reusable prompts that extend Claude's capabilities and automate common tasks. In this guide, we'll show you how to create skills that save time and enforce best practices.
What Are Skills?
Skills are predefined instructions that Claude follows when you invoke them. Instead of typing the same detailed prompt every time, you create a skill once and use it with a single command.
For example, instead of writing:
"Please review this code for security vulnerabilities, following OWASP guidelines. Check for SQL injection, XSS, CSRF, and authentication issues. Format your response as a markdown checklist."
You can create a skill called "security-review" and just type /security-review.
Creating Your First Skill
In Sonars, open the Skills panel and click "New Skill". You'll see a visual builder with these fields:
- Name — A short identifier (e.g., "security-review")
- Description — What the skill does
- Prompt — The instructions Claude will follow
- Parameters — Dynamic values you can pass when invoking
Here's an example skill for generating unit tests:
Name: generate-tests
Description: Generate comprehensive unit tests for a function or module
Prompt:
Generate unit tests for the specified code. Follow these guidelines:
- Use the project's existing test framework
- Cover happy path, edge cases, and error conditions
- Include descriptive test names that explain what's being tested
- Add comments explaining non-obvious test cases
- Mock external dependencies appropriately
Target: {{target}}
Parameters:
target— The function or file to test
Using Parameters
Parameters make skills dynamic. When you invoke /generate-tests, Sonars prompts you for the target value. You can also pass it directly:
/generate-tests target="src/auth/validate.rs"
This flexibility lets you create general-purpose skills that adapt to different situations.
Skill Ideas for Your Workflow
Here are some skills we find useful:
Code Review
Review this code for:
- Logic errors and bugs
- Performance issues
- Readability and maintainability
- Adherence to project conventions
Provide specific suggestions with line numbers.
Commit Message
Generate a commit message for the staged changes following conventional commits format.
Be concise but descriptive. Focus on the "why" not just the "what".
Documentation
Generate documentation for {{target}} including:
- Purpose and use cases
- Parameters and return values
- Example usage
- Edge cases to be aware of
Refactor
Refactor {{target}} to improve:
- Code clarity
- Separation of concerns
- Error handling
- Type safety
Explain your changes and reasoning.
Sharing Skills with Your Team
Skills are stored locally, but you can export them as JSON and share with teammates. This is a great way to:
- Onboard new developers with your team's conventions
- Ensure consistent code review standards
- Automate repetitive tasks team-wide
Tips for Effective Skills
- Be Specific — The more detail in your prompt, the better Claude's output
- Include Context — Tell Claude about your project's conventions and requirements
- Use Parameters — Make skills flexible so they work in different situations
- Iterate — Refine your prompts based on results
Conclusion
Custom skills turn Sonars into a personalized AI assistant that knows your workflow. Start with the examples above, then create skills tailored to your specific needs.
What skills will you create?