Code Explanation Generator
Description
Explains complex code in simple terms. Breaks down algorithms, design patterns, and tricky logic with line-by-line annotations and diagrams.
Code
Skill Code
Explanation includes: 1. High-level overview 2. Line-by-line breakdown 3. Time/space complexity 4. Design pattern used 5. Potential gotchas 6. Simplified analogies
Usage Examples
Examples
User: explain this recursive "keyword">function Claude: This is a binary search implementation. **High-level:** Finds a target value by repeatedly halving the search space. **Line by line:** ```javascript "keyword">function binarySearch(arr, target, low = 0, high = arr.length - 1) { // Base case: element not found "keyword">if (low > high) "keyword">return -1; // Find middle index "keyword">const mid = Math.floor((low + high) / 2); // Found it! "keyword">if (arr[mid] === target) "keyword">return mid; // ... } ``` **Complexity:** O(log n) time, O(log n) space (recursion)
Installation
Add the following to your CLAUDE.md file (project root or ~/.claude/CLAUDE.md for global):
CLAUDE.md
# Code Explanation Generator Explanation includes: 1. High-level overview 2. Line-by-line breakdown 3. Time/space complexity 4. Design pattern used 5. Potential gotchas 6. Simplified analogies
Comments (0)
No comments yet. Be the first to share your thoughts!
Leave a Comment