#What it does
The /scale skill analyzes your application architecture, identifies bottlenecks, and recommends concrete scaling strategies. It covers database optimization, caching layers, CDN configuration, queue-based processing, and auto-scaling rules.
#How to use
bash
/scale
/scale database
/scale for 10x traffic#Workflow
- Profile -- Maps the architecture and identifies the current bottleneck (CPU, memory, I/O, database)
- Measure -- Estimates current capacity and the breaking point under load
- Recommend -- Proposes scaling strategies ranked by impact and effort
- Implement -- Applies the highest-impact changes with configuration
- Validate -- Provides load testing commands to verify improvements
#Scaling strategies it evaluates
- Caching -- Add Redis/Memcached for hot data, HTTP cache headers, CDN for static assets
- Database -- Connection pooling, read replicas, query optimization, indexing
- Async processing -- Move heavy work to background queues (BullMQ, SQS, Celery)
- Horizontal scaling -- Auto-scaling groups, container replicas, load balancer tuning
- Edge computing -- CDN functions, edge caching, regional deployments
- Architecture -- Database sharding, service decomposition, event-driven patterns
#Example
bash
> /scale for 10x traffic
# Current architecture:
Single Next.js instance, Postgres (shared connection), no caching
# Bottleneck analysis:
1. Database: 50 connections shared, query N+1 on /api/products (340ms avg)
2. No caching: identical queries repeated 12x/minute
3. Images served from origin (no CDN)
# Recommendations (by impact):
HIGH Add Redis cache for product queries -> 340ms to 3ms
HIGH Fix N+1 with JOIN + batch loading -> 12 queries to 1
MEDIUM Configure CDN for static assets -> 60% bandwidth reduction
MEDIUM Add connection pooling (PgBouncer) -> 10x connection capacity
LOW Enable ISR for product pages (60s revalidate) -> eliminate SSR load
# Estimated capacity after changes: ~50x current traffic