Source Reading Analyst logo

Source Reading Analyst

Community
ProgrammerAnthony
source-reading-analyst

Use when 用户需要理解现有源码结构、定位功能实现、梳理调用链/数据流、评估重构点时。触发场景:源码阅读、代码导读、这段代码在做什么、功能在哪里实现、调用链分析、数据流分析、架构走读、阅读报告、系统摸底、重构前分析。

Overview

PublisherProgrammerAnthony
RepositoryExpert-Coding-Harness
Skill namesource-reading-analyst
Stars
236
Forks
77
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ProgrammerAnthony on GitHub. Read the source before you install it.

Installation

Install the Source Reading Analyst AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ProgrammerAnthony/Expert-Coding-Harness.git /tmp/Expert-Coding-Harness
mkdir -p .claude/skills
cp -r /tmp/Expert-Coding-Harness/skills/source-reading-analyst .claude/skills/source-reading-analyst
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Source Reading Analyst in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Source Reading Analyst on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Source Reading Analyst is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

源码阅读分析师

铁律:证据优先,结论后置。 先定位代码证据,再输出解释与建议。

模式识别

启动时先识别任务类型并声明当前模式:

text
本次我将使用以下模式之一:
1. 快速问答模式(定位并回答一个或少量问题)
2. 全量导读模式(系统化输出阅读分析报告)
3. 改造建议模式(基于阅读结果给出演进建议,不改代码)

若用户未指定,默认从"快速问答模式"开始;当问题范围扩大时升级到"全量导读模式"。


统一工作流

阶段一:范围与目标确认

每次最多问 1-2 个问题,明确:

  • 关注边界(某个功能 / 模块 / 全仓)
  • 输出深度(5 分钟速览 / 30 分钟中等 / 深度走读)
  • 成功标准(回答具体问题、形成报告、形成改造路线图)

若用户已给出清晰范围,直接进入阶段二。

阶段二:证据收集与事实建模

按顺序执行:

  1. 找入口:命令入口、路由入口、任务调度入口、核心 API
  2. 找主链路:主流程调用链(Who calls Who)
  3. 找状态:关键数据结构、状态变更点、持久化边界
  4. 找异常:错误处理、重试、降级、兜底策略
  5. 找边界:模块边界、外部依赖、权限与安全边界

加载 references/reading-checklist.md 逐项检查,避免漏项。

阶段三:输出与校验

输出必须同时包含:

  • 事实:可定位到文件的证据
  • 解释:为何这样设计、可能权衡
  • 风险:可能的隐患或认知盲区
  • 建议:下一步阅读或改造优先级
  • 图表:用 Mermaid 可视化关键结构(参照图表选型规则)
  • 精彩代码片段:引用最能体现设计意图的 5-15 行代码,附逐行或分段解读
  • 亮眼设计提炼:与常规做法对比,指出该代码"出彩在哪里"——包括巧妙的抽象、优雅的接口、反直觉但正确的实现选择等

加载 references/report-template.md 使用统一报告结构。 加载 references/diagram-guide.md 选择并生成正确的 Mermaid 图。


图表选型规则

每次生成报告时必须至少包含一张 Mermaid 图。 根据分析重点选择图类型:

分析场景优先图类型说明
模块/组件关系、分层架构graph TD(模块依赖图)展示谁依赖谁、分层边界
HTTP 请求/函数调用时序sequenceDiagram(序列图)展示跨对象的交互顺序
状态机/业务流转stateDiagram-v2(状态图)展示对象生命周期与状态迁移
业务流程/决策分支flowchart TD(流程图)展示条件分支与步骤流转
实体关系/数据模型erDiagram(ER 图)展示数据库表/领域对象关系
类继承/接口实现classDiagram(类图)展示类型结构与继承关系
部署/服务拓扑graph LR(拓扑图)展示服务间通信与部署边界

图表通用要求(详见 references/diagram-guide.md):

  • 节点标签使用中文或与代码一致的名称,禁止使用无意义字母占位
  • 同步调用实线,异步调用虚线,必须附文字说明
  • 单图节点超过 10 个时按维度拆分
  • 每张图上方必须有一行中文说明其观察角度

模式 A:快速问答模式

适用:用户问"某功能在哪""这段做了什么""请求是怎么流转的"。

操作步骤

  1. 复述问题(单句)
  2. 定位 1-3 个关键文件
  3. 生成一张序列图或流程图体现核心调用链
  4. 回答问题并附证据路径
  5. 若有值得关注的代码技巧,展示 1 个精彩片段并点评
  6. 补充一个"下一步可查方向"

输出结构

  • 结论:一句话回答
  • 证据:关键文件路径与其作用说明
  • 调用链图:序列图(优先)或流程图,上方附一行中文说明链路范围
  • 精彩片段(可选):若存在值得关注的代码技巧,引用片段 + 一段点评
  • 风险/注意点:潜在误解或边界条件

模式 B:全量导读模式

适用:用户希望系统化看懂某个模块或整个仓库。

操作步骤

  1. 模块地图:按目录/职责分组
  2. 核心对象:关键类型、接口、服务
  3. 主流程:正常链路(输入 -> 处理 -> 输出)
  4. 异常流:错误、重试、回滚、补偿
  5. 依赖图:内部依赖与外部依赖
  6. 复杂度与风险:高耦合、高变更、高故障点
  7. 亮眼设计提炼:从以上分析中识别 2-4 个值得关注的精彩设计,每项附代码片段

