Install
openclaw skills install @z-zihan/screenshot-to-prompt截图理解 + 页面结构抽取 + 实现 prompt 生成器。 输入页面截图,输出结构化识别结果和可直接发给 coding agent 的实现 prompt。 触发:用户发截图说"帮我分析这个页面"、"生成实现 prompt"、"页面结构抽取"、 "把这个页面转成 prompt"、"screenshot to prompt"、"截图转实现"。 NOT for: 直接写代码(除非用户明确要求)、业务分析、产品方案撰写、设计稿评审。
openclaw skills install @z-zihan/screenshot-to-prompt检测用户使用的语言,全程使用同一语言输出。 中文用户 → 读下方中文部分,全中文输出;English users → read the English section below, output in English only. 技术术语(UI、prompt、coding agent 等)保留原文即可。
根据用户提供的页面截图,识别页面结构、组件层级、文案字段、状态与交互,并生成一份可以直接发送给 coding agent 的实现 prompt。
核心链路:
截图理解 → 页面结构抽取 → 状态识别 → 实现 prompt 生成
这是一个:
不是:
用户给一张图后,稳定输出:
重点帮助 coding agent 理解:
而不是扩展业务背景。
用户可能提供:
例如:
以下情况需要主动澄清或降级处理,而非盲目执行。
收到截图后,自动完成以下步骤。
识别页面的信息架构与区块关系:
识别常见模块:
识别页面中的 UI 组件:
需要识别:
提取截图中的:
不要凭空补全文案。
识别:
允许轻度合理推断,详见下方「合理推断边界」表。推断深度锚点:仅限截图可见元素的直接派生状态,不超过 1 层嵌套(如看到弹窗→推断弹窗关闭状态,但不推断关闭后的级联行为)。
如果用户提供多张截图:
需要:
统一整理:
重点关注:
识别:
帮助 coding agent 即使没有设计稿,也能合理组织页面结构和视觉层级。
识别适合组件化的区域:
帮助 coding agent 做合理组件拆分。
将截图翻译成实现导向描述:
✅ 好的描述:
❌ 不好的描述:
重点:帮助 coding agent 理解"页面应该怎么实现"。
根据用户要求选择策略。用户未明确指定时,默认使用策略 A(骨架模式)。
选择依据:
适用于:
要求:
适用于:
要求:
适用于:
要求:
| 允许 | 不允许 |
|---|---|
| 推断基础状态切换 | 编造复杂业务规则 |
| 推断表单基础校验 | 擅自新增完整模块 |
| 推断列表选择行为 | 定义不存在的接口逻辑 |
| 推断区块主次关系 | 脱离截图扩展页面 |
| 推断基础联动关系 | 擅自定义系统类型 |
默认输出两部分。
使用结构化、工程化方式输出。建议使用表格。
| 项 | 内容 |
|---|---|
| 页面类型 | |
| 布局方式 | |
| 页面层级 | |
| 固定区域 | |
| 滚动区域 |
| 区块 | 组件 | 文案/字段 | 当前状态 | 可推断交互 |
|---|---|---|---|---|
用 2~5 句话总结这个页面主要需要实现什么。
prompt 必须:
你需要根据截图实现一个页面/页面局部区域。
### 实现目标
请根据截图完成页面结构搭建,重点实现:
- 页面布局
- 区块层级
- 组件结构
- 基础状态
- 基础交互
不要扩展截图中未体现的复杂业务逻辑。
---
### 实现范围
- 仅实现截图中出现的内容
- 不扩展未出现的模块
- 如果已有 layout/header/sidebar,请直接复用
- 不重复实现公共结构
- 重点实现当前截图区域
---
### 页面结构
页面包含以下区域:
1.
2.
3.
---
### 组件构成
请使用以下组件完成页面:
-
-
-
---
### 状态与交互
页面需要支持:
-
-
-
包括:
- 默认态
- selected 态
- disabled 态
- loading 态
- empty 态(如有)
---
### 布局要求
注意:
- 固定区域
- 滚动区域
- 自适应关系
- 区块层级
- 页面间距与留白
---
### 组件拆分建议
建议拆分:
-
-
-
保证结构清晰,方便后续迭代。
---
### UI 策略
<!-- 根据实际情况选择以下一种,删除其余两种 -->
#### 骨架模式
- 先搭页面骨架
- 不做高保真 UI
- 样式保持简洁
- 后续再继续精修
#### 自由发挥 UI
- 在截图结构基础上优化视觉
- 优先复用项目 UI 组件库
- 保持现代、统一、简洁
- 保证正式页面质量
#### 设计稿还原
- 尽量还原设计稿
- 保持布局与间距一致
- 优先复用设计系统
- 保证视觉统一
---
### 输出要求
- 使用项目现有技术栈
- 优先复用已有 UI 组件
- 没有接口可使用 mock 数据
- 不实现复杂业务逻辑
- 组件拆分合理
- 保持代码可维护
Given a user-provided page screenshot, recognize the page structure, component hierarchy, text content, states, and interactions, then generate a ready-to-use implementation prompt that can be sent directly to a coding agent.
Core pipeline:
Screenshot Understanding → Page Structure Extraction → State Recognition → Implementation Prompt Generation
This is a:
NOT:
After the user provides a screenshot, stably output:
Focus on helping the coding agent understand:
Rather than expanding on business context.
The user may provide:
Examples:
The following cases require proactive clarification or graceful degradation instead of blind execution.
After receiving a screenshot, automatically complete the following steps.
Recognize the information architecture and block relationships:
Recognize common modules:
Recognize UI components in the screenshot:
Identify:
Extract from the screenshot:
Do NOT fabricate text that isn't visible in the screenshot.
Recognize:
Allowed lightweight reasonable inference, see the "Reasonable Inference Boundaries" table below.
If the user provides multiple screenshots:
Required:
Consolidate:
Focus on:
Recognize:
Help the coding agent organize page structure and visual hierarchy reasonably, even without a design mockup.
Identify areas suitable for componentization:
Help the coding agent make reasonable component splits.
Translate the screenshot into implementation-oriented descriptions:
✅ Good descriptions:
❌ Bad descriptions:
Focus: Help the coding agent understand "how should this page be implemented".
Select strategy based on user requirements. When user doesn't specify, default to Strategy A (Skeleton Mode).
Selection criteria:
For:
Requirements:
For:
Requirements:
For:
Requirements:
| Allowed | NOT Allowed |
|---|---|
| Infer basic state transitions | Fabricate complex business rules |
| Infer basic form validation | Add complete new modules without basis |
| Infer list selection behavior | Define non-existent API logic |
| Infer block priority relationships | Expand page beyond the screenshot |
| Infer basic linkage relationships | Define system types without basis |
Output two parts by default.
Use a structured, engineering-oriented format. Tables are recommended.
| Item | Content |
|---|---|
| Page type | |
| Layout method | |
| Page hierarchy | |
| Fixed areas | |
| Scrollable areas |
| Block | Components | Text/Fields | Current State | Inferred Interactions |
|---|---|---|---|---|
Summarize in 2-5 sentences what this page needs to implement.
The prompt must:
You need to implement a page (or page section) based on the provided screenshot.
### Implementation Goal
Build the page structure based on the screenshot. Focus on:
- Page layout
- Block hierarchy
- Component structure
- Basic states
- Basic interactions
Do NOT expand into complex business logic not shown in the screenshot.
---
### Implementation Scope
- Only implement content visible in the screenshot
- Do NOT expand to modules not shown
- If layout/header/sidebar already exists, reuse them directly
- Do NOT re-implement common structures
- Focus on the current screenshot area
---
### Page Structure
The page contains the following areas:
1.
2.
3.
---
### Component Composition
Use the following components to build the page:
-
-
-
---
### States & Interactions
The page needs to support:
-
-
-
Including:
- Default state
- Selected state
- Disabled state
- Loading state
- Empty state (if applicable)
---
### Layout Requirements
Note:
- Fixed areas
- Scrollable areas
- Adaptive relationships
- Block hierarchy
- Page spacing and whitespace
---
### Component Split Suggestions
Suggested splits:
-
-
-
Ensure clear structure for future iteration.
---
### UI Strategy
<!-- Select one based on the actual situation, delete the other two -->
#### Skeleton Mode
- Build page skeleton first
- No high-fidelity UI
- Keep styles simple
- Refine later
#### Free UI Design
- Optimize visuals based on screenshot structure
- Prefer project UI component library
- Modern, unified, clean
- Production-ready quality
#### Design Restoration
- Match design as closely as possible
- Keep layout and spacing consistent
- Prefer design system
- Visual consistency
---
### Output Requirements
- Use the project's existing tech stack
- Prefer reusing existing UI components
- Use mock data if no API is available
- Do NOT implement complex business logic
- Reasonable component splits
- Maintainable code