visual-prompt-engine

TotalClaw 作者 totalclaw

由 Dribbble 和设计平台的真实视觉参考提供支持,生成多样化、非重复的图像提示。使用场景:用户想要图像提示、需要创造性的视觉灵感、要求设计提示、想要避免重复的 AI 图像生成,或者说“生成图像提示”、“给我一个创造性的图像想法”、“让我成为一个独特的视觉提示”。不要在以下情况下使用:用户想要生成图像本身(使用图像生成工具)、想要编辑现有图像或需要纯文本内容。边缘案例:“为我制作图像”→使用图像生成工具,然后可以选择使用此技能作为提示。 ‘改进这个图像提示’→这个技能。 “我不断获得类似的 AI 图像”→ 这项技能(解决重复问题)。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~abdullah4ai-visual-prompt-engine
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~abdullah4ai-visual-prompt-engine/file -o abdullah4ai-visual-prompt-engine.md
# Visual Prompt Engine

Generate high-quality, diverse image prompts by feeding real visual references into a structured prompt pipeline.

## Problem

AI agents reuse the same visual patterns and clichés when writing image prompts. This skill breaks that cycle by grounding prompts in real, trending design work.

## Architecture

```
Dribbble Scraper → Style Cards → Prompt Generator → Quality Reviewer → Final Prompt
```

## Quick Start

### 1. Collect Visual References

**Recommended: Browser-based collection** (Dribbble blocks automated requests)

Browse `https://dribbble.com/shots/popular` with a browser tool (Camofox, Playwright, etc.), collect shot URLs, titles, and image URLs, then save as JSON:

```bash
python3 scripts/scrape_dribbble.py --method import --import-file manual_shots.json --output data/references.json
```

**Alternative: RSS/HTML** (may be blocked by WAF)

```bash
python3 scripts/scrape_dribbble.py --output data/references.json --count 20
```

The import JSON format: `[{"title": "...", "url": "https://dribbble.com/shots/...", "image_url": "..."}]`

### 2. Build Style Cards

Convert raw references into style cards:

```bash
python3 scripts/style_card.py build --input data/references.json --output data/style_cards.json
```

### 3. Generate Prompts

When the user requests an image prompt:

1. Read `data/style_cards.json` for available visual references
2. Select 1-3 cards relevant to the user's goal
3. Read `references/prompt-patterns.md` for diverse prompt structures
4. Read `references/visual-vocabulary.md` for precise design terminology
5. Compose a prompt combining: user goal + style card elements + varied pattern
6. Check against recent prompts in `data/prompt_history.json` to prevent repetition
7. Append the new prompt to history

### 4. Review and Deliver

Before delivering, verify the prompt:
- Uses specific visual language (not generic adjectives)
- References concrete design elements from the style card
- Follows a pattern different from the last 5 prompts
- Includes composition, lighting, color palette, and mood

## Style Card Schema

See `references/style-card-schema.md` for the full schema. A style card contains:

| Field | Description |
|-------|-------------|
| `palette` | Hex colors extracted from the design |
| `composition` | Layout structure (grid, asymmetric, centered, etc.) |
| `typography` | Font style and weight characteristics |
| `mood` | Emotional tone (bold, minimal, playful, etc.) |
| `textures` | Surface qualities (glass, grain, matte, etc.) |
| `lighting` | Light direction and quality |
| `source_url` | Original Dribbble shot URL |
| `tags` | Design categories |

## Prompt Patterns

See `references/prompt-patterns.md` for 12+ distinct prompt structures that prevent repetition. Rotate through patterns to keep outputs fresh.

## Visual Vocabulary

See `references/visual-vocabulary.md` for precise design terminology covering color, composition, lighting, texture, and typography. Use these terms instead of generic words like "beautiful" or "nice".

## Automation (Optional)

Set up a daily cron to refresh visual references:

```bash
# Run daily to keep references current
python3 scripts/scrape_dribbble.py --output data/references.json --count 20
python3 scripts/style_card.py build --input data/references.json --output data/style_cards.json
```

## Data Directory

The skill stores working data in `data/`:

```
data/
├── references.json      # Raw Dribbble scrape results
├── style_cards.json     # Processed style cards
└── prompt_history.json  # Generated prompts (for deduplication)
```

