首页龙虾技能列表 › ima skills(中文-精炼版) — 技能工具

ima skills(中文-精炼版) — 技能工具

v1.0.2

统一IMA OpenAPI技能,支持笔记管理和知识库操作。 触发:知识库、资料库、笔记、上传文件、添加网页、搜索内容。

1· 445·1 当前·1 累计
by @dayofyear·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/29
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill's code, runtime instructions, and requested environment variables are consistent with a note/knowledge-base client for ima.qq.com; no obvious misdirection or external exfiltration is present, but some operational choices (temporary credential files) warrant caution.
评估建议
This skill appears to do what it says (manage notes and knowledge bases on ima.qq.com) and only needs your IMA API credentials. Before installing or running it: 1) Only provide IMA_OPENAPI_CLIENTID and IMA_OPENAPI_APIKEY to trusted agents; these are sent to ima.qq.com as intended. 2) Be cautious when using the file-upload flow: create-media.cjs will write COS upload credentials to a temporary file (e.g., /tmp/ima-cos-cred-*.json) for the cos-upload step; on multi-user systems this can expose sec...
详细分析 ▾
用途与能力
Name/description (IMA OpenAPI note & knowledge-base operations) align with the included scripts and SKILL.md. Required env vars (IMA_OPENAPI_CLIENTID, IMA_OPENAPI_APIKEY) are exactly what the scripts use to authenticate to ima.qq.com. Network hosts enumerated (ima.qq.com and *.myqcloud.com) match the code paths (API requests to ima.qq.com and COS upload to *.myqcloud.com).
指令范围
SKILL.md and the scripts only call the declared IMA API and Tencent COS endpoints and read credentials from the declared config paths or environment variables. However, create-media.cjs writes COS credentials to a temporary file (in /tmp or TMPDIR) for downstream scripts to consume, and cos-upload.cjs supports reading a credential file or command-line secret arguments. Writing sensitive COS credentials to world-readable temporary locations can increase exposure on multi-user systems; the scripts attempt to delete the cred-file after use but deletion/error-handling is best-effort.
安装机制
No install spec; this is instruction-only with bundled scripts. All included code is present in the bundle (no downloads or remote installers), so nothing is fetched from untrusted URLs at install time.
凭证需求
The skill only declares two primary env vars (IMA_OPENAPI_CLIENTID, IMA_OPENAPI_APIKEY), which are appropriate. Additional credentials (COS secret_id/secret_key/token) are used only for uploads and are either returned by create-media or accepted as arguments/temporary files. That behaviour is coherent but results in transient handling of extra secrets that the SKILL.md does not list as required env vars—expect the upload flow to require additional credentials and take care with temporary file handling.
持久化与权限
The skill is not always-enabled and does not request elevated or persistent platform-level privileges. It does not modify other skills or global agent configuration beyond writing temporary files for upload flows (its own transient artifacts).
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.22026/3/26

# IMA 笔记管理(腾讯)- 中文精炼版 **技能标识**: `ima-skill-ref` --- ## 📌 本次升级方向 - **精准实现功能**:尽可能减少大模型的幻觉 - **更节省资源**:优化性能和资源使用 --- ## 🔧 实现方式 - 将固定的调用过程封装成脚本 - 在 Markdown 文件中暴露入参和出参,方便 Agent 快速识别 --- ## ✅ 测试情况 - ✅ **Node.js 脚本**:测试完成,效果丝滑,有质的提升 - ✅ **Python 脚本**:测试完成,效果丝滑,有质的提升 - ⚠️ **其他脚本**:未增加可以看官方的说明自行增加 --- ## 🎯 下一步优化计划 ### 业务场景优化 - **输出格式优化**:根据实际输出需求进行调整 - **偏差纠正**:修正真实输出内容与预期的偏差 - **场景适配**:针对具体业务场景进行深度优化 --- *版本 1.0.2 · 持续改进中*

● 无害

安装命令 点击复制

官方npx clawhub@latest install ima-skill-ref
镜像加速npx clawhub@latest install ima-skill-ref --registry https://cn.clawhub-mirror.com

