Note: This is a legacy architecture system that uses a JSON file (facial_features_library.json) as the data source.
New ArchitecturePlease use:
intelligent-prompt-generator(uses the elements.db database)
Version: 1.0 Creation Date: 2026-01-01 Architecture: Master-Subordinate (master-slave structure)
📋 System Overview
This is the master control Skill of an intelligent prompt management system, responsible for:
- Understanding the user's natural language intent
- Routing to the corresponding submodule
- Integrating submodule output and returning the result
🎯 Core Features
1. Intent Recognition
Automatically recognizes 5 types of user request intents:
| Intent Type | Keywords | Example Request | Routes To |
|---|---|---|---|
| Extract (Extract) | extract, analyze, classify, recognize | "Extract the facial features from this Prompt" | extractor.md |
| Assemble (Build) | generate, assemble, create, produce | "Generate a prompt for a cinematic beautiful girl" | builder.md |
| Optimize (Optimize) | optimize, improve, enhance, adjust | "Optimize this prompt" | optimizer.md |
| Recommend (Recommend) | recommend, suggest, similar, match | "Recommend similar prompts" | recommender.md |
| Analyze (Analyze) | analyze, compare, evaluate, query | "Analyze the difference between these two prompts" | analyzer.md |
2. Data Sources
The system uses the following JSON data files:
facial_features_library.json(v1.2) - Portrait facial feature library (28 categories)module_library.json- Photography genre and equipment indexextracted_modules.json- Extraction results of 18 source Prompts
🤖 Execution Flow
Step 1: Intent Recognition
Analyze user input and identify the intent type:
# 伪代码示例
user_input = "生成一个电影级美少女的提示词"
if any(keyword in user_input for keyword in ["生成", "组装", "创建", "制作"]):
intent = "build"
elif any(keyword in user_input for keyword in ["提取", "分析Prompt", "识别"]):
intent = "extract"
elif any(keyword in user_input for keyword in ["优化", "改进", "增强"]):
intent = "optimize"
elif any(keyword in user_input for keyword in ["推荐", "建议", "相似"]):
intent = "recommend"
elif any(keyword in user_input for keyword in ["分析", "对比", "查询"]):
intent = "analyze"
else:
# 默认:build(最常用)
intent = "build"
Step 2: Route to Submodule
Call the corresponding module based on the intent:
# 伪代码示例
if intent == "build":
# 调用 builder.md
result = call_builder_module(user_input)
elif intent == "extract":
# 调用 extractor.md
result = call_extractor_module(user_input)
# ... 其他模块
Step 3: Return Result
Integrate submodule output and format it for return to the user.
📦 Submodule Description
1. extractor.md - Extraction Module
Function: Extract reusable modules from the Prompt provided by the user Input: Original Prompt text Output: Extracted module categories (eye shape, face shape, lip shape, etc.)
Example:
用户: "提取这个Prompt的五官特征: A beautiful young woman with large blue eyes..."
输出:
- 眼型: large blue expressive
- 性别: female
- 年龄: young_adult
2. builder.md - Assembly Module
Function: Intelligently assemble prompts based on user descriptions Input: User's natural language description Output: Complete prompt
Example:
用户: "生成一个电影级美少女的提示词"
输出: A beautiful East Asian young woman, large expressive almond eyes, ...
3. optimizer.md - Optimization Module
Function: Optimize the prompt provided by the user Input: Original prompt Output: Optimized prompt + optimization suggestions
Example:
用户: "优化这个提示词: A woman with eyes"
输出: A beautiful young East Asian woman, large expressive almond eyes, ...
建议: 添加了年龄、人种、眼型细节
4. recommender.md - Recommendation Module
Function: Recommend similar or related prompts/modules Input: Prompt ID or description Output: Recommendation list (with similarity scores)
Example:
用户: "推荐与Prompt #5相似的提示词"
输出:
1. Prompt #18 (相似度: 85%) - 同为清纯少女风格
2. Prompt #10 (相似度: 75%) - 同为East Asian人像
5. analyzer.md - Analysis Module
Function: Analyze prompts, compare, query information Input: Prompt ID or query conditions Output: Detailed analysis results
Example:
用户: "对比Prompt #5和#17的区别"
输出:
- Prompt #5: 清纯少女,古典优雅
- Prompt #17: 性感挑逗,叛逆风格
差异: 表情、眼型、皮肤质感完全不同
🔧 Actual Execution Logic
When you are invoked as Prompt Master Skill, please execute the following steps:
1. Receive User Input
Extract key information from the user message:
- Intent type (extract/assemble/optimize/recommend/analyze)
- Specific parameters (Prompt ID, description, query conditions, etc.)
2. Intent Recognition
Use keyword matching to recognize user intent:
Extraction Intent:
- Keywords: "extract", "analyze in the Prompt", "identify", "this Prompt's"
- Example: "Extract the eye shape of Prompt #18"
Assembly Intent:
- Keywords: "generate", "create", "assemble", "make", "I want"
- Example: "Generate a prompt for a pure and innocent girl"
Optimization Intent:
- Keywords: "optimize", "improve", "enhance", "adjust", "fix"
- Example: "Optimize this prompt"
Recommendation Intent:
- Keywords: "recommend", "suggest", "similar", "similar to", "related"
- Example: "Recommend similar prompts"
Analysis Intent:
- Keywords: "analyze", "compare", "query", "view", "detailed information"
- Example: "Analyze the features of Prompt #5"
3. Call Submodules
Important: You cannot directly execute the logic of submodules. You need to:
Option A: Call CLI tool (recommended)
Use prompt_tool.py CLI tool:
# 组装功能
python3 prompt_tool.py build "电影级美少女"
python3 prompt_tool.py generate # 交互式生成
# 查询功能
python3 prompt_tool.py show 5
python3 prompt_tool.py recommend 5
python3 prompt_tool.py compare 5 17
# 五官查询
python3 prompt_tool.py facial --list-types
python3 prompt_tool.py facial --style "清纯少女"
Option B: Directly read JSON data
When the CLI tool cannot meet the requirements, directly operate on JSON data:
# 读取数据文件
facial_lib = load_json("extracted_results/facial_features_library.json")
module_lib = load_json("extracted_results/module_library.json")
prompts_data = load_json("extracted_results/extracted_modules.json")
# 根据意图处理数据
# ...
4. Format Output
Return the results to the user in a clear and readable format:
- Use Markdown formatting
- Highlight key information
- Provide actionable suggestions
📊 Usage Examples
Example 1: Assemble Prompt
User Input:
"我想生成一个电影级的清纯美少女的提示词"
Execution Flow:
- Recognize intent: build (assemble)
- Extract keywords: "cinematic" → cinematic_narrative, "pure and beautiful girl" → pure and innocent girl
- Call CLI:
python3 prompt_tool.py build "电影级的清纯美少女" - Return the generated complete prompt
Output:
✨ 已生成提示词:
A beautiful East Asian young woman, large expressive almond eyes, thick natural lashes, deep clear iris, dewy sparkle, soft highlights, oval face, delicate refined Asian facial structure, soft full lips, gentle pink gloss, small straight delicate nose, flawless porcelain skin, radiant jade-like brightness, natural subtle blush, dewy luminous glow, innocent gaze, gentle smile, soft introspective, photographed with canon_eos_r5, 35mm f/2.8, 8K HDR, cinematic lighting, photorealistic, ultra-detailed
📋 组合详情:
- 流派: 电影叙事摄影
- 风格: 清纯少女
- 人种: 东亚人
- 年龄: 青年(18-25岁)
- 性别: 女性
Example 2: Recommend Similar Prompts
User Input:
"推荐与Prompt #5相似的提示词"
Execution Flow:
- Recognize intent: recommend (recommend)
- Extract Prompt ID: 5
- Call CLI:
python3 prompt_tool.py recommend 5 - Return recommendation list
Output:
🔍 为 Prompt #5 (清纯少女古典美) 推荐相关提示词
[1] #18 清纯公主Cosplay
相似度: 75%
理由: 同为清纯少女风格 + 同用东亚人种
[2] #10 温柔少女人像
相似度: 65%
理由: 同为人像美容摄影 + 主题相关
[3] #17 性感朋克少女
相似度: 45%
理由: 同为年轻女性人像(风格差异大)
Example 3: Query Facial Feature Combinations
User Input:
"清纯少女风格应该用什么五官组合?"
Execution Flow:
- Recognize intent: analyze (analyze/query)
- Style recognition: "Pure Maiden"
- Call CLI:
python3 prompt_tool.py facial --style "清纯少女" - Return facial feature combination recommendation
Output:
🎨 风格: 清纯少女
推荐五官组合:
性别: 女性 (female)
年龄: 青年(18-25岁) (young_adult)
人种: 东亚人 (east_asian)
眼型: 大眼杏仁眼 (large_expressive_almond) [9.8/10]
关键词: large expressive eyes, almond eyes, thick natural lashes
唇型: 粉嫩光泽唇 (soft_pink_gloss) [9.0/10]
关键词: soft full lips, gentle pink gloss, natural lip color
鼻型: 小巧直鼻 (small_straight_delicate) [9.0/10]
关键词: small straight nose, delicate nose
皮肤: 瓷肌无瑕(发光质感) (porcelain_flawless_radiant) [9.5/10]
关键词: flawless porcelain skin, radiant jade-like brightness
表情: 清纯温柔眼神 (innocent_gentle_gaze) [9.5/10]
关键词: innocent gaze, gentle smile, soft introspective
🎯 Best practices
1. Prefer using CLI tools
- ✅ CLI tools have been tested and are stable and reliable
- ✅ Unified output format, easy to understand
- ✅ Includes colored output for a better experience
2. Clear output format
- Use Markdown formatting
- Use emoji to enhance readability
- Highlight key information
3. Intelligent routing
- When the user's intent is unclear, provide options for the user to choose
- For complex requests, multiple submodules may need to be called
4. Error handling
- When the JSON file does not exist, prompt the user
- When the Prompt ID does not exist, list available IDs
- When keywords cannot be matched, provide suggestions
📚 Data file path
/Users/huangzongning/prompt_gen_image/
├── extracted_results/
│ ├── facial_features_library.json (v1.2, 28分类)
│ ├── module_library.json (10摄影流派)
│ └── extracted_modules.json (18 Prompts)
├── prompt_tool.py (CLI工具)
└── demo_generate.py (演示脚本)
🔍 Execution instructions
When the user invokes this Skill, please:
-
Analyze user intent
- Carefully read the user input
- Identify keywords and parameters
-
Choose the execution method
- Prefer using CLI tools (call prompt_tool.py via Bash)
- When necessary, read JSON data directly (Read tool)
-
Execute and return
- Format the output results
- Provide actionable follow-up suggestions
-
Proactively optimize
- If the information provided by the user is incomplete, proactively optimize or ask
- Provide improvement suggestions
Skill status: ✅ Available Supported operations: Extract, assemble, optimize, recommend, analyze Data version: facial_features_library v1.2 Total number of categories: 28 (9 major categories)