paperclip: Skill for Codex

.agents/skills/fix-slow-queries/SKILL.md

fix-slow-queries is a skill for Codex from paperclipai/paperclip. It costs 58 tokens per session (2,300 once invoked), scanned A, original, MIT.

A workflow for finding and speeding up slow PostgreSQL database queries, while checking that their results and behavior remain correct.

In plain words
What is it for?
Investigating expensive or repeated SQL work, reproducing slow requests, comparing query performance, adding regression coverage, and opening a pull request.
Why use it?
It replaces guesswork with a measured comparison between the current query and the proposed change, including regression tests and reviewable code changes.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: installed under .agents/ (shared by several agents); mentions AGENTS.md.

This is paperclipai/paperclip's own configuration. It tells Codex how to work on paperclip itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything paperclip configures →

About the project

Paperclip is a Node.js server and React application for coordinating AI agents as a business team, with goals, organizational roles, budgets, governance, and work tracking in one interface. It is used by people managing multiple agents or autonomous agent organizations across tools such as OpenClaw, Claude Code, Codex, and Cursor. The catalogue includes skills, agents, an MCP add-on, and an instruction for working with Paperclip.

paperclipai/paperclip · 107,044 stars · on GitHub · paperclip.ing

Reuse

Borrowing it

Nothing to install: this file belongs to paperclipai/paperclip. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/paperclipai/paperclip/master/.agents/skills/fix-slow-queries/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/paperclipai/paperclip

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fix-slow-queries

README.md
[![agentmods](https://agentmods.dev/badge/skills/paperclipai/paperclip/fix-slow-queries/github.svg)](https://agentmods.dev/skills/paperclipai/paperclip/fix-slow-queries)
Your own site
<a href="https://agentmods.dev/skills/paperclipai/paperclip/fix-slow-queries"><img src="https://agentmods.dev/badge/skills/paperclipai/paperclip/fix-slow-queries/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fix-slow-queries

Your own site · 80×15
<a href="https://agentmods.dev/skills/paperclipai/paperclip/fix-slow-queries"><img src="https://agentmods.dev/badge/skills/paperclipai/paperclip/fix-slow-queries.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,300 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.02300
Opus 5.5 $0.00023 $0.00920
Sonnet 5.5 $0.00012 $0.00460
Haiku 4.5 $0.00006 $0.00230

Measured 10d ago against content hash 090485207632, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

fix-slow-queries scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/fix-slow-queries/SKILL.md · 190 lines

How it starts

The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fix Slow Queries

Deliver a measured improvement with preserved behavior and a reviewable PR whose latest commit passes checks. A list of suspicious SQL or an unverified rewrite is an intermediate result. Respect a narrower request for diagnosis only.

1. Establish the target and finish line

  • Resolve the reported URL, environment, company/workspace, deployed revision, owning repository, and local checkout. Read its AGENTS.md and scoped rules. Paperclip and the private paperclip-cloud control plane have different rules.
  • Work in a dedicated branch/worktree. Reuse suitable existing work; keep the checkout running a live server out of branch switching and benchmark setup.
  • Select a bounded batch, usually the top two or three query families. Record deferred candidates so discovery does not turn into an unbounded rewrite.
  • The finish line is: reproducible baseline, faster treatment, output/behavior proof, relevant regression coverage, and green checks on each final PR head. A concrete access or infrastructure blocker must be reported as incomplete.

2. Find the actual database and rank the work

Read Cloud discovery when starting from a hosted workspace. Follow the chain from Paperclip Cloud fleet admin to the stack's Neon project, branch, endpoint, database, and runtime role. Record the corresponding application deployment and time window. Do not reuse IDs from a previous run.

Capture query text/fingerprint, calls, total execution time, mean time, rows, and available I/O, temporary-file, and lock-wait evidence. Rank both expensive individual calls and frequent work with high aggregate cost. Group variants by their actual caller; do not add unrelated query means into an endpoint latency.

Keep three claims separate:

Claim Evidence needed
SQL is expensive Query statistics and a reproducible execution plan
The database path dominates a slow request Correlated SQL, connection wait, and application timings
More database capacity would help Resource/queue pressure in the same window and a capacity-specific experiment

Read the full file on GitHub · 190 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 190 lines · 58 tokens per session scan A 090485207632

Subscribe to this mod's changes

fix-slow-queries is a skill published in the GitHub repository paperclipai/paperclip (107,044 stars, last pushed today), licensed MIT. It adds 58 tokens to every session and 2,300 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-15.