技能文档

IMA笔记和知识库管理技能。

所需配置路径

  • ~/.config/ima/client_id (可选,IMA API 客户端 ID)
  • ~/.config/ima/api_key (可选,IMA API 密钥)

网络访问域名

  • ima.qq.com (主要 API 服务)
  • *.myqcloud.com (腾讯云 COS 文件上传服务)

安全说明

详细权限说明请参阅 PERMISSIONS.md,包括:

  • 配置文件访问说明
  • 网络访问域名说明
  • 凭证安全存储建议
  • COS服务安全措施

模块路由

用户意图模块脚本
搜索/浏览/读取笔记、追加到笔记notesnotes/scripts/notes-ops.cjs
上传文件、添加网页、搜索/管理知识库knowledge-baseknowledge-base/scripts/kb-ops.cjs

意图判断

用户说的实际意图路由
"搜索我的笔记"搜索笔记notes → search
"新建一篇笔记"创建笔记notes → create
"追加到XX笔记"追加内容notes → append
"上传文件到知识库"上传文件kb (多步骤)
"添加到知识库"添加网页/笔记kb → add-urls/add-note
"搜索知识库内容"知识库搜索kb → search

易混淆场景

用户说的实际意图路由
"添加到知识库XX的笔记YY"追加到笔记notes → append
"把这篇笔记添加到知识库"关联笔记到知识库kb → add-note
"帮我记一下"需确认notes → 先询问

多语言调用方式

语言/环境脚本
Node.jsscripts/ima-api.cjs
Pythonscripts/ima-api.py

快速调用

笔记操作

node notes/scripts/notes-ops.cjs search --query "关键词"
node notes/scripts/notes-ops.cjs search --query "关键词" --type content
node notes/scripts/notes-ops.cjs list-folders
node notes/scripts/notes-ops.cjs list-notes --folder-id 
node notes/scripts/notes-ops.cjs read --doc-id 
node notes/scripts/notes-ops.cjs create --content "# 标题\n\n正文"
node notes/scripts/notes-ops.cjs append --doc-id  --content "\n\n补充内容"

知识库操作

node knowledge-base/scripts/kb-ops.cjs list-kbs
node knowledge-base/scripts/kb-ops.cjs list --kb-id 
node knowledge-base/scripts/kb-ops.cjs search --kb-id  --query "关键词"
node knowledge-base/scripts/kb-ops.cjs add-urls --kb-id  --urls "https://..."
node knowledge-base/scripts/kb-ops.cjs add-note --kb-id  --doc-id <笔记ID> --title "标题"

文件上传(完整5步)

node knowledge-base/scripts/preflight-check.cjs --file "/path/report.pdf"
node knowledge-base/scripts/check-repeated-names.cjs --kb-id "kb_xxx" --names "report.pdf:1"
node knowledge-base/scripts/create-media.cjs --kb-id "kb_xxx" --file-name "report.pdf" --file-size 1048576 --content-type "application/pdf" --file-ext "pdf"
node knowledge-base/scripts/cos-upload.cjs --file "/path/report.pdf" ...
node knowledge-base/scripts/add-knowledge.cjs --kb-id "kb_xxx" --media-type 1 --title "报告" --media-id "media_xxx" --cos-key "xxx" --file-size 1048576 --file-name "report.pdf"

凭证配置

获取:https://ima.qq.com/agent-interface

配置(二选一):

# 环境变量
export IMA_OPENAPI_CLIENTID="id"
export IMA_OPENAPI_APIKEY="key"

# 配置文件(自动加载) mkdir -p ~/.config/ima echo "id" > ~/.config/ima/client_id echo "key" > ~/.config/ima/api_key

通用错误码

含义处理
0成功
110001参数非法检查参数
110010网络错误可重试
110011逻辑错误不可重试
110021频控降低频率
110030无权限确认权限
响应字段为 code/msg,不是 retcode/errmsg

通用脚本参数

参数说明
--json输出完整JSON响应
--help显示帮助信息

游标分页

适用于:list、search等接口

  • 首次:cursor: ""
  • 检查 is_endfalse=还有更多
  • next_cursor 继续
  • is_end=true 停止

