fix-slow-queries
Skill by paperclipai
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Install fix-slow-queries
Built from the published package, never by AI.
git clone --depth 1 https://github.com/paperclipai/paperclip /tmp/paperclip && mkdir -p ~/.claude/skills && cp -r /tmp/paperclip/.agents/skills/fix-slow-queries ~/.claude/skills/fix-slow-queriesRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/paperclipai/paperclip /tmp/paperclip && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/paperclip/.agents/skills/fix-slow-queries ~/.gemini/antigravity-cli/skills/fix-slow-queriesAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The fix-slow-queries skill guides an AI assistant through diagnosing and fixing slow PostgreSQL queries in Paperclip. It starts from hosted workspace evidence, such as query statistics from Cloud and Neon, and ranks the top query families by cost. It then reproduces the baseline on a disposable local PostgreSQL database with synthetic data, and checks that the fix is faster and returns the same results.
The skill also requires regression tests, a pull request using the full template, and checks that pass on the final commit. It avoids migrations and boot-time DDL unless there is a serious reason, and flags slow migrations for human review. It is aimed at engineers working on Paperclip or the private paperclip-cloud control plane. It does not grant permission to comment, close, merge, deploy, or change a hosted database.
Written from the project's SKILL.md and checked against it.
What it can do
- Find the actual databaseFollows the chain from Paperclip Cloud fleet admin to the Neon project, branch, endpoint, and database.
- Rank query costRanks expensive individual calls and frequent work using query statistics and wait evidence.
- Trace callersTraces the route or scheduler, service, generated SQL, and indexes for each candidate query.
- Reproduce the baseline locallyBuilds a disposable real PostgreSQL fixture and captures EXPLAIN ANALYZE BUFFERS output.
- Compare performance and resultsRuns baseline and fix under the same settings and compares every returned column and behavior.
- Verify the blast radiusChooses regression tests from the caller graph and affected contracts.
- Prepare and carry a PRCreates a pull request with full evidence and follows checks and reviews on each head SHA.
- Hand off evidenceReports PR URLs, measured gains, correctness results, and limitations.
What you need
- Access to Paperclip Cloud and the Neon project for query statistics
- A local PostgreSQL instance for disposable benchmarks
- A local checkout of the owning repository with its AGENTS.md
- Access to create branches and pull requests
Try asking
- Diagnose the costliest query families in this Paperclip workspace's Neon database
- Reproduce the baseline for this slow query locally and time a fix
- Prepare a PR with regression tests and before and after timings
Good to know
- Migrations are avoided unless there is a serious reason, and slow ones need human review.
- Production latency gains stay unverified until a rollout is authorized and measured.
- The skill does not itself grant permission to comment, close, merge, deploy, or resize a hosted database.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/fix-slow-queries/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md11 KB -
agents/openai.yaml128 B -
references/cloud-discovery.md7 KB -
references/local-proof.md11 KB
Alternatives to fix-slow-queries
All alternatives →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Provides a PostgreSQL table design reference covering data types, indexing, constraints, partitioning and performance patterns. Built for developers who design or review PostgreSQL schemas.
Compare with hugging-face-datasets, db-repair or alloydb-basics
fix-slow-queries: common questions
What must pass before a query fix is considered done?
The source requires a reproducible baseline, a faster treatment, output and behavior proof, relevant regression coverage, and green checks on each final PR head.
Does the skill add migrations or startup scripts?
It says a solution should not require a migration script unless there is a serious reason, and it forbids boot-time DDL or recurring backfills to bypass that rule. Any migration must be timed on a production-size clone.
Can the skill deploy changes or modify a hosted database?
No. The source states that the skill does not itself grant permission to comment, close, merge, deploy, resize, or mutate a hosted database.
How do I install fix-slow-queries?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is fix-slow-queries free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is fix-slow-queries safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to fix-slow-queries?
Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.
