Dependency Map logo

Dependency Map

Community
312362115
dependency-map

依赖关系分析技能:回答"改这里会影响哪里"。 追踪调用链、数据流、副作用,评估改动的影响面。 和 code-walkthrough 的区别:walkthrough 关注"是什么",dependency-map 关注"改了影响谁"。 触发词:影响面、改这个会影响哪里、依赖关系、调用链、影响分析、谁在用这个。 触发场景:改动前评估影响、重构前分析依赖、删代码前确认安全、API 变更前评估调用方。 即使用户没有说"依赖分析",只要意图是"评估改动的影响范围",都应触发此技能。

Overview

Publisher312362115
Repositoryclaude
Skill namedependency-map
Stars
107
Forks
17
Bundled files
Instructions only
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

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

Installation

Install the Dependency Map 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.
    https://github.com/312362115/claude/tree/main/skills/dependency-map
  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/312362115/claude.git /tmp/claude
mkdir -p .claude/skills
cp -r /tmp/claude/skills/dependency-map .claude/skills/dependency-map
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Dependency Map 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 Dependency Map 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 Dependency Map 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.

依赖关系分析(Dependency Map)

代码改动最怕的不是改错,而是不知道改动波及到了哪里。 本 skill 的使命:在改动之前,画出影响面地图。


第一步:确定分析目标

用 AskUserQuestion 确认:

  • 分析什么:哪个函数/类/模块/文件?
  • 为什么分析:准备改什么?删什么?还是纯了解?
  • 分析深度:只看直接依赖,还是追踪到底?
分析请求
  │
  ├─ 改函数签名 → 追踪所有调用方
  ├─ 改数据结构 → 追踪数据的读写点
  ├─ 删文件/模块 → 追踪所有 import
  ├─ 改 API 接口 → 追踪前端调用 + 外部消费方
  └─ 改配置/环境变量 → 追踪所有引用点

第二步:静态依赖分析

2.1 Import/Require 分析

bash
# 找到谁引用了目标文件
grep -r "import.*from.*'目标模块'" src/
grep -r "require('目标模块')" src/

# 或用 Grep 工具搜索

输出格式:

markdown
## 引用关系

### 被谁引用(上游,改目标会影响他们)
- `src/api/auth.ts:3` — import { login } from './services/auth'
- `src/api/user.ts:5` — import { validateToken } from './services/auth'
- `tests/auth.test.ts:1` — import { login, logout } from '../services/auth'

### 引用了谁(下游,目标依赖他们)
- `src/models/user.ts` — UserModel
- `src/utils/jwt.ts` — signToken, verifyToken
- `bcrypt` — 外部依赖

2.2 函数/方法级调用链

对于函数级分析,追踪更精细的调用关系:

bash
# 搜索函数名的所有调用
grep -rn "目标函数名(" src/ --include="*.ts" --include="*.js"

输出格式:

markdown
## 调用链:validateToken()

定义:src/services/auth.ts:45

调用方:
├─ src/middleware/auth.ts:12 — authMiddleware() 每个请求都会调用
│   └─ 被 src/api/index.ts:8 的 app.use(authMiddleware) 注册为全局中间件
├─ src/api/user.ts:23 — getUserProfile() 手动调用做额外校验
└─ tests/auth.test.ts:34 — 测试用例

影响面评估:
- authMiddleware 是全局中间件 → 改签名会影响所有需要认证的接口
- 测试需要同步更新

第三步:数据流分析

当改动涉及数据结构时,追踪数据从哪来、到哪去:

3.1 数据结构变更

markdown
## 数据流:User 类型

### 定义位置
`src/types/user.ts:5` — interface User { id, name, email, role }

### 创建点(写入)
- `src/services/user.ts:createUser()` — 注册时创建
- `src/services/auth.ts:oauthCallback()` — OAuth 登录时创建

### 读取点
- `src/api/user.ts:getUserProfile()` — 返回给前端
- `src/middleware/auth.ts:12` — 从 token 解析出 user
- `src/services/order.ts:45` — 创建订单时读取 user.id

### 持久化
- `src/models/user.ts` — 数据库 users 表
- `src/utils/cache.ts:getUserCache()` — Redis 缓存

### 影响评估
如果给 User 加字段:
- 数据库需要 migration
- 缓存的序列化/反序列化需要兼容
- API 响应自动包含(如果没有字段过滤的话)

如果删 User 字段:
- 检查所有读取点是否还在用
- 前端是否依赖这个字段

第四步:输出影响面评估

4.1 影响面清单

markdown
## 影响面评估:<改动描述>

### 直接影响(必须改)
| 文件 | 行号 | 影响原因 | 改动类型 |
|------|------|---------|---------|
| src/api/auth.ts | 23 | 调用了要修改的函数 | 同步更新参数 |
| src/middleware/auth.ts | 12 | 依赖返回值结构 | 适配新结构 |

### 间接影响(需要验证)
| 文件 | 行号 | 风险点 | 验证方式 |
|------|------|--------|---------|
| src/api/user.ts | 45 | 使用了相同的类型 | 跑测试确认 |

### 不受影响(确认安全)
- src/services/order.ts — 虽然在同目录,但无依赖关系
- src/utils/format.ts — 纯工具函数,不涉及

### 测试影响
- tests/auth.test.ts — 需要更新测试用例
- tests/user.test.ts — 需要回归验证

4.2 风险等级

等级判断标准
低风险只影响内部实现,公共接口不变,有测试覆盖
中风险影响多个文件但不影响外部接口,有部分测试覆盖
高风险影响公共接口/全局中间件/数据结构,测试覆盖不足

分析准则

  • 宁多不漏:不确定的归入"需要验证",不要归入"不受影响"
  • 标注行号:每个影响点必须标注具体位置,方便定位
  • 区分直接/间接:直接影响必须改,间接影响需验证,不要混在一起
  • 关注隐式依赖:不只看 import,还要看运行时依赖(事件监听、全局状态、环境变量)
  • 递归但有界:追踪调用链要有深度限制,一般追 3 层足够。超过 3 层的间接影响可忽略

与其他 skill 的关系

code-walkthrough(理解代码)→ dependency-map(评估影响)→ refactoring(执行改动)

dependency-map vs code-walkthrough:

  • walkthrough:理解代码。"这段代码是什么,怎么运转"
  • dependency-map:评估影响。"改这里会动到哪里"
  • 通常先 walkthrough 建立理解,再 dependency-map 评估改动

Frequently asked questions

What does the Dependency Map AI skill do?

依赖关系分析技能:回答"改这里会影响哪里"。 追踪调用链、数据流、副作用,评估改动的影响面。 和 code-walkthrough 的区别:walkthrough 关注"是什么",dependency-map 关注"改了影响谁"。 触发词:影响面、改这个会影响哪里、依赖关系、调用链、影响分析、谁在用这个。 触发场景:改动前评估影响、重构前分析依赖、删代码前确认安全、API 变更前评估调用方。 即使用户没有说"依赖分析",只要意图是"评估改动的影响范围",都应触发此技能。

Why use Dependency Map on TypingMind?

Because you install it once and use it with any model. Dependency Map 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 Dependency Map in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/312362115/claude/tree/main/skills/dependency-map. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Dependency Map?

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 Dependency Map?

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

Is the Dependency Map AI skill free?

Yes. It is published on GitHub by 312362115 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 👇