standards-queries

Enforce parameterized queries and eager loading in SQL and ORM patterns.

1.8k|153|Updated Oct 18, 2025
One-click install
npx skills add https://github.com/maxritter/claude-pilot --skill standards-queries
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: standards-queries
Source: https://github.com/maxritter/claude-pilot/tree/main/pilot/skills/standards-queries
Command: npx skills add https://github.com/maxritter/claude-pilot --skill standards-queries

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers enforce secure, efficient database access patterns by promoting parameterized queries, eager loading where appropriate, and targeted indexing.

Core Features & Use Cases

  • Parameterized Queries: Enforce prepared statements or ORM filters to prevent SQL injection.
  • N+1 Prevention & Eager Loading: Guidance to fetch related data efficiently via joins or optimized loading strategies.
  • Selective Columns & Indexing: Recommend retrieving only necessary columns and applying indexes on common filters.
  • Transactional Integrity: Encourage wrapping related writes in transactions to maintain consistency.
  • Performance Validation: Use explain plans and query logging to verify improvements.

Quick Start

  • Refactor a sample vulnerable query to a parameterized version and describe how to test it with a simple dataset.
  • Add an index on a frequently filtered column and verify performance improvements with EXPLAIN plans.

Frequently Asked Questions about standards-queries

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

FAQPage Schema
How do I prevent SQL injection when writing backend database queries?

Prevent SQL injection by enforcing parameterized queries or prepared statements that separate SQL code from user-supplied input to stop malicious execution. This ensures secure data access across repositories and services.

What's the best way to fix the N+1 query problem in my ORM?

Fix the N+1 query problem by applying eager loading guidance to fetch related data efficiently via joins or optimized loading strategies. This reduces redundant database round trips across your repositories.

How do I use SQL indexing and EXPLAIN plans to optimize slow queries?

Optimize slow SQL queries by applying targeted indexing on frequently filtered columns and retrieving only necessary columns. Verify performance improvements using EXPLAIN plans and query logging.

How do I maintain transactional integrity for related database writes?

Maintain transactional integrity by wrapping related database writes in transactions to ensure consistency. This guarantees that grouped operations succeed or fail together without partial updates.

Does this database query optimization guidance work with any framework?

Yes, this guidance is framework-agnostic and applies to backend SQL and ORM query patterns across any platform. It addresses parameterization, loading strategies, and indexing uniformly.