This skill enables automatic collection and archiving of content from shared links into a structured knowledge base.
Core Workflow:
Detect Link → Fetch Content → Create Feishu Doc → Update Table
當用戶訊息包含以下觸發詞時,立即執行收錄:
示例:
在群聊場景中,自動檢測以下連結並靜默收錄:
靜默收錄條件:
兩種模式優先順序:
檢測到主動觸發詞 → 立即收錄(顯式模式)
未檢測到觸發詞但檢測到連結 → 靜默收錄(隱式模式)
| Type | Example | Fetch Method |
|---|---|---|
| WeChat Article | https://mp.weixin.qq.com/s/xxx |
kimi_fetch |
| Feishu Doc | https://xxx.feishu.cn/docx/xxx |
feishu_fetch_doc |
| Feishu Wiki | https://xxx.feishu.cn/wiki/xxx |
feishu_fetch_doc |
| Web Page | General URLs | kimi_fetch / web_fetch |
生效範圍:所有使用者、所有群聊
本技能已配置為全域性可用,支援以下物件:
| 物件型別 | 支援狀態 | 說明 |
|---|---|---|
| 所有使用者 | ✅ 可用 | 任何使用者分享的連結均可被收錄 |
| 所有群聊 | ✅ 可用 | 支援技能中心群、養蝦群、學習群等所有群組 |
| 私聊訊息 | ✅ 可用 | 使用者私信分享連結也可觸發收錄 |
| 多渠道 | ✅ 可用 | 飛書、其他渠道統一支援 |
許可權說明:
在正式使用本技能前,系統必須自動或引導使用者完成以下許可權校驗,以確保流程不中斷:
| 許可權項 | 驗證工具 | 目的 |
|---|---|---|
| OAuth 授權 | feishu_oauth |
獲取操作飛書文件和表格的使用者憑證 |
| 知識庫寫入許可權 | feishu_create_doc |
確保能在指定的 Space ID 下建立節點 |
| 多維表格編輯許可權 | feishu_bitable_app_table_record |
確保能向指定的 app_token 寫入記錄 |
| 圖片上傳許可權 | feishu_im_bot_upload |
允許將本地圖片同步至飛書素材庫 |
每次“安裝”或配置更新後,執行以下檢查:
關鍵詞、原連結 等必需欄位是否存在。feishu_oauth 彈出授權引導,而非在執行收錄時報錯。Before using, ensure these are configured in MEMORY.md:
## Content Collector Config
- **Knowledge Base Table**: `[Your Bitable App Token]` (Bitable app_token)
- **Table URL**: [Your Bitable Table URL]
- **Default Table ID**: `[Your Table ID]` (will auto-detect if available)
- **Knowledge Base Space ID**: `[Your Space ID]` (所有文件建立在此知識庫下)
- **Knowledge Base URL**: [Your Knowledge Base Homepage URL]
- **Content Categories**: 技術教程, 實戰案例, 產品文件, 學習筆記
- **Global Access**: 所有使用者可用,所有群聊可用
Note:
所有收錄的文件必須按照以下規則分類儲存到知識庫對應目錄:
請參考各專案或團隊定義的知識庫標準目錄結構進行儲存。收錄的文件通常存放在“素材”或“歸檔”類目錄下。
| 內容分類 | 儲存目錄 (wiki_node) | 命名字首 | 示例 |
|---|---|---|---|
| 技術教程 | F9pFw9dxTiXmpsk5bNlco704nag (內容文件) |
📖 | 📖 [標題] |
| 實戰案例 | F9pFw9dxTiXmpsk5bNlco704nag (內容文件) |
🛠️ | 🛠️ [標題] |
| 產品文件 | F9pFw9dxTiXmpsk5bNlco704nag (內容文件) |
📄 | 📄 [標題] |
| 學習筆記 | F9pFw9dxTiXmpsk5bNlco704nag (內容文件) |
💡 | 💡 [標題] |
| 熱點資訊 | F9pFw9dxTiXmpsk5bNlco704nag (內容文件) |
🔥 | 🔥 [標題] |
| 設計技能 | F9pFw9dxTiXmpsk5bNlco704nag (內容文件) |
🎨 | 🎨 [標題] |
| 工具推薦 | F9pFw9dxTiXmpsk5bNlco704nag (內容文件) |
🔧 | 🔧 [標題] |
| 訓練營 | F9pFw9dxTiXmpsk5bNlco704nag (內容文件) |
🎓 | 🎓 [標題] |
[Emoji字首] [原標題] | 收錄日期
示例:
📖 OpenClaw保姆級教程 | 2026-03-08
🛠️ 火山方舟自動化報表案例 | 2026-03-08
🔥 GPT-5.4釋出解讀 | 2026-03-08
# [Emoji] [原標題]
> 📌 **元資訊**
> - 來源:[原始來源]
> - 原文連結:[原始URL]
> - 收錄時間:YYYY-MM-DD
> - 內容分類:[技術教程/實戰案例/產品文件/學習筆記/熱點資訊/設計技能/工具推薦/訓練營]
> - 關鍵詞:[關鍵詞1, 關鍵詞2, 關鍵詞3]
---
## 📋 核心要點
[3-5條核心內容摘要]
---
## 📝 正文內容
[完整的轉存內容]
---
## 🔗 相關連結
- 原文連結:[原始URL]
- 知識庫索引:[素材池文件索引連結]
---
📚 **收錄時間**:YYYY-MM-DD
🏷️ **分類**:[分類名]
🔖 **關鍵詞**:[關鍵詞]
每次收錄完成後,必須:
Extract URL from user message using regex or direct extraction.
Choose appropriate fetch method based on URL pattern:
For WeChat articles:
kimi_fetch(url="https://mp.weixin.qq.com/s/xxx")
For Feishu docs:
feishu_fetch_doc(doc_id="https://xxx.feishu.cn/docx/xxx")
For general web pages:
kimi_fetch(url="https://example.com/article")
# or
web_fetch(url="https://example.com/article")
智慧分類判斷: 根據內容特徵自動判斷分類:
| 判斷依據 | 分類 |
|---|---|
| 包含"安裝/配置/部署/教程"等詞 | 📖 技術教程 |
| 包含"案例/實戰/專案/演示"等詞 | 🛠️ 實戰案例 |
| 包含"安全/公告/版本/功能"等詞 | 📄 產品文件 |
| 包含"學習/成長/指南/筆記"等詞 | 💡 學習筆記 |
| 包含"釋出/新功能/熱點"等詞 | 🔥 熱點資訊 |
| 包含"設計/Prompt/美學"等詞 | 🎨 設計技能 |
| 包含"工具/CLI/外掛"等詞 | 🔧 工具推薦 |
| 包含"訓練營/課程/教學"等詞 | 🎓 訓練營 |
When content contains images, download and upload them to Feishu:
Image Processing Workflow:
# 1. Extract image URLs from markdown
import re
image_urls = re.findall(r'!\[.*?\]\((https?://[^\)]+)\)', markdown_content)
# 2. Download and upload each image
for img_url in image_urls:
try:
# Download image
local_path = f"/tmp/img_{hash(img_url)}.jpg"
download_image(img_url, local_path)
# Upload to Feishu
upload_result = feishu_im_bot_upload(
action="upload_image",
file_path=local_path
)
# Replace URL in markdown
new_url = upload_result.get("image_key") or img_url
markdown_content = markdown_content.replace(img_url, new_url)
except Exception as e:
# Keep original URL if upload fails
print(f"Failed to process image {img_url}: {e}")
continue
Fallback Strategy:
Convert processed markdown to Feishu document with proper organization:
# 1. 確定分類和引數
content_category = classify_content(markdown_content) # 📖/🛠️/📄/💡/🔥/🎨/🔧/🎓
emoji_prefix = get_emoji_prefix(content_category) # 根據分類獲取emoji
wiki_node = get_wiki_node_by_category(content_category) # 獲取儲存目錄
# 2. 生成文件標題
doc_title = f"{emoji_prefix} {original_title} | {today_date}"
# 3. 生成文件內容(使用標準模板)
doc_content = f"""# {emoji_prefix} {original_title}
> 📌 **元資訊**
> - 來源:{source_name}
> - 原文連結:{original_url}
> - 收錄時間:{today_date}
> - 內容分類:{content_category}
> - 關鍵詞:{keywords}
---
## 📋 核心要點
{extract_key_points(markdown_content, 5)}
---
## 📝 正文內容
{processed_markdown_content}
---
## 🔗 相關連結
- 原文連結:{original_url}
- 知識庫索引:[Your Index Document URL]
---
📅 **收錄時間**:{today_date}
🏷️ **分類**:{content_category}
🔖 **關鍵詞**:{keywords}
"""
# 4. 建立文件到知識庫對應目錄
feishu_create_doc(
title=doc_title,
markdown=doc_content,
wiki_node=wiki_node # 必須指定儲存目錄
)
| 儲存目錄對映: | 分類 | wiki_node | 目錄名 |
|---|---|---|---|
| 所有素材 | F9pFw9dxTiXmpsk5bNlco704nag |
04-內容素材 |
IMPORTANT:
[Emoji] [Title] | [Date]Add record to the Bitable knowledge base (ONLY update this specific table):
feishu_bitable_app_table_record(
action="create",
app_token="[Your App Token]", # Configured in MEMORY.md
table_id="[Your Table ID]", # Will use correct table ID from the base
fields={
"關鍵詞": keywords,
"內容分類": content_category,
"文件標題": [{"text": original_title, "type": "text"}],
"來源": [{"text": source_name, "type": "text"}],
"核心要點": [{"text": key_points, "type": "text"}],
"飛書文件連結": {"link": new_doc_url, "text": "飛書文件", "type": "url"},
"原連結": {"link": original_url, "text": "原文連結", "type": "url"} # 新增:儲存原始連結
}
)
| Table Fields: | Field | Type | Description |
|---|---|---|---|
| 關鍵詞 | Text | Search keywords for the content | |
| 內容分類 | Single Select | Category: 📖技術教程/🛠️實戰案例/📄產品文件/💡學習筆記/🔥熱點資訊/🎨設計技能/🔧工具推薦/🎓訓練營 | |
| 文件標題 | Text | Title of the archived document | |
| 來源 | Text | Original source name | |
| 核心要點 | Text | Key points summary (3-5 items) | |
| 飛書文件連結 | URL | Link to the created Feishu document | |
| 原連結 | URL | Original source URL - 新增欄位,儲存採集的原始連結 |
IMPORTANT: Only update the configured knowledge base table. Never create or modify other tables.
After creating the document and updating the table, MUST update the index document:
# 1. 獲取當前索引文件內容
index_doc = feishu_fetch_doc(doc_id="[Your Index Doc ID]")
# 2. 在對應分類表格中新增新行
new_index_entry = f"| {original_title} | {source_name} | [檢視]({new_doc_url}) |\n"
# 3. 更新分類統計
update_category_stats(content_category)
# 4. 更新總計數
update_total_count()
或者直接追加到索引文件的末尾:
feishu_update_doc(
doc_id="[Your Index Doc ID]",
mode="append",
markdown=f"""
| {original_title} | {source_name} | [檢視]({new_doc_url}) |
"""
)
| Category | Emoji | Description | Examples |
|---|---|---|---|
| 技術教程 | 📖 | Step-by-step technical guides | Installation, configuration, API usage |
| 實戰案例 | 🛠️ | Real-world implementation examples | Case studies, project demos |
| 產品文件 | 📄 | Product features, security notices | Release notes, security advisories |
| 學習筆記 | 💡 | Conceptual knowledge, methodologies | Best practices, architecture guides |
| 熱點資訊 | 🔥 | Breaking news, releases | GPT-5.4, new features |
| 設計技能 | 🎨 | Design, prompts, aesthetics | AJ's prompts, design guides |
| 工具推薦 | 🔧 | Tools, CLI, plugins | gws, trae, autotools |
| 訓練營 | 🎓 | Courses, bootcamps, tutorials | OpenClaw bootcamp |
分類判斷優先順序:
When user replies "刪除" or "刪除 [keyword]":
# 1. Search records by keyword
feishu_bitable_app_table_record(
action="list",
app_token="[Your App Token]",
table_id="[Your Table ID]",
filter={
"conjunction": "and",
"conditions": [
{"field_name": "關鍵詞", "operator": "contains", "value": [keyword]}
]
}
)
# 2. Confirm deletion
# If multiple found → list for user to select
# If single found → ask for confirmation
# 3. Execute deletion
feishu_bitable_app_table_record(
action="delete",
app_token="[Your App Token]",
table_id="[Your Table ID]",
record_id="record_id_to_delete"
)
| Error | Cause | Solution |
|---|---|---|
| Fetch timeout | Network issue or heavy content | Retry with longer timeout, or use alternative fetch method |
| Unauthenticated | OAuth token expired or not authed | Trigger feishu_oauth to refresh user credentials |
| Permission denied | No write access to Space/Table | Check if user/bot has 'Editor' role in Feishu |
| Content too long | Exceeds API limits | Truncate or split into multiple documents |
| Table update failed | Wrong app_token or table_id | Verify configuration in MEMORY.md |
| Field Missing | "原連結" field not in table | Add the field to Bitable manually or via API |
{
"msg_type": "post",
"content": {
"post": {
"zh_cn": {
"title": "✅ 收錄完成",
"content": [
[
{"tag": "text", "text": "📄 "},
{"tag": "text", "text": "{emoji} {原標題} | {日期}", "style": {"bold": true}}
],
[{"tag": "text", "text": ""}],
[
{"tag": "text", "text": "💡 文件亮點:", "style": {"bold": true}}
],
[
{"tag": "text", "text": "• {亮點1}"}
],
[
{"tag": "text", "text": "• {亮點2}"}
],
[
{"tag": "text", "text": "• {亮點3}"}
],
[{"tag": "text", "text": ""}],
[
{"tag": "text", "text": "🔗 "},
{"tag": "a", "text": "檢視飛書文件", "href": "{文件URL}"}
]
]
}
}
}
}
簡潔輸出示例:
✅ 收錄完成
📄 📖 OpenClaw配置指南 | 2026-03-08
💡 文件亮點:
• 完整配置示例,含9大模組詳解
• 多Agent擴充套件配置方案
• 生產環境安全配置建議
🔗 檢視飛書文件 → [點選開啟](https://xxx.feishu.cn/docx/xxx)
{
"msg_type": "post",
"content": {
"post": {
"zh_cn": {
"title": "✅ 已自動收錄",
"content": [
[
{"tag": "text", "text": "📄 "},
{"tag": "text", "text": "{emoji} {原標題}", "style": {"bold": true}}
],
[{"tag": "text", "text": ""}],
[
{"tag": "text", "text": "💡 亮點:{亮點摘要}"}
],
[{"tag": "text", "text": ""}],
[
{"tag": "a", "text": "📎 檢視文件", "href": "{文件URL}"}
]
]
}
}
}
}
{
"msg_type": "post",
"content": {
"post": {
"zh_cn": {
"title": "✅ 批次收錄完成({N}份)",
"content": [
[
{"tag": "text", "text": "📄 {emoji1} {標題1}", "style": {"bold": true}}
],
[
{"tag": "text", "text": " 💡 {亮點1}"}
],
[
{"tag": "a", "text": " 🔗 檢視", "href": "{連結1}"}
],
[{"tag": "text", "text": ""}],
[
{"tag": "text", "text": "📄 {emoji2} {標題2}", "style": {"bold": true}}
],
[
{"tag": "text", "text": " 💡 {亮點2}"}
],
[
{"tag": "a", "text": " 🔗 檢視", "href": "{連結2}"}
]
]
}
}
}
}
輸出原則:
每次收錄必須完成以下所有步驟:
任何一步未完成,視為收錄失敗!
After each collection, update MEMORY.md:
### YYYY-MM-DD - Content Collection
- **新增收錄**: [Title]
- **來源**: [Source]
- **分類**: [Category]
- **知識庫狀態**: 共[N]條記錄
- **索引更新**: ✅ 已更新
This skill is part of the core knowledge management system. Execute with care and attention to detail.
原始網頁中的圖片無法直接顯示在飛書文件中(外鏈限制)
實現步驟:
import re
import requests
import os
def process_images_in_content(markdown_content):
"""
處理 Markdown 內容中的圖片:
1. 提取圖片URL
2. 下載到本地
3. 上傳到飛書
4. 替換為飛書圖片連結
"""
# 正則匹配 Markdown 圖片: 
img_pattern = r'!\[(.*?)\]\((https?://[^\)]+)\)'
def replace_image(match):
alt_text = match.group(1)
img_url = match.group(2)
try:
# 1. 下載圖片
local_path = f"/tmp/img_{abs(hash(img_url)) % 100000}.jpg"
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
}
response = requests.get(img_url, headers=headers, timeout=30)
response.raise_for_status()
with open(local_path, 'wb') as f:
f.write(response.content)
# 2. 上傳到飛書
upload_result = feishu_im_bot_upload(
action="upload_image",
file_path=local_path
)
image_key = upload_result.get("image_key")
# 3. 清理臨時檔案
os.remove(local_path)
# 4. 返回飛書圖片格式
if image_key:
return f""
else:
# 上傳失敗,保留原連結並新增警告
return f"\n\n> ⚠️ 圖片上傳失敗,已保留原連結: {img_url}"
except Exception as e:
# 處理失敗,保留原連結
return f"\n\n> ⚠️ 圖片處理失敗: {str(e)[:50]}"
# 執行替換
processed_content = re.sub(img_pattern, replace_image, markdown_content)
return processed_content
使用方式: 在建立文件之前呼叫:
# 獲取原始內容
raw_content = kimi_fetch(url=link)
# 處理圖片
processed_content = process_images_in_content(raw_content)
# 建立文件(使用處理後的內容)
feishu_create_doc(
title=title,
markdown=processed_content
)
def add_image_fallback_notice(markdown_content, original_url):
"""
在文件末尾新增圖片檢視說明
"""
notice = f"""
---
## 📎 原始圖片資源
本文件中的圖片已保留原始連結。
如圖片無法顯示,請檢視原文:
[{original_url}]({original_url})
"""
return markdown_content + notice
建立一個獨立的「圖片資源庫」多維表格:
# 收錄時同時記錄圖片資訊
feishu_bitable_app_table_record(
action="create",
app_token="圖片資源庫_token",
fields={
"文件標題": doc_title,
"圖片URL": img_url,
"圖片描述": alt_text,
"原文連結": original_url,
"收錄狀態": "待上傳/已上傳/失敗"
}
)
7w4.net小蔥技能站,你的AI助手技能庫。
圖片處理方案 v1.0 - 2026-03-05
這個 Skill 質量較好,功能設計完整,文件說明詳細,能自動識別和收錄群聊中的連結內容到飛書文件,智慧分類和模板設計都很實用。但配置方面存在明顯不足:很多關鍵引數需要手動填寫,文件中沒有提供完整的配置檔案示例,新使用者可能不知道如何正確配置。如果能附帶一個配置好的示例檔案會更加友好。