prompt-extractor
Reverse-engineers and extracts modular components from image generation prompts.
Install
mkdir -p .claude/skills/prompt-extractor && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4293" && unzip -o skill.zip -d .claude/skills/prompt-extractor && rm skill.zipInstalls to .claude/skills/prompt-extractor
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
自动化提取AI绘画提示词的模块化结构,从海量提示词中提炼可复用的模块组件Key capabilities
- →Processes text, TXT, CSV, or JSON prompt files
- →Cleans and deduplicates prompt data
- →Extracts structured modules and variables
- →Generates reusable prompt templates
- →Provides quality scoring and analysis reports
How it works
It parses input prompts to identify and categorize components like subjects, styles, and technical parameters into reusable JSON structures.
Inputs & outputs
When to use prompt-extractor
- →Analyzing a set of image prompts
- →Creating a library of prompt components
- →Standardizing design styles
About this skill
Prompt Extractor - AI绘画提示词模块化提取工具
快速开始
1. 激活Skill
在Claude Code中调用:
/skill prompt-extractor
或者直接说:
使用 prompt-extractor 分析我的提示词
2. 输入方式(二选一)
方式A:文件路径(适合大批量)
支持三种格式:
TXT格式 (每行一个提示词)
a portrait of a woman, cinematic lighting, 85mm lens, ultra detailed
cyberpunk city at night, neon lights, rain, photorealistic
CSV格式
id,prompt,score
1,"a portrait of a woman, cinematic lighting",8.5
2,"cyberpunk city at night, neon lights",9.2
JSON格式
[
{"prompt": "a portrait of a woman, cinematic lighting, 85mm lens"},
{"prompt": "cyberpunk city at night, neon lights, rain"}
]
方式B:直接粘贴(适合快速分析,推荐!✨)
我:帮我分析这些提示词:
a portrait of a woman, cinematic lighting, 85mm lens, ultra detailed
cyberpunk city at night, neon lights, rain, photorealistic
beautiful landscape, golden hour, dramatic clouds, HDR
无需创建文件,直接粘贴即可!
详见:粘贴模式完整指南
3. 自动处理
Skill会自动:
- 识别文件格式
- 清洗和去重
- 聚类分析(如果>100条)
- 逐条提取模块
- 生成模块库和分析报告
输出文件说明
extracted_modules.json
完整的提取结果,每条提示词对应一个JSON对象:
{
"original_prompt": "a portrait of a young woman, cinematic lighting, 85mm lens f/1.4, ultra detailed, photorealistic",
"theme": "人像摄影",
"modules": {
"subject_variables": {
"main": "young woman",
"modifiers": ["portrait"],
"is_replaceable": true
},
"visual_style": {
"art_style": "photorealistic",
"reference_artists": [],
"color_palette": "natural tones"
},
"technical_parameters": {
"camera": "85mm lens f/1.4",
"lighting": "cinematic lighting",
"render_engine": null,
"resolution": "ultra detailed"
},
"detail_enhancers": ["ultra detailed", "photorealistic"],
"mood_atmosphere": "professional, elegant",
"constraints": {
"negative_prompt": "",
"exclusions": []
}
},
"quality_score": {
"clarity": 9,
"detail_richness": 8,
"reusability": 9,
"comments": "结构清晰,技术参数具体,高度可复用"
},
"extracted_patterns": {
"structure_type": "分层描述:主体 + 技术 + 质量",
"advantages": ["参数明确", "易于替换主体", "专业摄影标准"],
"reusable_templates": "{主体}, {光线}, {镜头参数}, {质量增强}"
}
}
module_library.json
去重后的通用模块库:
{
"visual_styles": {
"art_styles": ["photorealistic", "cinematic", "cyberpunk", "anime", "oil painting"],
"frequency": {"photorealistic": 45, "cinematic": 38}
},
"technical_params": {
"camera_angles": ["85mm lens", "wide angle", "macro", "aerial view"],
"lighting": ["cinematic lighting", "soft light", "backlight", "golden hour"],
"render_engines": ["Unreal Engine", "Octane Render", "V-Ray"]
},
"detail_enhancers": [
"ultra detailed", "8k", "hyperrealistic", "intricate details",
"sharp focus", "professional photography"
],
"templates": [
{
"name": "人像摄影模板",
"structure": "{主体}, {光线}, {镜头}, {质量增强}",
"example": "a portrait of {subject}, cinematic lighting, 85mm lens, ultra detailed",
"usage_count": 23,
"avg_quality_score": 8.7
},
{
"name": "场景构图模板",
"structure": "{场景}, {氛围}, {视角}, {风格}, {质量}",
"example": "{location} at {time}, {mood}, {camera_angle}, {art_style}, {detail_enhancers}",
"usage_count": 18,
"avg_quality_score": 8.2
}
],
"high_value_modules": [
{
"module": "cinematic lighting, 85mm lens f/1.4",
"reusability_score": 9.5,
"category": "technical_parameters",
"usage_scenarios": ["人像", "产品", "静物"]
}
]
}
analysis_report.md
可读的分析报告:
# 提示词分析报告
## 数据概览
- 总数:500条
- 清洗后:487条
- 去重:13条
- 主题分布:
- 人像摄影:145条 (29.8%)
- 风景场景:132条 (27.1%)
- 概念艺术:98条 (20.1%)
- 其他:112条 (23.0%)
## 高频模块
### 视觉风格 Top 5
1. photorealistic (92次)
2. cinematic (76次)
3. cyberpunk (54次)
4. anime style (43次)
5. oil painting (38次)
### 技术参数 Top 5
1. cinematic lighting (88次)
2. 85mm lens (67次)
3. ultra detailed (156次)
4. 8k (89次)
5. Unreal Engine (45次)
## 推荐组合
### 组合1:专业人像
**模板:** {人物}, cinematic lighting, 85mm lens f/1.4, ultra detailed, photorealistic
**优势:** 技术参数明确,成片率高
**适用场景:** 人像、半身像、特写
### 组合2:赛博朋克城市
**模板:** cyberpunk {场景}, neon lights, rain, night, cinematic, 8k
**优势:** 氛围强烈,视觉冲击力强
**适用场景:** 科幻、城市、未来主义
## 改进建议
1. **增加负面提示**:只有23%的提示词包含负面提示,建议补充
2. **细化技术参数**:67%的提示缺乏具体镜头参数
3. **明确艺术风格**:建议每个提示都指定清晰的风格标签
使用场景示例
场景1:新手学习优秀提示词结构
用户:我有一个收藏的500条AI绘画提示词,想学习它们的结构
操作:使用 prompt-extractor 分析 favorites.txt
输出:
- 发现85%使用"主体+技术+质量"结构
- 提取10个高复用模板
- 生成学习手册
场景2:构建自己的模块库
用户:我想从1万条提示词中提炼出我的专属模块库
操作:分批处理,每次2000条
输出:
- 去重后的5000+独特模块
- 按主题分类的模板库
- 可直接复用的JSON文件
场景3:提升提示词质量
用户:我的提示词效果不好,想找到高质量模式
操作:上传失败案例和成功案例两个文件对比
输出:
- 识别成功案例的共同模式
- 指出失败案例的缺陷(如缺乏技术参数)
- 提供改进建议
高级功能
1. 增量更新模块库
# 合并新提示词到现有库
python preprocessor.py new_prompts.txt updated_library.json
2. 主题过滤
在skill中指定:
只提取"人像摄影"主题的模块
3. 自定义评分标准
修改 skill.md 中的评分权重:
"quality_score": {
"clarity": {"weight": 0.3, "score": 8},
"detail_richness": {"weight": 0.3, "score": 9},
"reusability": {"weight": 0.4, "score": 7}
}
最佳实践
数据准备
- 先清理明显无效的提示(如乱码、测试文本)
- 如果有评分,保留高分提示优先处理
- 按主题分文件更易管理
批次处理策略
- <100条:一次性处理,精细提取
- 100-500条:推荐规模,单次skill调用
- >500条:分批处理,每批300-500条
质量保障
- 首次处理前,手动标注20-50条作为基准
- 对比AI提取结果,调整meta-prompt
- 迭代3-5次达到满意精度
故障排除
问题1:文件格式识别失败
原因:编码问题或格式不标准 解决:
# 转换编码为UTF-8
iconv -f GBK -t UTF-8 input.txt > output.txt
问题2:提取质量差
原因:提示词本身质量低或结构混乱 解决:
- 先聚类,只处理主题清晰的簇
- 提高 min_length 阈值过滤短提示
- 人工review前100条,调整提取规则
问题3:处理速度慢
原因:单次处理量过大 解决:
- 减少批次大小(推荐50-100条/批)
- 先聚类后并行处理各簇
- 使用预处理脚本先过滤
技术支持
如需帮助,在Claude Code中问:
prompt-extractor 如何处理CSV中的多列数据?
prompt-extractor 如何自定义模块分类?
更新日志
v1.0 (当前版本)
- 支持 txt/csv/json 三种格式
- 自动聚类和主题识别
- 模块化提取和质量评分
- 生成可复用模板库
路线图
- 支持多语言提示词(中文、日文)
- 可视化分析dashboard
- 与Midjourney/SD参数库对接
- 在线模块搜索引擎
When not to use it
- →When prompts are too short to contain meaningful patterns
- →When data format is not supported
Limitations
- →Requires clear prompt structure for best results
- →Large datasets may require batch processing
How it compares
It automates the extraction of modular components from unstructured prompts to build a reusable library.
Compared to similar skills
prompt-extractor side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| prompt-extractor (this skill) | 1 | 7mo | Review | Intermediate |
| gemini-logo-remover | 9 | 8mo | Review | Beginner |
| ai-multimodal | 9 | 6mo | Review | Intermediate |
| jimeng-mcp-skill | 19 | 4mo | Caution | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by huangserva
View all by huangserva →You might also like
gemini-logo-remover
bear2u
Remove Gemini logos, watermarks, or AI-generated image markers using OpenCV inpainting. Use this skill when the user asks to remove Gemini logo, AI watermark, or any logo/watermark from images.
ai-multimodal
mrgoonie
Process and generate multimedia content using Google Gemini API. Capabilities include analyze audio files (transcription with timestamps, summarization, speech understanding, music/sound analysis up to 9.5 hours), understand images (captioning, object detection, OCR, visual Q&A, segmentation), process videos (scene detection, Q&A, temporal analysis, YouTube URLs, up to 6 hours), extract from documents (PDF tables, forms, charts, diagrams, multi-page), generate images (text-to-image, editing, composition, refinement). Use when working with audio/video files, analyzing images or screenshots, processing PDF documents, extracting structured data from media, creating images from text prompts, or implementing multimodal AI features. Supports multiple models (Gemini 2.5/2.0) with context windows up to 2M tokens.
jimeng-mcp-skill
wwwzhouhui
使用jimeng-mcp-server进行AI图像和视频生成。当用户请求从文本生成图像、合成多张图片、从文本描述创建视频或为静态图像添加动画时使用此技能。支持四大核心能力:文生图、图像合成、文生视频、图生视频。需要jimeng-mcp-server在本地运行或通过SSE/HTTP访问。
ai-image
tyrchen
Generate AI images using OpenAI's gpt-image-1 model with customizable aspect ratios and artistic themes. Use when the user wants to create images, generate artwork, or mentions image generation with specific styles like Ghibli, futuristic, Pixar, oil painting, or Chinese painting.
ux-researcher-designer
davila7
UX research and design toolkit for Senior UX Designer/Researcher including data-driven persona generation, journey mapping, usability testing frameworks, and research synthesis. Use for user research, persona creation, journey mapping, and design validation.
kpi-dashboard-design
wshobson
Design effective KPI dashboards with metrics selection, visualization best practices, and real-time monitoring patterns. Use when building business dashboards, selecting metrics, or designing data visualization layouts.