database-optimizer
An agent skill by Jeffallan, from Jeffallan/claude-skills. Tags: analytics, api, database, debugging, performance, strategy.
What it does
Optimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.
Install
With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:
npx skills add Jeffallan/claude-skills --skill database-optimizer
Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):
git clone --depth 1 https://github.com/Jeffallan/claude-skills
cp -r claude-skills/skills/database-optimizer ~/.claude/skills/database-optimizer
Safety box score
Grade C, moderate risk: 28 of 100 risk points, rated 2026-09-25. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.
This skill is documentation-only guidance for PostgreSQL and MySQL performance tuning, but it recommends running real SQL/admin commands and changing live server settings. The main risks are high-impact database maintenance actions, durability tradeoffs, and touching OS-level log/config paths outside the project.
| Category | Level | Why |
|---|---|---|
| Code & shell execution | 1 (low) | It includes many runnable SQL statements such as `EXPLAIN (ANALYZE, BUFFERS)`, `CREATE INDEX CONCURRENTLY`, and `ALTER SYSTEM SET ...`, but no native scripts or shell tooling. |
| Network access | 0 (none) | No code downloads, remote API calls, or data exfiltration paths are present; the only remote item is a documentation link. |
| Filesystem reach | 2 (moderate) | It reaches outside the repo to OS paths like `'/var/log/mysql/slow-query.log'` and refers to server config files such as `postgresql.conf` and `my.cnf`. |
| Secrets & credentials | 0 (none) | The files do not request passwords, tokens, `.env` files, browser sessions, or other secret stores. |
| Privilege & persistence | 2 (moderate) | The guidance uses privileged DB/server operations like `ALTER SYSTEM SET ...`, `SET GLOBAL ...`, and config-file changes that typically require database admin access. |
| Instruction hijack surface | 0 (none) | There is no instruction to ignore higher-priority rules, fetch and follow remote prompts, or hide behavior from the user. |
| Irreversible actions | 2 (moderate) | It directs the agent to apply live optimizations and includes potentially destructive maintenance actions like `VACUUM FULL`, `DROP PARTITION`, and `REPAIR TABLE`. |
| Transparency | 0 (none) | All shipped content is readable markdown; there are no binaries, base64 blobs, or dynamically decoded payloads. |
Before installing
- Read `references/mysql-tuning.md` and `references/postgresql-tuning.md` for absolute paths and irreversible commands like `DROP PARTITION` and `VACUUM FULL`.
- Test it only on a staging or scratch database first; confirm you are comfortable granting admin-level DB access.
- Verify whether your environment allows writes to host log paths such as `/var/log/mysql/slow-query.log`.
Rated 2026-09-25 by an automated review of 6 files from the skill's repository.
Source
- Repository
- Jeffallan/claude-skills (all skills from this repository)
- Path
- skills/database-optimizer/SKILL.md
- Branch
- main
- Updated
- 2026-09-19
Related skills
- postgres-pro — Use when optimizing PostgreSQL queries, configuring replication, or implementing advanced database features.
- sql-pro — Optimizes SQL queries, designs database schemas, and troubleshoots performance issues.
- eas-observe — EAS service (paid). Use for anything related to EAS Observe - adding `expo-observe` to an Expo project (AppMetricsRoot/ObserveRoot HOC.
- redshift-guide — Amazon Redshift is NOT PostgreSQL — corrects PostgreSQL-derived LLM mistakes; covers Redshift-specific SQL, DDL, COPY/UNLOAD, system views, metadata discovery.
- django-expert — Use when building Django web applications or REST APIs with Django REST Framework.
- java-architect — Use when building, configuring, or debugging enterprise Java applications with Spring Boot 3.x, microservices.