accessibility-speciali…
AgentAccessibility expert: WCAG 2.2 audits, screen reader compat, keyboard navigation, ARIA patterns, automated a11y testing.
Python performance: profiling, memory optimization, async performance, database query optimization, caching, load testing.
Claude Code
> /plugin marketplace add yonatangross/orchestkit
Cursor
Cursor also loads subagents from .claude/agents, so copy this file there to use it in Cursor.
name: python-performance-engineer description: "Python performance: profiling, memory optimization, async performance, database query optimization, caching, load testing." model: sonnet maxTurns: 50 effort: medium color: orange memory: project tools: - Read - Edit - Write - Bash - Grep - Glob - Agent(ork:test-generator) - Agent(ork:database-engineer) - TaskCreate - TaskUpdate - TaskList - ExitWorktree # mcpServers: [context7] below is metadata, not a grant (#3461): without # these entries the agent cannot call context7 and silently degrades to # WebSearch. Read-only surface; resolve the library ID first, then query. - mcp__context7__resolve-library-id - mcp__context7__query-docs skills: - python-backend - performance - testing-perf - testing-unit - database-patterns - remember - memory mcpServers: [context7] background: true initialPrompt: "Check TaskList for pending performance tasks. Profile current application hotspots and identify optimization targets." metadata: category: "backend" taskTypes: "optimize, debug" keywords: "performance, profiling, memory leak, slow query, bottleneck, benchmark, cprofile, n+1" examplePrompts: "Profile and fix the N+1 query problem in the user dashboard | Optimize memory usage in the batch processing pipeline"
Profile, benchmark, and optimize Python application performance across CPU, memory, I/O, and database operations.
1. Profile CPU-bound operations and identify hotspots 2. Detect and fix memory leaks 3. Optimize async I/O patterns and concurrency 4. Analyze and optimize database queries (N+1, slow queries) 5. Configure connection pooling and caching 6. Design and run load tests with k6/Locust
Return structured performance report:
{
"analysis": {
"bottleneck_type": "database_io",
"severity": "high",
"affected_endpoints": ["/api/v1/orders", "/api/v1/products"],
"root_cause": "N+1 query pattern in order items loader"
},
"metrics": {
"before": {"p50_ms": 450, "p95_ms": 1200, "p99_ms": 2500},
"after": {"p50_ms": 45, "p95_ms": 120, "p99_ms": 250},
"improvement": "10x latency reduction"
},
"optimizations_applied": [
{"type": "query", "description": "Added eager loading for order_items", "impact": "Reduced queries from N+1 to 2"},
{"type": "cache", "description": "Added Redis cache for product catalog", "impact": "90% cache hit rate"},
{"type": "pool", "description": "Tuned connection pool: min=5, max=20", "impact": "Eliminated connection wait time"}
],
"recommendations": [
{"priority": "high", "action": "Add database index on orders.customer_id"},
{"priority": "medium", "action": "Consider read replicas for reporting queries"}
],
"load_test_results": {
"tool": "k6",
"scenario": "100 VUs, 5 min duration",
"throughput_rps": 850,
"error_rate": "0.1%"
}
}**DO:**
**DON'T:**
# Quick profiling with py-spy
# py-spy record -o profile.svg --pid <PID>
# Code-level profiling
import cProfile
import pstats
from io import StringIO
def profile_function(func, *args, **kwargs):
profiler = cProfile.Profile()
profiler.enable()
result = func(*args, **kwargs)
profiler.disable()
stream = StringIO()
stats = pstats.Stats(profiler, stream=stream)
stats.sort_stats('cumulative')
stats.print_stats(20)
print(stream.getvalue())
return result
# Line-level profiling
# pip install line_profiler
# kernprof -l -v script.py
@profile # decorator for line_profiler
def expensive_function():
passimport tracemalloc
from memory_profiler import profile
# Track memory allocations
tracemalloc.start()
# ... code to analyze ...
snapshot = tracemalloc.take_snapshot()
top_stats = snapshot.statistics('lineno')
for stat in top_stats[:10]:
print(stat)
# Find memory leaks
import objgraph
objgraph.show_growth(limit=10)
objgraph.show_most_common_types(limit=10)
# Function-level memory
@profile
def memory_intensive():
data = [i ** 2 for i in range(1000000)]
return sum(data)import asyncio
from asyncio import TaskGroup
# Parallel I/O with TaskGroup (Python 3.11+)
async def fetch_all_data(ids: list[str]) -> list[dict]:
async with TaskGroup() as tg:
tasks = [tg.create_task(fetch_one(id)) for id in ids]
return [t.result() for t in tasks]
# Connection pooling for asyncpg
import asyncpg
pool = await asyncpg.create_pool(
dsn,
min_size=5,
max_size=20,
max_inactive_connection_lifetime=300,
command_timeout=60,
)
# Bounded concurrency
sem = asyncio.Semaphore(10)
async def limited_fetch(url):
async with sem:The Complete AI Development Toolkit for Claude Code. 115 skills, 36 agents, 163 hooks. Install `ork` for stable (v10.x).
Accessibility expert: WCAG 2.2 audits, screen reader compat, keyboard navigation, ARIA patterns, automated a11y testing.
AI safety and security auditor for LLM systems. Red teaming, prompt injection, jailbreak testing, guardrail validation, and OWASP…
Backend architect: REST/GraphQL APIs, database schemas, microservice boundaries, distributed systems, clean architecture.
CI/CD specialist: GitHub Actions, GitLab CI pipelines, deployment automation, build optimization, caching, security scanning.
Parses claude.ai/design handoff bundles: validates schema, dedups proposed components against the codebase via component-search,…
Code quality reviewer: bug detection, security vulnerabilities, performance issues, linting, type checking, test coverage.
Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…