From a7b17b6089b6ea897dc8fd1975ceeb8f67ec3220 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 08:20:48 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 15 +++++ README.md | 3 + commands/optimize-cache.md | 35 +++++++++++ plugin.lock.json | 61 +++++++++++++++++++ skills/cache-performance-optimizer/SKILL.md | 52 ++++++++++++++++ .../assets/README.md | 7 +++ .../references/README.md | 9 +++ .../scripts/README.md | 8 +++ 8 files changed, 190 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 commands/optimize-cache.md create mode 100644 plugin.lock.json create mode 100644 skills/cache-performance-optimizer/SKILL.md create mode 100644 skills/cache-performance-optimizer/assets/README.md create mode 100644 skills/cache-performance-optimizer/references/README.md create mode 100644 skills/cache-performance-optimizer/scripts/README.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..3eae7c1 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,15 @@ +{ + "name": "cache-performance-optimizer", + "description": "Optimize caching strategies for improved performance", + "version": "1.0.0", + "author": { + "name": "Claude Code Plugins", + "email": "[email protected]" + }, + "skills": [ + "./skills" + ], + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..02e8a47 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# cache-performance-optimizer + +Optimize caching strategies for improved performance diff --git a/commands/optimize-cache.md b/commands/optimize-cache.md new file mode 100644 index 0000000..b834e9a --- /dev/null +++ b/commands/optimize-cache.md @@ -0,0 +1,35 @@ +--- +description: Optimize caching strategies and implementation +--- + +# Cache Performance Optimizer + +Analyze and optimize caching strategies for maximum performance. + +## Analysis Areas + +1. **Cache Hit Rates**: Identify low cache hit ratios +2. **Cache Keys**: Evaluate key design and granularity +3. **TTL Configuration**: Time-to-live optimization +4. **Cache Invalidation**: Proper invalidation strategies +5. **Cache Warming**: Pre-loading critical data +6. **Cache Layers**: Multi-level caching opportunities +7. **Memory Usage**: Cache size and eviction policies + +## Process + +1. Locate all caching implementations +2. Analyze cache usage patterns +3. Identify cache misses and inefficiencies +4. Evaluate TTL and invalidation strategies +5. Generate optimization recommendations + +## Output + +Provide report with: +- Cache inventory and configuration analysis +- Hit rate improvement opportunities +- Key design recommendations +- TTL optimization suggestions +- Multi-level caching strategies +- Code examples for improvements diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..e162831 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,61 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:jeremylongshore/claude-code-plugins-plus:plugins/performance/cache-performance-optimizer", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "ae6f26a84e9d39a4bd7f8de4335b0c18e523d743", + "treeHash": "528b1d0d897428aae72a242f5a1a690c76a1f990da7883ac9d0a699f09d43f79", + "generatedAt": "2025-11-28T10:18:11.804023Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "cache-performance-optimizer", + "description": "Optimize caching strategies for improved performance", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "a2c0c26853d44a067538c618dd1292d74c8125489f9c459b72e71d22ae3ad053" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "08100a0dc68b1e66da3f0c8f3112b7151c9236328758390bdca87f979dd6b7d3" + }, + { + "path": "commands/optimize-cache.md", + "sha256": "a74a481c71d37b76ed7cf39c473001de8eb81b64a35b5d2ea642beed55c8b0da" + }, + { + "path": "skills/cache-performance-optimizer/SKILL.md", + "sha256": "673cbbb1543e14f3551349c22f35911bcf9c7da0127477b4b0d907e0ac5ed71d" + }, + { + "path": "skills/cache-performance-optimizer/references/README.md", + "sha256": "c0afe1d81e9b664a97d6d1e99d8b612d14bb259e3cb22e59cd2cd1a97a7edc68" + }, + { + "path": "skills/cache-performance-optimizer/scripts/README.md", + "sha256": "bfff36e502837a65b857ce1756f41c2504c3e1f49227a76d3e15b27a99feb42b" + }, + { + "path": "skills/cache-performance-optimizer/assets/README.md", + "sha256": "59845ed1b2d53c002824041d61ee4b8853573c27f02c39815453ac10db3bdcc1" + } + ], + "dirSha256": "528b1d0d897428aae72a242f5a1a690c76a1f990da7883ac9d0a699f09d43f79" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/cache-performance-optimizer/SKILL.md b/skills/cache-performance-optimizer/SKILL.md new file mode 100644 index 0000000..a588aa5 --- /dev/null +++ b/skills/cache-performance-optimizer/SKILL.md @@ -0,0 +1,52 @@ +--- +name: optimizing-cache-performance +description: | + This skill enables Claude to analyze and improve application caching strategies. It optimizes cache hit rates, TTL configurations, cache key design, and invalidation strategies. Use this skill when the user requests to "optimize cache performance", "improve caching strategy", "analyze cache hit rate", or needs assistance with "cache key design", "TTL optimization", or "cache invalidation". The skill identifies potential bottlenecks and recommends adjustments for improved performance and efficiency of caching mechanisms like Redis. +allowed-tools: Read, Write, Bash, Grep +version: 1.0.0 +--- + +## Overview + +This skill empowers Claude to diagnose and resolve caching-related performance issues. It guides users through a comprehensive optimization process, ensuring efficient use of caching resources. + +## How It Works + +1. **Identify Caching Implementation**: Locates the caching implementation within the project (e.g., Redis, Memcached, in-memory caches). +2. **Analyze Cache Configuration**: Examines the existing cache configuration, including TTL values, eviction policies, and key structures. +3. **Recommend Optimizations**: Suggests improvements to cache hit rates, TTLs, key design, invalidation strategies, and memory usage. + +## When to Use This Skill + +This skill activates when you need to: +- Improve application performance by optimizing caching mechanisms. +- Identify and resolve caching-related bottlenecks. +- Review and improve cache key design for better hit rates. + +## Examples + +### Example 1: Optimizing Redis Cache + +User request: "Optimize Redis cache performance." + +The skill will: +1. Analyze the Redis configuration, including TTLs and memory usage. +2. Recommend optimal TTL values based on data access patterns. + +### Example 2: Improving Cache Hit Rate + +User request: "Improve cache hit rate in my application." + +The skill will: +1. Analyze cache key design and identify potential areas for improvement. +2. Suggest more effective cache key structures to increase hit rates. + +## Best Practices + +- **TTL Management**: Set appropriate TTL values to balance data freshness and cache hit rates. +- **Key Design**: Use consistent and well-structured cache keys for efficient retrieval. +- **Invalidation Strategies**: Implement proper cache invalidation strategies to avoid serving stale data. + +## Integration + +This skill can integrate with code analysis tools to automatically identify caching implementations and configuration. It can also work with monitoring tools to track cache hit rates and performance metrics. \ No newline at end of file diff --git a/skills/cache-performance-optimizer/assets/README.md b/skills/cache-performance-optimizer/assets/README.md new file mode 100644 index 0000000..77cc75d --- /dev/null +++ b/skills/cache-performance-optimizer/assets/README.md @@ -0,0 +1,7 @@ +# Assets + +Bundled resources for cache-performance-optimizer skill + +- [ ] cache_key_template.json - Template for defining cache key structures. +- [ ] cache_config_example.json - Example cache configuration file. +- [ ] cache_monitoring_dashboard.json - Example dashboard configuration for monitoring cache performance. diff --git a/skills/cache-performance-optimizer/references/README.md b/skills/cache-performance-optimizer/references/README.md new file mode 100644 index 0000000..046d112 --- /dev/null +++ b/skills/cache-performance-optimizer/references/README.md @@ -0,0 +1,9 @@ +# References + +Bundled resources for cache-performance-optimizer skill + +- [ ] cache_best_practices.md - Comprehensive guide on caching best practices. +- [ ] redis_configuration.md - Detailed Redis configuration guide. +- [ ] memcached_configuration.md - Detailed Memcached configuration guide. +- [ ] cache_key_design_guide.md - Guide on designing effective cache keys. +- [ ] cache_invalidation_strategies.md - Guide on different cache invalidation strategies. diff --git a/skills/cache-performance-optimizer/scripts/README.md b/skills/cache-performance-optimizer/scripts/README.md new file mode 100644 index 0000000..b9c9064 --- /dev/null +++ b/skills/cache-performance-optimizer/scripts/README.md @@ -0,0 +1,8 @@ +# Scripts + +Bundled resources for cache-performance-optimizer skill + +- [ ] analyze_cache_hit_rate.py - Analyzes cache hit rates from logs or metrics endpoints. +- [ ] optimize_ttl.py - Suggests optimal TTL values based on data access patterns. +- [ ] validate_cache_key_design.py - Validates cache key design against best practices. +- [ ] generate_cache_invalidation_strategy.py - Generates cache invalidation strategies based on data dependencies.