Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@
"name": "database-data-management",
"source": "plugins/database-data-management",
"description": "Database administration, SQL optimization, and data management tools for PostgreSQL, SQL Server, and general database development best practices.",
"version": "1.0.0"
"version": "1.0.1"
},
{
"name": "datadog",
Expand Down
2 changes: 1 addition & 1 deletion plugins/database-data-management/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "database-data-management",
"description": "Database administration, SQL optimization, and data management tools for PostgreSQL, SQL Server, and general database development best practices.",
"version": "1.0.0",
"version": "1.0.1",
"author": {
"name": "Awesome Copilot Community"
},
Expand Down
21 changes: 12 additions & 9 deletions skills/postgresql-optimization/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: 'PostgreSQL-specific development assistant focusing on unique Postg

Expert PostgreSQL guidance for ${selection} (or entire project if no selection). Focus on PostgreSQL-specific features, optimization patterns, and advanced capabilities.

## � PostgreSQL-Specific Features
## PostgreSQL-Specific Features

### JSONB Operations
```sql
Expand Down Expand Up @@ -94,11 +94,13 @@ WHERE search_vector @@ plainto_tsquery('postgresql')
ORDER BY rank DESC;
```

## � PostgreSQL Performance Tuning
## PostgreSQL Performance Tuning

### Query Optimization
```sql
-- EXPLAIN ANALYZE for performance analysis
-- Note: ANALYZE actually executes the statement. For INSERT/UPDATE/DELETE,
-- run it inside BEGIN ... ROLLBACK so the changes are not kept.
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)
SELECT u.name, COUNT(o.id) as order_count
FROM users u
Expand All @@ -107,10 +109,11 @@ WHERE u.created_at > '2024-01-01'::date
GROUP BY u.id, u.name;

-- Identify slow queries from pg_stat_statements
SELECT query, calls, total_time, mean_time, rows,
-- (PostgreSQL 13+; on 12 and earlier the columns are total_time and mean_time)
SELECT query, calls, total_exec_time, mean_exec_time, rows,
100.0 * shared_blks_hit / nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
FROM pg_stat_statements
ORDER BY total_time DESC
ORDER BY total_exec_time DESC
LIMIT 10;
```

Expand Down Expand Up @@ -142,7 +145,7 @@ FROM pg_settings
WHERE name IN ('shared_buffers', 'work_mem', 'maintenance_work_mem');
```

## �️ PostgreSQL Advanced Data Types
## PostgreSQL Advanced Data Types

### Custom Types & Domains
```sql
Expand Down Expand Up @@ -243,7 +246,7 @@ WHERE idx_scan = 0; -- Unused indexes
```

### PostgreSQL-Specific Optimization Tips
- **Use EXPLAIN (ANALYZE, BUFFERS)** for detailed query analysis
- **Use EXPLAIN (ANALYZE, BUFFERS)** for detailed query analysis (it executes the statement, so wrap INSERT/UPDATE/DELETE in a transaction and roll back)
- **Configure postgresql.conf** for your workload (OLTP vs OLAP)
- **Use connection pooling** (pgbouncer) for high-concurrency applications
- **Regular VACUUM and ANALYZE** for optimal performance
Expand All @@ -254,10 +257,10 @@ WHERE idx_scan = 0; -- Unused indexes

### Query Performance Monitoring
```sql
-- Identify slow queries
SELECT query, calls, total_time, mean_time, rows
-- Identify slow queries (PostgreSQL 13+; use total_time and mean_time on 12 and earlier)
SELECT query, calls, total_exec_time, mean_exec_time, rows
FROM pg_stat_statements
ORDER BY total_time DESC
ORDER BY total_exec_time DESC
LIMIT 10;

-- Check index usage
Expand Down
22 changes: 4 additions & 18 deletions skills/prompt-optimizer/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,13 @@ Either way: no brackets, no fill-in-the-blank, no template syntax. The prompt is

A single fenced code block containing the optimized prompt. Nothing else. No preamble like "Here's your prompt:". No trailing explanation of what you changed.

The prompt should end with a closing instruction that signals depth of reasoning. Choose one that matches your target model:
The prompt should end with this closing line, which signals depth of reasoning:

For models with reasoning capabilities (like Claude with extended thinking):
```
Think before answering (maximum reasoning)
```

For general-purpose LLM models:
```
Take time to think through this carefully before responding.
Think before answering (take time to reason through this carefully).
```

This signals to the LLM model that a thorough, reasoned approach is needed. The exact wording can be adapted to fit your model's strengths.
This signals to the LLM model that a thorough, reasoned approach is needed. The wording can be adapted to the language of the prompt.

## Why these principles work

Expand Down Expand Up @@ -121,15 +115,7 @@ These are sharp tools for specific task types. Apply only when relevant.

## Output format

Always exactly this:

````
```
You are helping with the user's request. If the request is missing essential information, ask a concise clarifying question first. Otherwise, complete the task directly and clearly.

Think before answering (take time to reason through this carefully).
```
````
Always a single fenced code block containing the finished prompt: the content, structure, and length come from the rewrite workflow and the two hard rules above (see the examples below), and the prompt ends with the closing line from "What you output".

No text before the code block. No text after. No "here you go." No "I added X and Y." Just the prompt.

Expand Down
Loading