agentleFS
almax000almax000/claude-skills/explain-code/SKILL.md

explain-code

Skill1 starsChanged 7 months agoMITView on GitHub

解释代码的工作原理。当用户问"这是如何工作的"、"这段代码做什么"、需要理解代码逻辑时使用。

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use write-tests, teach and 7 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.
  • SentrySkill

    write-tests

    Write tests following project conventions. Use when adding new tests or modifying existing ones.

    Also in 4 projects that use this

  • AWSSkill

    teach

    Teach the user a new skill or concept, within this workspace.

    Also in 4 projects that use this

  • NVIDIASkill

    deep-research

    Queue deep, multi-step research and analysis tasks to the DeepAgents worker. Supports execution depth presets, request-specific rubrics, SubAgent delegation, and RubricMiddleware cross-validation.

    Also in 3 projects that use this

  • AnthropicSkill

    debug

    Structured debugging session — reproduce, isolate, diagnose, and fix. Trigger with an error message or stack trace, "this works in staging but not prod", "something broke after the deploy", or when behavior diverges from expected and the cause isn't obvious.

    Also in 3 projects that use this

  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 4 projects that use this

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 5 projects that use this

The file

Files
SKILL.md

代码解释助手

解释方法

1. 从整体到细节

先给出高层次的概述,再深入细节:

这段代码的作用是 [一句话概述]

它通过以下步骤实现:
1. 首先...
2. 然后...
3. 最后...

2. 使用类比

将代码概念与日常生活类比:

  • Promise → 餐厅取餐号
  • 回调函数 → 留下电话等回电
  • 缓存 → 便利贴备忘
  • 队列 → 排队
  • 栈 → 叠盘子
  • 递归 → 俄罗斯套娃

3. 绘制图表

用 ASCII 图展示流程或结构:

请求 → [验证] → [处理] → [响应]
           ↓
        [错误处理]
┌─────────────┐
│   Controller │
└──────┬──────┘
       │
       ▼
┌─────────────┐
│   Service    │
└──────┬──────┘
       │
       ▼
┌─────────────┐
│  Repository  │
└─────────────┘

4. 逐步讲解

对于复杂代码,逐行/逐块解释:

// 1. 获取用户输入
const input = getUserInput();

// 2. 验证输入格式
if (!isValid(input)) {
  throw new Error('Invalid input');
}

// 3. 处理数据
const result = process(input);

5. 突出关键点

指出:

  • 核心逻辑是什么
  • 为什么这样设计
  • 常见的误解或陷阱
  • 可能的改进空间

输出格式

## 代码概述
[一句话说明这段代码的作用]

## 工作原理
[用类比或图表解释核心概念]

## 详细步骤
1. [步骤1]
2. [步骤2]
...

## 关键点
- [重要的设计决策]
- [需要注意的地方]

## 相关知识
- [涉及的概念或模式]

原则

  • 根据受众调整深度
  • 避免术语堆砌,用简单语言
  • 复杂概念用多个角度解释
  • 鼓励提问和互动

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.