tldr-deep by parcadei/continuous-claude-v3
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill tldr-deep对特定函数进行完整的五层分析。用于调试或深入理解代码。
/tldr-deep <函数名>| 层级 | 目的 | 命令 |
|---|---|---|
| L1: 抽象语法树 | 结构分析 | tldr extract <文件> |
| L2: 调用图 | 导航分析 | tldr context <函数> --depth 2 |
| L3: 控制流图 | 复杂度分析 | tldr cfg <文件> <函数> |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| L4: 数据流图 | 数据流分析 | tldr dfg <文件> <函数> |
| L5: 程序切片 | 依赖关系分析 | tldr slice <文件> <函数> <行号> |
给定一个函数名,运行所有分析层级:
# 首先找到文件
tldr search "def <函数名>" .
# 然后运行每个层级
tldr extract <找到的文件> # L1: 完整文件结构
tldr context <函数名> --project . --depth 2 # L2: 调用图
tldr cfg <找到的文件> <函数名> # L3: 控制流
tldr dfg <找到的文件> <函数名> # L4: 数据流
tldr slice <找到的文件> <函数名> <目标行号> # L5: 程序切片
## 深度分析: {函数名}
### L1: 结构 (抽象语法树)
文件: {文件路径}
函数签名: {签名}
文档字符串: {文档字符串}
### L2: 调用图
调用函数: {此函数调用的函数列表}
被调用: {调用此函数的函数列表}
### L3: 控制流 (控制流图)
基本块: {N}
圈复杂度: {M}
[如果 M > 10 则标记为热点]
分支结构:
- if: 第 X 行
- for: 第 Y 行
- ...
### L4: 数据流 (数据流图)
定义的变量:
- {变量1} @ 第 X 行
- {变量2} @ 第 Y 行
使用的变量:
- {变量1} @ 第 [A, B, C] 行
- {变量2} @ 第 [D, E] 行
### L5: 程序切片 (影响第 {目标行} 行)
切片中的行数: {N}
关键依赖关系:
- 第 X 行 → 第 Y 行 (数据依赖)
- 第 A 行 → 第 B 行 (控制依赖)
---
总计: ~{令牌数} 个令牌 (相比原始文件节省 95%)
from tldr.api import (
extract_file,
get_relevant_context,
get_cfg_context,
get_dfg_context,
get_slice
)
# 获取一个函数的所有分析层级
file_info = extract_file("src/processor.py")
context = get_relevant_context("src/", "process_data", depth=2)
cfg = get_cfg_context("src/processor.py", "process_data")
dfg = get_dfg_context("src/processor.py", "process_data")
slice_lines = get_slice("src/processor.py", "process_data", target_line=42)
每周安装量
195
代码仓库
GitHub 星标数
3.6K
首次出现时间
2026年1月24日
安全审计
安装于
opencode188
gemini-cli185
codex185
github-copilot182
cursor182
amp179
Full 5-layer analysis of a specific function. Use when debugging or deeply understanding code.
/tldr-deep <function_name>| Layer | Purpose | Command |
|---|---|---|
| L1: AST | Structure | tldr extract <file> |
| L2: Call Graph | Navigation | tldr context <func> --depth 2 |
| L3: CFG | Complexity | tldr cfg <file> <func> |
| L4: DFG | Data flow | tldr dfg <file> <func> |
| L5: Slice | Dependencies | tldr slice <file> <func> <line> |
Given a function name, run all layers:
# First find the file
tldr search "def <function_name>" .
# Then run each layer
tldr extract <found_file> # L1: Full file structure
tldr context <function_name> --project . --depth 2 # L2: Call graph
tldr cfg <found_file> <function_name> # L3: Control flow
tldr dfg <found_file> <function_name> # L4: Data flow
tldr slice <found_file> <function_name> <target_line> # L5: Slice
## Deep Analysis: {function_name}
### L1: Structure (AST)
File: {file_path}
Signature: {signature}
Docstring: {docstring}
### L2: Call Graph
Calls: {list of functions this calls}
Called by: {list of functions that call this}
### L3: Control Flow (CFG)
Blocks: {N}
Cyclomatic Complexity: {M}
[Hot if M > 10]
Branches:
- if: line X
- for: line Y
- ...
### L4: Data Flow (DFG)
Variables defined:
- {var1} @ line X
- {var2} @ line Y
Variables used:
- {var1} @ lines [A, B, C]
- {var2} @ lines [D, E]
### L5: Program Slice (affecting line {target})
Lines in slice: {N}
Key dependencies:
- line X → line Y (data)
- line A → line B (control)
---
Total: ~{tokens} tokens (95% savings vs raw file)
from tldr.api import (
extract_file,
get_relevant_context,
get_cfg_context,
get_dfg_context,
get_slice
)
# All layers for one function
file_info = extract_file("src/processor.py")
context = get_relevant_context("src/", "process_data", depth=2)
cfg = get_cfg_context("src/processor.py", "process_data")
dfg = get_dfg_context("src/processor.py", "process_data")
slice_lines = get_slice("src/processor.py", "process_data", target_line=42)
Weekly Installs
195
Repository
GitHub Stars
3.6K
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
opencode188
gemini-cli185
codex185
github-copilot182
cursor182
amp179
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
31,600 周安装