OpenClaw/clawhub-security-signals huggingface dataset:
Skill: ppop0uuiu/evomap-dashboard (version 1.0.0)

--- name: evomap-dashboard description: Launch a local EvoMap Node Dashboard web viewer. Use when user wants to view their EvoMap node status (reputation, tasks, assets) locally without requiring web browser invite code access. The tool works with any Node ID + Node Secret combination. --- # EvoMap Node Dashboard A local web dashboard for viewing any EvoMap node's data without requiring an invite code or web browser access. ## Quick Start ### Option 1: Run pre-built executable (fastest) 1. Download `EvoMapDashboard.exe` from the GitHub releases page 2. Double-click to run 3. Open `http://localhost:8766` in your browser 4. Enter your Node ID and Node Secret ### Option 2: Run from source ```bash # Clone the repo git clone https://github.com/ppop0uuiu/evomap-dashboard.git cd evomap-dashboard # Install dependencies pip install fastapi uvicorn # Run python evomap_main.py # Then open http://localhost:8766 ``` ## Features - **Login screen** — enter any Node ID + Node Secret to view that node's data - **Reputation overview** — total score, published count, promoted count, rejected count - **Reputation breakdown** — bars showing base score, promotion bonus, GDI bonus, confidence weighting - **Task list** — all claimed tasks with status badges (submitted, quarantine, runner_up, etc.) - **Asset history** — recent capsule and gene publications with confidence scores - **Auto-refresh** — updates every 30 seconds - **Switch node** — logout and log in with different credentials - **No cloud dependency** — all data fetched directly from EvoMap API ## Architecture ``` Browser (HTML/JS) │ │ localhost:8766 ▼ FastAPI Backend (Python) │ │ /a2a/* API calls with Bearer token ▼ EvoMap Hub (evomap.ai) ``` ## Environment Variables | Variable | Default | Description | |----------|---------|-------------| | `EVO_NODE_ID` | (required) | Your EvoMap node ID | | `EVO_NODE_SECRET` | (required) | Your EvoMap node secret | ## Build Executable ```bash pip install pyinstaller pyinstaller --onefile --name EvoMapDashboard \ --add-data "evomap_dashboard.html;." \ evomap_main.py ``` Output: `dist/EvoMapDashboard.exe` (~37MB) ## Security Notes - Node credentials are stored only in browser `sessionStorage` (cleared when tab closes) - Credentials are sent only to EvoMap API, never to third parties - No logging of credentials anywhere - Works fully offline after startup (only needs internet to call EvoMap API) ## For OpenClaw Agents This tool can be launched by an OpenClaw agent using the `exec` tool: ```bash # Start the dashboard server python /path/to/evomap_main.py # Open in browser # http://localhost:8766 ``` ## GitHub Repository https://github.com/ppop0uuiu/evomap-dashboard ## EvoMap Capsule Reference This tool was published as a Capsule on EvoMap: - Capsule ID: `sha256:2e716e6149fd6fb47f9ba72a1778ce1dbf1bd8b1fe1e5bdceeebd9de69904fdd` - Signal: `evomap dashboard viewer tool`


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)
Skill: yang1002378395-cmyk/ai-content-gen (version 1.0.0)

--- name: ai-intelligent-content-generation version: 1.0.0 description: 内容生成，文章生成 + 图片生成。 metadata: openclaw: emoji: "🤖" requires: bins: [] --- # AI 智能内容生成系统 ## 描述 内容生成，文章生成 + 图片生成。 ## 功能 - 文章生成（AI写作） - 图片生成（AI绘图） - 视频生成（AI视频） - 标题优化（标题生成） - 内容审核（自动审核） ## 定价 - 基础版：¥199/月（100 篇/月） - 专业版：¥999/月（1000 篇/月） - 企业版：¥2999/月（无限篇） ## 适用场景 - 内容创作 - 营销文案 - 新闻写作 - 社媒内容 ## 技术栈 - Python + FastAPI - GPT 集成 - 图片生成 - 内容审核 ## 安装 ```bash git clone https://github.com/openclaw-skills/ai-intelligent-content-generation cd ai-intelligent-content-generation pip install -r requirements.txt python app.py ``` --- 创建：2026-03-13 作者：OpenClaw Skills Team


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)
Skill: bytesagain-lab/roast-generator (version 2.0.0)

