원클릭으로
query-optimize
Optimizes database queries - adds indexes, rewrites N+1s, batches requests
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Optimizes database queries - adds indexes, rewrites N+1s, batches requests
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Analyzes the current session's token usage, pinpoints where tokens were wasted, and produces concrete optimization actions
Generates API documentation from route definitions (Express, Fastify, Hono, etc.)
Adds caching to expensive operations - Redis, in-memory, HTTP cache headers
Staged değişiklikleri analiz edip Conventional Commits formatında commit mesajı oluşturur
Reports cyclomatic complexity hotspots and refactoring suggestions
Finds unused functions, variables, exports, and dependencies across the codebase
| name | query-optimize |
| description | Optimizes database queries - adds indexes, rewrites N+1s, batches requests |
| argument-hint | ["file-path"] |
| user-invocable | true |
| allowed-tools | Read Grep Glob Edit |
| effort | medium |
Target: $1 (or scan src/ for all DB interactions)
grep -rn "\.find\|\.findMany\|\.query\|\.select\|db\.\|prisma\.\|knex\." ${1:-src/} --include="*.ts" | head -40
// ❌ N+1: querying inside a loop
for (const user of users) {
user.posts = await db.posts.findMany({ where: { userId: user.id } })
}
// ✅ Fix: batch with include or Promise.all
const users = await db.users.findMany({ include: { posts: true } })
select (over-fetching):// ❌ Fetches all 40 columns
await db.users.findMany()
// ✅ Only what's needed
await db.users.findMany({ select: { id: true, name: true, email: true } })
Propose missing indexes for frequently-filtered columns.
Show before/after for each optimization. Apply on confirmation.