← ClaudeAtlas

explain-allierays-agentic-looplisted

Explain what code does line by line so you can understand and learn from it.
majiayu000/claude-skill-registry · ★ 364 · AI & Automation · score 83
Install: claude install-skill majiayu000/claude-skill-registry
# Explain Code Explain what code does, line by line, so you can understand and learn from it. ## Instructions When the user asks you to explain code: ### Step 1: Identify the Code If the user provides a file path, read that file. If they paste code directly, use that. If no code is specified, ask: > "What code would you like me to explain? Please provide a file path or paste the code." ### Step 2: Provide Overview Start with a high-level summary: - What is the purpose of this code? - What problem does it solve? - How does it fit into the larger application? ### Step 3: Walk Through Line by Line For each significant section, explain: - **What** it does (literally) - **Why** it's needed (purpose) - **How** it works (mechanism) Use this format: ``` Lines X-Y: [Brief description] - This code [what it does] - It's needed because [why] - It works by [how] ``` ### Step 4: Highlight Key Concepts Point out important patterns and concepts: - Design patterns used - Language features that might be unfamiliar - Best practices demonstrated - Potential gotchas or edge cases ### Step 5: Summarize End with: - Key takeaways - What the user should understand now - Suggestions for further learning if applicable ## Example Output ``` ## Overview This is a React custom hook that manages authentication state. It handles login, logout, and automatic token refresh. ## Line-by-Line Explanation ### Lines 1-5: Imports ```typescript import { useState, useEffect, useCallback } from 'r