소스 정보
- 저장소
- diegosouzapw/awesome-omni-skill
- 최근 소스 활동
- 2026년 2월 28일 04:04
- 감지된 SKILL.md 언어
- 영어
- 스타
- 50
- 포크
- 19
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/diegosouzapw/awesome-omni-skill --skill api-performance-api-performance명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | api-performance-api-performance |
| description | Query optimization, caching, indexing |
Quick Guide: Optimize backend performance through database query optimization (indexes, prepared statements, avoiding N+1), caching strategies (Redis cache-aside, write-through), connection pooling, and non-blocking async patterns. Always measure before optimizing.
<critical_requirements>
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST always release database connections back to the pool using finally blocks)
(You MUST use .with() or eager loading to prevent N+1 queries - never lazy load in loops)
(You MUST set TTL on all cached data to prevent stale data and memory exhaustion)
(You MUST offload CPU-intensive work to Worker Threads - blocking the event loop degrades all requests)
</critical_requirements>
Detailed Resources:
Auto-detection: Redis, connection pool, query optimization, database index, N+1, caching, cache invalidation, prepared statement, worker threads, event loop, CPU-bound, latency, throughput, performance tuning
When to use:
When NOT to use:
Key patterns covered:
Backend performance optimization follows one core principle: measure first, optimize second. Premature optimization wastes development time and adds complexity without evidence of benefit.
The Three Pillars of Backend Performance:
When to optimize:
When NOT to optimize:
Connection pooling reuses database connections instead of creating new ones per request. A PostgreSQL handshake takes 20-30ms - pooling eliminates this overhead.
// Good Example - Proper connection pooling with node-postgres
import { Pool } from "pg";
const POOL_MAX_CONNECTIONS = 20;
const POOL_IDLE_TIMEOUT_MS = 30000;
const POOL_CONNECTION_TIMEOUT_MS = 5000;
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
max: POOL_MAX_CONNECTIONS,
idleTimeoutMillis: POOL_IDLE_TIMEOUT_MS,
connectionTimeoutMillis: POOL_CONNECTION_TIMEOUT_MS,
});
// Listen for pool errors (idle clients can still emit errors)
pool.on("error", (err) => {
console.error("Unexpected pool error:", err);
});
// For simple queries - auto-manages connection lifecycle
async function getUsers() {
const result = await pool.query("SELECT * FROM users WHERE active = $1", [
true,
]);
return result.rows;
}
// For transactions - manual checkout with guaranteed release
() {
client = pool.();
{
client.();
userResult = client.(
,
[userData., userData.],
);
client.(, [
userResult.[].,
profileData.,
]);
client.();
userResult.[];
} (error) {
client.();
error;
} {
client.();
}
}
() {
pool.();
}
{ pool, getUsers, createUserWithProfile, shutdown };
Why good: Named constants document configuration, pool.query() auto-manages simple queries, finally block guarantees connection release preventing pool exhaustion, error listener catches backend failures, graceful shutdown prevents connection leaks
// Bad Example - Connection leak and missing error handling
import { Pool } from "pg";
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
async function createUser(data) {
const client = await pool.connect();
await client.query("INSERT INTO users (name) VALUES ($1)", [data.name]);
// Missing client.release() - connection leaked!
// Missing error handling - transaction left open on failure
}
Why bad: Missing client.release() causes connection pool exhaustion, no try/catch means failed queries leave connections checked out forever, no transaction handling means partial writes possible
The N+1 problem occurs when fetching N records triggers N additional queries for related data. Use eager loading or batching instead.
// Good Example - Single query with eager loading (Drizzle)
import { db } from "./database";
import { and, eq, isNull } from "drizzle-orm";
async function getJobsWithCompanies() {
// Single SQL query fetches jobs + companies + locations
const jobs = await db.query.jobs.findMany({
where: and(eq(jobs.isActive, true), isNull(jobs.deletedAt)),
with: {
company: {
with: {
locations: true,
},
},
jobSkills: {
with: {
skill: true,
},
},
},
});
return jobs;
}
Why good: .with() generates a single SQL query with JOINs, eliminates N+1 problem entirely, fully typed result prevents runtime errors
// Bad Example - N+1 query anti-pattern
async function getJobsWithCompanies() {
const jobs = await db.query.jobs.findMany({
where: eq(jobs.isActive, true),
});
// N+1: One query per job to get company!
for (const job of jobs) {
job.company = await db.query.companies.findFirst({
where: eq(companies.id, job.companyId),
});
}
return jobs;
}
Why bad: 1 query for jobs + N queries for companies = N+1 total queries, latency grows linearly with data size, database gets hammered with many small queries
// Good Example - DataLoader for batching
import DataLoader from "dataloader";
// Create loader once per request (caches within request lifecycle)
function createCompanyLoader() {
return new DataLoader<string, Company>(async (companyIds) => {
// Single query for all requested companies
const companies = await db.query.companies.findMany({
where: inArray(companies.id, [...companyIds]),
});
// Return in same order as requested IDs
const companyMap = new Map(companies.map((c) => [c.id, c]));
return companyIds.map((id) => companyMap.get(id) ?? null);
});
}
// Usage in resolver or handler
async function resolveJob(job: Job, context: Context) {
// DataLoader batches all .load() calls in same tick
const company = context...(job.);
{ ...job, company };
}
Why good: DataLoader batches multiple .load() calls into single query, caches results within request preventing duplicate fetches, works with any data source (DB, API, etc.)
Indexes speed up queries by avoiding full table scans. Index columns used in WHERE, JOIN, and ORDER BY clauses.
// Good Example - Strategic indexes (Drizzle schema)
import {
pgTable,
uuid,
varchar,
timestamp,
boolean,
index,
} from "drizzle-orm/pg-core";
import { sql } from "drizzle-orm";
export const jobs = pgTable(
"jobs",
{
id: uuid("id").primaryKey().defaultRandom(),
companyId: uuid("company_id").notNull(),
title: varchar("title", { length: 255 }).notNull(),
country: varchar("country", { length: 100 }),
employmentType: varchar("employment_type", { length: 50 }),
isActive: boolean("is_active").default(true),
createdAt: timestamp("created_at").defaultNow(),
deletedAt: timestamp("deleted_at"),
},
(table) => ({
: ().(
table.,
table.,
),
: ()
.(table., table.)
.(sql),
: ().(table.),
: ().(table.),
}),
);
Why good: Composite index matches common query patterns (country + employmentType), partial index reduces index size by excluding deleted records, foreign key index speeds up JOINs, column order in composite index matches query filter order
Index Decision Framework:
| Column Usage | Index Type | When to Use |
|---|---|---|
| WHERE equality | B-tree (default) | High-selectivity columns |
| WHERE range (>, <, BETWEEN) | B-tree | Date ranges, numeric ranges |
| WHERE multiple columns | Composite | Queries always filter by same columns together |
| WHERE on subset | Partial | Most queries filter on active/non-deleted |
| Full-text search | GIN/GiST | Text search with LIKE, tsvector |
| JSON field access | GIN | JSONB column queries |
The following patterns are documented with full examples in examples/:
<critical_reminders>
All code must follow project conventions in CLAUDE.md
(You MUST always release database connections back to the pool using finally blocks)
(You MUST use .with() or eager loading to prevent N+1 queries - never lazy load in loops)
(You MUST set TTL on all cached data to prevent stale data and memory exhaustion)
(You MUST offload CPU-intensive work to Worker Threads - blocking the event loop degrades all requests)
Failure to follow these rules will cause connection pool exhaustion, N+1 performance degradation, memory leaks from unbounded caches, and blocked event loops affecting all concurrent requests.
</critical_reminders>