AgentSkillsCN

explain

用通俗易懂的语言解释代码的运行原理。

SKILL.md
--- frontmatter
name: explain
description: Explain how code works in plain language
argument-hint: "[file:line or function name]"
allowed-tools: Read, Glob, Grep

Explain the code at $ARGUMENTS in clear, accessible language.

Guidelines

  1. Start with the big picture

    • What is the overall purpose of this code?
    • Where does it fit in the larger system?
  2. Break down the logic

    • Walk through the code step by step
    • Explain non-obvious algorithms or patterns
    • Note any clever tricks or idioms
  3. Highlight key concepts

    • Design patterns used
    • Important data structures
    • External dependencies and their roles
  4. Call out gotchas

    • Edge cases handled (or not)
    • Assumptions made
    • Potential pitfalls

Output Format

code
## Overview
[1-2 sentence summary]

## How It Works
[Step-by-step explanation]

## Key Details
- [Important point 1]
- [Important point 2]

## Related Code
- [References to related files/functions if relevant]

Adjust depth based on code complexity. Simple utilities need brief explanations; complex algorithms need more detail.