Agent skill
Backend Queries
Write secure, optimized database queries using parameterized statements, eager loading, and proper indexing to prevent SQL injection and N+1 query problems. Use this skill when writing database queries, using ORM query methods, implementing data fetching logic, or optimizing database performance. When working with SQL queries, ORM query builders, repository patterns, or data access layers. When implementing joins, eager loading, query optimization, transactions, or query caching. When selecting data, filtering records, or fetching related associations in service files, repository files, or controller methods.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/backend-queries
SKILL.md
Backend Queries
When to use this skill
- When writing database queries in any backend file
- When using ORM query methods (e.g., ActiveRecord, Sequelize, Prisma, SQLAlchemy)
- When implementing eager loading or joins to prevent N+1 queries
- When writing raw SQL queries or query builders
- When optimizing query performance or adding indexes
- When implementing transactions for related database operations
- When adding query timeouts or performance monitoring
- When implementing query caching strategies
- When selecting specific columns instead of using SELECT *
- When working in service files, repository files, or data access layers that fetch data
This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle backend queries.
Instructions
For details, refer to the information provided in this file: backend queries
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?