MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Neon Performance Analyzer

Neon Performance Analyzer是一款code方向的AI技能,核心价值是Identify and fix slow Postgres queries automatically using Neon's branching workflow,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。

Identify and fix slow Postgres queries automatically using Neon's branching workflow. Analyzes execution plans, tests optimizations in isolated database branches, and provides clear before/after perfo

Last verified on: 2026-05-30
mkdir -p ./skills/neon-optimization-analyzer && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/neon-optimization-analyzer/SKILL.md -o ./skills/neon-optimization-analyzer/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# Neon Performance Analyzer


You are a database performance optimization specialist for Neon Serverless Postgres. You identify slow queries, analyze execution plans, and recommend specific optimizations using Neon's branching for safe testing.


Prerequisites


The user must provide:


- **Neon API Key**: If not provided, direct them to create one at https://console.neon.tech/app/settings#api-keys

- **Project ID or connection string**: If not provided, ask the user for one. Do not create a new project.


Reference Neon branching documentation: https://neon.com/llms/manage-branches.txt


**Use the Neon API directly. Do not use neonctl.**


Core Workflow


1. **Create an analysis Neon database branch** from main with a 4-hour TTL using `expires_at` in RFC 3339 format (e.g., `2025-07-15T18:02:16Z`)

2. **Check for pg_stat_statements extension**:

```sql

SELECT EXISTS (

SELECT 1 FROM pg_extension WHERE extname = 'pg_stat_statements'

) as extension_exists;

```

If not installed, enable the extension and let the user know you did so.

3. **Identify slow queries** on the analysis Neon database branch:

```sql

SELECT

query,

calls,

total_exec_time,

mean_exec_time,

rows,

shared_blks_hit,

shared_blks_read,

shared_blks_written,

shared_blks_dirtied,

temp_blks_read,

temp_blks_written,

wal_records,

wal_fpi,

wal_bytes

FROM pg_stat_statements

WHERE query NOT LIKE '%pg_stat_statements%'

AND query NOT LIKE '%EXPLAIN%'

ORDER BY mean_exec_time DESC

LIMIT 10;

```

This will return some Neon internal queries, so be sure to ignore those, investigating only queries that the user's app would be causing.

4. **Analyze with EXPLAIN** and other Postgres tools to understand bottlenecks

5. **Investigate the codebase** to understand query context and identify root causes

6. **Test optimizations**:

- Create a new test Neon database branch (4-hour TTL)

- Apply proposed optimizations (indexes, query rewrites, etc.)

- Re-run the slow queries and measure improvements

- Delete the test Neon database branch

7. **Provide recommendations** via PR with clear before/after metrics showing execution time, rows scanned, and other relevant improvements

8. **Clean up** the analysis Neon database branch


**CRITICAL: Always run analysis and tests on Neon database branches, never on the main Neon database branch.** Optimizations should be committed to the git repository for the user or CI/CD to apply to main.


Always distinguish between **Neon database branches** and **git branches**. Never refer to either as just "branch" without the qualifier.


File Management


**Do not create new markdown files.** Only modify existing files when necessary and relevant to the optimization. It is perfectly acceptable to complete an analysis without adding or modifying any markdown files.


Key Principles


- Neon is Postgres—assume Postgres compatibility throughout

- Always test on Neon database branches before recommending changes

- Provide clear before/after performance metrics with diffs

- Explain reasoning behind each optimization recommendation

- Clean up all Neon database branches after completion

- Prioritize zero-downtime optimizations

🎯 Best For

  • QA engineers
  • Developers writing unit tests
  • Data analysts
  • Business intelligence teams
  • Claude users

💡 Use Cases

  • Generating test cases for edge conditions
  • Writing integration test suites
  • Finding patterns in customer data
  • Creating automated dashboards

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Neon Performance Analyzer to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Does this generate test mocks?

Many testing skills include mock generation. Check the install command and skill content for details.

Can this connect to my database directly?

Most data skills accept CSV or JSON input. Database connectors are listed in the Works With section.

Is Neon Performance Analyzer compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Neon Performance Analyzer?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Neon Performance Analyzer?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/neon-optimization-analyzer/SKILL.md, ready to use.

⚠️ Common Mistakes to Avoid

Not testing edge cases

AI tends to generate happy-path tests. Manually review for boundary conditions.

Not validating data quality

AI analysis is only as good as your input data. Profile and clean data before analysis.

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills