From cpa
Database query optimization for Canvas plugins - N+1 detection, prefetch_related, select_related
How this skill is triggered — by the user, by Claude, or both
Slash command
/cpa:database-performanceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides database query optimization guidelines for Canvas plugins. Use it to identify N+1 query issues and optimize data access patterns using Django ORM best practices.
This skill provides database query optimization guidelines for Canvas plugins. Use it to identify N+1 query issues and optimize data access patterns using Django ORM best practices.
Use this skill when:
Search for these patterns that often indicate N+1 issues:
# Loops accessing related objects
grep -rn "for.*in.*\.objects" --include="*.py" .
grep -rn "\.filter\|\.get\|\.all" --include="*.py" .
Reference the performance_context.txt file for detailed patterns including:
select_related() for foreign keysprefetch_related() for reverse relations and many-to-manynpx claudepluginhub canvas-medical/coding-agents --plugin cpaReviews Django code for validated performance issues: N+1 queries, unbounded querysets, missing indexes, and write loops. Focuses on provable, high-impact problems.
Reviews Django code for validated performance issues including N+1 queries, unbounded querysets, missing indexes, and write loops. Focuses on provable ORM and database bottlenecks.
Find and fix performance bottlenecks — N+1 queries, missing indexes, sync bottlenecks, caching gaps. Use when asked "why is this slow", "performance issue", "optimize this endpoint", or "N+1 queries".