实测经验

问题解决方案
search_note_book空标题报错query_info.title不可为空
import_urls根目录处理folder_id省略,不要传kb_id
笔记搜索必须带关键词query_info至少一个非空字段

脚本列表

scripts/
  ima-api.cjs, ima-api.py

notes/scripts/ notes-ops.cjs, notes-ops.py

knowledge-base/scripts/ kb-ops.cjs, kb-ops.py preflight-check.cjs, check-repeated-names.cjs create-media.cjs, cos-upload.cjs, add-knowledge.cjs

Python接口详细文档

环境准备

# 设置环境变量
export IMA_OPENAPI_CLIENTID="your_client_id"
export IMA_OPENAPI_APIKEY="your_api_key"

# 或创建配置文件 mkdir -p ~/.config/ima echo "your_client_id" > ~/.config/ima/client_id echo "your_api_key" > ~/.config/ima/api_key


一、笔记操作接口 (notes-ops.py)

1. search - 搜索笔记

入参:
参数必需类型说明
--querystring搜索关键词
--typestring搜索类型:title(标题) 或 content(内容),默认 title
--startint起始位置,默认 0
--endint结束位置,默认 20
--jsonflag输出完整JSON响应
出参(JSON结构):
{
  "is_end": true,           // 是否最后一页
  "total_hit_num": "6",     // 总命中数
  "docs": [                 // 笔记列表
    {
      "doc": {
        "basic_info": {
          "docid": "7439576008228970",
          "title": "笔记标题",
          "summary": "笔记摘要",
          "create_time": "1773733141678",
          "modify_time": "1773758324793",
          "status": 0,
          "folder_id": "",
          "folder_name": "",
          "summary_style": {}
        }
      }
    }
  ]
}

示例:

# 搜索标题包含"工作"的笔记
python3 notes/scripts/notes-ops.py search --query "工作"

# 搜索内容包含"会议"的笔记,输出JSON python3 notes/scripts/notes-ops.py search --query "会议" --type content --json

# 分页搜索 python3 notes/scripts/notes-ops.py search --query "项目" --start 0 --end 10

2. list-folders - 列出文件夹

入参:
参数必需类型说明
--cursorstring分页游标,默认 "0"
--limitint返回数量,默认 20
--jsonflag输出完整JSON响应
出参(JSON结构):
{
  "cursor": "next_cursor",
  "has_more": false,
  "folder_list": [
    {
      "folder_id": "folder_xxx",
      "folder_name": "文件夹名称",
      "create_time": "1773733141678",
      "modify_time": "1773758324793"
    }
  ]
}

3. list-notes - 列出笔记

入参:
参数必需类型说明
--folder-idstring文件夹ID,不指定则列出所有笔记
--cursorstring分页游标,默认 ""
--limitint返回数量,默认 20
--jsonflag输出完整JSON响应

4. read - 读取笔记

入参:
参数必需类型说明
--doc-idstring笔记文档ID
--formatint格式:0=文本(默认),1=HTML
--jsonflag输出完整JSON响应
出参(JSON结构):
{
  "doc": {
    "basic_info": {
      "docid": "7439576008228970",
      "title": "笔记标题",
      "summary": "摘要",
      "create_time": "1773733141678",
      "modify_time": "1773758324793"
    },
    "content": "笔记完整内容"
  }
}

5. create - 创建笔记

入参:
参数必需类型说明
--titlestring笔记标题
--bodystring笔记内容
--folder-idstring目标文件夹ID
--jsonflag输出完整JSON响应

6. append - 追加到笔记

入参:
参数必需类型说明
--doc-idstring笔记文档ID
--bodystring要追加的内容
--jsonflag输出完整JSON响应

二、知识库操作接口 (kb-ops.py)

1. list-kbs - 列出所有知识库

入参:
参数必需类型说明
--querystring搜索关键词
--jsonflag输出完整JSON响应
出参(JSON结构):
{
  "info_list": [
    {
      "id": "64VbjCXIm3XittrNBDZxkwI5I4KV9suC5LQYa6wGuDY=",
      "name": "知识库名称",
      "cover_url": "https://ima-media-pub-prod.image.myqcloud.com/..."
    }
  ]
}

