vuralserhat86/antigravity-agentic-skills/backend-database

Claude Code and agent skill by vuralserhat86/antigravity-agentic-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Repository pattern, transactions, caching ve query optimization.

Install

npx vskill@latest install vuralserhat86/antigravity-agentic-skills/backend-database

SKILL.md

The same SKILL.md was published earlier as vuralserhat86/antigravity-agentic-skills/backend-database.

🗄️ Backend Database

Database patterns, caching ve performance optimization.

📋 1. Repository Pattern

typescript
interface IUserRepository {
findById(id: string): Promise<User | null>;
findByEmail(email: string): Promise<User | null>;
create(data: CreateUserDto): Promise<User>;
update(id: string, data: UpdateUserDto): Promise<User>;
delete(id: string): Promise<void>;
}
class UserRepository implements IUserRepository {
constructor(private prisma: PrismaClient) {}
async findById(id: string) {
return this.prisma.user.findUnique({ where: { id } });
}
}

🔄 2. Transactions

typescript
async function transferMoney(fromId, toId, amount) {
return prisma.$transaction(async (tx) => {
const from = await tx.account.update({
where: { id: fromId },
data: { balance: { decrement: amount } },
});
if (from.balance < 0) throw new Error('Insufficient funds');
await tx.account.update({
where: { id: toId },
data: { balance: { increment: amount } },
});
});
}

⚡ 3. Caching (Redis)

typescript
async function getCachedUser(id: string) {
const cacheKey = `user:${id}`;
const cached = await redis.get(cacheKey);
if (cached) return JSON.parse(cached);
const user = await userRepository.findById(id);
if (user) {
await redis.set(cacheKey, JSON.stringify(user), 'EX', 3600);
}
return user;
}

🔍 4. Query Optimization

typescript
// ❌ N+1 problem
const users = await prisma.user.findMany();
for (const user of users) {
await prisma.post.findMany({ where: { authorId: user.id } });
}
// ✅ Include ile tek sorgu
const users = await prisma.user.findMany({
include: { posts: true },
});
// ✅ Select ile sadece gerekli alanlar
const users = await prisma.user.findMany({
select: { id: true, name: true, email: true },
});

⏱️ 5. Async Best Practices

typescript
// ❌ Sequential
const user = await getUser(id);
const orders = await getOrders(id);
// ✅ Parallel
const [user, orders] = await Promise.all([
getUser(id),
getOrders(id),
]);

🔗 İlgili Skill'ler

  • backend-core - Yapı, TypeScript
  • backend-api - Endpoints, response

  • backend-api - Endpoints, response

Backend Database v1.2 - Verified

🔄 Workflow

Aşama 1: Schema & Migration
  • [ ] Design: ER diyagramını çiz ve normalize et.
  • [ ] Migration Tool: Drizzle Kit, Prisma Migrate veya TypeORM ile versiyonlu migration yapısı kur.
  • [ ] Seed: Test ve geliştirme için idempotent seed scriptleri yaz.
Aşama 2: Access Layer (Repository Pattern)
  • [ ] Abstraction: Veritabanı sorgularını Controller'dan ayır (Repo/DAO).
  • [ ] Injection: DB instance'ını dependency injection ile servislere ver.
  • [ ] Transactions: Kritik işlemleri (Para transferi vb.) transaction bloğuna al.
Aşama 3: Optimization & Safety
  • [ ] Indices: Yavaş sorguları EXPLAIN ile analiz et ve index ekle.
  • [ ] Connection Pooling: Prod ortamında pool size ayarlarını yap.
  • [ ] Sanitization: SQL Injection koruması (ORM kullan veya parametreli sorgu yap).
Kontrol Noktaları
AşamaDoğrulama
1Migration dosyaları Git'e commit edilmiş mi?
2N+1 sorgu problemi var mı? (Loop içinde query)
3DB şifresi kodun içinde hardcoded mı? (Asla olmamalı)

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
42
Repository forks
12
7-day trend score
19

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 15 Apr 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/vuralserhat86/antigravity-agentic-skills/backend-database/badge)](https://verified-skill.com/skills/vuralserhat86/antigravity-agentic-skills/backend-database)

Something wrong with this skill or its page? Tell us.