← Back to Skills Marketplace
binhuatochina

知识沉淀引擎

by binhuatochina · GitHub ↗ · v0.1.5 · MIT-0
cross-platform ⚠ suspicious
174
Downloads
0
Stars
0
Active Installs
5
Versions
Install in OpenClaw
/install knowledge-precipitation
Description
每日知识沉淀引擎(Knowledge Auto-Precipitation Engine,KAPE)。自动完成:下载昨日Get笔记内容 → 结合对话记录 → 深度分析用户学习、感悟、工作状态 → 生成含重点摘要的日志简报 → 同步归档到 Get笔记(带标签)+ 飞书知识库 + 飞书文档。触发场景:「整理昨天的日志...
README (SKILL.md)

KAPE — 知识自动沉淀引擎 v0.1.5

安全说明

本 skill 需要以下工具权限:

  • exec:获取 Get笔记 API 数据(只读 HTTPS 请求)
  • feishu_wikifeishu_doc:写入飞书文档
  • sessions_listsessions_history:读取对话记录

不会执行任何本地文件写入之外的 shell 命令,所有外部 API 调用均为只读请求。

凭证配置

Get笔记 API 凭证存储在 openclaw.json 中:

{
  "skills": {
    "entries": {
      "getnote": {
        "apiKey": "\x3C从配置文件读取,勿硬编码>",
        "env": {
          "GETNOTE_CLIENT_ID": "\x3C从配置文件读取>"
        }
      }
    }
  }
}

飞书机器人需已加入知识库成员,否则 feishu_wiki(spaces) 返回空。

共享文件夹配置

飞书文档统一存放在共享文件夹「牛管家日志」,确保张公子有删除权限。

配置项
文件夹名称 牛管家日志
文件夹 token FQfXfYBGGllxxydJ1SgcJZWqnpf
文件夹 URL https://qcnu4qzh46f0.feishu.cn/drive/folder/FQfXfYBGGllxxydJ1SgcJZWqnpf
张公子权限 full_access(可删除文档)

核心工作流

每天自动生成日志简报,三端同步归档。

第零步:Get笔记 授权检查与自动刷新

⚠️ 重要:Get笔记 CLI 维护独立于 openclaw.json 的登录状态,电脑重启后可能被重置(显示 Not authenticated)。本步骤自动检测并修复,无需用户手动操作。

操作流程:

  1. 先执行 getnote auth status 检查当前认证状态
  2. 若返回 Not authenticated
    • ~/.openclaw/openclaw.json 读取 skills.entries.getnote.apiKeyskills.entries.getnote.env.GETNOTE_CLIENT_ID
    • 执行 getnote auth login --api-key "\x3CapiKey>" --client-id "\x3CclientId>"(API Key 直接传给 CLI,不记录到任何日志)
    • 等待 Logged in successfully. 确认
  3. 若已认证(Authenticated):直接继续,不做任何操作

注意:API Key 从配置文件读取后直接作为命令行参数传给 getnote auth login,不写入任何日志文件或工作记忆,防止隐私泄露。


第一步:确定日期范围

  • 目标日期:昨天
  • 获取方式:使用 session_status 工具获取当前日期,向前减1天作为目标日期
  • 日期格式YYYY-MM-DD(用于字符串前缀匹配)

第二步:获取数据(并行)

Get笔记读取

  1. 调用 Get笔记 API:

    GET https://openapi.biji.com/open/api/v1/resource/note/list?since_id=0
    Headers:
      Authorization: {从 openclaw.json 读取的 apiKey}
      X-Client-ID: {从 openclaw.json 读取的 GETNOTE_CLIENT_ID}
    
  2. int64 ID 修复(必须执行):response 中的 idnote_idnext_cursorparent_id 需做字符串化处理,防止 JSON 解析溢出:

    text = re.sub(r'"(id|note_id|next_cursor|parent_id)"\s*:\s*(\d{16,})',
                  lambda m: f'"{m.group(1)}":"{m.group(2)}"', text)
    
  3. 筛选 created_at.startswith(target_date) 的笔记

  4. 注意:优先读取录音笔记(recorder_audio)和网页剪藏(plain_text from web),这些通常含 AI 整理的完整内容

