SKILL.md 4.6 KB


name: fmode-image-analysis

description: Analyze images, screenshots, posters, UI captures, charts, product photos, and image text through Fmode Doubao vision from Claude Code. Use when the user asks for 图片识别, 看图, 识图, 分析截图, 提取图片文字, UI 截图分析, 图片转 VOC evidence/context, or when DeepSeek/other text-only models cannot read images and Claude Code needs a vision fallback using the platform user token.

Fmode Image Analysis

图像/视频分析推荐改用 fmode-vision 技能包(功能更完整:单轮/多轮聚焦分析、视频帧分析、批量处理)。本技能是 Claude Code 内置 MCP 工具 fmode_image_analysis 的轻量图片识别入口/回退,适合“当前对话里已有图片、需要快速识图”的场景;需要更精细或视频/批量处理时,引导用户/Agent 改用 fmode-vision

Core Rule

Use MCP tool fmode_image_analysis for image understanding. Do not ask the user to install a VS Code image-recognition plugin when this installed Fmode tool can handle the image.

When the current Claude Code turn contains an uploaded image, pasted screenshot, local temp image path, attachment object, or data URL, and the user asks any question about that visual content, call fmode_image_analysis first and answer from its result.

Default to:

  • baseUrl: https://api.fmode.cn
  • path: v1/chat/completions
  • model: doubao-seed-2-0-pro-260215(默认/推荐,不强制使用单一模型——可按可用权限改用其他多模态模型,如 gpt-4o 等;通过工具入参 model 覆盖即可)

Auth and billing should use the configured platform user token. Never hardcode or echo tokens.

Inputs

Accept natural user input:

  • Local file paths: imagePath or imagePaths
  • Remote image URLs: imageUrl or imageUrls
  • Data URLs or mixed arrays: images
  • Claude Code uploaded/pasted image attachments surfaced as image, images, file, files, attachment, or attachments
  • User request: prompt, question, or text
  • Optional background: context

If the user provides a screenshot, pasted image, uploaded image, or image path in chat, pass it directly to fmode_image_analysis. If the user asks a broad question like "帮我看下这张图", use a concise general prompt that asks for visible text, subject, scene, key facts, risks, and next actions.

Tool Call Examples

Single local image:

{
  "imagePath": "E:\\workspace\\example\\screenshot.png",
  "prompt": "请识别这张截图里的关键信息,并指出可能的问题。"
}

Multiple images:

{
  "imagePaths": [
    "E:\\workspace\\example\\before.png",
    "E:\\workspace\\example\\after.png"
  ],
  "prompt": "对比两张 UI 截图,说明布局和文案差异。"
}

Structured output:

{
  "imageUrl": "https://example.com/product.png",
  "prompt": "提取图片中的产品卖点、可见文字和合规风险。",
  "outputFormat": "json"
}

Token Handling

The tool may read tokens from tool input, .env.local, environment variables, or user-level Claude credential JSON.

Preferred token fields:

  • fmodeToken
  • vocToken
  • sessionToken
  • tihaoToken

Environment variables:

  • FMODE_TOKEN
  • VOC_TOKEN
  • TIHAO_SESSION_TOKEN
  • DOUBAO_VISION_TOKEN
  • VIDEO_ANALYSIS_TOKEN

Friendly states (aligned with the fmode-api billing 口径 — self-rescue first, recharge only on a real 402):

  • Missing token (needs_token): this is not a balance problem — guide self-rescue first. Read the sk- fmode key from ~/.claude/settings.json (env.ANTHROPIC_AUTH_TOKEN), ~/.fmode/config.json, or ~/.claude/voc-credentials.json. Do NOT push a recharge link here.
  • Invalid token: return needs_valid_token and ask for a valid platform token.
  • Quota exhausted / real 402: return needs_recharge with the runtime-generated Tokenized Balance link or QR payment result and errors=[].
  • Success: return ok with the analysis in chat.

Do not expose raw upstream errors, Authorization, bearer tokens, session tokens, stack traces, or model keys.

Output Standard

Return the analysis body in chat. For normal image reading, include:

  • Visible text or OCR-like extraction when present.
  • Main objects, people, product, interface, chart, or scene.
  • Important facts and uncertainty.
  • Risks, inconsistencies, or items that need manual review.
  • A short conclusion or next action.

When the image analysis should support VOC reports, summarize the result as reusable evidence and pass it into the relevant VOC tool as evidence, context, or reportText only after the user asks to continue into VOC analysis.