query-optimizer

Official

Prevent D1 billing traps with static queries.

Authorlittlebearapps
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Static analysis of D1 queries to prevent costly row reads caused by unindexed queries, missing limits, and N+1 patterns. This approach helps developers catch problematic query patterns before they hit production and incur excessive costs.

Core Features & Use Cases

  • Detects expensive patterns such as SELECT * without LIMIT, unindexed WHERE clauses, and queries inside loops.
  • Flags N+1 query scenarios and suggests batching or in-clauses.
  • Supports Drizzle ORM patterns and general D1 usage across codebases.
  • Guides indexing strategies and query refactoring to reduce row reads and costs.
  • Use cases include API route audits, background jobs, and development environments to avoid cost surges.

Quick Start

Analyze a project to generate a D1 query optimization report that highlights risky queries and recommended fixes.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: query-optimizer
Download link: https://github.com/littlebearapps/cloudflare-engineer/archive/main.zip#query-optimizer

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.