pluginagentmarketplace/custom-plugin-backend
backend-development-assistant
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-backend/blob/main/skills/performance/SKILL.md -a claude-code --skill performanceInstallation paths:
.claude/skills/performance/# Performance Optimization Skill
**Bonded to:** `caching-performance-agent`
---
## Quick Start
```bash
# Invoke performance skill
"My API is slow, help me optimize it"
"Set up Redis caching for my application"
"Configure load balancing for high availability"
```
---
## Instructions
1. **Identify Bottlenecks**: Profile application, analyze metrics
2. **Choose Strategy**: Select caching, scaling, or optimization approach
3. **Implement Cache**: Set up Redis/Memcached with appropriate pattern
4. **Configure Scaling**: Horizontal or vertical based on needs
5. **Monitor Results**: Set up APM and track improvements
---
## Caching Patterns
| Pattern | Use Case | Consistency | Complexity |
|---------|----------|-------------|------------|
| Cache-Aside | Read-heavy, tolerates stale | Eventual | Low |
| Write-Through | Write-heavy, needs consistency | Strong | Medium |
| Write-Behind | High throughput writes | Eventual | High |
| Refresh-Ahead | Predictable access | Strong | Medium |
---
## Decision Tree
```
Performance Issue?
│
├─→ High latency → Check database queries
│ ├─→ Slow queries → Add indexes, optimize SQL
│ └─→ Network → Add caching, reduce round-trips
│
├─→ High CPU → Profile code
│ ├─→ Algorithmic → Optimize algorithms
│ └─→ Too much load → Scale horizontally
│
└─→ Memory issues → Analyze memory usage
├─→ Leaks → Find and fix leaks
└─→ Large data → Implement pagination, streaming
```
---
## Examples
### Example 1: Redis Cache-Aside
```python
import redis
import json
from functools import wraps
r = redis.Redis(host='localhost', port=6379, decode_responses=True)
def cache(ttl_seconds=3600):
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
cache_key = f"{func.__name__}:{args}:{kwargs}"
cached = r.get(cache_key)
if cached:
return json.loads(cached)
result = func(*args, **kwar