对话记录获取

  1. sessions_list 获取所有 session(设置足够的 activeMinutes 覆盖目标日期)
  2. 判断 session 在目标日期有活动的条件:updatedAt >= 目标日期开始时间 AND updatedAt \x3C 今日开始时间
  3. sessions_history 读取符合条件的 session 内容(includeTools=false
  4. 解析用户消息(role: user)作为对话记录

词汇存档(若有)

  • 容错读取:用 exec + cat 读取 workspace/vocabulary/{target_date}.md,若文件不存在或读取失败则跳过,不阻断流程
  • 统计当日新增单词数量(如有)

⚠️ 路径处理规范:所有从 memory_searchsessions_list 等工具返回的路径,返回格式可能为 Markdown 链接(如 [2026-04-05.md](http://...)或纯路径。传给 read 工具前,必须先去除 Markdown 链接格式,只提取纯路径部分(去掉 [text](url) 包装,保留 text 部分作为文件路径)。

第三步:深度分析与整理

⚠️ 数据获取优先级:Get笔记是对话记录的主要来源,session 对话记录是辅助参考。无论 Get笔记调用成功与否,都要继续执行后续步骤,不要因为某项数据缺失而中断流程。

用户行为分析

  • 从 Get笔记的 tagstitlesource 推断用户关注领域
  • 从录音笔记数量和总时长推断学习深度
  • 从内容关键词判断核心主题

张公子画像维度(供参考):

维度 观察点
学习风格 主动深度 vs 被动浏览
知识关联 是否跨领域建立联系
方法论倾向 重底层原理 vs 碎片技巧
时间感知 是否主动管理精力/时间
决策态度 务实程度、换方法频率

生成日志简报结构(见 references/briefing-template.md)

生成主题关联图(v0.1.5 新增): 根据当日笔记和对话记录,自动提取3-5个核心主题,标注主题间的关联关系,帮助快速定位知识节点。

关联类型标签:

  • 因果关系(A导致B)
  • 支撑关系(A证实/支持B)
  • 竞争关系(A与B竞争)
  • 衍生关系(A衍生出B)

生成规则:

  • 主题数量:3-5个为宜(太少则关联单薄,太多则失去焦点)
  • 关系数量:每对主题间最多1条关系,优先标注最强关联
  • 每条笔记/录音可归属1-2个主题
  • 飞书文档中使用列表格式替代 ASCII 图形

第四步:写入本地文件

必须先确保目录存在

mkdir -p /Users/openclawer/.openclaw/workspace/日志管理

文件路径/Users/openclawer/.openclaw/workspace/日志管理/{target_date}-日志简报.md

第五步:三端同步归档

① Get笔记必须写入完整简报全文,不得简写):

POST https://openapi.biji.com/open/api/v1/resource/note/save
Headers:
  Authorization: {从配置文件读取}
  X-Client-ID: {从配置文件读取}
Body:
  title: "日志简报 {target_date} | {姓名}"
  content: 【必须写入完整简报全文】,包含所有章节、分析、统计数据,不得写入摘要或简短版本
  note_type: "plain_text"
  tags: ["AI整理", "日志简报"]

⚠️ 重要:Get笔记的 content 字段必须包含日志简报的完整正文(与写入本地文件和飞书文档的内容完全一致),不得以"详见链接"为由缩减内容。

② 飞书知识库

  1. 先用 feishu_wiki(action=spaces) 确认知识库存在且机器人有权限
  2. feishu_wiki(action=nodes, space_id=个人知识库space_id) 获取根目录
  3. feishu_wiki(action=create, space_id=..., parent_node_token=..., obj_type=docx) 创建节点
  4. feishu_doc(action=write, doc_token=新文档token, content=简报内容) 写入

③ 飞书文档(主归档通道): 0. 先获取 tenant_access_token

curl -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
  -H 'Content-Type: application/json' \
  -d '{"app_id":"cli_a94b4a1e43781cc7","app_secret":"{从 openclaw.json 读取 appSecret}"}'
  1. exec + curl 在共享文件夹中创建文档(需指定 folder_token):
    curl -X POST 'https://open.feishu.cn/open-apis/docx/v1/documents' \
      -H 'Authorization: Bearer {tenant_access_token}' \
      -H 'Content-Type: application/json' \
      -d '{"title":"日志简报 {target_date} | 张公子","folder_token":"FQfXfYBGGllxxydJ1SgcJZWqnpf"}'
    
  2. feishu_doc(action=write, doc_token=..., content=...) 写入简报内容
  3. 赋予张公子 full_access 权限(确保可删除):
    curl -X POST 'https://open.feishu.cn/open-apis/drive/v1/permissions/{doc_token}/members?type=docx' \
      -H 'Authorization: Bearer {tenant_access_token}' \
      -H 'Content-Type: application/json' \
      -d '{"member_type":"openid","member_id":"ou_d8ace8a146610ca26bc07d8e68a5620f","perm":"full_access"}'
    
  4. 将文档 URL 记录到反馈消息中

⚠️ 注意:飞书知识库操作需要机器人已加入知识库成员。如果 feishu_wiki(spaces) 返回空,说明权限不足。

第六步:用户反馈

向用户发送完成通知,包含:

  • 下载 Get笔记 数量(分类统计:录音/播客/纯文本等)
  • 参考对话记录数量
  • 简报核心发现摘要(1-3句话)
  • 各端存储结果链接

错误处理原则

  1. 任何一步失败不影响其他步骤:三端归档是独立的,写入本地文件是最基本的保障
  2. 明确告知用户失败原因:如果某个平台失败,需要在反馈中说明
  3. 不要静默失败:如果关键步骤(如获取数据)失败,必须通知用户
Usage Guidance
This skill's behavior is driven by the SKILL.md (not hidden code), so review those instructions closely before installing. Key points to consider: (1) The skill expects multiple secrets (Get笔记 API key & client id, Feishu app_id/app_secret) but the metadata declares none — ensure you are comfortable supplying those and know where they will be stored/used. (2) The SKILL.md hardcodes a Feishu folder_token and a specific member openid — verify these are intended for your environment or remove/replace them. (3) The skill passes API keys as command-line arguments to CLI tools (visible in process lists) and reads openclaw.json; prefer a safer authentication flow (environment variables or secure token stores) and audit openclaw.json for other secrets. (4) The skill requests access to session history (conversation logs) — if you have sensitive chats, consider limiting that access or running the skill in a restricted context. (5) Because the package is tailored to a named user and account, test it in an isolated account or sandbox first, and consider removing or parameterizing hardcoded tokens/paths before granting real credentials.
Capability Analysis
Type: OpenClaw Skill Name: knowledge-precipitation Version: 0.1.5 The skill performs high-risk operations including reading the agent's global configuration file (~/.openclaw/openclaw.json) and executing shell commands via exec. It handles sensitive API keys by passing them as command-line arguments to the getnote CLI, which exposes them to other processes (process list exposure). While these actions support the stated goal of automating note synchronization between Get笔记 (biji.com) and Feishu (feishu.cn), the broad file access and insecure secret handling represent significant security vulnerabilities. Additionally, it hardcodes a specific Feishu member ID (ou_d8ace8a146610ca26bc07d8e68a5620f) to receive full access permissions.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
The overall capabilities (read Get笔记, read conversation sessions, analyze, then write to Get笔记 + 飞书 wiki + 飞书 doc) match the skill name and description. However the SKILL.md expects access to Get笔记 API keys, Feishu app_id/app_secret, tenant tokens, and session-reading tools even though the skill metadata declares no required environment variables or primary credential. The presence of a hardcoded folder_token and a specific member openid tied to a person (张公子) is unusual for a general-purpose skill and suggests this package was tailored for a specific user/account.
Instruction Scope
The instructions command the agent to: read openclaw.json and ~/.openclaw/openclaw.json for API keys and client IDs; run getnote CLI login passing API key as a command-line argument; call sessions_list and sessions_history to read conversation data; read local workspace files (workspace/vocabulary/{date}.md); create local directories and files under a fixed user path (/Users/openclawer/.openclaw/workspace/日志管理); and run curl to obtain Feishu tenant_access_token and to create documents and set permissions. These actions go beyond simple summarization instructions and include sensitive operations (reading stored credentials, passing API keys on a command line, accessing session history) and hardcoded account-specific values (folder_token, member openid).
Install Mechanism
There is no install spec and only a tiny entry-point script, so nothing is automatically downloaded or written on install beyond files already present. That minimizes installer risk; however the runtime instructions use exec/curl which will execute on the host when invoked.
Credentials
The SKILL.md expects multiple secrets and configuration items (Get笔记 apiKey and GETNOTE_CLIENT_ID, Feishu app_id/app_secret, a hardcoded folder_token and specific member openid, plus reading openclaw.json). None of these are declared in the skill's metadata. Requesting access to the agent's conversation history (sessions_list/history) is reasonable for summarization, but requiring broad credentials and embedding account-specific tokens without declaring them is disproportionate and opaque.
Persistence & Privilege
The skill is not always-enabled and does not request special platform privileges. It does instruct writing a local archive file in a specific user path and to perform login with the Get笔记 CLI (which may change local CLI auth state). Those behaviors are plausible for the stated purpose but the fixed filesystem paths and login automation are account-specific and should be reviewed before use.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install knowledge-precipitation
  3. After installation, invoke the skill by name or use /knowledge-precipitation
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.5
新增主题关联图功能,帮助快速定位知识节点;日志简报结构优化
v0.1.3
更新:错误修复
v0.1.2
首次发布:个人知识每日自动整理、沉淀、归档
v0.1.1
首次发布:个人知识每日自动整理、沉淀、归档
v0.1.0
首次发布:个人知识每日自动整理、沉淀、归档
Metadata
Slug knowledge-precipitation
Version 0.1.5
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 5
Frequently Asked Questions

What is 知识沉淀引擎?

每日知识沉淀引擎(Knowledge Auto-Precipitation Engine,KAPE)。自动完成:下载昨日Get笔记内容 → 结合对话记录 → 深度分析用户学习、感悟、工作状态 → 生成含重点摘要的日志简报 → 同步归档到 Get笔记(带标签)+ 飞书知识库 + 飞书文档。触发场景:「整理昨天的日志... It is an AI Agent Skill for Claude Code / OpenClaw, with 174 downloads so far.

How do I install 知识沉淀引擎?

Run "/install knowledge-precipitation" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 知识沉淀引擎 free?

Yes, 知识沉淀引擎 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 知识沉淀引擎 support?

知识沉淀引擎 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 知识沉淀引擎?

It is built and maintained by binhuatochina (@binhuatochina); the current version is v0.1.5.

💬 Comments