发现优质的 AI Agent 技能
聚合 Claude Skills、LangChain、AutoGPT 等优质资源,助力开发者快速构建智能应用
SQL
Master relational databases from the command line. Covers SQLite, PostgreSQL, MySQL, and SQL Server with battle-tested patterns for schema design, querying, migrations, and operations.
Calendar Database Schema
Calendar-like workflows work best when the target database has these verified fields:
Network Fundamentals
- TCP guarantees delivery with retransmission — use for reliability (HTTP, SSH, databases) - UDP is fire-and-forget — use for speed when loss is acceptable (video, gaming, DNS queries) - Port numbers: 0-1023 privileged (need root), 1024-65535 available — common services have well-known ports - Ephemeral ports for client connections — OS assigns randomly from high range
FastAPI Patterns
- Mixing sync database drivers (psycopg2, PyMySQL) in async endpoints blocks the event loop — use async drivers (asyncpg, aiomysql) or run sync code in `run_in_executor` - `time.sleep()` in async endpoints blocks everything — use `await asyncio.sleep()` instead - CPU-bound work in async endpoints starves other requests — offload to `ProcessPoolExecutor` or background workers - Async endpoints calling sync functions that do I/O still block — the entire call chain must be async
Async Traps
- ORM is sync-only — `await Model.objects.get()` raises SynchronousOnlyOperation - `sync_to_async` for ORM — `await sync_to_async(Model.objects.get)(pk=1)` - `sync_to_async` default not thread-safe — use `thread_sensitive=True` for ORM - Async view with sync middleware — entire request becomes sync - `database_sync_to_async` in Channels — wrapper for ORM in consumers
Deployment Rules
- Tests passing in CI — never deploy with failing tests - Environment variables set in target — missing secrets cause silent failures - Database migrations run before code deploy — new code expecting new schema fails - Rollback plan ready — know exactly how to revert before you need to
Database Gotchas
- Connection pools exhausted = app hangs silently — set max connections, monitor pool usage - Each Lambda/serverless invocation may open new connection — use connection pooling proxy (RDS Proxy, PgBouncer) - Connections left open block schema changes — `ALTER TABLE` waits for all transactions - Idle connections consume memory — set connection timeout, kill idle connections
Reusable Templates
Use these templates when preparing high-impact database changes.
Setup - Database Manager
Use this file on first activation or whenever `~/database-manager/` is missing key files.
Memory Template - Database Manager
Create `~/database-manager/memory.md` with this structure: