terminalskills-understand-explain
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "terminalskills-understand-explain":https://skillpi.com/zh/skills/deepskill-9e50a3eef18bd3cf6269393469cb0d1fd4dc32272eae9325c28decec0841a6e0。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
使用代码库知识图谱对任意文件、函数或模块做深入解释。适用于理解不熟悉的代码、解释某项功能的实现方式或学习遗留代码库的场景。
介绍来源: third_party · TerminalSkills · 1.0.0 参考来源
SkillPi 解读
- 实测状态
- 未测试
文件浏览
Frontmatter
name: understand-explain
description: >-
Get a deep-dive explanation of any file, function, or module using the codebase knowledge
graph. Use when: understanding unfamiliar code, explaining how a feature is implemented,
learning a legacy codebase.
license: MIT
compatibility: "Claude Code, Cursor, any AI coding agent"
metadata:
author: terminal-skills
version: "1.0.0"
category: development
tags: [codebase, knowledge-graph, documentation, explanation, learning]/understand-explain
Overview
Get a deep-dive explanation of any file, function, or module by combining knowledge graph context with source code analysis. The skill locates the target component in the graph, maps its connections and architectural layer, reads the actual source code, and delivers a clear explanation of how it works and why it exists.
Graph Structure Reference
The knowledge graph JSON has this structure:
project— {name, description, languages, frameworks, analyzedAt, gitCommitHash}nodes[]— each has {id, type, name, filePath, summary, tags[], complexity, languageNotes?}- Node types: file, function, class, module, concept
- IDs:
file:path,func:path:name,class:path:name
edges[]— each has {source, target, type, direction, weight}- Key types: imports, contains, calls, depends_on
layers[]— each has {id, name, description, nodeIds[]}tour[]— each has {order, title, description, nodeIds[]}
How to Read Efficiently
- Use Grep to search within the JSON for relevant entries BEFORE reading the full file
- Only read sections you need — don't dump the entire graph into context
- Node names and summaries are the most useful fields for understanding
- Edges tell you how components connect — follow imports and calls for dependency chains
Instructions
-
Check that
.understand-anything/knowledge-graph.jsonexists. If not, tell the user to run/understandfirst. -
Find the target node — use Grep to search the knowledge graph for the component: "$ARGUMENTS"
- For file paths (e.g.,
src/auth/login.ts): search for"filePath"matches - For function notation (e.g.,
src/auth/login.ts:verifyToken): search for the function name in"name"fields filtered by the file path - Note the exact node
id,type,summary,tags, andcomplexity
- For file paths (e.g.,
-
Find all connected edges — Grep for the target node's ID in the edges section:
"source"matches → things this node calls/imports/depends on (outgoing)"target"matches → things that call/import/depend on this node (incoming)- Note the connected node IDs and edge types
-
Read connected nodes — for each connected node ID from step 3, Grep for those IDs in the nodes section to get their
name,summary, andtype. This builds the component's neighborhood. -
Identify the layer — Grep for the target node's ID in the
"layers"section to find which architectural layer it belongs to and that layer's description. -
Read the actual source file — Read the source file at the node's
filePathfor the deep-dive analysis. -
Explain the component in context:
- Its role in the architecture (which layer, why it exists)
- Internal structure (functions, classes it contains — from
containsedges) - External connections (what it imports, what calls it, what it depends on — from edges)
- Data flow (inputs → processing → outputs — from source code)
- Explain clearly, assuming the reader may not know the programming language
- Highlight any patterns, idioms, or complexity worth understanding
Examples
Example 1: Explaining a file
User: /understand-explain src/auth/session.ts
The agent searches the knowledge graph for filePath matching src/auth/session.ts and finds file:src/auth/session.ts (summary: "JWT session management with refresh token rotation", complexity: 7, tags: auth, jwt, security). It finds edges showing that createSession is called by createUser and handleLogin, and that the file imports jsonwebtoken and src/config/auth-config.ts. The layer lookup shows it belongs to the Authentication layer. The agent reads the source file and explains: the file exports 4 functions (createSession, validateSession, refreshSession, destroySession), implements JWT with RS256 signing, uses refresh token rotation to prevent token theft, and sits at the core of the auth layer with 6 upstream callers depending on it.
Example 2: Explaining a specific function
User: /understand-explain src/api/middleware.ts:requireAuth
The agent searches for a node with name requireAuth in file src/api/middleware.ts and finds func:src/api/middleware.ts:requireAuth (summary: "Express middleware that validates JWT and attaches user to request", complexity: 4). Edge traversal shows 12 API route handlers depend on this function, and it calls validateSession from the auth layer. The agent reads the source file, locates the function, and explains: it extracts the Bearer token from the Authorization header, calls validateSession to verify the JWT, attaches the decoded user object to req.user, and returns 401 if the token is missing or invalid. It is the gateway function that protects all authenticated endpoints.
Guidelines
- Start with the graph context before reading source code to understand the component's role in the architecture first
- Explain clearly assuming the reader may not know the programming language used
- Highlight complexity hotspots and patterns that are non-obvious from the code alone
- When explaining a file, focus on exported functions and the public API rather than internal helpers
- If the target component is not found in the graph, search by partial name match and suggest corrections
当前收录版本
1.0.0
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供代码库深度解释功能,适用于理解陌生代码、学习遗留代码库等高频开发场景
- 结合知识图谱与源码分析,提供架构上下文与实现细节的双重解释
亮点
- 触发场景描述清晰明确,覆盖多种使用变体
- 边界定义合理,不易与其他 Skill 混淆
亮点
- 文档结构完整,包含图结构参考、分步指令、端到端示例
- frontmatter 信息完整,包含兼容性、元数据等关键信息
待提升项
-
description写错位置 原报告严重程度:轻微
顶层 description 字段内容与 skill_body 内部 frontmatter 重复,且顶层 description 较短
改进建议:建议将详细描述统一放在顶层 description 字段,或确保两个位置的描述内容互补而非重复
亮点
- 执行流程设计合理,包含前置条件检查与异常处理建议
- 工具使用明确,参数说明清晰,覆盖主要使用场景
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。