quality-correctness

Reviews code changes for invariant violations, edge cases, and concurrency hazards.

1|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/pnewsam/skills --skill quality-correctness-pnewsam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: quality-correctness
Source: https://github.com/pnewsam/skills/tree/main/archive/quality-evicted/quality-correctness
Command: npx skills add https://github.com/pnewsam/skills --skill quality-correctness-pnewsam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes often pass happy-path tests while silently breaking business rules, data integrity, retries, or concurrent behavior. This Skill provides a language-agnostic correctness framework that forces systematic reasoning about invariants, boundary validation, idempotency, and race conditions before defects reach production. ## Core Features & Use Cases - Invariant-First Reasoning: Start from what must always be true before and after code runs, then check persistence constraints, transactions, and unique keys that protect it. - Decision Rubric: A risk-driven table covering invariants, boundary input, persistence, retries, concurrency, and time-related hazards like clock skew and boundary dates. - Review Checklist & Handoff Rules: Concrete questions for partial failure, duplicate execution, and concurrent actors, plus routing to quality-testing, quality-reliability, and compliance-security skills. - Use Case: While reviewing a payment-processing change, apply the rubric to discover that a retry path is not idempotent and that uniqueness is enforced only in application code rather than by a database constraint. ## Quick Start Ask the agent to review this code change for correctness risks including invariants, edge cases, retries, and concurrency using the quality-correctness checklist.

Frequently Asked Questions about quality-correctness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review code for correctness beyond happy-path tests?▼

Start by identifying the invariants the code must preserve, then systematically check edge cases, partial failures, duplicate execution, and concurrent access. The decision rubric maps each risk type to a specific question about validation, persistence, retries, and timing.

What should I check for race conditions and concurrency bugs?▼

Ask what happens if two actors run the same operation simultaneously and whether database constraints or transactions protect shared state. Single-run tests passing does not rule out race conditions, so look for unprotected read-modify-write sequences.

How do I make retry logic safe for write operations?▼

Make retry behavior explicit by ensuring operations are idempotent or deduplicated, typically via unique constraints or idempotency keys at the data layer. Blindly retrying unsafe writes can create duplicates or corrupt state.

When should validation happen at the database instead of the UI?▼

Critical invariants belong near the data or domain boundary, enforced by database constraints, transactions, or unique keys. UI-only checks are insufficient because APIs, scripts, and concurrent clients can bypass them.

Does this correctness review replace writing tests?▼

No, it complements testing by identifying which behaviors need proof. Hand off to quality-testing to design regression and edge-case tests, and to quality-reliability when correctness depends on dependency failure behavior.