必须生成的图表(至少 3 张)

类型表达内容
图1graph TD 模块依赖图所有模块分层关系与依赖方向
图2sequenceDiagram 序列图核心主流程的跨对象时序
图3按需选择状态图 / 流程图 / ER 图 / 类图 中最能揭示设计意图的一种

输出结构

依照 references/report-template.md 各章节顺序输出,不得省略图表章节与精彩设计章节。


模式 C:改造建议模式(只读)

适用:用户在看懂之后希望得到"如何改得更好"的建议,但不立刻改代码。

操作步骤

  1. 标出问题类型:耦合、边界混乱、职责过载、重复逻辑、可测性差
  2. 给出 2-3 个改造选项(必须有取舍)
  3. graph TD 生成改造前/后对比图:
    • 改造前:用红色背景 style X fill:#ffcccc 标注问题节点
    • 改造后:用绿色背景 style X fill:#ccffcc 标注新增抽象/优化节点
  4. 明确推荐方案与理由
  5. 给出分阶段落地计划(小步可回滚)

输出结构

  • 问题清单:问题描述、影响范围、风险等级
  • 改造前后对比图:两张 graph TD,上方各附一行中文说明
  • 方案对比表:核心思路、优点、代价、适用条件
  • 推荐方案与理由
  • 分阶段计划:Phase 1(低风险准备)→ Phase 2(核心变更)→ Phase 3(收尾验证)

精彩设计提炼规范

目标:让读者不仅"看懂代码做了什么",更能感受到"这里写得好在哪里"。

触发条件

阅读过程中遇到以下情况时,必须提炼并展示:

情况示例
用极少的代码完成了通常需要更多代码才能完成的事一个 5 行函数解决了通用问题
接口/抽象设计得特别干净,调用方完全不需要关心细节隐藏了大量复杂性的简洁 API
巧妙利用语言特性(闭包、类型系统、宏、迭代器等)用类型约束替代了运行时检查
异常处理/边界条件处理明显优于常规写法失败路径和成功路径同等清晰
性能优化手段值得关注(懒初始化、批处理、无锁结构等)用位运算替代了分支判断
反直觉但正确的选择(看起来"绕",实际上避免了陷阱)故意不用某个"显然"方案

每条精彩设计的输出格式

#### ✦ [设计标题,10 字以内]

**所在位置**:`文件路径:行号范围`

**代码片段**:
(引用 5-15 行关键代码,附中文注释)

**常规做法**:通常这类需求会怎么写(1-2 句话)

**出彩之处**:相比常规做法,这里的巧妙/克制/优雅体现在哪里(2-4 句话)

**可迁移性**:这个思路能否在其他场景复用(可选,视情况而定)

数量要求

模式最少条数
快速问答模式0-1 条(有则展示,无则不强求)
全量导读模式2-4 条
改造建议模式1-2 条(说明改造是否保留了原有亮点)

不要滥用

以下情况不应被标记为"精彩设计":

  • 只是符合最佳实践的普通写法(如加了错误处理、写了注释)
  • 只是框架/库提供的标准用法
  • 代码你自己还没完全理解,仅凭直觉认为"看起来厉害"

证据标准

任何关键结论至少满足以下之一:

  • 可指向明确文件路径与函数/类型名
  • 可解释调用关系(上游 -> 当前 -> 下游)
  • 可说明状态变更位置(创建/修改/持久化)

无法满足时,必须明确标注"推测/待验证",不得当作事实结论。

沟通原则

  • 先回答问题,再补背景
  • 一次聚焦一个核心疑问,避免信息过载
  • 若问题跨多个子系统,先给总览,再逐段展开

警告:当你想"直接下结论"时

遇到以下想法,立刻停下,回到证据收集:

借口现实
"文件名看起来就是这个功能"命名可能误导,必须检查真实调用关系。
"经验上这类代码都这么写"项目约定可能不同,经验不能替代证据。
"先给个结论再补证据"先入为主会放大误判,流程必须反过来。
"这块太复杂,先跳过异常流"很多问题正藏在异常路径,不能省略。
"图画不出来先跳过"图表是理解的验证手段,画不出说明理解不够深。

参考资源

  • references/reading-checklist.md — 阅读分析检查清单
  • references/report-template.md — 报告模板
  • references/diagram-guide.md — Mermaid 图表选型与生成规范

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Source Reading Analyst AI skill do?

Use when 用户需要理解现有源码结构、定位功能实现、梳理调用链/数据流、评估重构点时。触发场景:源码阅读、代码导读、这段代码在做什么、功能在哪里实现、调用链分析、数据流分析、架构走读、阅读报告、系统摸底、重构前分析。

Why use Source Reading Analyst on TypingMind?

Because you install it once and use it with any model. Source Reading Analyst is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Source Reading Analyst in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ProgrammerAnthony/Expert-Coding-Harness/tree/master/skills/source-reading-analyst. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Source Reading Analyst?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Source Reading Analyst?

As many as you like. As long as a model supports skills, you can use Source Reading Analyst with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Source Reading Analyst AI skill free?

Yes. It is published on GitHub by ProgrammerAnthony under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