ln-25-persistence-auditor

Audits database queries, transactions, consistency, and persistence resource lifecycle with evidence-based findings.

556|83|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-25-persistence-auditor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ln-25-persistence-auditor
Source: https://github.com/levnikolaevich/claude-code-skills/tree/main/plugins/codebase-audit-suite/skills/ln-25-persistence-auditor
Command: npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-25-persistence-auditor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Data-layer defects like N+1 queries, broken transaction boundaries, connection leaks, and unsafe isolation assumptions often hide until they cause corruption or outages in production. This Skill performs a read-only, evidence-driven audit of persistence and data-heavy runtime paths so risks are found and prioritized before they cause damage.

Core Features & Use Cases

  • Query and Cache Efficiency Audit: Traces entrypoints to generated SQL to find N+1 patterns, over-fetching, missing pagination, redundant round trips, and cache design flaws.
  • Transaction and Consistency Audit: Verifies atomicity, isolation assumptions, idempotency, retry safety, migration behavior, and trigger or event semantics against the actual database and framework versions.
  • Resource Lifecycle Audit: Tracks sessions, connections, cursors, streams, and pools through success, error, cancellation, and abandonment paths, including DI scope mismatches and total connection budgets.
  • Use Case: Before scaling a service, run the audit to get a prioritized P0-P3 findings table with call paths, evidence, and verified remediation links, plus a PASS/CONCERNS/FAIL/BLOCKED verdict.

Quick Start

Audit the persistence layer of this repository for query efficiency, transaction safety, and resource lifecycle issues, and report prioritized findings with a verdict.

Frequently Asked Questions about ln-25-persistence-auditor

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

FAQPage Schema
How do I audit database queries for N+1 problems?

Trace representative paths from entrypoints through business logic to generated SQL, then look for query-in-loop patterns, repeated identical fetches, and sequential independent reads. Confirm impact with query logs, tracing, or ORM diagnostics rather than static suspicion alone.

How to check transaction isolation and consistency issues in code?

Identify who begins, commits, rolls back, and retries each transaction, then check atomicity across related writes, long-held transactions, lost updates, and retry safety. Verify assumptions against the official semantics of the installed database, driver, and framework versions.

Can this audit run against a production database?

No. The audit is strictly read-only and never connects to production or runs mutating diagnostics. EXPLAIN ANALYZE is allowed only for confirmed read-only queries on approved non-production targets, and no indexes, migrations, or pool changes are made.

What evidence is needed to confirm a database performance finding?

Query count, duration, rows, plan, lock, or profile evidence is required to claim performance impact. Static analysis can prove correctness and lifecycle defects, but unmeasured performance candidates must be explicitly labeled as unmeasured.

When should I not use a persistence audit?

Skip it for general application performance tuning unrelated to data paths, since the audit targets queries, transactions, consistency, and resource lifecycle. It is also unsuitable when no safe non-production environment or credible fallback exists for verifying critical data paths.