performance-scalability
Skill30 starsChanged 4 days agoApache-2.0View on GitHub
Identifies, diagnoses, and remediates performance bottlenecks, memory leaks, and architectural scaling limitations. Use this skill when asked to optimize slow queries, configure caching mechanisms, design asynchronous worker systems, or perform load profiling.
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 62
Antigravity: Run diagnostic performance scans and benchmark code before and after optimizations.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Performance and Scalability Skill
Overview
This skill identifies, measures, and eliminates performance bottlenecks, memory leaks, and architectural scaling limits. It acts as a Pragmatic Performance Architect and Systems Engineer, focusing on maximizing throughput, minimizing latency, and achieving linear $O(N)$ or sub-linear algorithmic complexity. It balances engineering effort against empirical metrics, eliminating premature optimization while eradicating choke points under concurrent load.
When to Use
Trigger Scenarios
- Profiling slow function execution paths, API endpoints, or batch jobs.
- Diagnosing and resolving database N+1 queries, unindexed scans, and missing connection pools.
- Identifying memory leaks, unbounded cache growth, or excessive heap consumption.
- Refactoring high-complexity algorithms (e.g. converting $O(N^2)$ loops to $O(N)$ or $O(1)$ lookups).
- Designing caching strategies (Cache-Aside, Write-Through, Redis, TTL eviction).
When NOT to Use
- Premature optimization on unmeasured prototypes: Implement cleanly first using
code-implementer. - Database schema migration planning: Route to
database-migration-expert. - General code smells diagnosis without profiling: Route to
code-smells-expert. - Dedicated BigQuery query plan optimization: Route to
bigquery-query-optimization.
Process
Phase 1: Automated Bottleneck Scanning
Statically scan the codebase to identify nested complexity loops, unbuffered file I/O, or N+1 query signatures:
python3 ./skills/performance-scalability/scripts/measure_performance.py scan [optional_path_to_scan]Phase 2: Runtime Execution & Memory Profiling
Measure actual runtime execution duration and peak memory footprint of specific functions:
python3 ./skills/performance-scalability/scripts/measure_performance.py profile <path_to_script.py> <function_name>Phase 3: Scalability Architectural Optimization
Apply proven patterns from the scalability reference:
- Database Queries: Eliminate N+1 queries using eager loading (
select_related,joinedload). Ensure query filters match composite indexes. Implement database connection pooling. - Caching Strategy: Apply Cache-Aside with strict TTL invalidation and LRU eviction on read-heavy paths.
- Asynchronous Offloading: Offload long-running I/O or CPU operations into background task queues (Celery, async workers).
- Algorithmic Complexity: Replace quadratic nested loops with hash map or set-based lookup tables.
Usage
Commands & Automation Scripts
# Scan repository or directory for performance anti-patterns
python3 ./skills/performance-scalability/scripts/measure_performance.py scan src/
# Profile execution time and memory of a function
python3 ./skills/performance-scalability/scripts/measure_performance.py profile src/data_loader.py process_batchExample Prompts
- "Profile this batch data processing function and identify where memory is leaking."
- "Scan our backend repositories for N+1 database queries and nested loop bottlenecks."
- "Design a Redis caching architecture with Cache-Aside pattern for our product catalog."
Host Execution Instructions
- Claude Code: Execute
measure_performance.pyin the shell and evaluate profiling telemetry. - Antigravity: Run diagnostic performance scans and benchmark code before and after optimizations.
Red Flags
- Optimizing code without empirical baseline profiling or benchmark evidence.
- Executing database queries or network requests inside loops (N+1 anti-pattern).
- Storing unbounded data in global in-memory dictionaries without size limits or TTL eviction.
- Blocking the asynchronous event loop with synchronous I/O or heavy computations.
- Sacrificing code readability for negligible sub-microsecond gains.
Verification
- Automated bottleneck scan executes and issues resolved:
python3 ./skills/performance-scalability/scripts/measure_performance.py scan . - Empirical profiling proves latency or memory reduction.
- No N+1 database queries detected in data-access layers.
- In-memory caches include explicit TTL or LRU maxsize eviction policies.
References
For architectural patterns, caching blueprints, and algorithmic recipes:
- Scalability Patterns Reference
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- AL-JANEF/janef-forge★ 1same name
- AL-JANEF/janefskills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-challengerSkill
- agent-metricsSkill
- bigquery-query-optimizationSkill
- blackbox-testerSkill
- build-and-ci-gatesSkill
- cdc-scd-patternsSkill
- code-criticSkill
- code-implementerSkill
- code-smells-expertSkill
- commit-expertSkill
- compliance-verifierSkill
- context-captureSkill
- context-restoreSkill
- database-migration-expertSkill
- design-spec-expertSkill
- documentation-expertSkill
- flutter-architecture-decisionsSkill
- flutter-performance-profilingSkill
- flutter-release-engineeringSkill
- flutter-review-checklistSkill
- flutter-senior-orchestrationSkill
- flutter-test-strategySkill
- flutter-upgrade-migrationSkill
- gcp-data-engineeringSkill
- guidelines-karpathySkill
- loop-engineeringSkill
- product-analystSkill
- pull-request-expertSkill
- python-expertSkill
- qa-testerSkill
- refactoring-code-expertSkill
- repo-researchSkill
- security-auditSkill
- senior-architect-engineeringSkill
- senior-dev-orchestratorSkill
- sql-query-optimizationSkill
- test-driven-developmentSkill
- testing-expertSkill
- ui-ux-designerSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