--- version: "2.0.0" name: Roast Generator description: "Roast Generator. Use when you need roast generator capabilities. Triggers on: roast generator." 吐槽生成器。温和吐槽、毒舌模式、朋友互怼、名人吐槽、自嘲、Battle模式。Roast generator with gentle, savage modes. 吐槽、毒舌、搞笑。 author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Roast Generator 吐槽生成器。温和吐槽、毒舌模式、朋友互怼、名人吐槽、自嘲、Battle模式。Roast generator with gentle, savage modes. 吐槽、毒舌、搞笑。 ## 常见问题 **Q: 这个工具适合谁用？** A: 任何需要roast generator的人，无论是个人还是企业用户。 **Q: 输出格式是什么？** A: 主要输出Markdown格式，方便复制和编辑。 ## 命令速查 ``` gentle gentle savage savage friend friend celebrity celebrity self self battle battle ``` --- *Roast Generator by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com - Run `roast-generator help` for all commands ## Commands Run `roast-generator help` to see all available commands. ## Output Results go to stdout. Save with `roast-generator run > output.txt`. ## Output Results go to stdout. Save with `roast-generator run > output.txt`.


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)
Skill: landercortazarromero/korta-obsidian (version 1.0.0)

--- name: obsidian description: Work with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli. homepage: https://help.obsidian.md metadata: {"clawdbot":{"emoji":"💎","requires":{"bins":["obsidian-cli"]},"install":[{"id":"brew","kind":"brew","formula":"yakitrak/yakitrak/obsidian-cli","bins":["obsidian-cli"],"label":"Install obsidian-cli (brew)"}]}} --- # Obsidian Obsidian vault = a normal folder on disk. Vault structure (typical) - Notes: `*.md` (plain text Markdown; edit with any editor) - Config: `.obsidian/` (workspace + plugin settings; usually don’t touch from scripts) - Canvases: `*.canvas` (JSON) - Attachments: whatever folder you chose in Obsidian settings (images/PDFs/etc.) ## Find the active vault(s) Obsidian desktop tracks vaults here (source of truth): - `~/Library/Application Support/obsidian/obsidian.json` `obsidian-cli` resolves vaults from that file; vault name is typically the **folder name** (path suffix). Fast “what vault is active / where are the notes?” - If you’ve already set a default: `obsidian-cli print-default --path-only` - Otherwise, read `~/Library/Application Support/obsidian/obsidian.json` and use the vault entry with `"open": true`. Notes - Multiple vaults common (iCloud vs `~/Documents`, work/personal, etc.). Don’t guess; read config. - Avoid writing hardcoded vault paths into scripts; prefer reading the config or using `print-default`. ## obsidian-cli quick start Pick a default vault (once): - `obsidian-cli set-default "<vault-folder-name>"` - `obsidian-cli print-default` / `obsidian-cli print-default --path-only` Search - `obsidian-cli search "query"` (note names) - `obsidian-cli search-content "query"` (inside notes; shows snippets + lines) Create - `obsidian-cli create "Folder/New note" --content "..." --open` - Requires Obsidian URI handler (`obsidian://…`) working (Obsidian installed). - Avoid creating notes under “hidden” dot-folders (e.g. `.something/...`) via URI; Obsidian may refuse. Move/rename (safe refactor) - `obsidian-cli move "old/path/note" "new/path/note"` - Updates `[[wikilinks]]` and common Markdown links across the vault (this is the main win vs `mv`). Delete - `obsidian-cli delete "path/note"` Prefer direct edits when appropriate: open the `.md` file and change it; Obsidian will pick it up.


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)
Skill: am-will/openai-docs (version 1.0.0)

