Skip to content
Development
Command

/explain

Ultra-fast parallel technical explanations using 10 sub-agents for comprehensive multi-angle analysis

From plugin
claude-cmd
313180 skills180 commands

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/explain

Context preview

What this command does when you run it.

Ultra-fast parallel technical explanations using 10 sub-agents for comprehensive multi-angle analysis

Command definition

explain.md
allowed-tools: Read, Write, Bash(fd:*), Bash(rg:*), Bash(git:*), Bash(gdate:*), Bash(jq:*), Bash(wc:*), Task, WebFetch
name: "Explain"
description: "Ultra-fast parallel technical explanations using 10 sub-agents for comprehensive multi-angle analysis"
author: "wcygan"
tags: ["docs","analyze"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"

Context

  • Session ID: !`gdate +%s%N`
  • Current directory: !`pwd`
  • Explanation target: $ARGUMENTS
  • Project structure: !`fd . -t d -d 2 | head -10 || echo "No directories found"`
  • Code files: !`fd "\.(rs|go|java|py|js|ts|cpp|c|kt|scala|rb|php|cs|swift)$" . | wc -l | tr -d ' ' || echo "0"`
  • Configuration files: !`fd "(package\.json|Cargo\.toml|go\.mod|pom\.xml|deno\.json|requirements\.txt)$" . -d 3 | head -5 || echo "No config files"`
  • Git repository: !`git rev-parse --is-inside-work-tree 2>/dev/null && echo "Yes" || echo "No"`
  • Current branch: !`git branch --show-current 2>/dev/null || echo "N/A"`
  • Recent changes: !`git log --oneline -3 2>/dev/null || echo "No git repository"`
  • Technology indicators: !`rg "(import|require|use|include|from)" . --type rust --type go --type java --type python --type typescript | head -5 | cut -d: -f3 | sort -u | head -3 || echo "No imports detected"`

Your Task

**IMMEDIATELY DEPLOY 10 PARALLEL SUB-AGENTS** for instant comprehensive explanation

STEP 1: Initialize comprehensive explanation session

  • CREATE session state file: `/tmp/explain-session-$SESSION_ID.json`
  • Initialize results directory: `/tmp/explain-results-$SESSION_ID/`

STEP 2: **LAUNCH ALL 10 AGENTS SIMULTANEOUSLY**

**NO SEQUENTIAL ANALYSIS** - All agents work in parallel:

1. **Code Analysis Agent**: Analyze syntax, structure, and patterns 2. **Architecture Agent**: Examine system design and integration 3. **Algorithm Agent**: Explain computational complexity and logic 4. **Pattern Recognition Agent**: Identify design patterns and idioms 5. **Security Analysis Agent**: Assess vulnerabilities and best practices 6. **Performance Agent**: Analyze efficiency and optimization opportunities 7. **Usage Examples Agent**: Generate practical implementation examples 8. **Testing Strategy Agent**: Create comprehensive test scenarios 9. **Documentation Agent**: Research related concepts and resources 10. **Visual Explanation Agent**: Create diagrams and visual aids

Each agent saves analysis to: `/tmp/explain-results-$SESSION_ID/agent-N.json`

Think deeply about the optimal explanation approach while maximizing parallel execution.

**Expected speedup: 10x faster comprehensive explanation generation**

**Extended Thinking Areas:**

  • Technical depth assessment and complexity analysis for adaptive explanations
  • Project context integration strategies for maximum relevance
  • Learning pathway optimization based on user expertise level
  • Multi-modal explanation techniques for different learning styles
  • ANALYZE target type from $ARGUMENTS:
  • Code snippet (raw code provided)
  • File path (specific file to explain)
  • Concept (abstract technical topic)
  • Architecture pattern (system design)
  • Algorithm (computational approach)
  • ASSESS explanation scope and complexity:
  • Simple: Basic concepts, single functions, straightforward patterns
  • Moderate: Complex algorithms, architectural components, framework usage
  • Enterprise: System architectures, multi-service interactions, advanced patterns
  • DETERMINE analysis approach:

IF target is file path AND file exists:

  • SET explanation_type = "file_analysis"
  • FOCUS on code structure, patterns, dependencies, and usage
  • INCLUDE related files and integration points

ELSE IF target contains code syntax:

  • SET explanation_type = "code_snippet"
  • ANALYZE syntax, patterns, and best practices
  • PROVIDE context-aware explanations

ELSE IF target is architectural concept:

  • SET explanation_type = "architecture_pattern"
  • USE extended thinking for system design implications
  • FOCUS on trade-offs, alternatives, and implementation strategies

ELSE:

  • SET explanation_type = "technical_concept"
  • PROVIDE foundational understanding with practical examples
  • CONNECT to project context when applicable

STEP 3: Execute targeted analysis strategy

TRY:

IF explanation_type == "file_analysis":

  • READ target file and analyze structure
  • SEARCH for related files: dependencies, tests, documentation
  • MAP usage patterns across codebase
  • IDENTIFY design patterns and architectural decisions
  • TRACE data flow and integration points

ELSE IF explanation_type == "code_snippet":

  • PARSE syntax and identify language/framework
  • ANALYZE algorithmic complexity and patterns
  • IDENTIFY best practices and potential improvements
  • PROVIDE equivalent implementations in other languages if applicable

ELSE IF explanation_type == "architecture_pattern":

  • USE Task tool for comprehensive research if complex:

1. **Pattern Analysis Agent**: Core pattern explanation and variations 2. **Implementation Agent**: Technology-specific implementation examples 3. **Trade-offs Agent**: Advantages, disadvantages, alternatives 4. **Real-world Agent**: Case studies and practical applications

ELSE IF explanation_type == "technical_concept":

  • PROVIDE foundational explanation with clear definitions
  • INCLUDE practical examples and use cases
  • CONNECT to current project context when relevant
  • SUGGEST learning resources and next steps

CATCH (analysis_failed):

  • LOG issues to session state
  • PROVIDE best-effort explanation with available information
  • DOCUMENT limitations and suggest manual research approaches

STEP 4: Generate structured explanation based on complexity level

CASE complexity_level:

WHEN "simple":

  • PROVIDE clear, beginner-friendly explanation
  • FOCUS on core concepts and basic examples
  • INCLUDE step-by-step breakdown
  • SUGGEST next learning steps

WHEN "moderate":

  • INCLUDE comprehensive analysis with detailed examples
  • EXPLAIN design decisions and trade-offs
  • PROVIDE imp
Read more
Ships withclaude-cmd

A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.

Get the whole plugin