explain · superclaude-org — команда для Claude Code: объяснить код и концепции
Команда explain для структурированного объяснения кода, архитектуры и концепций на нужном уровне сложности. Помогает разобраться в чужом коде или научить других.
MIT ★ 23 950 обновлён 2026-09-27
.claude/commands/explain.mdЧто делает explain
Команда /sc:explain разбирает код или концепцию в несколько этапов: анализирует, оценивает уровень аудитории, строит объяснение от простого к сложному и проверяет ясность. Поддерживает три режима глубины — базовый, промежуточный и продвинутый — и выбирает формат: текст, примеры или интерактивное исследование.
Внутри работают три роли: преподаватель (учебная структура), архитектор (дизайн систем) и специалист по безопасности (best practices). Для разбора сложных конструкций команда задействует Sequential MCP (структурный анализ) и Context7 (официальная документация фреймворков). Если эти серверы не установлены, команда переключается на встроенное мышление и веб-поиск.
Примеры: explain authentication.js --level basic объяснит аутентификацию новичку; explain react-hooks --level intermediate --context react встроит официальные паттерны React; explain microservices-system --level advanced --format interactive разберёт архитектуру с интерактивной глубиной.
Какие задачи решает
- разобраться в чужом коде без читки строка за строкой
- объяснить архитектуру системы на нужном уровне сложности
- перевести сложную концепцию в формат для обучения
- проверить понимание security-паттернов в контексте фреймворка
Примеры запросов агенту
- Объясни работу middleware в Express на промежуточном уровне
- /sc:explain JWT-аутентификация --level
basic --context security - Разбери микросервисную архитектуру интерактивным методом
Как установить explain
Вручную: положить файлы
.claude/commands/explain.mdВызов — /explain. Для всех проектов — ~/.claude/commands/
Вручную: положить файлы
~/.codex/prompts/explain.mdВызов — /prompts:explain. В Codex этот формат помечен устаревшим, замена — скиллы
Вручную: положить файлы
.github/prompts/explain.prompt.mdВручную: положить файлы
.gemini/commands/explain.tomlGemini хранит команды в TOML: текст запроса — в поле prompt
Вопросы об explain
Как установить explain в Claude Code?
Скопируй файл в .claude/commands/explain.md внутри проекта. Claude Code автоматически подхватит команду; запусти /sc:explain с нужным кодом или концепцией.
Что делает explain?
Объясняет код и архитектурные концепции пошагово, подбирая уровень сложности (базовый, промежуточный, продвинутый) и формат (текст, примеры, интерактив). Встраивает фреймворк-специфичные паттерны через официальную документацию.
Работает ли explain без MCP-серверов?
Да. Sequential и Context7 — предпочтительный инструмент, но не обязательный. Без них команда использует встроенный анализ кода и веб-поиск по документации.
Исходный текст
explain.md · MIT
--- name: explain description: "Provide clear explanations of code, concepts, and system behavior with educational clarity" category: workflow complexity: standard mcp-servers: [sequential, context7] personas: [educator, architect, security] --- # /sc:explain - Code and Concept Explanation ## Triggers - Code understanding and documentation requests for complex functionality - System behavior explanation needs for architectural components - Educational content generation for knowledge transfer - Framework-specific concept clarification requirements ## Usage ``` /sc:explain [target] [--level basic|intermediate|advanced] [--format text|examples|interactive] [--context domain] ``` ## Behavioral Flow 1. **Analyze**: Examine target code, concept, or system for comprehensive understanding 2. **Assess**: Determine audience level and appropriate explanation depth and format 3. **Structure**: Plan explanation sequence with progressive complexity and logical flow 4. **Generate**: Create clear explanations with examples, diagrams, and interactive elements 5. **Validate**: Verify explanation accuracy and educational effectiveness Key behaviors: - Multi-persona coordination for domain expertise (educator, architect, security) - Framework-specific explanations via Context7 integration - Systematic analysis via Sequential MCP for complex concept breakdown - Adaptive explanation depth based on audience and complexity ## MCP Integration - **Sequential MCP**: Auto-activated for complex multi-component analysis and structured reasoning - **Context7 MCP**: Framework documentation and official pattern explanations - **Persona Coordination**: Educator (learning), Architect (systems), Security (practices) - **Availability fallback**: The MCP servers named here are preferred tooling, not hard requirements — when one is not installed, degrade gracefully (native reasoning in place of Sequential, official docs via web lookup in place of Context7, native tools otherwise) instead of routing work to absent servers. ## Tool Coordination - **Read/Grep/Glob**: Code analysis and pattern identification for explanation content - **TodoWrite**: Progress tracking for complex multi-part explanations - **Task**: Delegation for comprehensive explanation workflows requiring systematic breakdown ## Key Patterns - **Progressive Learning**: Basic concepts → intermediate details → advanced implementation - **Framework Integration**: Context7 documentation → accurate official patterns and practices - **Multi-Domain Analysis**: Technical accuracy + educational clarity + security awareness - **Interactive Explanation**: Static content → examples → interactive exploration ## Examples ### Basic Code Explanation ``` /sc:explain authentication.js --level basic # Clear explanation with practical examples for beginners # Educator persona provides learning-optimized structure ``` ### Framework Concept Explanation ``` /sc:explain react-hooks --level intermediate --context react # Context7 integration for official React documentation patterns # Structured explanation with progressive complexity ``` ### System Architecture Explanation ``` /sc:explain microservices-system --level advanced --format interactive # Architect persona explains system design and patterns # Interactive exploration with Sequential analysis breakdown ``` ### Security Concept Explanation ``` /sc:explain jwt-authentication --context security --level basic # Security persona explains authentication concepts and best practices # Framework-agnostic security principles with practical examples ``` ## Boundaries **Will:** - Provide clear, comprehensive explanations with educational clarity - Auto-activate relevant personas for domain expertise and accurate analysis - Generate framework-specific explanations with official documentation integration **Will Not:** - Generate explanations without thorough analysis and accuracy verification - Override project-specific documentation standards or reveal sensitive details - Bypass established explanation validation or educational quality requirements
© SuperClaude-Org · MIT · SuperClaude-Org/SuperClaude_Framework
Похожие слэш-команды
Все слэш-команды по теме «Код-ревью и рефакторинг» →Сначала — explain от других авторов.