--- name: openai-docs-skill description: Query the OpenAI developer documentation via the OpenAI Docs MCP server using CLI (curl/jq). Use whenever a task involves the OpenAI API (Responses, Chat Completions, Realtime, etc.), OpenAI SDKs, ChatGPT Apps SDK, Codex, MCP integrations, endpoint schemas, parameters, limits, or migrations and you need up-to-date official guidance. --- # OpenAI Docs MCP Skill ## Overview Use the OpenAI developer documentation MCP server from the shell to search and fetch authoritative docs. Always do this for OpenAI platform work instead of relying on memory or non-official sources. ## Core rules - Always use this skill for OpenAI API/SDK/Apps/Codex questions or when precise, current docs are required. - Query the MCP server via the CLI wrapper in `scripts/openai-docs-mcp.sh` (do not rely on Codex MCP tools). - Use `search` or `list` to find the best doc page, then `fetch` the page (or anchor) for exact text. - Surface the doc URL you used in your response so sources are clear. ## Quick start ```bash scripts/openai-docs-mcp.sh search "Responses API" 5 scripts/openai-docs-mcp.sh fetch https://platform.openai.com/docs/guides/migrate-to-responses ``` ## Workflow 1. Discover: `search` with a focused query. If unsure, use `list` to browse. 2. Read: `fetch` the most relevant URL (optionally add an anchor). 3. Apply: summarize and/or quote relevant sections; include the URL. ## Script reference The CLI wrapper is at `scripts/openai-docs-mcp.sh` and uses `curl` + `jq` against `https://developers.openai.com/mcp`. Subcommands: - `init`: initialize and inspect server capabilities. - `tools`: list available tools on the MCP server. - `search <query> [limit] [cursor]`: return JSON hits from the docs index. - `list [limit] [cursor]`: browse docs index. - `fetch <url> [anchor]`: return markdown for a doc page or section. - `endpoints`: list OpenAPI endpoints. - `openapi <endpoint-url> [lang1,lang2] [code-only]`: fetch OpenAPI schema or code samples. Environment: - `MCP_URL`: override the default MCP endpoint.


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)
Skill: z904832819/local-api-chart-generator (version 1.0.3)

--- name: local-api-chart-generator description: 专为调用本地数据接口并生成图表展示定制的 Skill。接收自然语言指令（如“我要最近一年燃油类型为天然气的扭矩占比”），自动提取参数，请求本地接口，生成 HTML 柱状图并返回完整的 HTML 源码。 version: 1.0.0 author: 小果 tags: [local-api, chart, echart, bar-chart, data-visualization] --- # 本地接口数据图表生成器 (Local API Chart Generator) **重要：这是一个专为 API 调用设计的技能，必须严格遵守以下执行流程。** ## 🔄 强制执行流程 (Strict Workflow) ### 第一步：提取参数 从用户指令中提取： - **燃油类型（必传）**：如 `柴油,天然气` - **时间范围（必传）**：转换为 `['开始日期', '结束日期']` 格式 - **马力（选传）**:如 `90` - **排放（选传）**:如 `国六` - **排量（选传）**:如 `7` ### 第二步：执行 Python 脚本 执行命令： ```bash python3 /Users/laixufei/PycharmProjects/skills/local-api-chart-generator/build_chart.py --fueltype1 "燃油类型" --time '["开始日期", "结束日期"]' ``` 如需带选传参数，可使用： ```bash python3 /Users/laixufei/PycharmProjects/skills/local-api-chart-generator/build_chart.py --fueltype1 "燃油类型" --time '["开始日期", "结束日期"]' --horsepower "马力" --emission "排放" --displacement "排量" ``` ### 第三步：提取并原样返回 HTML（关键！） **严格约束：** 1. 从 Python 输出中提取 `---HTML_CODE_START---` 和 `---HTML_CODE_END---` 之间的内容。 2. **直接将这段 HTML 源码原封不动地放在回复的最前面**，不要添加任何额外的解释文字。 3. **禁止使用** `[embed]`、`MEDIA:` 或任何其他 OpenClaw 内部渲染语法。 4. **禁止对数据进行额外分析或总结**，只需返回 HTML 源码即可。 ## ⚠️ API 调用模式 当通过 `/v1/chat/completions` API 调用时，回复格式必须为： ``` <!DOCTYPE html> <html lang="zh-CN"> ...完整 HTML 源码... </html> ``` 这样调用方可以直接从 `choices[0].message.content` 中获取 HTML 并在前端渲染。


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)
Skill: amdf01-debug/sw-self-improving-agent (version 1.0.0)

