agentleFS
allieraysallierays/agentic-loop/.claude/skills/explain/SKILL.md

explain

Skill38 starsChanged 9 months agoMITView on GitHub

Explain what code does line by line so you can understand and learn from it.

58 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use doc, rubber-duck and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • JetBrainsSkill

    doc

    Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts/render_docx.py` for visual checks.

    Also in 5 projects that use this

  • ElliotJLTSkill

    rubber-duck

    When a user is stuck, frustrated, or describing a problem vaguely, do NOT immediately suggest solutions. First, force structured problem articulation through targeted questions: What did you expect? What happened instead? What have you tried? Only after the problem is clearly defined, propose solutions.

    Also in 3 projects that use this

  • clearsmogSkill

    translate

    Multi-format document translation. Supports Typst ↔ Quarto. For Beamer translations, configure at project level.

    Also in 3 projects that use this

  • genomewalkerSkill

    migrate

    Import soul data from SQLite or shared chitta files

    Also in 4 projects that use this

  • Google CloudSkill

    fix

    Plan a remediation strategy after a test failure.

    Also in 4 projects that use this

  • Hugging FaceSkill

    self-review

    Use before opening a PR, or whenever asked to self-review a diffusers contribution. Applies the same rubric as the `@claude` CI (checks the diff against references/review-rules.md, traces call paths for dead code). Reports findings grouped by severity, flagging what to fix before submitting (blocking issues + dead code) vs what to leave for the actual review. Report-only — does not edit files.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 52 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the user asks you to explain code:

    line 11
  2. Distinctive:

    If the user provides a file path, read that file.

    line 15
  3. Distinctive:

    If no code is specified, ask:

    line 17
  4. Distinctive:

    Start with a high-level summary:

    line 22
  5. Distinctive:

    Ask me to explain:

    line 107

“Common” is measured: kept by at least 6 in 10 of the 52 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 'react';
import { authApi } from '@/services/api';
import { User } from '@/types';
  • Imports React hooks for state management and side effects
  • Imports the auth API service for making authentication requests
  • Imports the User type for type safety

Lines 7-15: Hook Definition and State

export function useAuth() {
  const [user, setUser] = useState<User | null>(null);
  const [loading, setLoading] = useState(true);
  • Creates a custom hook that can be used in any component
  • user state holds the current user (or null if logged out)
  • loading state tracks whether we're still checking auth status
  • Starting with loading: true prevents flash of unauthenticated content

Lines 17-30: Auto-refresh Effect

[... continue explanation ...]

Key Concepts

  1. Custom Hooks: Reusable logic extracted from components
  2. Optimistic Updates: UI updates before server confirms
  3. Token Refresh: Automatic re-authentication before expiry

Takeaways

  • This hook centralizes all auth logic in one place
  • Components just need to call useAuth() to access auth state
  • The refresh logic runs automatically in the background

## Tips for Users

Ask me to explain:
- "Explain this function" (paste code)
- "Explain src/hooks/useAuth.ts"
- "Explain lines 50-100 of api.ts"
- "What does this regex do?"
- "Why is this pattern used here?"

I'll adjust the depth based on what you ask. For simple code, I'll be brief. For complex code, I'll be thorough.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.