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

explain-code

Skill1 starsChanged 7 months agoMITView on GitHub

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

48 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use explore-codebase, write-tests and 9 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.
  • srclightSkill

    explore-codebase

    This skill should be used when the user asks to "explore this codebase", "understand this project", "give me an overview", "how does this work", "onboard me", "walk me through the architecture", "map the codebase", or any request to understand a codebase's structure, architecture, or design.

    Also in 3 projects that use this

  • SentrySkill

    write-tests

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

    Also in 6 projects that use this

  • silvainfmSkill

    copy-editing

    When the user wants to edit, review, or improve existing marketing copy. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,' 'proofread,' 'polish this,' 'make this better,' or 'copy sweep.' This skill provides a systematic approach to editing marketing copy through multiple focused passes.

    Also in 3 projects that use this

  • silvainfmSkill

    pricing-strategy

    When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' or 'monetization.' This skill covers pricing research, tier structure, and packaging strategy.

    Also in 3 projects that use this

  • SentrySkill

    marketing-psychology

    When the user wants to apply psychological principles, mental models, or behavioral science to marketing. Also use when the user mentions 'psychology,' 'mental models,' 'cognitive bias,' 'persuasion,' 'behavioral science,' 'why people buy,' 'decision-making,' or 'consumer behavior.' This skill provides 70+ mental models organized for marketing application.

    Also in 3 projects that use this

  • Google CloudSkill

    open-pr

    Commits local changes to a new Git branch and opens a GitHub pull request through the configured GitHub MCP server. Use when proposing code changes in a new pull request. Don't use for local-only commits without a remote GitHub repository.

    Also in 3 projects that use this

  • +1 more from getsentry

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.