# Self-Improving Agent Skill ## Trigger Build agents that learn from corrections and get better over time. **Trigger phrases:** "self-improving agent", "agent learns", "correction loop", "agent keeps making mistakes", "teach my agent" ## The Correction Loop ``` User corrects agent → Agent logs correction to RULES.md → Next session, agent reads RULES.md → Agent avoids the mistake → Over time, RULES.md becomes a refined operating manual ``` ## Implementation ### RULES.md Structure ```markdown # RULES.md — Self-Improving Operating Rules ## Communication - [2026-03-15] Never use "I hope this helps" — just end the message - [2026-03-18] When drafting emails, provide ONLY the email text — no commentary ## Operations - [2026-03-16] Check calendar BEFORE suggesting meeting times - [2026-03-20] When referencing a project, include status from projects/ folder ## People - [2026-03-17] Client X prefers formal communication - [2026-03-19] Always CC studio manager on client emails unless told otherwise ``` ### Rules for Rules - Date-stamp every rule - One rule per line — atomic, independently useful - Max ~150 rules (beyond this, models start losing adherence) - Review monthly: remove stale rules, merge duplicates - If two rules contradict, the newer one wins - Promote patterns (not incidents) — "always check X before Y" > "that one time X broke" ### AGENTS.md Integration Add to your AGENTS.md: ```markdown ## Self-Improvement After ANY correction from the user: 1. Log the correction pattern to RULES.md with date 2. Identify the general rule (not just the specific instance) 3. Check if a similar rule already exists — update rather than duplicate 4. Silently scan RULES.md every ~10 interactions for contradictions ``` ## Metrics - Track correction frequency over time (should decrease) - Track RULES.md size (should grow, then plateau) - Track unique vs repeat corrections (repeats should approach zero)


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)
Skill: saurabhjain1592/axonflow-governance-policies (version 1.0.2)

--- name: axonflow-governance-policies description: DEPRECATED — use @axonflow/governance-policies instead. This personal copy is no longer maintained. homepage: https://clawhub.ai/axonflow/governance-policies tags: deprecated, security, governance --- # DEPRECATED This skill has moved to the official AxonFlow organization on ClawHub: **Use [@axonflow/governance-policies](https://clawhub.ai/axonflow/governance-policies) instead.** This personal copy (`saurabhjain1592/axonflow-governance-policies`) is no longer updated.


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)
Skill: xueyetianya/newsletter-writer (version 2.0.0)

--- version: "2.0.0" name: newsletter-writer description: "Newsletter邮件内容生成、标题优化、受众分类、A/B测试文案、发送时间建议、效果分析。Newsletter content writer with subject optimization, audience segmentation, A/B testing, scheduling." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # newsletter-writer Newsletter邮件内容生成、标题优化、受众分类、A/B测试文案、发送时间建议、效果分析。Newsletter content writer with subject optimization, audience segmentation, A/B testing, scheduling, performance analysis. ## 为什么选择这个工具 - ✅ 专为中文用户设计，理解中国市场和文化 - ✅ 多种命令覆盖不同场景需求 - ✅ 输出实用、可直接使用的内容 - ✅ 持续更新，紧跟行业最新趋势 ## 命令速查 ``` write write subject subject segment segment ab-test ab test schedule schedule analyze analyze ``` ## 专业建议 - 数字+好处**: "5个方法让你的转化率翻倍" - 紧迫感**: "最后24小时: 你不能错过的..." - 好奇心**: "我们发现了一个秘密..." - 个性化**: "[姓名]，专属你的..." - 问题式**: "你是否还在为...烦恼？" --- *newsletter-writer by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Commands Run `newsletter-writer help` to see all available commands.


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)
Skill: kaising050708/xiaohongshu-title-generator (version 1.0.0)

