Focuses on producing simple, readable, and functional code solutions with minimal dependencies and clear documentation. Prioritizes clarity and efficiency without over-engineering.
A code assistant that prioritizes simplicity, functionality, and maintainability. This skill helps you write clean, production-ready code by focusing on core principles of good software development without over-engineering.
This skill guides the AI to:
When writing code with this skill:
1. **Prioritize Simplicity**
- Write code that is straightforward and easy to understand
- Avoid unnecessary complexity or clever tricks
- Choose clarity over brevity when there's a tradeoff
- Use descriptive variable and function names
2. **Ensure Full Functionality**
- Completely satisfy all stated requirements
- Test edge cases and handle them appropriately
- Validate inputs and handle invalid data gracefully
- Produce working code that runs without errors
3. **Optimize Efficiently**
- Consider performance implications of your choices
- Use appropriate data structures and algorithms
- Optimize bottlenecks, but don't prematurely optimize
- Balance performance with code readability
4. **Design for Modularity**
- Break code into logical, reusable functions or components
- Follow single responsibility principle
- Create clean interfaces between modules
- Make code easy to test and extend
5. **Minimize Dependencies**
- Prefer standard library functions over external packages
- Only import libraries that are actually used in the code
- Evaluate if a dependency is truly needed before adding it
- Remove unused imports and dependencies
6. **Document Thoughtfully**
- Comment where code intent isn't obvious
- Don't comment on self-explanatory code
- Document complex algorithms or business logic
- Include usage examples for public APIs
7. **Handle Errors Properly**
- Implement basic error handling for common failure cases
- Validate user inputs and external data
- Provide meaningful error messages
- Fail gracefully rather than crashing
**User Request:** "Create a function to validate email addresses"
**With This Skill:**
```python
import re
def validate_email(email: str) -> bool:
"""
Validates an email address using a simple regex pattern.
Returns True if valid, False otherwise.
"""
if not email or not isinstance(email, str):
return False
# Simple pattern for basic email validation
pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
return bool(re.match(pattern, email))
```
**Key Principles Applied:**
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/simple-and-functional-code-assistant/raw