Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Review

ASecurity

Comprehensive PostgreSQL schema analysis to identify optimization opportunities

8 stars
0 votes
0 copies
0 views
Added 9/20/2026
databasesbashsqldockertestingdatabaseperformance

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add tstapler/dotfiles --skill review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Review?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tstapler-review-dotfiles/badge)](https://www.skillsdirectory.com/skills/tstapler-review-dotfiles)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
description: Comprehensive PostgreSQL schema analysis to identify optimization opportunities
---

# Database Schema Review and Optimization Analysis

This command uses the `postgres-optimizer` and `project-coordinator` agents to perform a comprehensive database schema review.

## Agent Delegation

### Phase 1: Schema Analysis with postgres-optimizer

```
@task postgres-optimizer

Perform comprehensive PostgreSQL schema analysis for the engineering-score-cards project.

**Database Connection** (from docker-compose.yml):
- Host: localhost:5432
- Database: scorecardsdb
- User: scorecardsuser
- Password: scorecardspass

**Analysis Tasks**:

1. **Discovery & Inventory**:
   - List all tables with sizes, row counts, and index information
   - Identify unused indexes (idx_scan = 0)
   - Find missing indexes on foreign keys
   - Analyze table bloat and dead tuple percentages
   - Gather cardinality statistics for all tables

2. **Per-Table Optimization Analysis**:
   - Review normalization appropriateness for access patterns
   - Identify unused or redundant indexes
   - Recommend missing indexes based on query patterns
   - Evaluate partitioning opportunities for large tables
   - Assess column type efficiency
   - Check for partial index or covering index opportunities
   - Verify VACUUM effectiveness

3. **Query Performance Review**:
   - Identify slow queries from pg_stat_statements
   - Run EXPLAIN ANALYZE on top queries
   - Check for cardinality estimation errors
   - Verify optimal index usage
   - Evaluate join strategies
   - Identify sequential scans that should be index scans

4. **Anti-Pattern Detection**:
   - N+1 query patterns
   - Missing composite indexes
   - Over-indexing (redundant indexes)
   - Under-indexing (missing FK indexes)
   - Inappropriate data types
   - Lack of partitioning on time-series data

5. **Data Lifecycle Review**:
   - Assess partitioning needs for growing tables
   - Review archival/cleanup strategies
   - Verify VACUUM effectiveness for write patterns
   - Recommend TTL strategies where appropriate

**Deliverables**:
- Database inventory report with statistics
- Per-table optimization recommendations (P0-P3 priority)
- Unused index report with removal recommendations
- Missing index report with implementation SQL
- Query performance analysis with optimization suggestions
- Expected performance impact estimates
- Implementation complexity assessment
```

### Phase 2: Task Organization with project-coordinator

After the postgres-optimizer agent completes its analysis:

```
@task project-coordinator

Organize database optimization findings into actionable ATOMIC tasks.

**Context**:
Completed comprehensive schema review identifying [N] optimization opportunities across indexes, normalization, partitioning, and query performance.

**Input from postgres-optimizer**:
[Paste the findings summary with priorities]

**Constraints**:
- Zero-downtime migrations preferred
- Must maintain read consistency during changes
- Backup before any DDL changes
- Each task should be 1-4 hours of focused work
- Use `CREATE INDEX CONCURRENTLY` for production

**Request**:
1. Create `docs/tasks/database-optimization.md` using Implementation Plan format
2. Break down optimizations into atomic tasks (1-4 hours each):
   - Specific tables/indexes to modify
   - Clear success criteria
   - Testing requirements
   - Rollback plans
3. Identify task dependencies (e.g., must create index before dropping old one)
4. Recommend next action to start with (prioritize high-impact quick wins)
5. Provide progress tracking structure

**Output**: Structured task document with Epic → Story → Task breakdown, dependency visualization, and clear next action recommendation.
```

## Safety Reminders

- ⚠️ Always backup before DDL changes
- ⚠️ Test migrations on staging first
- ⚠️ Use `CREATE INDEX CONCURRENTLY` for zero-downtime
- ⚠️ Monitor query performance after changes
- ⚠️ Have rollback plans for all schema changes
- ⚠️ Consider resetting pg_stat_statements after baseline measurements

## Usage

```bash
# Run complete schema review
/db:review
```

The command will automatically invoke both agents in sequence, producing a comprehensive analysis and actionable task breakdown.

Attribution

tstaplertstapler
View sourceMore from tstapler →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Mysql Best Practices

MySQL development best practices for schema design, query optimization, and database administration

2481 votes

Clickhouse Io

ClickHouse数据库模式、查询优化、分析和数据工程最佳实践,适用于高性能分析工作负载。

2456590 votes

Jpa Patterns

Spring Boot中的JPA/Hibernate实体设计、关系、查询优化、事务、审计、索引、分页和连接池模式。

2456590 votes

Postgres Patterns

基于Supabase最佳实践的PostgreSQL数据库模式,用于查询优化、架构设计、索引和安全。

2456590 votes

V3 Memory Unification

Unify 6+ memory systems into AgentDB with HNSW indexing for 150x-12,500x search improvements. Implements ADR-006 (Unified Memory Service) and ADR-009 (Hybrid Memory Backend).

701370 votes
View all in databases →