IMA Crayfish API Integration: Unified Operation of IMA Notes and Knowledge Base within Agents

Introduction

In environments like Cursor and Claude Code, users often casually say things like “put this PDF into the knowledge base” or “search whether a certain passage exists in my notes”. Without a systematic Skill, the Agent either cannot call Tencent IMA’s OpenAPI, or it conflates “appending content to notes” and “attaching notes to a knowledge base” as one operation, which can easily lead to accidental modification of existing notes or taking the wrong upload path.

Below is an introduction to the IMA Lobster API Integration Skill | Star Core Master Link Interconnection on SkillHub (coordinate @user_32bcb989/ima-lobster-link). The SKILL.md in the skill package positions it as a unified IMA OpenAPI integration capability, currently covering two major modules: notes and knowledge-base. The store page description supplements the integration background with the local four-in-one panel, Star Core master scheduling, and MCP links. After installing into the Agent’s skills directory via the official installation method, it can route to the corresponding submodule by intent during conversations, and call the official https://ima.qq.com API through ima_api.cjs.

What Is This

  • One-sentence positioning: An IMA OpenAPI Skill for Agents, using Client ID + API Key authentication, encapsulating HTTP POST calls through scripts, to complete note reading/writing and knowledge base search, upload, collection, and other operations.
  • Source and version: A SkillHub community skill, published by user_32bcb989, categorized as dev-programming; the store page marks version 1.0.0 (as of 2026-10-22 page information). The meta.json in the skill package also carries runtime metadata (such as built-in API encapsulation version 1.1.7, dependency Node.js ≥ 18.0.0), which may differ from the version number displayed on the store—the actual installed package prevails.
  • Store data (already captured): rating 100000, 1513 downloads; tags include requires_api_key=false (meaning SkillHub installation itself does not require a store API Key, not equivalent to not needing IMA Open Platform credentials).
  • Official entry points: SkillHub Skill Page, api.skillhub.cn Coordinate Page.

Core Functions

The following capabilities all come from the skill package’s SKILL.md and submodule documentation, and can be compared with the IMA official website.

Notes Module (notes/)

  • Read: search notes (search_note), list notebooks/notes (list_notebook, list_note), get body content (get_doc_content).
  • Write: create new note (import_doc), append to a specified note (append_doc).
  • Constraints: before writing, ensure content, title, etc. are valid UTF-8; append_doc modifies existing notes, so when the intent is unclear, the Skill requires confirming the target note with the user first.

Knowledge Base Module (knowledge-base/)

  • Upload local files to the knowledge base (check_repeated_names → create_media → COS upload → add_knowledge); title must match the original file_name (including extension).
  • Add webpage/link (import_urls), associate existing notes to the knowledge base (add_knowledge, media_type=11).
  • Browse and search: knowledge base list and details, items in a directory, keyword search (search_knowledge, search_knowledge_base, get_knowledge_list, etc.).
  • Before upload, perform type validation via preflight-check.cjs; unsupported videos, Bilibili/YouTube links, file://, etc. require prompting users to use the IMA desktop client.

Agent-Side Triggering and Routing

The skill’s description convention: when users mention knowledge base, data library, notes, memo, or when the intent is to upload files, collect webpages, search the knowledge base, or store/retrieve personal documents (such as “help me note this down”, “search whether XX is in the knowledge base”), this Skill should be enabled. The module decision table in the root SKILL.md distinguishes between notes and knowledge-base, and lists easily confused scenarios (for example, “appending content to a note in the knowledge base” should go through notes’ append_doc, not the knowledge base upload flow).

Security and Dependency Notes

  • Credentials are only sent as HTTP headers to ima.qq.com; the file upload flow uses temporary credentials returned by IMA to access *.myqcloud.com, and Client ID / API Key are not sent to COS.
  • Runtime dependency: Node.js 18+ (for executing ima_api.cjs, COS upload, and preflight scripts).

Installation and Activation

1. Install SkillHub CLI (if not already installed)

command -v skillhub && skillhub --version

If not installed, follow the SkillHub installation documentation to perform a complete installation:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

2. Install this skill to the current Agent’s skills directory

When installing, you must use --dir to point to the directory actually read by the Agent; otherwise, the default ./skills/ may not be recognized.

skillhub install @user_32bcb989/ima-lobster-link --dir ~/.cursor/skills/

Other common paths (excerpted from the same documentation): for Claude Code it is ~/.claude/skills/; for Codex it is ~/.codex/skills/ or .agents/skills/ under the project. After installation, restart or refresh the Agent according to the client’s requirements.

You can also give the following prompt to the AI, letting it install according to official guidance:

