Get the FREE Ultimate OpenClaw Setup Guide →

explain-code

Scanned
npx machina-cli add skill kimliss/claude-code-inhand/explain-code --openclaw
Files (1)
SKILL.md
613 B

When explaining code, always include:

  1. Start with an analogy: Compare the code to something from everyday life
  2. Draw a diagram: Use ASCII art to show the flow, structure, or relationships
  3. Walk through the code: Explain step-by-step what happens
  4. Highlight a gotcha: What's a common mistake or misconception?

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

Source

git clone https://github.com/kimliss/claude-code-inhand/blob/main/plugins/dev-toolkit/skills/explain-code/SKILL.mdView on GitHub

Overview

Explain-code helps you demystify code by pairing everyday-life analogies with visual ASCII diagrams. It guides you through the code step by step and flags common misconceptions, making complex codebases easier to understand for engineers and new teammates. It's especially useful when someone asks 'how does this work?' or when teaching a codebase.

How This Skill Works

Technically, explain-code starts with an everyday analogy, then presents an ASCII diagram to illustrate flow, structure, or relationships. It then walks through the code line by line, explaining what happens, and finishes by highlighting a gotcha to prevent common mistakes.

When to Use It

  • When explaining how a function or module works in a codebase
  • During onboarding or knowledge transfer to new teammates
  • When reviewing unfamiliar code in a pull request
  • In a team workshop or code-along session
  • When a user asks 'how does this work?' about a snippet or feature

Quick Start

  1. Step 1: Share the code snippet or file you want explained
  2. Step 2: Kick off with a relatable analogy relevant to the code
  3. Step 3: Draw an ASCII diagram, walk through the code line by line, and call out a gotcha

Best Practices

  • Lead with an everyday-life analogy before diving into technical details
  • Include an ASCII diagram that clearly maps flow, structure, or relationships
  • Walk through the code step by step, narrating each action
  • Highlight a gotcha or common misconception for clarity
  • Keep explanations conversational and use multiple analogies for complex ideas

Example Use Cases

  • Explain a sorting function by analogy (e.g., organizing drawers) and diagram its flow
  • Explain a REST API client call with request/response diagram and step-through
  • Explain a React component render cycle with a diagram of props/state and updates
  • Explain a memoization helper by showing cache lookup and miss path
  • Explain a database query builder by mapping it to a menu-selection flow

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers