AGENT SKILL

ck:databases

Design schemas, write queries for MongoDB and PostgreSQL. Use for database design, SQL/NoSQL queries, aggregation pipelines, indexes, migrations, replication, performance optimization, psql CLI.

适用职业设计师
License 许可
MIT
最近更新
2026-05-13
Stars
★ 0
Forks
0

01 前言 Front Matter

name
ck:databases
license
MIT
metadata
{ "author": "claudekit", "version": "1.0.0" }
description
Design schemas, write queries for MongoDB and PostgreSQL. Use for database design, SQL/NoSQL queries, aggregation pipelines, indexes, migrations, replication, performance optimization, psql CLI.
argument-hint
[query or schema task]

02 资源文件 27

03 SKILL.md 正文

Databases Skill

Unified guide for working with MongoDB (document-oriented) and PostgreSQL (relational) databases. Choose the right database for your use case and master both systems.

When to Use This Skill

Use when:

  • Designing database schemas and data models
  • Writing queries (SQL or MongoDB query language)
  • Building aggregation pipelines or complex joins
  • Optimizing indexes and query performance
  • Implementing database migrations
  • Setting up replication, sharding, or clustering
  • Configuring backups and disaster recovery
  • Managing database users and permissions
  • Analyzing slow queries and performance issues
  • Administering production database deployments

Reference Navigation

Database Design

  • db-design.md - Activate when user requests: Database/table design for transactional (OLTP), analytics (OLAP), create or extend schema, design fact/dimension tables, analyze/review CSV/JSON/SQL files to create tables, or need advice on data storage structure.

MongoDB References

PostgreSQL References

Python Utilities

Database utility scripts in scripts/:

  • db_migrate.py - Generate and apply migrations for both databases (MongoDB and PostgreSQL)
  • db_backup.py - Backup and restore MongoDB and PostgreSQL
  • db_performance_check.py - Analyze slow queries and recommend indexes
# Generate migration
python scripts/db_migrate.py --db mongodb --generate "add_user_index"

# Run backup
python scripts/db_backup.py --db postgres --output /backups/

# Check performance
python scripts/db_performance_check.py --db mongodb --threshold 100ms

Best Practices

MongoDB:

  • Use embedded documents for 1-to-few relationships
  • Reference documents for 1-to-many or many-to-many
  • Index frequently queried fields
  • Use aggregation pipeline for complex transformations
  • Enable authentication and TLS in production
  • Use Atlas for managed hosting

PostgreSQL:

  • Normalize schema to 3NF, denormalize for performance
  • Use foreign keys for referential integrity
  • Index foreign keys and frequently filtered columns
  • Use EXPLAIN ANALYZE to optimize queries
  • Regular VACUUM and ANALYZE maintenance
  • Connection pooling (pgBouncer) for web apps

Resources

04 同仓库更多 Skills

datnguyense1104
datnguyense1104/hom-nay-an-gi

ck:web-testing

Web testing with Playwright, Vitest, k6. E2E/unit/integration/load/security/visual/a11y testing. Use for test automation, flakiness, Core Web Vitals, mobile gestures, cross-browser.

测试与质量
★ 0
datnguyense1104
datnguyense1104/hom-nay-an-gi

ck:web-frameworks

Build with Next.js (App Router, RSC, SSR, ISR), Turborepo monorepos. Use for React apps, server rendering, build optimization, caching strategies, shared dependencies.

★ 0
datnguyense1104
datnguyense1104/hom-nay-an-gi

ck:ui-styling

Style UIs with shadcn/ui components (Radix UI + Tailwind CSS). Use for accessible components, themes, dark mode, responsive layouts, design systems, color customization.

设计师视觉设计
★ 0
datnguyense1104
datnguyense1104/hom-nay-an-gi

ck:threejs

Build 3D web apps with Three.js (WebGL/WebGPU). 556 searchable examples, 60 API classes, 20 use cases. Actions: create 3D scene, load model, add animation, implement physics, build VR/XR. Topics: GLTF loader, PBR materials, particle effects, shadows, post-processing, compute shaders, TSL. Integrations: WebGPU, physics engines, spatial audio.

后端与接口
★ 0
datnguyense1104
datnguyense1104/hom-nay-an-gi

ck:stitch

AI design generation with Google Stitch. Generate UI designs from text prompts, export Tailwind/HTML/DESIGN.md, orchestrate design-to-code pipeline. Use for rapid prototyping, UI generation, design exploration.

开发工程师设计师视觉设计Skill与智能体开发
★ 0
datnguyense1104
datnguyense1104/hom-nay-an-gi

ck:skill-creator

Create or update Claude skills with eval-driven iteration. Use for new skills, skill scripts, references, benchmark optimization, description optimization, eval testing, extending Claude's capabilities.

测试与质量Skill与智能体开发
★ 0