snap-context
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseScreenshot to Structured Markdown
截图转结构化Markdown
When this skill is invoked, you MUST delegate image analysis to subagents using the Task tool. Do NOT read or process any images in the current context — this keeps image tokens out of the main conversation.
当调用此技能时,你必须使用Task工具将图像分析任务委托给子代理(subagent)。请勿在当前上下文里读取或处理任何图像——这样可以避免图像令牌进入主对话流程。
How to invoke
调用方式
Single image
单张图像
Use the Task tool with these parameters:
- :
subagent_type"general-purpose" - :
model"sonnet" - :
description"Extract screenshot to markdown" - : The full agent prompt below, with
promptreplaced by the actual file pathIMAGE_PATH
使用Task工具并传入以下参数:
- :
subagent_type"general-purpose" - :
model"sonnet" - :
description"Extract screenshot to markdown" - : 下方完整的代理提示词,将其中的
prompt替换为实际文件路径IMAGE_PATH
Multiple images
多张图像
Spawn one Task per image in parallel (all in a single message with multiple tool calls). Each subagent processes one image independently. Replace in each prompt with the corresponding file path.
IMAGE_PATH并行生成每个图像对应一个Task(在单条消息中包含多个工具调用)。每个子代理独立处理一张图像。将每个提示词中的替换为对应的文件路径。
IMAGE_PATHIdentifying images
识别图像
Collect all image file paths from:
- Explicit paths in
$ARGUMENTS - Images attached/pasted in the user's message (these appear as )
[Image: source: /path/to/file]
If no images are found, ask the user for the image file path(s) before spawning any agents.
从以下位置收集所有图像文件路径:
- 中的显式路径
$ARGUMENTS - 用户消息中附加/粘贴的图像(格式为)
[Image: source: /path/to/file]
如果未找到任何图像,请在生成代理前向用户询问图像文件路径。
Agent prompt
代理提示词
Pass this exact prompt to each Task agent (replacing with the real path for that image):
IMAGE_PATHYou are a screenshot-to-markdown converter. Use the Read tool to open the image at: IMAGE_PATH
Detect the structure type and output clean markdown. Follow these rules exactly.
将以下精确提示词传递给每个Task代理(将替换为该图像的实际路径):
IMAGE_PATH你是一个截图转Markdown转换器。使用Read工具打开位于以下路径的图像:IMAGE_PATH
检测结构类型并输出清晰的Markdown格式。严格遵循以下规则。
Detection Priority
检测优先级
Pick the first type that clearly fits. If none fit, use Plain Text.
- Table — grid of aligned columns with repeated rows of data
- Form — labeled fields with values (Label: Value pairs), possibly grouped under section headings
- Card — 2–6 side-by-side content blocks arranged in columns
- Code — monospaced text with syntax patterns (braces, keywords, indentation)
- Dialog — a small, narrow overlay box with a title, message, and action buttons
- Hierarchy — indented/nested list structure (file trees, outlines, task lists)
- Plain Text — paragraphs of text that don't match any above type
选择第一个完全匹配的类型。如果没有匹配项,使用Plain Text(纯文本)。
- Table — 由对齐列和重复数据行组成的网格
- Form — 带值的标记字段(Label: Value键值对),可能按章节标题分组
- Card — 2-6个并排排列的内容块,按列布局
- Code — 具有语法模式(大括号、关键字、缩进)的等宽文本
- Dialog — 带有标题、消息和操作按钮的小型窄幅覆盖框
- Hierarchy — 缩进/嵌套列表结构(文件树、大纲、任务列表)
- Plain Text — 不符合上述任何类型的文本段落
Context Detection
上下文检测
Before formatting the main content, check for:
-
Sidebar navigation: If a left-side nav panel is visible, extract it as:Context: AppName > ActivePage Sidebar: item1, ActivePage, item3 Bold the active page. Place above main content with a blank line separator.
-
Modal/dialog overlay: If a modal on a dimmed background, focus only on the modal — ignore the background.
在格式化主内容之前,检查以下内容:
-
Sidebar navigation(侧边栏导航):如果左侧导航面板可见,将其提取为:Context(上下文): AppName > ActivePage(当前页面) Sidebar(侧边栏): item1, ActivePage(当前页面), item3 为当前页面添加粗体。将其放在主内容上方,中间用空白行分隔。
-
Modal/dialog overlay(模态框/对话框覆盖层):如果是暗背景上的模态框,仅关注模态框——忽略背景。
Formatting Rules
格式规则
Table:
- Pipe-delimited markdown table with padded columns (minimum 3 chars)
- Use distinguishable header row (bold, ALL CAPS, or first row)
- Preserve context lines above and footer lines below
Form:
- Bullet list with bolded labels:
- **Label:** Value - Group under when section headers are visible
## Section Heading - Omit section headings if none exist
Card:
- for overall title,
##for each card title### - Subtitle = smaller text below card title
- Action buttons as
**[Label]**
Code:
- Fenced code block with language tag (swift, python, javascript, rust, go, java, bash, html, sql, typescript)
- Omit language tag only if truly unidentifiable
- Preserve indentation exactly
Dialog:
- Everything inside a blockquote
- Title as
> ## Title - Buttons as
> **[OK]** **[Cancel]** - Menus (vertical list, no title/buttons): same blockquote, each item on its own line
Hierarchy:
- 2-space indent per nesting level
- Preserve bullet types: unordered,
-numbered,1./- [x]checkboxes- [ ] - Convert and
•to*, convert-/☑to✓, convert- [x]/☐to✗- [ ]
Plain Text:
- Separate paragraphs with blank lines
- Preserve line breaks within paragraphs
Table(表格):
- 使用竖线分隔的Markdown表格,列宽至少填充3个字符
- 使用可区分的表头行(粗体、全大写或第一行)
- 保留表格上方的上下文行和下方的页脚行
Form(表单):
- 带粗体标签的项目符号列表:
- **Label:** Value - 当存在章节标题时,按分组
## Section Heading - 如果没有章节标题则省略
Card(卡片):
- 整体标题使用,每个卡片标题使用
##### - 副标题 = 卡片标题下方的小号文本
- 操作按钮格式为
**[Label]**
Code(代码):
- 带语言标签的围栏代码块(swift, python, javascript, rust, go, java, bash, html, sql, typescript)
- 仅在确实无法识别时省略语言标签
- 严格保留缩进
Dialog(对话框):
- 所有内容放在块引用内
- 标题格式为
> ## Title - 按钮格式为
> **[OK]** **[Cancel]** - 菜单(垂直列表,无标题/按钮):放在同一个块引用中,每个项目单独一行
Hierarchy(层级结构):
- 每个嵌套级别使用2个空格缩进
- 保留项目符号类型:无序列表,
-有序列表,1./- [x]复选框- [ ] - 将和
•转换为*,将-/☑转换为✓,将- [x]/☐转换为✗- [ ]
Plain Text(纯文本):
- 段落之间用空白行分隔
- 保留段落内的换行符
Output Rules
输出规则
- Output ONLY the formatted markdown — no explanations, no preamble, no commentary
- If sidebar context was detected, include it at the top
- Pick exactly one structure type for the main content
- Be precise — transcribe text exactly as shown, do not paraphrase or summarize
- For ambiguous cases (e.g. a form inside a dialog), prefer the outer container type
- 仅输出格式化后的Markdown——不添加解释、开场白或评论
- 如果检测到侧边栏上下文,将其放在顶部
- 为主内容精确选择一种结构类型
- 保持精准——严格按照显示的文本转录,不要意译或总结
- 对于模糊情况(例如对话框内的表单),优先选择外部容器类型
After the agent(s) return
代理返回结果后
Single image
单张图像
Return the agent's markdown output directly to the user. Do not add any wrapper text, explanation, or commentary — just the raw markdown result.
直接将代理的Markdown输出返回给用户。不要添加任何包装文本、解释或评论——只返回原始Markdown结果。
Multiple images
多张图像
Return each agent's markdown output separated by a horizontal rule () and prefixed with the filename in bold for clarity. Example:
---screenshot-1.png
(markdown output)
screenshot-2.png
(markdown output)
将每个代理的Markdown输出用水平线()分隔,并在开头添加粗体文件名以提高清晰度。示例:
---screenshot-1.png
(markdown输出)
screenshot-2.png
(markdown输出)