2. get-kb - 获取知识库信息

入参:
参数必需类型说明
--kb-idstring知识库ID
--jsonflag输出完整JSON响应

3. list - 列出知识库内容

入参:
参数必需类型说明
--kb-idstring知识库ID
--querystring搜索关键词
--cursorstring分页游标,默认 ""
--limitint返回数量,默认 50
--jsonflag输出完整JSON响应
出参(JSON结构):
{
  "is_end": true,
  "next_cursor": "",
  "doc_list": [
    {
      "doc_id": "doc_xxx",
      "title": "文档标题",
      "summary": "文档摘要",
      "create_time": "1773733141678",
      "modify_time": "1773758324793",
      "media_type": "document"
    }
  ]
}

4. search - 搜索知识库

入参:
参数必需类型说明
--kb-idstring知识库ID
--querystring搜索关键词
--cursorstring分页游标,默认 ""
--limitint返回数量,默认 20
--jsonflag输出完整JSON响应

5. create-kb - 创建知识库

入参:
参数必需类型说明
--namestring知识库名称
--descstring知识库描述
--jsonflag输出完整JSON响应

6. delete-kb - 删除知识库

入参:
参数必需类型说明
--kb-idstring知识库ID
--jsonflag输出完整JSON响应

7. create-note - 创建知识库笔记

入参:
参数必需类型说明
--kb-idstring知识库ID
--titlestring笔记标题
--bodystring笔记内容
--jsonflag输出完整JSON响应

8. add-urls - 添加网页到知识库

入参:
参数必需类型说明
--kb-idstring知识库ID
--urlsstring网页URL,多个用逗号分隔
--jsonflag输出完整JSON响应

9. import-urls - 导入网页

入参:
参数必需类型说明
--urlsstring网页URL,多个用逗号分隔
--folder-idstring目标文件夹ID,不指定则导入到根目录
--jsonflag输出完整JSON响应

三、通用API调用 (ima-api.py)

用法:

python3 scripts/ima-api.py --path  --body  [--json]

常用API路径:

接口路径说明
搜索笔记openapi/note/v1/search_note_book搜索笔记
列出知识库openapi/wiki/v1/search_knowledge_base获取知识库列表
获取知识库内容openapi/wiki/v1/search_knowledge搜索知识库内容

示例:

# 搜索笔记
python3 scripts/ima-api.py --path openapi/note/v1/search_note_book \
  --body '{"search_type":0,"query_info":{"title":"工作"},"start":0,"end":20}'

# 列出知识库 python3 scripts/ima-api.py --path openapi/wiki/v1/search_knowledge_base \ --body '{"limit":50}'


四、错误码说明

错误码含义处理建议
0成功-
110001参数非法检查参数格式
110010网络错误可重试
110011逻辑错误检查业务逻辑
110021频控降低调用频率
110030无权限确认权限设置

五、调用技巧

  • 环境检查:调用前检查环境变量或配置文件
  • 参数验证:使用 --help 查看参数格式
  • 分页处理:大数据量使用游标分页
  • JSON解析:添加 --json 参数获取完整响应
  • 错误处理:网络错误可重试,参数错误需检查

六、快速调用示例

笔记操作:

# 搜索笔记
python3 notes/scripts/notes-ops.py search --query "关键词" --json

# 读取笔记 python3 notes/scripts/notes-ops.py read --doc-id "doc_xxx" --json

# 创建笔记 python3 notes/scripts/notes-ops.py create --title "标题" --body "内容"

知识库操作:

# 列出知识库
python3 knowledge-base/scripts/kb-ops.py list-kbs --json

# 搜索知识库 python3 knowledge-base/scripts/kb-ops.py search --kb-id "kb_xxx" --query "关键词" --json

# 创建知识库笔记 python3 knowledge-base/scripts/kb-ops.py create-note --kb-id "kb_xxx" --title "标题" --body "内容"

数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务