vault backup: 2026-04-14 23:49:17
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
"title": "Greet user in Chinese",
|
||||
"titleGenerationStatus": "success",
|
||||
"createdAt": 1776071385957,
|
||||
"updatedAt": 1776169327308,
|
||||
"lastResponseAt": 1776169327308,
|
||||
"updatedAt": 1776179962356,
|
||||
"lastResponseAt": 1776179962356,
|
||||
"sessionId": "c432006f-72f1-4f80-9625-7cb62e468878",
|
||||
"providerState": {
|
||||
"providerSessionId": "c432006f-72f1-4f80-9625-7cb62e468878"
|
||||
@@ -14,10 +14,10 @@
|
||||
"usage": {
|
||||
"model": "opus[1m]",
|
||||
"inputTokens": 1,
|
||||
"cacheCreationInputTokens": 1118,
|
||||
"cacheReadInputTokens": 36301,
|
||||
"cacheCreationInputTokens": 1084,
|
||||
"cacheReadInputTokens": 41428,
|
||||
"contextWindow": 1000000,
|
||||
"contextTokens": 37420,
|
||||
"contextTokens": 42513,
|
||||
"percentage": 4,
|
||||
"contextWindowIsAuthoritative": true
|
||||
}
|
||||
|
||||
@@ -158,3 +158,18 @@ graphify trae-cn uninstall
|
||||
| httpx(合成 Python 库) | 6 | ~1x | [`worked/httpx/`](worked/httpx/) |
|
||||
|
||||
Token 压缩效果会随着语料规模增大而更明显。6 个文件本来就塞得进上下文窗口,所以 graphify 在这种场景里的价值更多是结构清晰度,而不是 token 压缩。到了 52 个文件(代码 + 论文 + 图片)这种规模,就能做到 71x+。每个 `worked/` 目录里都带了原始输入和真实输出(`GRAPH_REPORT.md`、`graph.json`),你可以自己跑一遍核对数字。
|
||||
|
||||
# 针对UE开发的使用方式
|
||||
### 具体的实施路线图
|
||||
1. **安装 Graphify 并配置 ClaudeCode 技能:** 在你的项目根目录运行:
|
||||
```
|
||||
graphify install # 自动向 CLAUDE.md 注入架构索引规则
|
||||
/graphify . # 生成初始代码图
|
||||
```
|
||||
2. **编写 `CLAUDE.md` 引导:** 在项目根目录创建或修改 `CLAUDE.md`:
|
||||
> **Architecture Context:** Always read `graphify-out/GRAPH_REPORT.md` before answering architecture questions. **UE Standards:** Follow Unreal Engine 5.x coding standards (PascalCase, U-Prefixes).
|
||||
3. **开发 MCP 插件:** 如果你有能力,实现一个简单的 MCP Server,能够通过命令行搜索 UE 的 `Reflection Database`。
|
||||
|
||||
### 总结建议
|
||||
- **如果你追求立即理解代码逻辑:** 优先配置 **Graphify**。它能让 Claude 从“逐行看代码”进化到“看地图写代码”。
|
||||
- **如果你在进行长期复杂的特性开发:** 引入 **Graphiti** 作为 Claude 的“开发日志”,防止它忘记你之前的架构决策。
|
||||
@@ -1,18 +1,93 @@
|
||||
# 前言
|
||||
# Obsidian CLI
|
||||
|
||||
## 参考资料
|
||||
|
||||
- [Obsidian CLI 详细教程:官方命令行工具,激进拥抱智能体,高效 + 自动化 + 降低 Token 消耗](https://www.bilibili.com/video/BV19TPXzAEtW/?share_source=copy_web&vd_source=fe8142e8e12816535feaeabd6f6cdc8e)
|
||||
- [如何为 Obsidian 配置 AI Agent?9 个必备 Skill 详解与安装指南](https://www.bilibili.com/video/BV14d9TBiE1S/?share_source=copy_web&vd_source=fe8142e8e12816535feaeabd6f6cdc8e)
|
||||
|
||||
# 步骤
|
||||
## 配置步骤
|
||||
|
||||
1. Obsidian → 小齿轮(Settings)→ 开启**命令行界面**
|
||||
2. 安装 Obsidian 适配 Claude Code 的插件(可选)
|
||||
1. Claudian:https://github.com/YishenTu/claudian
|
||||
2. 配置自定义变量
|
||||
3. 安装 [obsidian-skills](https://github.com/kepano/obsidian-skills)
|
||||
1. `npm install -g defuddle`
|
||||
4. 安装 Obsidian 绘图增强 Skill:[axton-obsidian-visual-skills](https://github.com/axtonliu/axton-obsidian-visual-skills)
|
||||
### 1. 开启 CLI
|
||||
|
||||
# 其他 Skill
|
||||
Obsidian → 小齿轮(Settings)→ 开启**命令行界面**
|
||||
|
||||
- 学习用 Skill:[tutor-skills](https://github.com/bevibing/tutor-skills)
|
||||
### 2. 安装 Claudian 插件(可选)
|
||||
|
||||
Obsidian 适配 Claude Code 的插件,提供更好的集成体验。
|
||||
|
||||
- 仓库:[Claudian](https://github.com/YishenTu/claudian)
|
||||
- 安装后需配置自定义变量
|
||||
|
||||
### 3. 安装 Obsidian Skills
|
||||
|
||||
官方 Skill 集合,包含 Markdown、Bases、Canvas、CLI、Defuddle 等能力。
|
||||
|
||||
- 仓库:[obsidian-skills](https://github.com/kepano/obsidian-skills)
|
||||
- Defuddle 需要全局安装依赖:`npm install -g defuddle`
|
||||
|
||||
### 4. 安装绘图增强 Skill
|
||||
|
||||
支持 Excalidraw、Mermaid、Canvas 等可视化图表生成。
|
||||
|
||||
- 仓库:[axton-obsidian-visual-skills](https://github.com/axtonliu/axton-obsidian-visual-skills)
|
||||
|
||||
## 其他 Skill
|
||||
|
||||
| Skill | 用途 | 仓库 |
|
||||
| --- | --- | --- |
|
||||
| tutor-skills | 学习辅助 | [GitHub](https://github.com/bevibing/tutor-skills) |
|
||||
|
||||
## 外部大型代码库索引策略(以 UE 为例)
|
||||
|
||||
针对 Unreal Engine 这种体量的外部依赖,全量索引通常不是最优解。以下是三种可行策略:
|
||||
|
||||
### 方案一:软链接(最简单)
|
||||
|
||||
在项目根目录创建指向引擎源码的软链接,让索引工具将其视为项目内目录。
|
||||
|
||||
```bash
|
||||
ln -s /Users/Shared/Epic\ Games/UE_5.4/Engine ./UE_Source_Link
|
||||
```
|
||||
|
||||
> [!warning] 注意
|
||||
> - 务必在 `.gitignore` 中忽略该目录
|
||||
> - UE 源码文件量巨大,索引时间可能极长
|
||||
|
||||
### 方案二:多图谱架构(性能最优)
|
||||
|
||||
将引擎(静态)和项目(动态)分离为两个独立图谱,通过桥接查询关联。
|
||||
|
||||
1. 对 UE 引擎预生成 `engine_graph.db`(一次性)
|
||||
2. 对项目生成 `project_graph.db`(持续更新)
|
||||
3. 在 MCP Server 中实现双向查询:项目类 → 发现继承关系 → 自动去引擎图谱检索基类定义
|
||||
|
||||
### 方案三:指定多路径参数
|
||||
|
||||
```bash
|
||||
graphify . /path/to/external/ue_source --output ./unified_graph
|
||||
```
|
||||
|
||||
> [!note] 弊端
|
||||
> 每次扫描都会重新处理外部目录,除非工具支持增量索引。
|
||||
|
||||
### 剪枝策略:减少索引噪音
|
||||
|
||||
对 UE 外部目录索引时应进行**语义剪枝**,提升 Claude 回复精准度:
|
||||
|
||||
| 策略 | 说明 |
|
||||
| --- | --- |
|
||||
| **排除 Private 目录** | 只索引 `Public/` 下的头文件(接口和宏定义),性价比最高 |
|
||||
| **模块化索引** | 按需索引:渲染相关只索引 `Runtime/Renderer` + `Runtime/RenderCore`;逻辑相关只索引 `Runtime/Engine` + `Runtime/CoreUObject` |
|
||||
| **头文件优先** | 仅解析 `.h` 文件,不解析 `.cpp`,大幅降低图谱复杂度同时保留类层次关系 |
|
||||
|
||||
### 让 Claude Code 感知外部索引
|
||||
|
||||
在 `CLAUDE.md` 中声明外部图谱的存在和使用规则:
|
||||
|
||||
```markdown
|
||||
# External Context
|
||||
- **UE Engine Source:** Indexed at `~/.cache/ue_engine_graph.db`
|
||||
- **Search Rule:** If a class prefix is 'U', 'A', or 'F' and not found in the current project, use the `search_ue_engine_graph` tool via MCP.
|
||||
```
|
||||
|
||||
这样可将外部目录转变为**只读远程知识库**——既保证响应速度,又扩展知识边界。
|
||||
|
||||
Reference in New Issue
Block a user