Back to list
rockyflux

explaining-code

by rockyflux

箫风博客

3🍴 0📅 Jan 22, 2026

SKILL.md


name: explaining-code description: Explains code with visual diagrams and analogies. Use when explaining how code works, teaching about a codebase, or when the user asks "how does this work?"

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.

Example Structure

Code Function
    │
    ├── Input Processing
    │   ├── Validation ── Error Handling
    │   └── Transformation
    │
    ├── Core Logic
    │   ├── Algorithm A ── Optimization
    │   └── Algorithm B ── Fallback
    │
    └── Output
        ├── Formatting ── Success
        └── Logging ── Debug Info

Common Patterns

Factory Pattern = Restaurant Kitchen

  • Chef (factory) creates different dishes (objects) based on orders
  • Each dish follows a recipe (interface) but implementation varies
  • Customer gets finished dish without knowing cooking details

Observer Pattern = Newspaper Subscription

  • Newspaper (subject) maintains subscriber list
  • When new edition arrives, notifies all subscribers
  • Subscribers receive updates automatically

Gotchas to Watch For

  • Null pointer exceptions: Like trying to open a door that doesn't exist
  • Race conditions: Multiple cooks fighting over the same ingredient
  • Memory leaks: Dirty dishes piling up in the sink
  • Off-by-one errors: Recipe says "add 2 cups" but you add 3

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon