← スキル一覧に戻る

explaining-code
by rockyflux
箫风博客
⭐ 3🍴 0📅 2026年1月22日
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:
- Start with an analogy: Compare the code to something from everyday life
- Draw a diagram: Use ASCII art to show the flow, structure, or relationships
- Walk through the code: Explain step-by-step what happens
- 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
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓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
レビュー
💬
レビュー機能は近日公開予定です