code-quality
Ensures code follows quality standards. Apply when reviewing or writing production code.
When & Why to Use This Skill
This Claude skill serves as an automated quality gate for software development, ensuring that production-grade code adheres to rigorous engineering standards. It focuses on enhancing code maintainability and reliability by enforcing strict type safety, robust error handling, performance optimization, and clean architectural organization.
Use Cases
- Automated Pull Request Reviews: Use the skill to automatically scan new code submissions for anti-patterns such as deep nesting, 'any' types, or inefficient O(n²) algorithms.
- Production Readiness Audits: Apply the guidelines to verify that error handling is comprehensive and provides sufficient context before deploying critical features.
- Refactoring Legacy Code: Identify and resolve technical debt by evaluating existing modules against the Single Responsibility Principle and modern type-safety standards.
- Standardizing Team Practices: Implement these rules as a consistent benchmark to ensure all developers follow the same high-quality coding conventions and organizational patterns.
| name | code-quality |
|---|---|
| description | Ensures code follows quality standards. Apply when reviewing or writing production code. |
Code Quality Guidelines
Type Safety
- Always use strict type checking
- Avoid
anytypes - Use discriminated unions for variant types
Error Handling
- Never silently catch errors
- Always provide context in error messages
- Use error boundaries appropriately
Performance
- Avoid O(n²) algorithms
- Profile before optimizing
- Consider memory implications
Code Organization
- Keep functions small and focused
- Use meaningful variable names
- Follow single responsibility principle
- Avoid deep nesting (max 3 levels)