skills/code-quality-rules/SKILL.md
Use when conducting a code review and evaluating whether a change meets project quality standards.
npx skillsauth add maestria-co/ai-playbook code-quality-rulesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Specifies assessment standards, issue severity rankings, and a systematic multi-pass inspection methodology. These guidelines govern evaluation of any codebase modification.
Code Hygiene: Purge all commented-out code blocks. Strip debug print statements. Never silently swallow exceptions—handle errors explicitly at every failure point. Never commit secrets—use environment variables. Choose descriptive identifiers consistently. Replace magic numbers with named constants. Apply the Don't Repeat Yourself principle rigorously.
Security Posture: Never expose sensitive data through logging or error messages. Validate and sanitize all untrusted input at system boundaries. Prevent SQL injection through parameterized queries exclusively. Apply output encoding to block XSS attacks. Ban eval() and related dynamic execution. Verify auth/authz implementation thoroughly—confirm authorization logic executes at the service tier, never solely in presentation layers. Keep credentials out of repositories. New API endpoints and data paths must enforce access restrictions. Changes touching authentication or authorization warrant heightened scrutiny—verify modifications don't accidentally broaden permissions.
Performance Characteristics: Eliminate N+1 query antipatterns. Release resources explicitly—close database connections, file handles, network streams. Move computationally expensive operations away from hot execution paths.
Test Coverage: New features require corresponding test cases. Assertions must verify genuine behavior, not merely mock presence. Include edge cases and failure scenarios in test suites. Avoid polluting production code with test-only methods. When altering decision logic, verify presence of the standardized Coverage Evidence Block from testing-discipline. Consider this coaching guidance: flag missing evidence as developmental feedback, not automatic rejection.
Verification Evidence: Confirm build and test execution actually occurred—demand output artifacts or reproducible steps, never accept assumptions.
Maintainability Factors: Limit method length to reasonable bounds. Manage cyclomatic complexity actively. Preserve clear responsibility boundaries between components. Prevent circular dependency graphs.
Critical Priority: Security vulnerabilities, data corruption risks, runtime crashes, breaking modifications to public contracts, faulty business logic implementation.
Moderate Priority: Performance degradation, absent error handling, missing test coverage for critical paths, departure from established architectural patterns.
Minor Priority: Style inconsistencies beyond linter scope, documentation enhancement opportunities, discretionary refactoring suggestions.
Execute comprehensive reviews through multiple targeted inspection passes rather than attempting omniscient single-pass review. Each pass concentrates on a specific quality dimension to prevent oversight.
Complete multi-pass inspection: New feature development, cross-module modifications, security-critical code, public interface changes.
Condensed inspection (Passes 1, 4, 5 exclusively): Isolated bug fixes, documentation updates, configuration adjustments, test augmentations.
Review output should employ the standard Findings taxonomy (Critical / Moderate / Minor), annotating which pass surfaced each finding—this contextualizes the issue category for the author.
development
Writes and runs a test suite for a piece of code, covering happy path, edge cases, error cases, and security cases. Use when: implementation is complete and needs test coverage, a bug needs a reproduction test and fix validation, or code needs coverage before a refactor. Do not use when: the code under test is not yet implemented, or the spec is still unclear.
testing
Use when creating a new skill, editing an existing skill, or helping a user author a skill for this system. Covers structure, discoverability, quality, and discipline hardening.
development
Evidence-based verification process to run before marking any task complete. Use this skill every time you're about to report that work is done — for features, bug fixes, refactoring, or any code change. This catches the most common failure mode: declaring "done" without proof. If you're finishing up and about to tell the user the task is complete, run this checklist first.
development
Teaches agents how to discover, select, and invoke skills from the skill library. Use this skill whenever you're uncertain which skill applies to a task, when composing multiple skills for complex work, or when you need to understand what skills are available. This is your go-to when facing an ambiguous task and need to figure out the right approach before diving into implementation.