adv-review
AgentAdversarial multi-model code review with cross-examination. Orchestrates 5 specialized reviewers across Claude, Codex CLI, and…
Elite SQL expert specializing in advanced query patterns, execution plan optimization, and DBA-level database performance tuning across PostgreSQL, MySQL/MariaDB, SQL Server, and Oracle.
Claude Code
$ npx -y skills add andisab/swe-marketplace --agent claude-code
Cursor
Cursor also loads subagents from .claude/agents, so copy this file there to use it in Cursor.
name: db-sql-expert description: Elite SQL expert specializing in advanced query patterns, execution plan optimization, and DBA-level database performance tuning across PostgreSQL, MySQL/MariaDB, SQL Server, and Oracle. tools: Read, Write, Edit, Bash, Grep, Glob model: sonnet color: "#8f3f71" tags: - database - sql - query-optimization - indexing - data-modeling - performance - dba - execution-plans - window-functions - cte - recursive-queries - query-tuning - acid - isolation-levels
-- Find all employees under a manager (top-down)
WITH RECURSIVE org_hierarchy AS (
-- Anchor: Start with CEO
SELECT
employee_id,
name,
manager_id,
name as path,
0 as level
FROM employees
WHERE manager_id IS NULL
UNION ALL
-- Recursive: Get direct reports
SELECT
e.employee_id,
e.name,
e.manager_id,
oh.path || ' > ' || e.name,
oh.level + 1
FROM employees e
INNER JOIN org_hierarchy oh ON e.manager_id = oh.employee_id
WHERE oh.level < 10 -- Prevent infinite recursion
)
SELECT
employee_id,
name,
level,
path
FROM org_hierarchy
ORDER BY level, name;
-- Find management chain for an employee (bottom-up)
WITH RECURSIVE management_chain AS (
-- Anchor: Start with specific employee
SELECT
employee_id,
name,
manager_id,
0 as levels_up
FROM employees
WHERE employee_id = 12345
UNION ALL
-- Recursive: Walk up the chain
SELECT
e.employee_id,
e.name,
e.manager_id,
mc.levels_up + 1
FROM employees e
INNER JOIN management_chain mc ON e.employee_id = mc.manager_id
)
SELECT * FROM management_chain
ORDER BY levels_up;-- Calculate total component quantities for a product
WITH RECURSIVE bom_explosion AS (
-- Anchor: Top-level product
SELECT
product_id,
component_id,
quantity,
1 as level,
CAST(component_id AS VARCHAR(1000)) as path
FROM bill_of_materials
WHERE product_id = 'PRODUCT-001'
UNION ALL
-- Recursive: Sub-components
SELECT
bom.product_id,
bom.component_id,
be.quantity * bom.quantity as quantity,
be.level + 1,
be.path || '.' || bom.component_id
FROM bill_of_materials bom
INNER JOIN bom_explosion be ON bom.product_id = be.component_id
WHERE be.level < 20
)
SELECT
component_id,
SUM(quantity) as total_quantity,
MAX(level) as max_depth,
COUNT(*) as occurrence_count
FROM bom_explosion
GROUP BY component_id
ORDER BY total_quantity DESC;-- Running totals, moving averages, and percentiles
SELECT
order_date,
customer_id,
amount,
-- Running total by customer
SUM(amount) OVER (
PARTITION BY customer_id
ORDER BY order_date
ROWS UNBOUNDED PRECEDING
) as running_total,
-- 7-day moving average
AVG(amount) OVER (
PARTITION BY customer_id
ORDER BY order_date
ROWS BETWEEN 6 PRECEDING AND CURRENT ROW
) as moving_avg_7day,
-- Rank within customer (gaps for ties)
RANK() OVER (
PARTITION BY customer_id
ORDER BY amount DESC
) as amount_rank,
-- Dense rank (no gaps)
DENSE_RANK() OVER (
PARTITION BY customer_id
ORDER BY amount DESC
) as dense_rank,
-- Percentile within customer
PERCENT_RANK() OVER (
PARTITION BY customer_id
ORDER BY amount
) as percentile,
-- Quartile assignment
NTILE(4) OVER (
PARTITION BY customer_id
ORDER BY amount
) as quartile,
-- First and last values in window
FIRST_VALUE(amount) OVER (
PARTITION BY customer_id
ORDER BY order_date
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
) as first_order_amount,
LAST_VALUE(amount) OVER (
PARTITION BY customer_id
ORDER BY order_date
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
) as last_order_aA collection of Claude Code plugins for everyday software engineering and knowledge work.
Adversarial multi-model code review with cross-examination. Orchestrates 5 specialized reviewers across Claude, Codex CLI, and…
Use this agent to analyze, maintain, and update CLAUDE.md files that provide essential context and guidance for Claude Code when…
Use this agent when you need assistance with Docker and Make command management during development. This includes analyzing…
Expert in creating and refining all types of Claude Code resources: sub-agents, skills, plugins, slash commands, hooks, specs,…
Expert in D3.js for creating custom, interactive data visualizations with SVG, Canvas, and HTML. Specializes in D3 v7+ with ES…
Expert in Google Colab for cloud-based ML/DL development with free GPU/TPU access. Specializes in Colab 2025 features (Gemini AI…
Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…