better-auth-add-plugin
Add a better-auth plugin to an existing project. Configures server and client plugins with proper imports.
Analyze and optimize Cloudflare Workers performance. Checks bundle size, caching, memory usage, and provides actionable recommendations.
$ npx -y skills add secondsky/claude-skills --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/workers-optimizeContext preview
What this command does when you run it.
Analyze and optimize Cloudflare Workers performance. Checks bundle size, caching, memory usage, and provides actionable recommendations.
name: cloudflare-workers:optimize description: Analyze and optimize Cloudflare Workers performance. Checks bundle size, caching, memory usage, and provides actionable recommendations. allowed-tools: - Read - Grep - Bash - Glob argument-hint: "--target <bundle|memory|cache> (optional: focus analysis)"
Comprehensive performance analysis and optimization for Cloudflare Workers.
**If --target argument provided**:
**If no --target argument**:
Analyze Worker bundle size and identify bloat:
1. **Build Worker and check output size**:
bunx wrangler deploy --dry-run --outdir=.wrangler-output du -h .wrangler-output/
2. **Parse bundle size**:
3. **Identify large dependencies**:
# Analyze package.json dependencies grep -A 100 '"dependencies"' package.json
Common bloat sources:
4. **Check for unnecessary imports**:
**Findings**:
### Bundle Size Analysis **Current Size**: X KB / Y MB limit (Z% used) **Large Dependencies**: 1. [package-name]: X KB 2. [package-name]: X KB **Recommendations**: - Remove [package] (unused in production) - Replace [package] with [lighter alternative] - Use dynamic imports for [feature]
Analyze Cache API usage and opportunities:
1. **Check for Cache API usage**:
grep -r "caches.open" src/ grep -r "cache.match" src/ grep -r "cache.put" src/
2. **Identify cacheable endpoints**:
3. **Check cache headers**:
grep -r "Cache-Control" src/ grep -r "max-age" src/
**Findings**:
### Caching Analysis **Cache API Usage**: [Found/Not Found] **Cacheable Opportunities**: 1. Route: /api/data - No caching detected 2. Route: /static/* - Could cache for 24h 3. External API: api.example.com - Called 100x/min, no caching **Recommendations**: - Implement Cache API for /api/data (TTL: 5min) - Add Cache-Control headers for static assets - Cache external API responses (TTL: 1h)
Analyze memory patterns and identify leaks:
1. **Check for large in-memory objects**:
grep -r "new Map(" src/
grep -r "new Set(" src/
grep -r "const data = " src/2. **Identify potential memory leaks**:
3. **Check for streaming opportunities**:
**Findings**:
### Memory Usage Analysis **Potential Issues**: 1. Global Map at line X - grows unbounded 2. Large array created at line Y - not cleaned up 3. File uploads read entire body - use streaming **Recommendations**: - Use WeakMap for caching with automatic cleanup - Implement streaming for files >1MB - Clear arrays after processing
Analyze factors affecting cold start performance:
1. **Check for top-level await**:
grep -n "await" src/index.ts | grep -v "async"
2. **Check import patterns**:
3. **Check for large constants/data**:
**Findings**:
### Cold Start Analysis **Blocking Factors**: 1. Top-level await at line X 2. Heavy computation in module scope 3. 50KB JSON imported at module level **Recommendations**: - Move await into request handler - Lazy load heavy dependencies - Store large data in KV, load on demand
Check for CPU-intensive operations:
1. **Identify expensive operations**:
grep -r "for (" src/
grep -r "while (" src/
grep -r "map(" src/
grep -r "filter(" src/
grep -r "reduce(" src/2. **Check for blocking operations**:
**Findings**:
### CPU Time Analysis
**Expensive Operations**:
1. Nested loop at line X - O(n²) complexity
2. Large JSON.parse() without streaming
3. Complex regex: /(?:...){1000,}/ - catastrophic backtracking
**Recommendations**:
- Optimize algorithm to O(n)
- Stream large JSON payloads
- Simplify regex or use string methodsAnalyze external API calls and database queries:
1. **Count external fetch calls**:
grep -r "fetch(" src/ | wc -l2. **Check for parallel requests**:
grep -r "Promise.all" src/ grep -r "await.*await" src/
3. **Database query patterns**:
**Findings**:
### External Dependencies **API Calls**: X total found **Issues**: 1. Sequential calls to 3 APIs - add 300ms latency 2. Database N+1 query pattern 3. No timeout on external fetch **Recommend
145 production-ready skills for Claude Code CLI 🔌 Platform / Harness Support These plugins ship as Claude Code marketplace plugins (.claude-plugin/ manifests) and Codex CLI plugins (.codex-plugin/ manifests).
Repo: secondsky/claude-skills
Add a better-auth plugin to an existing project. Configures server and client plugins with proper imports.
Interactive setup wizard for better-auth authentication. Guides through database, framework, OAuth providers, and plugin configuration.
Explain Better Auth error codes and provide solutions with code examples
Display Better Auth available authentication providers and their configuration