code-quality
Code quality and safety standards. Activates when editing or reviewing code. Use for quality priorities, safety checks, and code correctness verification.
When & Why to Use This Skill
The Code Quality skill is a comprehensive framework designed to enforce high-standard coding practices and safety protocols during the software development lifecycle. It ensures that all code generated or edited adheres to a strict hierarchy of priorities: correctness, runtime safety, security, performance, and maintainability. By automating critical checks for race conditions, memory leaks, and input validation, this skill acts as a persistent quality gate to deliver robust, production-ready software.
Use Cases
- Automated Safety Audits: Automatically scan code for runtime risks such as nil pointer dereferences, array bounds violations, and potential race conditions during the editing process.
- Security Hardening: Enforce strict input sanitization and resource management protocols to prevent common vulnerabilities and ensure secure data handling.
- Standardizing Technical Debt: Apply consistent quality priorities across projects to ensure that maintainability and performance are never compromised for speed.
- Language-Specific Best Practices: Utilize specialized guidance for languages like Go to ensure idiomatic usage of concurrency, error handling, and safety patterns.
- Pre-Deployment Verification: Use as a blocking quality check to verify that all error paths are handled and resources are properly cleaned up before code is finalized.
| name | code-quality |
|---|---|
| description | Code quality and safety standards. Activates when editing or reviewing code. Use for quality priorities, safety checks, and code correctness verification. |
| allowed-tools | ["shell", "read_file", "apply_patch"] |
| short-description | Enforce code quality and safety |
Code Quality
Read these references:
references/quality.md- Quality priorities (correctness, safety, performance)references/safety.md- Runtime and security safety guidelines
Instructions
Apply all guidance from references when writing or reviewing code.
Quality Priority Order
Per quality.md:
- Correctness - Does it work? Handle all cases?
- Safety - Runtime safety (no crashes, race conditions)
- Security - No vulnerabilities, input validation
- Performance - Efficient use of resources
- Maintainability - Clear, consistent, documented
Safety Checks
Per safety.md:
- Runtime safety: nil checks, bounds checking, race conditions
- Error handling: All errors checked and handled appropriately
- Resource management: Proper cleanup, no leaks
- Input validation: Sanitize and validate all external input
- Thread safety: Mutex usage, data races, concurrent access
Language-Specific Guidance
For Go projects, also reference:
~/.config/agent/domain/coding/go/style.md~/.config/agent/domain/coding/go/idioms.md~/.config/agent/domain/coding/go/concurrency.md~/.config/agent/domain/coding/go/safety.md
For other languages, check ~/.config/agent/domain/coding/<language>/ if available.
All Steps Blocking
Quality and safety checks are blocking - code must pass all requirements before proceeding. Never compromise on correctness or safety for speed.