--- name: xiaohongshu-title-generator version: 1.0.0 description: "批量生成小红书爆款标题，支持多种模板和 emoji 自动添加" author: xiaokai-ai license: MIT platforms: - openclaw - cursor - claude-code tags: - content - xiaohongshu - title - generator - chinese price: 9.9 --- # 小红书爆款标题生成器 批量生成小红书风格爆款标题，适合内容创作者、电商卖家、自媒体运营。 ## When to Activate Trigger when the user mentions: 小红书标题，生成标题，爆款标题，title generator, xiaohongshu titles. ## Workflow 1. **Confirm inputs:** - 主题/关键词 (required) - 目标受众 (optional: 学生党/上班族/宝妈/等) - 标题数量 (default: 10, max: 50) - 风格偏好 (optional: 干货型/种草型/测评型/故事型) 2. **Generate titles using templates:** ### Title Templates **数字型** (点击率高) - "{数字}个{主题}技巧，亲测有效！" - "花了{数字}{单位}，总结的{主题}攻略" - "{数字}年{主题}经验，告诉你{痛点}" **疑问型** (引发好奇) - "为什么你的{主题}总是{问题}？" - "{主题}到底要不要{行为}？" - "谁懂啊！{主题}这样{行为}真的好吗？" **对比型** (突出差异) - "{产品 A}vs{产品 B}，到底哪个更{指标}？" - "月薪{数字}和月薪{数字}的{主题}区别" - "用{方法 A}和{方法 B}，效果差{数字}倍！" **痛点型** (引发共鸣) - "{人群}必看！{痛点}终于有救了" - "后悔没早{行为}！{主题}避坑指南" - "{主题}踩了{数字}个坑，总结的血泪教训" **种草型** (促进转化) - "按头安利！这个{主题}真的{形容词}" - "挖到宝了！{价格}的{主题}居然{效果}" - "无限回购！{主题}界的{比喻}" 3. **Add emoji automatically:** - 根据标题内容匹配相关 emoji - 每个标题 1-3 个 emoji - 避免过度使用 4. **Quality check:** - 标题长度 15-30 字 (最佳阅读体验) - 包含关键词 (SEO 友好) - 避免违禁词 (最/第一/唯一等) - 有吸引力但不标题党 ## Output Format ```markdown ## 生成的{数量}个小红书标题 ### 数字型 1. 💡 {标题 1} 2. 📊 {标题 2} 3. 🎯 {标题 3} ### 疑问型 4. 🤔 {标题 4} 5. ❓ {标题 5} ### 对比型 6. ⚖️ {标题 6} 7. 🆚 {标题 7} ### 痛点型 8. 😭 {标题 8} 9. ✅ {标题 9} ### 种草型 10. 🌿 {标题 10} --- **使用建议:** - A/B 测试不同标题看数据 - 根据封面图选择匹配的标题 - 结合热点话题效果更好 ``` ## Examples **输入:** ``` 主题：护肤 受众：25 岁 + 女性 数量：10 风格：干货型 ``` **输出:** ``` ## 生成的 10 个小红书标题 ### 数字型 1. 💡 25 岁后必看的 5 个抗初老秘诀！ 2. 📊 花了 3 万块，总结的护肤攻略 3. 🎯 10 年护肤经验，告诉你怎么选精华 ### 疑问型 4. 🤔 为什么你的护肤总是没效果？ 5. ❓ 早 C 晚 A 到底要不要建立耐受？ ### 对比型 6. ⚖️ 平价 vs 大牌，精华液哪个更值得？ 7. 🆚 国货和进口，护肤品差 3 倍价格！ ### 痛点型 8. 😭 敏感肌必看！泛红终于有救了 9. ✅ 后悔没早刷酸！黑头避坑指南 ### 种草型 10. 🌿 按头安利！这个精华真的绝了 --- **使用建议:** - A/B 测试不同标题看数据 - 根据封面图选择匹配的标题 - 结合热点话题效果更好 ``` ## Pricing - **Free tier:** 10 titles per generation - **Pro tier:** ¥9.9/month - unlimited generations ## Support Issues: https://github.com/xiaokai-ai/xiaohongshu-title-generator Docs: https://clawhub.ai/skills/xiaohongshu-title-generator --- *Made with ❤️ by Xiao Kai AI*


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)
Skill: kortney-lee/wihy-health (version 1.0.3)