Please install `@user_32bcb989/ima-lobster-link` according to https://skillhub.cn/install/skillhub.md.

3. Configure IMA OpenAPI credentials

Before calling any API, you need to obtain Client ID and API Key at https://ima.qq.com/agent-interface.

Method A — Config file (recommended by the Skill):

mkdir -p ~/.config/ima
echo "your_client_id" > ~/.config/ima/client_id
echo "your_api_key" > ~/.config/ima/api_key

Method B — Environment variables:

export IMA_OPENAPI_CLIENTID="your_client_id"
export IMA_OPENAPI_APIKEY="your_api_key"

The Agent reads credentials in the order of environment variables first, then config file; when missing, node ima_api.cjs ... will exit with error code -100 and provide instructions on stderr.

Typical Usage

Credential Self-Check

The skill root directory provides check logic; after installation, the Agent can first confirm whether credentials are ready (corresponding to the Credential Check in SKILL.md).

General Template for Calling OpenAPI

All requests are HTTP POST + JSON, sent to https://ima.qq.com via ./ima_api.cjs. The following example lists notes (openapi/list_docs) and demonstrates the layered handling approach of -100 / -200 on stderr and business code on stdout:

SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
OPTS=$(printf '{"clientId":"%s","apiKey":"%s"}' "$IMA_OPENAPI_CLIENTID" "$IMA_OPENAPI_APIKEY")

if ! resp=$(node "$SKILL_DIR/ima_api.cjs" "openapi/list_docs" '{"limit":10}' "$OPTS" 2>/tmp/ima_err); then
  err_json=$(cat /tmp/ima_err)
  err_code=$(echo "$err_json" | jq -r '.code // empty' 2>/dev/null)
  err_msg=$(echo "$err_json" | jq -r '.msg // empty' 2>/dev/null)

  if [ "$err_code" = "-200" ]; then
    echo "[update] $err_msg" >&2
  else
    echo "[error] $err_msg" >&2
  fi
  exit 1
fi

echo "$resp"

Specific API paths and parameters follow the submodules: for notes see notes/SKILL.md (base path openapi/note/v1); for knowledge base see knowledge-base/SKILL.md (base path openapi/wiki/v1). Cross-module tasks (such as “note down knowledge base content into notes”) require reading both submodules first, then calling in sequence.

Example Intents on the Dialogue Side

User’s words (example) Routed module Typical API
Create a new meeting minutes note notes import_doc
Append this passage to the “Weekly Report” note notes search_note first, then append_doc
Upload report.pdf to the “Product Documentation” knowledge base knowledge-base preflight → duplicate name check → create_media → COS → add_knowledge
Search whether “deployment process” is in the knowledge base knowledge-base search_knowledge, etc.

Applicable Scenarios and Notes

Suitable for whom

  • Teams or individuals already using Tencent IMA who want to manage personal notes and knowledge base with natural language in Coding Agents.
  • Those who need to solidify rules such as OpenAPI calls, UTF-8 validation, file upload gating, and error code layering in the Skill, reducing the maintenance cost of handwriting scripts each time.

Limitations and pitfalls

  1. Encoding: note writing must be UTF-8; under PowerShell 5.1, all API requests need to convert the Body to a UTF-8 byte array, otherwise Chinese characters may be silently garbled (the root SKILL.md has a detection template).
  2. Files and links: unsupported types must be directly rejected; do not suggest users to “force upload”. When large files or COS uploads fail, add_knowledge must not be called further.
  3. Version: ima_api.cjs defaults to checking for Skill updates on the first call each day; when returning -200, the original request was not sent, and you need to guide the update and retry according to the instruction in stdout. You can set export IMA_FORCE_UPDATE_CHECK=1 to proactively trigger the check.
  4. Store description vs. in-package positioning: The SkillHub page emphasizes narratives such as Star Core link integration and WebSocket operations; for daily Agent development, follow the in-package IMA OpenAPI notes/knowledge base documentation to avoid misunderstanding the capability boundary based on the store’s one-sentence description.
  5. Privacy: note content is private data; the Skill requires only displaying title and summary in group chat scenarios.

Conclusion

IMA Lobster API Integration Skill | Star Core Master Link Interconnection converges IMA OpenAPI’s note and knowledge base capabilities into an installable Agent Skill: credentials go through the official domain, calls go through the unified exit of ima_api.cjs, and submodule documentation covers search, read/write, upload, and routing rules for easily confused intents. If your conversations frequently involve knowledge base uploads, webpage collection, or note searches, you can install it to the corresponding skills directory and configure Client ID / API Key as described above to activate it.

Official address: https://www.skillhub.cn/skills/user_32bcb989/ima-lobster-link

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye