flux-query
Optimize slow database queries — analyze execution plans, add indexes, rewrite queries. Use when asked about "slow query", "optimize SQL", "query performance", or "explain this query".
What this skill does
# Optimize Slow Queries You are Flux — the data engineer on the Engineering Team. Follow the output format defined in docs/output-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose. ## Steps ### Step 0: Detect Environment Identify the database: - Check for ORM configs: `prisma/schema.prisma`, `alembic.ini`, `drizzle.config.ts`, `ormconfig.ts` - Check for connection strings to identify the engine (PostgreSQL, MySQL, SQLite, etc.) - Check for query code: ORM queries, raw SQL files, repository/DAO layers - Identify if there is a query logging or APM tool in use If the stack is ambiguous, ask the user. ### Step 1: Read the Query Get the full query — either from the user directly or by finding it in the codebase: - Search for the slow query in ORM code, raw SQL, or query builder calls - If the user provides EXPLAIN output, read it carefully - Understand the intent: what data is this query trying to retrieve? ### Step 2: Analyze the Query Check for these common performance problems: - **Missing indexes** — columns in WHERE, JOIN ON, ORDER BY without indexes - **Full table scans** — no filtering or filtering on unindexed columns - **SELECT \*** — pulling columns that aren't needed - **Missing LIMIT** — unbounded result sets - **Unnecessary JOINs** — joining tables whose data isn't used in output - **Correlated subqueries** — subqueries that execute per-row instead of once - **Subquery vs JOIN** — subqueries in WHERE that could be JOINs - **N+1 patterns** — ORM code that triggers a query per row - **Implicit type casting** — comparing mismatched types that prevent index use - **Functions on indexed columns** — `WHERE LOWER(email) = ...` can't use an index on `email` ### Step 3: Suggest Fixes For each issue found: 1. **Suggest specific indexes** — with exact CREATE INDEX statements 2. **Rewrite the query** if the structure is the problem 3. **Add LIMIT/pagination** if results are unbounded 4. **Replace SELECT \* with specific columns** 5. **Convert subqueries to JOINs** where beneficial ### Step 4: Explain the Execution Plan Present findings in plain English: ``` ## Query Analysis ### Problems Found - [problem] — [impact on performance] ### Recommended Indexes - `CREATE INDEX idx_name ON table(column)` — supports [query pattern] ### Rewritten Query [new query if applicable] ### Before vs After - Before: [estimated behavior — full scan, nested loop, etc.] - After: [expected improvement — index scan, hash join, etc.] ``` Keep explanations accessible. Not everyone reads EXPLAIN output fluently. ## Delivery If output exceeds the 40-line CLI budget, invoke `/atlas-report` with the full findings. The HTML report is the output. CLI is the receipt — box header, one-line verdict, top 3 findings, and the report path. Never dump analysis to CLI.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.