基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/deathrashed/agents --skill db命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Control the in-app Browser for opening, navigating, inspecting visible or interactive page state, clicking, typing, screenshots, and local web testing. It can have existing signed-in sessions. For semantic operations on linked resources, prefer a purpose-built connector, API, or CLI when available.
Control the user's Chrome browser for tasks that depend on existing Chrome state: tabs, logged-in sessions, or extensions. Prefer purpose-built connectors, APIs, or CLIs when available.
Control local Mac apps through Computer Use for tasks that require reading or operating app UI. Prefer purpose-built connectors, APIs, or CLIs when available.
| name | db |
| description | Database admin with health check and optimization (Database Admin Agent) |
Database task:
Task: {{args}}
| Mode | Trigger | Output |
|---|---|---|
| QUERY | "query", "sql" | Optimized SQL + EXPLAIN |
| SCHEMA | "schema", "design" | DDL + indexes + constraints |
| OPTIMIZE | "slow", "optimize" | Index strategy, query rewrite |
| HEALTH | "health", "check" | Full diagnostic report |
| BACKUP | "backup", "recovery" | PITR, WAL, restore |
| POOL | "connection", "pool" | PgBouncer, pooling config |
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)
SELECT ...
| Metric | Before | After | Improvement |
|---|---|---|---|
| Execution | 45s | 0.8s | 98% faster |
| Rows scanned | 10M | 1K | Index usage |
| Buffer hits | 20% | 95% | Cache improved |
-- Missing index detected
CREATE INDEX CONCURRENTLY idx_orders_created_at
ON orders(created_at);
-- Covering index for query
CREATE INDEX idx_users_orders
ON users(id) INCLUDE (name, email);
SELECT count(*), state
FROM pg_stat_activity
GROUP BY state;
| State | Count | Status |
|---|---|---|
| Active | 20 | ✅ |
| Idle | 75 | ⚠️ High |
| Idle in transaction | 5 | ⚠️ |
| Query | Avg Time | Calls |
|---|---|---|
| SELECT... | 4.2s | 1200/day |
orders.user_id - No index!users.email - Frequent WHERE| Table | Size | Bloat | Action |
|---|---|---|---|
| orders | 10GB | 30% | VACUUM |
[databases]
mydb = host=localhost port=5432 dbname=mydb
[pgbouncer]
pool_mode = transaction
max_client_conn = 1000
default_pool_size = 20
reserve_pool_size = 5
// Prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
connection_limit = 10
}
#!/bin/bash
pg_dump -Fc mydb > backup_$(date +%Y%m%d).dump
aws s3 cp backup_*.dump s3://backups/postgres/
# postgresql.conf
archive_mode = on
archive_command = 'aws s3 cp %p s3://wal-archive/%f'
# 1. Stop app
# 2. Restore base backup
pg_restore -d mydb backup.dump
# 3. Replay WAL to point-in-time
recovery_target_time = '2024-01-15 14:30:00'
CREATE TABLE orders (
id SERIAL,
created_at TIMESTAMP,
...
) PARTITION BY RANGE (created_at);
CREATE TABLE orders_2024_q1 PARTITION OF orders
FOR VALUES FROM ('2024-01-01') TO ('2024-04-01');
-- Store product_name in order_items for history
-- Even if products.name changes, order history intact
| Optimization | Expected |
|---|---|
| Query speed | 90-98% faster |
| Index creation | 15-20 min/1M rows |
| Health check savings | $4K/month typical |
| Cache hit ratio | >99% target |
Key Takeaway: Turn 45s queries into 0.8s. Design production-ready schemas. Get actionable health reports.