--- name: wihy-health description: Fact-check health and nutrition claims using the WIHY research knowledge base. Returns science-backed answers with citations from peer-reviewed sources. homepage: https://wihy.ai metadata: {"openclaw": {}} --- # WIHY Health Research & Fact Checker Use this skill when the user wants to verify a health or nutrition claim, asks whether something is true, or wants science-backed evidence on a topic. ## When to Use This Skill Trigger on questions like: - "Is [food/habit] actually good for you?" - "I heard [health claim] — is that true?" - "Does [supplement/diet/food] work?" - "What does the research say about...?" - "Is [X] healthy or not?" - "Are eggs bad for cholesterol?" - "Does intermittent fasting actually work?" - "Is coffee good or bad for you?" Do NOT use for generating meal plans, shopping lists, or workout programs — those require the full WIHY app at [wihy.ai](https://wihy.ai). ## How to Call the API Generate a random UUID for `session_id` at the start of each conversation and reuse it for follow-ups. It is **required** by the API. ```bash SESSION_ID=$(python3 -c "import uuid; print(uuid.uuid4())") curl -s -X POST https://ml.wihy.ai/ask \ -H "Content-Type: application/json" \ -d "{ \"message\": \"<USER_QUESTION_HERE>\", \"session_id\": \"$SESSION_ID\", \"source_site\": \"openclaw\" }" ``` ## Presenting the Answer The response is JSON. Key fields: - `message` — the answer text - `citations[]` — each has `title`, `journal`, `year`, `pmcid` (PubMed Central ID) - `confidence` — 0.0 to 1.0 - `follow_up_questions[]` — optional suggested next questions Format the response like this: 1. **Lead with the verdict** from `message` 2. **If citations exist**, list each with a constructed PMC link: - Build URL as: `https://www.ncbi.nlm.nih.gov/pmc/articles/{pmcid}/` - Format: `[Title](url) — Journal, Year` 3. **State confidence** only if below 0.6: "Note: the evidence on this is mixed." 4. Keep the tone factual and neutral. Example output: ``` [Answer from message] Sources: - [Title](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1234567/) — Journal Name, 2023 - [Title](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9876543/) — Journal Name, 2022 ``` If `follow_up_questions` is present, offer 1-2 as natural suggestions: "You might also want to know: ..." ## Closing Line (Optional, Once Per Conversation) If the user seems interested in applying the research to their own life, you may add once: > For personalized recommendations based on your goals and health profile, visit [wihy.ai](https://wihy.ai) ## Error Handling - **No citations returned**: Present the answer but note it is based on general knowledge, not a cited source. - **500 / timeout**: Tell the user there was a server error and suggest rephrasing the question.


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)
Skill: sunkaikai123/large-file-handler (version 1.0.0)

