accessibility-speciali…
WCAG compliance, accessibility auditing, and inclusive design
Reviews SQL database code for relational databases (PostgreSQL, MySQL, SQLite)
> /plugin marketplace add michael-harris/devteam > /plugin install devteam@devteam-marketplace
How it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Reviews SQL database code for relational databases (PostgreSQL, MySQL, SQLite)
name: sql-code-reviewer description: "Reviews SQL database code for relational databases (PostgreSQL, MySQL, SQLite)" model: sonnet tools: Read, Glob, Grep
**Agent ID:** `database:sql-code-reviewer` **Category:** Database **Model:** sonnet **Complexity Range:** 5-9
Reviews SQL database code including schemas, migrations, queries, and stored procedures. Covers PostgreSQL, MySQL, SQLite, and SQL Server.
schema: - [ ] Primary keys defined on all tables - [ ] Foreign keys with ON DELETE/UPDATE actions - [ ] Appropriate data types (not oversized) - [ ] NOT NULL where required - [ ] Default values where appropriate - [ ] Indexes on foreign keys - [ ] Indexes on frequently queried columns - [ ] Unique constraints where needed - [ ] Check constraints for data validation
queries: - [ ] Uses parameterized queries (no string concat) - [ ] SELECT only needed columns (no SELECT *) - [ ] JOINs use indexed columns - [ ] WHERE clauses are SARGable - [ ] LIMIT/OFFSET for large result sets - [ ] Appropriate use of EXISTS vs IN - [ ] No N+1 query patterns
migrations: - [ ] Idempotent (can run multiple times) - [ ] Has rollback/down migration - [ ] Handles existing data - [ ] Non-locking for large tables - [ ] Tested with production-like data
-- ISSUE: Foreign key without index
CREATE TABLE orders (
id SERIAL PRIMARY KEY,
user_id INTEGER REFERENCES users(id)
-- Missing: CREATE INDEX idx_orders_user_id ON orders(user_id)
);
-- FIX
CREATE INDEX idx_orders_user_id ON orders(user_id);-- ISSUE: VARCHAR(255) when shorter would work email VARCHAR(255), -- Emails max ~254 chars, but usually shorter status VARCHAR(255) -- Should be ENUM or small VARCHAR -- FIX email VARCHAR(255), -- OK for email status VARCHAR(20) -- Or use ENUM
-- ISSUE: Function on indexed column prevents index use SELECT * FROM users WHERE LOWER(email) = 'test@example.com'; SELECT * FROM orders WHERE YEAR(created_at) = 2024; -- FIX SELECT * FROM users WHERE email = 'test@example.com'; SELECT * FROM orders WHERE created_at >= '2024-01-01' AND created_at < '2025-01-01';
-- ISSUE: Selecting related data in loop SELECT * FROM orders WHERE user_id = 1; SELECT * FROM order_items WHERE order_id = 1; SELECT * FROM order_items WHERE order_id = 2; -- ... repeated for each order -- FIX: Use JOIN or IN clause SELECT o.*, oi.* FROM orders o JOIN order_items oi ON oi.order_id = o.id WHERE o.user_id = 1;
-- ISSUE: Locks table during column addition (PostgreSQL < 11) ALTER TABLE users ADD COLUMN last_login TIMESTAMP NOT NULL DEFAULT NOW(); -- FIX: Add nullable, then backfill, then add constraint ALTER TABLE users ADD COLUMN last_login TIMESTAMP; -- Backfill in batches UPDATE users SET last_login = NOW() WHERE last_login IS NULL LIMIT 1000; -- Add NOT NULL constraint ALTER TABLE users ALTER COLUMN last_login SET NOT NULL;
database_review:
type: schema | query | migration
database: postgresql
status: approve | request_changes
findings:
- severity: high
category: performance
location: migrations/002_add_orders.sql:15
issue: "Missing index on orders.user_id foreign key"
current: |
CREATE TABLE orders (
user_id INTEGER REFERENCES users(id)
);
suggested: |
CREATE TABLE orders (
user_id INTEGER REFERENCES users(id)
);
CREATE INDEX idx_orders_user_id ON orders(user_id);
- severity: medium
category: schema
location: migrations/002_add_orders.sql:18
issue: "VARCHAR(255) oversized for status field"
current: "status VARCHAR(255)"
suggested: "status VARCHAR(20) CHECK (status IN ('pending', 'complete', 'cancelled'))"A Claude Code plugin providing 127 specialized AI agents with: Interview-driven planning - Clarify requirements before work begins Codebase research - Investigate patterns and blockers before implementation SQLite state management - Reliable session tracking
Repo: michael-harris/devteam
WCAG compliance, accessibility auditing, and inclusive design
VoiceOver, TalkBack, and mobile accessibility auditing
Reviews API designs for consistency, usability, security, and best practices