Create the `data/` directory on first run if it does not exist.

## Dependencies

Python 3.9+ with standard library only. Optional: `requests`, `beautifulsoup4` for live scraping (falls back to Dribbble RSS if not installed).

Install optional dependencies:

```bash
pip install requests beautifulsoup4
```

---

## 中文说明

# Visual Prompt Engine

通过将真实的视觉参考输入到结构化的提示流水线中,生成高质量、多样化的图像提示。

## 问题

AI 代理在撰写图像提示时会反复使用相同的视觉模式和陈词滥调。本技能通过将提示建立在真实的、流行的设计作品之上,打破这种循环。

## 架构

```
Dribbble Scraper → Style Cards → Prompt Generator → Quality Reviewer → Final Prompt
```

## 快速开始

### 1. 收集视觉参考

**推荐:基于浏览器的收集**(Dribbble 会拦截自动化请求)

使用浏览器工具(Camofox、Playwright 等)浏览 `https://dribbble.com/shots/popular`,收集作品 URL、标题和图像 URL,然后保存为 JSON:

```bash
python3 scripts/scrape_dribbble.py --method import --import-file manual_shots.json --output data/references.json
```

**替代方案:RSS/HTML**(可能被 WAF 拦截)

```bash
python3 scripts/scrape_dribbble.py --output data/references.json --count 20
```

导入 JSON 格式:`[{"title": "...", "url": "https://dribbble.com/shots/...", "image_url": "..."}]`

### 2. 构建风格卡

将原始参考转换为风格卡:

```bash
python3 scripts/style_card.py build --input data/references.json --output data/style_cards.json
```

### 3. 生成提示

当用户请求图像提示时:

1. 读取 `data/style_cards.json` 以获取可用的视觉参考
2. 选择 1-3 张与用户目标相关的卡片
3. 读取 `references/prompt-patterns.md` 以获取多样化的提示结构
4. 读取 `references/visual-vocabulary.md` 以获取精确的设计术语
5. 组合一个提示,结合:用户目标 + 风格卡元素 + 多变的模式
6. 对照 `data/prompt_history.json` 中最近的提示进行检查,以防止重复
7. 将新提示追加到历史记录中

### 4. 审查并交付

交付前,验证提示:
- 使用具体的视觉语言(而非通用的形容词)
- 引用风格卡中具体的设计元素
- 遵循与最近 5 个提示不同的模式
- 包含构图、光照、配色和氛围

## 风格卡 Schema

完整 schema 见 `references/style-card-schema.md`。一张风格卡包含:

| 字段 | 描述 |
|-------|-------------|
| `palette` | 从设计中提取的十六进制颜色 |
| `composition` | 布局结构(网格、非对称、居中等) |
| `typography` | 字体风格与字重特征 |
| `mood` | 情感基调(大胆、极简、活泼等) |
| `textures` | 表面质感(玻璃、颗粒、哑光等) |
| `lighting` | 光线方向与质感 |
| `source_url` | 原始 Dribbble 作品 URL |
| `tags` | 设计类别 |

## 提示模式

`references/prompt-patterns.md` 提供了 12 种以上不同的、可防止重复的提示结构。轮换使用各种模式,让输出保持新鲜。

## 视觉词汇

`references/visual-vocabulary.md` 提供了涵盖颜色、构图、光照、质感和排版的精确设计术语。使用这些术语,而非 "beautiful" 或 "nice" 等通用词。

## 自动化(可选)

设置一个每日定时任务来刷新视觉参考:

```bash
# Run daily to keep references current
python3 scripts/scrape_dribbble.py --output data/references.json --count 20
python3 scripts/style_card.py build --input data/references.json --output data/style_cards.json
```

## 数据目录

本技能将工作数据存储在 `data/` 中:

```
data/
├── references.json      # Raw Dribbble scrape results
├── style_cards.json     # Processed style cards
└── prompt_history.json  # Generated prompts (for deduplication)
```

如果 `data/` 目录不存在,请在首次运行时创建它。

## 依赖

Python 3.9+,仅使用标准库。可选:`requests`、`beautifulsoup4` 用于实时抓取(如未安装则回退到 Dribbble RSS)。

安装可选依赖:

```bash
pip install requests beautifulsoup4
```