--- name: large-file-handler description: 大文件异步处理器。当用户发送大文件（>10MB）时自动启用，采用流式保存 + 后台异步处理，避免 Gateway 卡死。支持 PDF、视频、图片、日志、Office 文档等。处理完成后主动推送结果。 author: Leo license: MIT --- # large-file-handler - 大文件异步处理技能 ## 🎯 功能 接收和处理大文件（PDF、视频、图片、日志、Office 等），采用**异步处理 + 结果推送**模式，避免 Gateway 卡死。 ## 📁 文件存储结构 ``` tmp/files/ ├── pending/ # 待处理文件 ├── processing/ # 处理中文件（带锁标记） └── completed/ # 已完成文件（保留 24 小时后清理） ``` ## ⚙️ 配置参数 | 参数 | 默认值 | 说明 | |------|--------|------| | `LARGE_FILE_THRESHOLD` | 10MB | 超过此大小自动切换异步模式 | | `MAX_FILE_SIZE` | 500MB | 最大接收文件大小 | | `CHUNK_SIZE` | 5MB | 分块处理大小 | | `RETENTION_HOURS` | 24 | 完成文件保留时间 | ## 🔄 处理流程 ### 1. 文件接收 ``` 用户发送文件 ↓ 检查文件大小 ↓ <阈值：直接处理 >阈值：异步模式 ↓ 流式保存到 tmp/files/pending/ ↓ 立即回复"收到，处理中" ``` ### 2. 异步处理 ``` 后台任务启动 ↓ 移动文件到 processing/（加锁） ↓ 根据文件类型调用对应处理器 ↓ 处理完成 → 移动到 completed/ ↓ 推送结果给用户 ``` ## 📦 文件类型处理器 | 类型 | 处理器 | 说明 | |------|--------|------| | `.pdf` | `pdf-processor` | PDF 提取/OCR/摘要 | | `.mp4,.mov,.avi` | `video-processor` | 关键帧提取 + 音频转文字 | | `.jpg,.png,.webp` | `image-processor` | OCR + 内容描述 | | `.log,.txt` | `log-processor` | 关键字提取 + 错误分析 | | `.docx,.pptx,.xlsx` | `office-processor` | 转换为 Markdown | | `.zip,.rar,.7z` | `archive-processor` | 解压 + 选择性提取 | ## 💬 用户交互示例 ### 小文件（<10MB） ``` 用户：[发送文件] 我：[直接处理并回复结果] ``` ### 大文件（>10MB） ``` 用户：[发送 50MB PDF] 我：收到文件「xxx.pdf」（50MB），正在后台处理，完成后发你结果 🦁 【3 分钟后】 我：[PDF 处理完成] 📄 文档标题：xxx 📊 共 xx 页 📝 内容摘要：... ``` ## 🔧 技术实现 ### 文件保存（流式） ```python def save_file_stream(file_stream, dest_path, chunk_size=5*1024*1024): with open(dest_path, 'wb') as f: while chunk := file_stream.read(chunk_size): f.write(chunk) return True ``` ### 异步任务启动 ```python import subprocess def start_async_task(file_path, handler_type): # 启动独立子进程，与 Gateway 隔离 subprocess.Popen([ 'python', 'handlers/{handler_type}.py', '--file', file_path, '--notify', 'feishu' ], cwd=WORKSPACE) ``` ### 文件锁机制 ```python def acquire_lock(file_path): lock_file = file_path + '.lock' try: with open(lock_file, 'x') as f: f.write(str(os.getpid())) return True except FileExistsError: return False # 已被其他进程处理 ``` ## 📝 待办事项 - [ ] 实现文件接收和流式保存 - [ ] 实现大小阈值判断 - [ ] 创建各类型文件处理器 - [ ] 实现结果推送机制 - [ ] 添加定时清理任务（清理 completed/ 超过 24 小时的文件） ## 🚀 使用方法 ```python # 在 Gateway 中调用 from large_file_handler import handle_file result = handle_file( file_stream=request.files['file'], file_name='example.pdf', user_id='ou_xxx', channel='feishu' ) if result['async']: # 异步模式，已自动后台处理 return "收到文件，处理完成后通知你" else: # 同步模式，直接返回结果 return result['content'] ``` --- **版本**: v0.1 **创建日期**: 2026-04-03 **作者**: Leo 🦁

path: _meta.json
content: {
  "ownerId": "ou_074397f5ddd46b75d7ae06baea9eea45",
  "ownerName": "Leo",
  "slug": "large-file-handler",
  "version": "1.0.0",
  "publishedAt": 1775289600000,
  "author": "Leo 🦁",
  "license": "MIT",
  "tags": ["file", "async", "large-file", "pdf", "video", "image"]
}


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (HIGH)