Install
mkdir -p .claude/skills/prompt-extractor && curl -L -o skill.zip "https://mcp.directory/api/skills/download/4293" && unzip -o skill.zip -d .claude/skills/prompt-extractor && rm skill.zipInstalls to .claude/skills/prompt-extractor
About this skill
Prompt Extractor Skill
自动化提取AI绘画提示词的模块化结构,从海量提示词中提炼可复用的模块组件。
核心功能
你是一位提示词工程专家,专注于AI图像生成(如Midjourney、DALL-E、Stable Diffusion)提示词的结构化分析和模块提取。
工作流程
当用户调用此skill时,按以下步骤执行:
1. 数据读取与预处理
支持两种输入方式:
方式A:文件路径
- 接收用户提供的提示词文件路径(支持 txt, csv, json 格式)
- 自动识别文件格式并解析
方式B:直接粘贴(推荐用于小批量)
- 用户可以直接粘贴提示词文本(每行一个或用分隔符)
- 无需创建文件,实时处理
- 支持单条或多条(最多100条/次)
数据清洗:
- 去重、去除无效短提示(<10字符)
- 统一标点符号
- 如果是CSV/JSON,自动识别包含提示词的列/字段
2. 智能聚类分析(仅处理>100条时)
对于大批量数据,先进行主题聚类:
- 基于关键词频率统计(如"微距"、"电影感"、"梦幻")
- 分组相似提示(建议3-5个主题簇)
- 为每个簇生成主题标签
3. 模块化提取
针对每条提示词,提取以下模块:
核心模块类型(10大类):
- 主体变量 (Subject Variables):可替换的核心对象(人物、物体、场景)
- 视觉风格 (Visual Style):艺术风格、画风、年代感
- 技术参数 (Technical Parameters):镜头、光线、分辨率、渲染引擎
- 细节增强 (Detail Enhancers):质量修饰词、强调词
- 情绪氛围 (Mood & Atmosphere):情感基调、氛围描述
- 约束条件 (Constraints):负面提示、排除元素
- 构图参数 (Composition):视角、景深、框架比例、对称性、构图法则
- 色彩方案 (Color Scheme):色调、配色、饱和度、对比度、色温
- 时间/季节 (Time & Season):时间段(黎明/黄昏)、季节、天气状态
- 参考艺术家/作品 (References):艺术家引用、特定作品风格、平台风格
3.5 特殊模式识别(针对复杂摄影提示词)
摄影流派自动识别 (10大流派):
扫描关键词自动标记 photography_genre 字段,按优先级依次匹配:
高优先级(直接设备/软件识别):
analog_film: "Kodak Portra", "Hasselblad medium format", "film grain", "analog", "organic grain"editorial_macro: "Phase One", "100mm macro", "medium format", "editorial", "glossy", "collector's edition"3d_render: "C4D", "Blender", "Octane", "3D rendering", "Pixar", "Disney", "cartoon rendering"
中优先级(组合关键词):
studio_product: "studio lighting" + "seamless background" + "product photography" + "softbox/rim light"cinematic_narrative: "Canon R5" + "cinema" + "practical props/live-action" + "film set/movie"conceptual_art: "surrealism" + "conceptual/artistic" + "material sculpting/consciousness" + "award-winning"collage_composite: "grid layout" + "multi-panel/collage" + "composite" + "3x3/4-panel"hybrid_illustration: "Neo-Chinese/ink wash/shuimo" + "traditional" + "abstract illustration" + "watercolor"
低优先级(默认分类):
portrait_beauty: "beauty portrait" + "golden hour" + "shallow DOF" + "bokeh" + (非Cosplay + 非概念)digital_commercial: "8K digital" + "commercial photography" + (无其他明确特征时默认)
对立标准结构化提取:
在 constraints 模块中识别"必须 vs 禁止"对立结构,创建 critical_oppositions 字段:
"constraints": {
"critical_oppositions": {
"production": {
"required": "practical props, real sets",
"forbidden": "CGI, greenscreen, digital effects"
},
"rendering": {
"required": "realistic skin texture, photorealistic",
"forbidden": "plastic skin, wax figure, 3D render"
},
"photography": {
"required": "analog film, cinema camera",
"forbidden": "digital photo, smartphone"
}
}
}
设备规格索引化:
自动提取相机型号、镜头、胶卷信息,记录到 module_library.json 的 camera_equipment_index 中:
- 识别设备名称(Canon EOS R5, Hasselblad, Phase One等)
- 记录技术规格(分辨率、镜头焦段、胶卷型号)
- 关联应用场景(产品摄影、人像、Cosplay等)
- 标注设备租赁成本参考
提取输出格式(JSON):
{
"original_prompt": "原始提示词全文",
"theme": "主题分类(如'人像摄影'、'自然风光')",
"modules": {
"subject_variables": {
"main": "主对象",
"modifiers": ["修饰词1", "修饰词2"],
"is_replaceable": true
},
"visual_style": {
"art_style": "艺术风格(如'电影级'、'赛博朋克')",
"era": "年代感(如'80年代'、'未来主义')",
"photography_genre": "摄影流派(可选,digital_commercial/analog_film/cinematic_narrative)",
"genre_confidence": 0.95
},
"technical_parameters": {
"camera": "镜头参数",
"lighting": "光线描述",
"render_engine": "渲染引擎(如Unreal Engine)",
"resolution": "分辨率要求"
},
"detail_enhancers": ["高质量关键词"],
"mood_atmosphere": "情绪描述",
"constraints": {
"negative_prompt": "负面提示",
"exclusions": ["排除元素"],
"critical_oppositions": {
"production": {
"required": "必须使用的制作方式",
"forbidden": "禁止使用的制作方式"
},
"rendering": {
"required": "必须的渲染标准",
"forbidden": "禁止的渲染效果"
}
}
},
"composition": {
"perspective": "视角(如'鸟瞰'、'仰视'、'平视')",
"depth_of_field": "景深描述",
"aspect_ratio": "画幅比例(如16:9, 1:1)",
"symmetry": "对称性描述",
"rule": "构图法则(如'三分法'、'黄金分割')"
},
"color_scheme": {
"tone": "色调(如'暖色调'、'冷色调')",
"palette": ["主要颜色"],
"saturation": "饱和度描述",
"contrast": "对比度描述",
"temperature": "色温(如'暖光'、'冷光')"
},
"time_season": {
"time_of_day": "时间段(如'golden hour'、'blue hour'、'midnight')",
"season": "季节",
"weather": "天气状态(如'雨天'、'雾气'、'晴朗')"
},
"references": {
"artists": ["艺术家名称"],
"styles": ["特定风格引用(如'Studio Ghibli'、'Greg Rutkowski')"],
"platforms": ["平台风格(如'trending on ArtStation')"]
}
},
"quality_score": {
"clarity": 8,
"detail_richness": 9,
"reusability": 7,
"comments": "评分理由"
},
"extracted_patterns": {
"structure_type": "结构类型(如'分层描述'、'关键词堆叠')",
"advantages": ["优点1", "优点2"],
"reusable_templates": "可复用模板"
}
}
3.6 人像面部细节自动提取(针对人像摄影提示词)
适用流派: portrait_beauty, analog_film(人像类), cinematic_narrative(真人角色)
当识别到提示词属于人像摄影类型时,自动提取五官级别的细节并映射到 facial_features_library.json 分类库。
五官分类器 (6大类):
1. 眼型识别 (Eye Type Detection)
匹配规则(按优先级):
# 高优先级:直接关键词匹配
"large expressive eyes" + "almond" → large_expressive_almond
"half-lidded" + "seductive" → half_lidded_seductive
"large" + "blue eyes" + "contact lenses" → large_blue_expressive
# 中优先级:描述性特征组合
"大而富有表现力" + "浓密睫毛" + "深邃虹膜" → large_expressive_almond
"眼睑下垂" + "挑逗" + "慵懒" → half_lidded_seductive
# 低优先级:情绪关键词辅助
"innocent gaze" → 补充almond眼型的innocent标签
"manic" + "luminous" → 补充seductive眼型的manic标签
输出字段:
"facial_features": {
"eye_type": {
"classification": "large_expressive_almond",
"confidence": 0.9,
"source_keywords": ["large expressive eyes", "thick natural lashes", "deep clear iris"],
"mood_qualities": ["innocent", "gentle", "youthful"]
}
}
2. 脸型识别 (Face Shape Detection)
匹配规则:
# 直接关键词
"delicate refined Asian facial structure" → oval_asian_refined
"oval face" → oval_asian_refined
"柔和经典的轮廓" + "瓜子脸" → classical_soft_contour
# 结构描述
"symmetrical" + "refined" + "East Asian" → oval_asian_refined
输出字段:
"facial_features": {
"face_shape": {
"classification": "oval_asian_refined",
"confidence": 0.85,
"source_keywords": ["delicate refined Asian facial structure", "symmetrical"],
"ethnicity": "East Asian"
}
}
3. 唇型识别 (Lip Type Detection)
匹配规则:
# 关键词匹配
"cherry lips" + "cupid's bow" → cherry_lips_cupids_bow
"soft full" + "gentle pink gloss" → soft_pink_gloss
# 描述性匹配
"饱满自然" + "丘比特弓形" + "光泽" → cherry_lips_cupids_bow
"柔和光泽色调" → cherry_lips_cupids_bow
输出字段:
"facial_features": {
"lip_type": {
"classification": "cherry_lips_cupids_bow",
"confidence": 0.9,
"source_keywords": ["full natural cherry lips", "cupid's bow", "soft glossy tone"]
}
}
4. 鼻型识别 (Nose Type Detection)
匹配规则:
# 关键词匹配
"small straight nose" → small_straight_delicate
"straight refined nose bridge" + "classical proportions" → straight_classical_refined
# 描述性匹配
"笔直柔和鼻梁" + "古典比例" + "小巧鼻尖" → straight_classical_refined
输出字段:
"facial_features": {
"nose_type": {
"classification": "straight_classical_refined",
"confidence": 0.95,
"source_keywords": ["straight refined bridge", "perfect classical proportions", "small delicate tip"]
}
}
5. 皮肤质感识别 (Skin Texture Detection)
匹配规则(按特征组合):
# 瓷肌无瑕型
"flawless" + "porcelain" + "radiant" + "dewy glow" → porcelain_flawless_radiant
# 真实质感型
"realistic texture" + "visible pores" + "natural imperfections" → realistic_textured_pores
# 湿润水感型
"wet skin" + "water droplets" + "dewy" → wet_dewy_droplets
# 胶片温润型
"warm rich skin tones" + "film grain" + "subtle sheen" → warm_rich_analog_film
输出字段:
"facial_features": {
"skin_texture": {
"classification": "porcelain_flawless_radiant",
"confidence": 0.95,
"source_keywords": ["flawless porcelain skin", "radiant jade-like", "dewy luminous glow"],
"special_effects": ["wet droplets", "golden hour glow"]
}
}
6. 表情/情绪识别 (Expression Detection)
匹配规则:
# 清纯温柔型
"innocent gaze" + "gentle smile" + "soft introspective" → innocent_gentle_gaze
# 挑逗顽皮型
"seductive" + "half-lidded" + "biting lower lip" + "mischievous" → seductive_mischievous
# 宁静冒险型
"serene" + "adventurous" + "whimsical" + "dreamy" → serene_adventurous
输出字段:
"facial_features": {
"expression": {
"classification": "innocent_gentle_gaze",
"confidence": 0.9,
"source_keywords": ["innocent gaze", "gentle smile", "soft introspective"],
"emotional_tone": "柔和迷人,结合古典温柔与微妙的诱惑魅力"
}
}
完整人像提示词输出示例(Prompt #5):
{
"prompt_id": 5,
"theme": "人物肖像摄影 / 参数化提示词系统",
"modules": {
"visual_style": {
"photography_genre": "portrait_beauty",
"genre_confidence": 0.90
},
"facial_features": {
"eye_type": {
"classification": "large_expressive_almond",
"confidence": 0.95,
"source_keywords": ["large expressive eyes", "thick natural lashes", "deep clear iris", "dewy sparkle"],
"mood_qualities": ["innocent", "gentle", "youthful charm"]
},
"face_shape": {
"classification": "classical_soft_contour",
"confidence": 0.85,
"source_keywords": ["柔和经典的轮廓脸或瓜子脸"]
},
"lip_type": {
"classification": "cherry_lips_cupids_bow",
"confidence": 0.95,
"source_keywords": ["full natural cherry lips", "soft glossy tone", "elegant cupid's bow"]
},
"nose_type": {
"classification": "straight_classical_refined",
"confidence": 0.98,
"source_keywords": ["straight refined nose bridge", "perfect classical proportions", "subtle highlights", "small delicate tip"]
},
"skin_texture": {
"classification": "porcelain_flawless_radiant",
---
*Content truncated.*
More by huangserva
View all skills by huangserva →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.