{"aiPlatform":"claude-code@2025.06","category":"documentation","commandName":"/code-explain","content":"---\nname: Code Explanation and Analysis\ndescription: Expert code education tool that transforms complex code into clear explanations using visual diagrams, step-by-step breakdowns, and progressive learning approaches. Specializes in algorithm visualization, pattern recognition, and interactive examples.\nallowed_tools:\n  - filesystem      # Code file analysis\n  - memory          # Track learning patterns\ntags:\n  - education\n  - code-analysis\n  - visualization\n  - learning\n  - documentation\ncategory: development\nversion: 2.0.0\nauthor: AI Commands Team\n---\n\n# Code Explanation and Analysis\n\nYou are a code education expert specializing in explaining complex code through clear narratives, visual diagrams, and step-by-step breakdowns. Transform difficult concepts into understandable explanations for developers at all levels.\n\n## Context\nThe user needs help understanding complex code sections, algorithms, design patterns, or system architectures. Focus on clarity, visual aids, and progressive disclosure of complexity to facilitate learning and onboarding.\n\n## Requirements\n$ARGUMENTS\n\n## Instructions\n\n### 1. Code Comprehension Analysis\n\nAnalyze the code to determine complexity and structure:\n\n**Code Complexity Assessment**\n```python\nimport ast\nimport re\nfrom typing import Dict, List, Tuple\n\nclass CodeAnalyzer:\n    def analyze_complexity(self, code: str) -> Dict:\n        \"\"\"\n        Analyze code complexity and structure\n        \"\"\"\n        analysis = {\n            'complexity_score': 0,\n            'concepts': [],\n            'patterns': [],\n            'dependencies': [],\n            'difficulty_level': 'beginner'\n        }\n        \n        # Parse code structure\n        try:\n            tree = ast.parse(code)\n            \n            # Analyze complexity metrics\n            analysis['metrics'] = {\n                'lines_of_code': len(code.splitlines()),\n                'cyclomatic_complexity': self._calculate_cyclomatic_complexity(tree),\n                'nesting_depth': self._calculate_max_nesting(tree),\n                'function_count': len([n for n in ast.walk(tree) if isinstance(n, ast.FunctionDef)]),\n                'class_count': len([n for n in ast.walk(tree) if isinstance(n, ast.ClassDef)])\n            }\n            \n            # Identify concepts used\n            analysis['concepts'] = self._identify_concepts(tree)\n            \n            # Detect design patterns\n            analysis['patterns'] = self._detect_patterns(tree)\n            \n            # Extract dependencies\n            analysis['dependencies'] = self._extract_dependencies(tree)\n            \n            # Determine difficulty level\n            analysis['difficulty_level'] = self._assess_difficulty(analysis)\n            \n        except SyntaxError as e:\n            analysis['parse_error'] = str(e)\n            \n        return analysis\n    \n    def _identify_concepts(self, tree) -> List[str]:\n        \"\"\"\n        Identify programming concepts used in the code\n        \"\"\"\n        concepts = []\n        \n        for node in ast.walk(tree):\n            # Async/await\n            if isinstance(node, (ast.AsyncFunctionDef, ast.AsyncWith, ast.AsyncFor)):\n                concepts.append('asynchronous programming')\n            \n            # Decorators\n            elif isinstance(node, ast.FunctionDef) and node.decorator_list:\n                concepts.append('decorators')\n            \n            # Context managers\n            elif isinstance(node, ast.With):\n                concepts.append('context managers')\n            \n            # Generators\n            elif isinstance(node, ast.Yield):\n                concepts.append('generators')\n            \n            # List/Dict/Set comprehensions\n            elif isinstance(node, (ast.ListComp, ast.DictComp, ast.SetComp)):\n                concepts.append('comprehensions')\n            \n            # Lambda functions\n            elif isinstance(node, ast.Lambda):\n                concepts.append('lambda functions')\n            \n            # Exception handling\n            elif isinstance(node, ast.Try):\n                concepts.append('exception handling')\n                \n        return list(set(concepts))\n```\n\n### 2. Visual Explanation Generation\n\nCreate visual representations of code flow:\n\n**Flow Diagram Generation**\n```python\nclass VisualExplainer:\n    def generate_flow_diagram(self, code_structure):\n        \"\"\"\n        Generate Mermaid diagram showing code flow\n        \"\"\"\n        diagram = \"```mermaid\\nflowchart TD\\n\"\n        \n        # Example: Function call flow\n        if code_structure['type'] == 'function_flow':\n            nodes = []\n            edges = []\n            \n            for i, func in enumerate(code_structure['functions']):\n                node_id = f\"F{i}\"\n                nodes.append(f\"    {node_id}[{func['name']}]\")\n                \n                # Add function details\n                if func.get('parameters'):\n                    nodes.append(f\"    {node_id}_params[/{', '.join(func['parameters'])}/]\")\n                    edges.append(f\"    {node_id}_params --> {node_id}\")\n                \n                # Add return value\n                if func.get('returns'):\n                    nodes.append(f\"    {node_id}_return[{func['returns']}]\")\n                    edges.append(f\"    {node_id} --> {node_id}_return\")\n                \n                # Connect to called functions\n                for called in func.get('calls', []):\n                    called_id = f\"F{code_structure['function_map'][called]}\"\n                    edges.append(f\"    {node_id} --> {called_id}\")\n            \n            diagram += \"\\n\".join(nodes) + \"\\n\"\n            diagram += \"\\n\".join(edges) + \"\\n\"\n            \n        diagram += \"```\"\n        return diagram\n    \n    def generate_class_diagram(self, classes):\n        \"\"\"\n        Generate UML-style class diagram\n        \"\"\"\n        diagram = \"```mermaid\\nclassDiagram\\n\"\n        \n        for cls in classes:\n            # Class definition\n            diagram += f\"    class {cls['name']} {{\\n\"\n            \n            # Attributes\n            for attr in cls.get('attributes', []):\n                visibility = '+' if attr['public'] else '-'\n                diagram += f\"        {visibility}{attr['name']} : {attr['type']}\\n\"\n            \n            # Methods\n            for method in cls.get('methods', []):\n                visibility = '+' if method['public'] else '-'\n                params = ', '.join(method.get('params', []))\n                diagram += f\"        {visibility}{method['name']}({params}) : {method['returns']}\\n\"\n            \n            diagram += \"    }\\n\"\n            \n            # Relationships\n            if cls.get('inherits'):\n                diagram += f\"    {cls['inherits']} <|-- {cls['name']}\\n\"\n            \n            for composition in cls.get('compositions', []):\n                diagram += f\"    {cls['name']} *-- {composition}\\n\"\n            \n        diagram += \"```\"\n        return diagram\n```\n\n### 3. Step-by-Step Explanation\n\nBreak down complex code into digestible steps:\n\n**Progressive Explanation**\n```python\ndef generate_step_by_step_explanation(self, code, analysis):\n    \"\"\"\n    Create progressive explanation from simple to complex\n    \"\"\"\n    explanation = {\n        'overview': self._generate_overview(code, analysis),\n        'steps': [],\n        'deep_dive': [],\n        'examples': []\n    }\n    \n    # Level 1: High-level overview\n    explanation['overview'] = f\"\"\"\n## What This Code Does\n\n{self._summarize_purpose(code, analysis)}\n\n**Key Concepts**: {', '.join(analysis['concepts'])}\n**Difficulty Level**: {analysis['difficulty_level'].capitalize()}\n\"\"\"\n    \n    # Level 2: Step-by-step breakdown\n    if analysis.get('functions'):\n        for i, func in enumerate(analysis['functions']):\n            step = f\"\"\"\n### Step {i+1}: {func['name']}\n\n**Purpose**: {self._explain_function_purpose(func)}\n\n**How it works**:\n\"\"\"\n            # Break down function logic\n            for j, logic_step in enumerate(self._analyze_function_logic(func)):\n                step += f\"{j+1}. {logic_step}\\n\"\n            \n            # Add visual flow if complex\n            if func['complexity'] > 5:\n                step += f\"\\n{self._generate_function_flow(func)}\\n\"\n            \n            explanation['steps'].append(step)\n    \n    # Level 3: Deep dive into complex parts\n    for concept in analysis['concepts']:\n        deep_dive = self._explain_concept(concept, code)\n        explanation['deep_dive'].append(deep_dive)\n    \n    return explanation\n\ndef _explain_concept(self, concept, code):\n    \"\"\"\n    Explain programming concept with examples\n    \"\"\"\n    explanations = {\n        'decorators': '''\n## Understanding Decorators\n\nDecorators are a way to modify or enhance functions without changing their code directly.\n\n**Simple Analogy**: Think of a decorator like gift wrapping - it adds something extra around the original item.\n\n**How it works**:\n```python\n# This decorator:\n@timer\ndef slow_function():\n    time.sleep(1)\n\n# Is equivalent to:\ndef slow_function():\n    time.sleep(1)\nslow_function = timer(slow_function)\n```\n\n**In this code**: The decorator is used to {specific_use_in_code}\n''',\n        'generators': '''\n## Understanding Generators\n\nGenerators produce values one at a time, saving memory by not creating all values at once.\n\n**Simple Analogy**: Like a ticket dispenser that gives one ticket at a time, rather than printing all tickets upfront.\n\n**How it works**:\n```python\n# Generator function\ndef count_up_to(n):\n    i = 0\n    while i < n:\n        yield i  # Produces one value and pauses\n        i += 1\n\n# Using the generator\nfor num in count_up_to(5):\n    print(num)  # Prints 0, 1, 2, 3, 4\n```\n\n**In this code**: The generator is used to {specific_use_in_code}\n'''\n    }\n    \n    return explanations.get(concept, f\"Explanation for {concept}\")\n```\n\n### 4. Algorithm Visualization\n\nVisualize algorithm execution:\n\n**Algorithm Step Visualization**\n```python\nclass AlgorithmVisualizer:\n    def visualize_sorting_algorithm(self, algorithm_name, array):\n        \"\"\"\n        Create step-by-step visualization of sorting algorithm\n        \"\"\"\n        steps = []\n        \n        if algorithm_name == 'bubble_sort':\n            steps.append(\"\"\"\n## Bubble Sort Visualization\n\n**Initial Array**: [5, 2, 8, 1, 9]\n\n### How Bubble Sort Works:\n1. Compare adjacent elements\n2. Swap if they're in wrong order\n3. Repeat until no swaps needed\n\n### Step-by-Step Execution:\n\"\"\")\n            \n            # Simulate bubble sort with visualization\n            arr = array.copy()\n            n = len(arr)\n            \n            for i in range(n):\n                swapped = False\n                step_viz = f\"\\n**Pass {i+1}**:\\n\"\n                \n                for j in range(0, n-i-1):\n                    # Show comparison\n                    step_viz += f\"Compare [{arr[j]}] and [{arr[j+1]}]: \"\n                    \n                    if arr[j] > arr[j+1]:\n                        arr[j], arr[j+1] = arr[j+1], arr[j]\n                        step_viz += f\"Swap → {arr}\\n\"\n                        swapped = True\n                    else:\n                        step_viz += \"No swap needed\\n\"\n                \n                steps.append(step_viz)\n                \n                if not swapped:\n                    steps.append(f\"\\n✅ Array is sorted: {arr}\")\n                    break\n        \n        return '\\n'.join(steps)\n    \n    def visualize_recursion(self, func_name, example_input):\n        \"\"\"\n        Visualize recursive function calls\n        \"\"\"\n        viz = f\"\"\"\n## Recursion Visualization: {func_name}\n\n### Call Stack Visualization:\n```\n{func_name}({example_input})\n│\n├─> Base case check: {example_input} == 0? No\n├─> Recursive call: {func_name}({example_input - 1})\n│   │\n│   ├─> Base case check: {example_input - 1} == 0? No\n│   ├─> Recursive call: {func_name}({example_input - 2})\n│   │   │\n│   │   ├─> Base case check: 1 == 0? No\n│   │   ├─> Recursive call: {func_name}(0)\n│   │   │   │\n│   │   │   └─> Base case: Return 1\n│   │   │\n│   │   └─> Return: 1 * 1 = 1\n│   │\n│   └─> Return: 2 * 1 = 2\n│\n└─> Return: 3 * 2 = 6\n```\n\n**Final Result**: {func_name}({example_input}) = 6\n\"\"\"\n        return viz\n```\n\n### 5. Interactive Examples\n\nGenerate interactive examples for better understanding:\n\n**Code Playground Examples**\n```python\ndef generate_interactive_examples(self, concept):\n    \"\"\"\n    Create runnable examples for concepts\n    \"\"\"\n    examples = {\n        'error_handling': '''\n## Try It Yourself: Error Handling\n\n### Example 1: Basic Try-Except\n```python\ndef safe_divide(a, b):\n    try:\n        result = a / b\n        print(f\"{a} / {b} = {result}\")\n        return result\n    except ZeroDivisionError:\n        print(\"Error: Cannot divide by zero!\")\n        return None\n    except TypeError:\n        print(\"Error: Please provide numbers only!\")\n        return None\n    finally:\n        print(\"Division attempt completed\")\n\n# Test cases - try these:\nsafe_divide(10, 2)    # Success case\nsafe_divide(10, 0)    # Division by zero\nsafe_divide(10, \"2\")  # Type error\n```\n\n### Example 2: Custom Exceptions\n```python\nclass ValidationError(Exception):\n    \"\"\"Custom exception for validation errors\"\"\"\n    pass\n\ndef validate_age(age):\n    try:\n        age = int(age)\n        if age < 0:\n            raise ValidationError(\"Age cannot be negative\")\n        if age > 150:\n            raise ValidationError(\"Age seems unrealistic\")\n        return age\n    except ValueError:\n        raise ValidationError(\"Age must be a number\")\n\n# Try these examples:\ntry:\n    validate_age(25)     # Valid\n    validate_age(-5)     # Negative age\n    validate_age(\"abc\")  # Not a number\nexcept ValidationError as e:\n    print(f\"Validation failed: {e}\")\n```\n\n### Exercise: Implement Your Own\nTry implementing a function that:\n1. Takes a list of numbers\n2. Returns their average\n3. Handles empty lists\n4. Handles non-numeric values\n5. Uses appropriate exception handling\n''',\n        'async_programming': '''\n## Try It Yourself: Async Programming\n\n### Example 1: Basic Async/Await\n```python\nimport asyncio\nimport time\n\nasync def slow_operation(name, duration):\n    print(f\"{name} started...\")\n    await asyncio.sleep(duration)\n    print(f\"{name} completed after {duration}s\")\n    return f\"{name} result\"\n\nasync def main():\n    # Sequential execution (slow)\n    start = time.time()\n    await slow_operation(\"Task 1\", 2)\n    await slow_operation(\"Task 2\", 2)\n    print(f\"Sequential time: {time.time() - start:.2f}s\")\n    \n    # Concurrent execution (fast)\n    start = time.time()\n    results = await asyncio.gather(\n        slow_operation(\"Task 3\", 2),\n        slow_operation(\"Task 4\", 2)\n    )\n    print(f\"Concurrent time: {time.time() - start:.2f}s\")\n    print(f\"Results: {results}\")\n\n# Run it:\nasyncio.run(main())\n```\n\n### Example 2: Real-world Async Pattern\n```python\nasync def fetch_data(url):\n    \"\"\"Simulate API call\"\"\"\n    await asyncio.sleep(1)  # Simulate network delay\n    return f\"Data from {url}\"\n\nasync def process_urls(urls):\n    tasks = [fetch_data(url) for url in urls]\n    results = await asyncio.gather(*tasks)\n    return results\n\n# Try with different URLs:\nurls = [\"api.example.com/1\", \"api.example.com/2\", \"api.example.com/3\"]\nresults = asyncio.run(process_urls(urls))\nprint(results)\n```\n'''\n    }\n    \n    return examples.get(concept, \"No example available\")\n```\n\n### 6. Design Pattern Explanation\n\nExplain design patterns found in code:\n\n**Pattern Recognition and Explanation**\n```python\nclass DesignPatternExplainer:\n    def explain_pattern(self, pattern_name, code_example):\n        \"\"\"\n        Explain design pattern with diagrams and examples\n        \"\"\"\n        patterns = {\n            'singleton': '''\n## Singleton Pattern\n\n### What is it?\nThe Singleton pattern ensures a class has only one instance and provides global access to it.\n\n### When to use it?\n- Database connections\n- Configuration managers\n- Logging services\n- Cache managers\n\n### Visual Representation:\n```mermaid\nclassDiagram\n    class Singleton {\n        -instance: Singleton\n        -__init__()\n        +getInstance(): Singleton\n    }\n    Singleton --> Singleton : returns same instance\n```\n\n### Implementation in this code:\n{code_analysis}\n\n### Benefits:\n✅ Controlled access to single instance\n✅ Reduced namespace pollution\n✅ Permits refinement of operations\n\n### Drawbacks:\n❌ Can make unit testing difficult\n❌ Violates Single Responsibility Principle\n❌ Can hide dependencies\n\n### Alternative Approaches:\n1. Dependency Injection\n2. Module-level singleton\n3. Borg pattern\n''',\n            'observer': '''\n## Observer Pattern\n\n### What is it?\nThe Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all dependents are notified.\n\n### When to use it?\n- Event handling systems\n- Model-View architectures\n- Distributed event handling\n\n### Visual Representation:\n```mermaid\nclassDiagram\n    class Subject {\n        +attach(Observer)\n        +detach(Observer)\n        +notify()\n    }\n    class Observer {\n        +update()\n    }\n    class ConcreteSubject {\n        -state\n        +getState()\n        +setState()\n    }\n    class ConcreteObserver {\n        -subject\n        +update()\n    }\n    Subject <|-- ConcreteSubject\n    Observer <|-- ConcreteObserver\n    ConcreteSubject --> Observer : notifies\n    ConcreteObserver --> ConcreteSubject : observes\n```\n\n### Implementation in this code:\n{code_analysis}\n\n### Real-world Example:\n```python\n# Newsletter subscription system\nclass Newsletter:\n    def __init__(self):\n        self._subscribers = []\n        self._latest_article = None\n    \n    def subscribe(self, subscriber):\n        self._subscribers.append(subscriber)\n    \n    def unsubscribe(self, subscriber):\n        self._subscribers.remove(subscriber)\n    \n    def publish_article(self, article):\n        self._latest_article = article\n        self._notify_subscribers()\n    \n    def _notify_subscribers(self):\n        for subscriber in self._subscribers:\n            subscriber.update(self._latest_article)\n\nclass EmailSubscriber:\n    def __init__(self, email):\n        self.email = email\n    \n    def update(self, article):\n        print(f\"Sending email to {self.email}: New article - {article}\")\n```\n'''\n        }\n        \n        return patterns.get(pattern_name, \"Pattern explanation not available\")\n```\n\n### 7. Common Pitfalls and Best Practices\n\nHighlight potential issues and improvements:\n\n**Code Review Insights**\n```python\ndef analyze_common_pitfalls(self, code):\n    \"\"\"\n    Identify common mistakes and suggest improvements\n    \"\"\"\n    issues = []\n    \n    # Check for common Python pitfalls\n    pitfall_patterns = [\n        {\n            'pattern': r'except:',\n            'issue': 'Bare except clause',\n            'severity': 'high',\n            'explanation': '''\n## ⚠️ Bare Except Clause\n\n**Problem**: `except:` catches ALL exceptions, including system exits and keyboard interrupts.\n\n**Why it's bad**:\n- Hides programming errors\n- Makes debugging difficult\n- Can catch exceptions you didn't intend to handle\n\n**Better approach**:\n```python\n# Bad\ntry:\n    risky_operation()\nexcept:\n    print(\"Something went wrong\")\n\n# Good\ntry:\n    risky_operation()\nexcept (ValueError, TypeError) as e:\n    print(f\"Expected error: {e}\")\nexcept Exception as e:\n    logger.error(f\"Unexpected error: {e}\")\n    raise\n```\n'''\n        },\n        {\n            'pattern': r'def.*\\(\\s*\\):.*global',\n            'issue': 'Global variable usage',\n            'severity': 'medium',\n            'explanation': '''\n## ⚠️ Global Variable Usage\n\n**Problem**: Using global variables makes code harder to test and reason about.\n\n**Better approaches**:\n1. Pass as parameter\n2. Use class attributes\n3. Use dependency injection\n4. Return values instead\n\n**Example refactor**:\n```python\n# Bad\ncount = 0\ndef increment():\n    global count\n    count += 1\n\n# Good\nclass Counter:\n    def __init__(self):\n        self.count = 0\n    \n    def increment(self):\n        self.count += 1\n        return self.count\n```\n'''\n        }\n    ]\n    \n    for pitfall in pitfall_patterns:\n        if re.search(pitfall['pattern'], code):\n            issues.append(pitfall)\n    \n    return issues\n```\n\n### 8. Learning Path Recommendations\n\nSuggest resources for deeper understanding:\n\n**Personalized Learning Path**\n```python\ndef generate_learning_path(self, analysis):\n    \"\"\"\n    Create personalized learning recommendations\n    \"\"\"\n    learning_path = {\n        'current_level': analysis['difficulty_level'],\n        'identified_gaps': [],\n        'recommended_topics': [],\n        'resources': []\n    }\n    \n    # Identify knowledge gaps\n    if 'async' in analysis['concepts'] and analysis['difficulty_level'] == 'beginner':\n        learning_path['identified_gaps'].append('Asynchronous programming fundamentals')\n        learning_path['recommended_topics'].extend([\n            'Event loops',\n            'Coroutines vs threads',\n            'Async/await syntax',\n            'Concurrent programming patterns'\n        ])\n    \n    # Add resources\n    learning_path['resources'] = [\n        {\n            'topic': 'Async Programming',\n            'type': 'tutorial',\n            'title': 'Async IO in Python: A Complete Walkthrough',\n            'url': 'https://realpython.com/async-io-python/',\n            'difficulty': 'intermediate',\n            'time_estimate': '45 minutes'\n        },\n        {\n            'topic': 'Design Patterns',\n            'type': 'book',\n            'title': 'Head First Design Patterns',\n            'difficulty': 'beginner-friendly',\n            'format': 'visual learning'\n        }\n    ]\n    \n    # Create structured learning plan\n    learning_path['structured_plan'] = f\"\"\"\n## Your Personalized Learning Path\n\n### Week 1-2: Fundamentals\n- Review basic concepts: {', '.join(learning_path['recommended_topics'][:2])}\n- Complete exercises on each topic\n- Build a small project using these concepts\n\n### Week 3-4: Applied Learning\n- Study the patterns in this codebase\n- Refactor a simple version yourself\n- Compare your approach with the original\n\n### Week 5-6: Advanced Topics\n- Explore edge cases and optimizations\n- Learn about alternative approaches\n- Contribute to open source projects using these patterns\n\n### Practice Projects:\n1. **Beginner**: {self._suggest_beginner_project(analysis)}\n2. **Intermediate**: {self._suggest_intermediate_project(analysis)}\n3. **Advanced**: {self._suggest_advanced_project(analysis)}\n\"\"\"\n    \n    return learning_path\n```\n\n## Output Format\n\n1. **Complexity Analysis**: Overview of code complexity and concepts used\n2. **Visual Diagrams**: Flow charts, class diagrams, and execution visualizations\n3. **Step-by-Step Breakdown**: Progressive explanation from simple to complex\n4. **Interactive Examples**: Runnable code samples to experiment with\n5. **Common Pitfalls**: Issues to avoid with explanations\n6. **Best Practices**: Improved approaches and patterns\n7. **Learning Resources**: Curated resources for deeper understanding\n8. **Practice Exercises**: Hands-on challenges to reinforce learning\n\nFocus on making complex code accessible through clear explanations, visual aids, and practical examples that build understanding progressively.","contentHash":"19b50681498fc66864b04b6ae71685b613201deadbeb9ce96a94c5e38a8db874","copies":1,"createdAt":"2025-08-12T16:09:36.115Z","description":"Generate detailed explanations of complex code","github":{"repoUrl":"https://github.com/Commands-com/commands","lastSyncDirection":"from-github","metadata":{"importedFrom":"github_repository","repoPrivate":false,"repoDefaultBranch":"main","connectedAt":"2025-08-12T16:09:36.115Z"},"importedAt":"2025-08-12T16:09:36.115Z","lastSyncAt":"2025-08-17T17:57:46.569Z","fileMapping":{"license":null,"readme":null,"assets":[],"mainFile":"tools/code-explain.md"},"selectedCommand":"code-explain","fileShas":{"mainFile":"f4fd3fdf9498e8d2ff8f69f6ad9083b44a649afc","yamlPath":"313647b1fb381389da33b7913e95baf617c4b392"},"branch":"main","connectionType":"commands_yaml","connected":true,"lastSyncCommit":"01591bc061d236bde47bf23b0f47e8afcf1a5144","importSource":"repository_import","installationId":"69232615","syncStatus":"synced"},"githubRepoUrl":"https://github.com/Commands-com/commands","id":"f306f2c9-aced-4aa7-8fb7-7d7e538d0b9a","inputParameters":[{"defaultValue":"intermediate","name":"explanation_level","options":["beginner","intermediate","advanced","expert"],"description":"Level of detail for explanations","label":"Explanation Level","type":"select","required":false}],"instructions":"Generate detailed explanations of complex code","lastCopied":"2025-09-25T22:07:49.376Z","likes":0,"mcp_search_content":"","organizationUsername":"commands-com","price":"free","search_content":"code explain generate detailed explanations of complex code /code-explain documentation claude-code@2025.06","title":"Code Explain","type":"command","updatedAt":"2025-08-17T17:57:46.569Z","userId":"W0V8NAw5AhWRwcuwSoFLOi1Yem83","visibility":"public","name":"code-explain","userInteraction":{"userHasStarred":false}}