Code Explainer
Paste the following prompt into your AI chat to install this skill:
Please install @user_70c2f807/code-explainer by following https://skillhub.cn/install/skillhub.md.
About this skill
The problem
When taking over unfamiliar modules, reading open-source projects, or reviewing legacy code, the bottleneck is often not running the code, but understanding why it is written that way. Code Explainer performs static explanation over pasted code snippets, helping readers quickly form judgments about functionality, structure, and risk. It is useful for questions like “what is this code doing,” “which lines contain the core logic,” and “what issues might exist here.”
How it works
The skill does not execute code or access repositories. It works by reading the provided snippet statically:
- Overall analysis: identifies the
language, module boundaries, core functions, and main data flow, then states the purpose and design intent. - Block-level explanation: annotates lines or blocks, highlights key logic such as with
⭐, and avoids superficial line-by-line translation. - Pattern recognition: points out likely design patterns, technical choices, or idioms, helping explain how the code is organized.
- Risk hints: flags possible
bugs, performance bottlenecks, edge cases, or maintainability risks, and suggests improvement directions.
More complete input produces more stable explanations. Provide file snippets, function context, call scenarios, or specific questions. For long code, split it into modules; for complex business logic, adding background improves accuracy.
Boundaries
This skill is suited for code comprehension, structure explanation, and static risk review. It is not a substitute for code generation, runtime debugging, or refactoring. It cannot read external repository links and will not modify code automatically. If the snippet contains keys, passwords, or sensitive configuration, redact it before pasting. For logic that depends heavily on runtime state, external services, or hidden context, the explanations are inferences based on visible code only; final conclusions still need tests and execution.
Use Cases
- Take over a legacy Python module and quickly clarify the main function, call chain, and key branches.
- Read an open-source utility class and understand how it parses config, handles errors, and sets defaults.
- Before a review, explain an unfamiliar Go service snippet and locate core logic plus concurrency risks.
- Understand a SQL reporting script, including CTEs, filters, aggregation logic, and full-scan risks.
Best For
- Engineers taking over unfamiliar backend modules who need to understand function roles, parameter flow, and error handling.
- Open-source contributors who want to confirm a utility function's inputs, outputs, edge cases, and patterns.
- Reviewers maintaining unfamiliar code who need to spot key branches, performance bottlenecks, and defects.
- Engineers learning a new language who need plain explanations of library calls, resource management, and error recovery.
Related Skills
A systematic code error fixing skill that follows a five-step workflow: Reproduce, Isolate, Understand, Fix, Verify, to help developers resolve code errors.
Supports inline SVG/HTML rendering and Mermaid code output, covering common technical diagram creation like architecture and flow diagrams.
A comprehensive browser automation guide covering navigation, interaction, multi-tab management, and data collection, tailored for domestic web ecosystems and tools like Playwright/Selenium.
Control Windows WeChat through GUI automation to search contacts and send text, images, or files without official APIs.