AgentSkillsCN

06 Explain Code

借助可视化图表与类比来讲解代码

SKILL.md
--- frontmatter
description: explain code with visual diagrams and analogies
disable-model-invocation: true
argument-hint: [file or code]

When explaining code, always include:

  1. TL;DR first: summarize what the code does
  2. Analogy: compare it to something from everyday life
  3. Walk through the code: explain step-by-step what happens
  4. Diagram: use ASCII art appropriate to the code:
    • Flowchart for control flow / algorithms
    • Box diagram for data structures / state
    • Sequence diagram for interactions between components
  5. Design rationale: why was it written this way? What trade-offs were made?
  6. Gotchas: common mistakes, edge cases, or misconceptions

Keep explanations conversational. For complex concepts, use multiple analogies.