# Skill Prompt Generator - Intelligent Prompt Generation System Based on Skills

> 🌐 **English Translation** - This is the English version of the original Chinese project.
> 📖 **Original Repository**: [huangserva/skill-prompt-generator](https://github.com/huangserva/skill-prompt-generator)
> 🙏 **Credits**: All credit goes to the original author. This translation was created to make the project accessible to English-speaking users.

---

> 🎉 **v2.0 Released!** New cross-domain queries and design system integration. [View upgrade guide →](UPGRADE_GUIDE_v2.0.md)

**A Claude Code Skills project** that generates high-quality AI image prompts through 12 specialized domain Skills, based on the Universal Elements Library (1246+ elements).

## 🆕 v2.0 New Features

- 🔄 **Cross-Domain Queries** - Database utilization increased from 40.3% to 79.9%, fully leveraging all domain elements
- 🎨 **Design System Integration** - Integrates prompt-crafter's color schemes, supporting 200,000+ combinations
- 📐 **Three Generation Modes** - Portrait / Cross-Domain / Design
- 🔧 **Variable Sampling System** - Parameterized elements to avoid repetitive generation
- ✅ **100% Backward Compatible** - All v1.0 functionality fully preserved

**[Quick Start v2.0 →](README_v2.0.md)** | **[Complete Upgrade Guide →](UPGRADE_GUIDE_v2.0.md)**

## 🎯 Project Positioning

**This is not an ordinary Python tool, but a complete Skills system:**

- 🎨 **Skills-First**: Users generate prompts by calling Skills, not directly calling Python
- 🧠 **Intelligent Routing**: Automatically identifies domains (portrait/art/design/product/video) and calls the corresponding expert
- 📦 **12 Specialized Skills**: Each domain has its own expert Skill
- 💾 **Unified Data Source**: All Skills share the Universal Elements Library (1140+ elements)

## ✨ Core Features

### 🎯 Skills System (Core)
- **12 Specialized Domain Skills**: intelligent-prompt-generator, art-master, design-master, product-master, video-master, universal-learner, etc.
- **Intelligent Domain Routing**: Automatically identifies user needs and calls the corresponding expert
- **Modular Architecture**: Each Skill works independently while collaborating together

### 🆕 v2.0 Three Generation Modes
- **Portrait** - Pure portrait photography, uses portrait domain (502 elements)
- **Cross-Domain** - Complex scenes, automatically combines multiple domains (995 elements)
- **Design** - Posters and cards, SQLite elements + YAML color schemes (200,000+ combinations)

### 🧠 Intelligent Capabilities
- **Semantic Understanding**: Distinguishes subject/style/atmosphere
- **Common Sense Reasoning**: Automatically infers reasonable attributes (e.g., ethnicity → eye color)
- **Consistency Checking**: Automatically detects and corrects logical conflicts
- **Framework-Driven**: Structured generation based on `prompt_framework.yaml`
- **🆕 Cross-Domain Queries**: Automatically identifies required domains and intelligently combines them
- **🆕 Variable Sampling**: Parameterized elements with intelligent repetition avoidance

### 📦 Dual-Track System
- **Element-Level Generation**: Intelligently selects and combines from 1246+ elements
- **Template-Level Generation**: Complete design system templates (e.g., Apple PPT template)
- **🆕 Design Variable Library**: 37 color schemes + borders + decorative elements

### 📦 Supported Domains
- 📷 **portrait** - Portrait photography (502 elements)
- 🎨 **design** - Graphic design (155 elements, including 5 complete templates)
- 🏠 **interior** - Interior design
- 📦 **product** - Product photography (77 elements)
- 🎭 **art** - Art styles (51 elements)
- 🎬 **video** - Video generation (49 elements)
- 📸 **common** - Common photography techniques (205 elements)
- 🆕 **cross-domain** - Automatically combines multiple domains (995 elements)
- 🆕 **design variables** - Colors + borders + decorations (200,000+ combinations)

## 📦 Installation

### Prerequisites

- **Claude Code** - Requires Claude Code CLI installation
- **Python 3.8+** - For running the underlying engine
- **Git** - For cloning the project (optional)

### Installation Steps

#### Method 1: Clone Locally (Recommended)

```bash
# 1. Clone the project
git clone https://github.com/gupsammy/skill-prompt-generator-en.git

# 2. Enter project directory
cd skill-prompt-generator-en

# 3. Install Python dependencies
pip install -r requirements.txt
```

**Important**: After cloning, the 12 Skills under `.claude/skills/` will be automatically recognized by Claude Code.

#### Method 2: Download ZIP

1. Visit https://github.com/gupsammy/skill-prompt-generator-en
2. Click "Code" → "Download ZIP"
3. Extract to any directory
4. Run `pip install -r requirements.txt` in that directory

### Verify Installation

Test in Claude Code:

```
# Test portrait generation skill
Generate a cinematic Asian woman

# Test design skill
Generate a Bento Grid poster
```

If Claude Code can correctly call Skills and generate prompts, the installation is successful.

---

## 🚀 Quick Start

### Method 1: Use via Skills (Recommended) ⭐

**This is the primary usage method** - Call Skills directly in Claude Code:

```
# Portrait photography (Portrait mode)
Generate a cinematic Asian woman, Zhang Yimou film style

# Cross-domain scene (Cross-Domain mode) 🆕
Generate a prompt for Goku firing a Kamehameha from Dragon Ball

# Design poster (Design mode) 🆕
Generate a warm and cute children's education poster

# Graphic design
Generate a Bento Grid glass morphism poster

# Art painting
Generate a Chinese ink wash landscape painting

# Product photography
Generate luxury watch product photography
```

Claude Code will automatically:
1. Identify the domain (portrait/design/art/product)
2. Identify the generation mode (Portrait/Cross-Domain/Design) 🆕
3. Call the corresponding expert Skill
4. Return the perfect prompt

### Method 2: Directly Call v2.0 Python Engine 🆕

Use the new unified interface:

```python
from core.cross_domain_generator import CrossDomainGenerator

generator = CrossDomainGenerator()

# Automatically identify type (portrait/cross_domain/design)
result = generator.generate("Goku firing a Kamehameha from Dragon Ball")

print(result['type'])      # cross_domain
print(result['prompt'])    # Complete prompt
print(result['domains'])   # ['portrait', 'video', 'art', 'common']

generator.close()
```

### Method 3: Use v1.0 Engine (Fully Compatible)

v1.0 API is fully preserved, no modifications needed:

```python
from intelligent_generator import IntelligentGenerator

gen = IntelligentGenerator()

# Generate portrait prompt (v1.0 method)
prompt = gen.generate_from_intent({
    'subject': {
        'gender': 'female',
        'ethnicity': 'East_Asian',
        'age_range': 'young_adult'
    },
    'styling': {
        'makeup': 'k_beauty'
    },
    'lighting': {
        'lighting_type': 'natural'
    }
})

print(prompt)
gen.close()
```

**Note**:
- **Recommended Method 1** (Skills) - Simplest and most intelligent
- **Method 2** (v2.0) - Suitable for scenarios requiring cross-domain and design systems
- **Method 3** (v1.0) - Suitable for portrait-only generation scenarios

## 📖 Project Structure

```
.
├── .claude/                       # ⭐ Skills system (core)
│   ├── CLAUDE.md                  # Project rules and Skill routing guide
│   └── skills/                    # 12 specialized domain Skills
│       ├── intelligent-prompt-generator/  # Portrait prompt expert
│       ├── art-master/            # Art style expert
│       ├── design-master/         # Graphic design expert
│       ├── product-master/        # Product photography expert
│       ├── video-master/          # Video generation expert
│       ├── universal-learner/     # Learning system
│       ├── prompt-analyzer/       # Prompt analysis
│       ├── prompt-extractor/      # Element extraction
│       ├── prompt-generator/      # General generator
│       ├── prompt-master/         # Master scheduler
│       ├── prompt-xray/           # X-Ray analysis
│       └── domain-classifier/     # Domain classification
│
├── 🆕 core/                       # v2.0 core modules
│   ├── cross_domain_generator.py  # Unified generation interface (main entry)
│   ├── cross_domain_query.py      # Cross-domain query engine
│   ├── variable_sampler.py        # Variable sampling system
│   ├── yaml_sampler.py            # YAML variable sampling
│   ├── design_bridge.py           # SQLite+YAML fusion
│   └── schema_migration_v1.sql    # Database extension script
│
├── 🆕 variables/                  # Design variable library (YAML)
│   ├── colors.yaml                # 37 color schemes
│   ├── borders.yaml               # Border styles
│   └── decorations.yaml           # Decorative elements
│
├── 🆕 design-logic/               # Design logic system
│   ├── warm-cute/                 # Warm and cute style
│   └── modern-minimal/            # Modern minimal style
│
├── intelligent_generator.py       # Python engine: Core generation
├── framework_loader.py            # Python engine: Framework loading
├── element_db.py                  # Python engine: Database operations
├── prompt_framework.yaml          # Portrait framework definition
│
├── extracted_results/
│   └── elements.db                # Universal Elements Library (1246+ elements)
│
├── README_v2.0.md                 # 🆕 v2.0 quick start
├── UPGRADE_GUIDE_v2.0.md          # 🆕 v2.0 upgrade guide
├── requirements.txt               # Python dependencies
└── README.md                      # Project documentation (this file)
```

**Architecture Description**:
- **User Layer**: Call Skills through Claude Code
- **Skills Layer**: 12 specialized domain experts (.claude/skills/)
- **🆕 v2.0 Engine Layer**: core/ modules (cross-domain + design system)
- **v1.0 Engine Layer**: Python engine supporting Skills operation (fully preserved)
- **Data Layer**: Universal Elements Library (1246+ elements) + Design variable library

## 🎨 Usage Examples

### Example 1: Portrait Photography - Portrait Mode (intelligent-prompt-generator skill)

**User Request**:
```
Generate a cinematic Asian woman, Zhang Yimou film style
```

**Skill Automatic Processing**:
- Identify: Portrait photography domain, Portrait mode
- Call: intelligent-prompt-generator skill
- Generate: Cinematic portrait prompt with dramatic lighting

**Output Prompt**:
```
Cinematic portrait of young East Asian woman, dramatic lighting with rim light
and chiaroscuro effect, Zhang Yimou's signature color palette with rich reds
and golds, 85mm lens, shallow depth of field, film grain texture...
```

### Example 2: Cross-Domain Complex Scene - Cross-Domain Mode 🆕

**User Request**:
```
Generate a prompt for Goku firing a Kamehameha from Dragon Ball
```

**Skill Automatic Processing**:
- Identify: Cross-domain scene (character + action + effects)
- Automatically combine 4 domains: portrait + video + art + common
- Generate: Complete prompt including character, action pose, energy effects

**Output Prompt**:
```
Son Goku from Dragon Ball, spiky black hair, orange gi martial arts uniform,
Kamehameha pose with hands at waist forming glowing blue energy sphere,
dynamic action shot, energy beam effects, blue energy glow, cinematic lighting...
```

### Example 3: Design Poster - Design Mode 🆕

**User Request**:
```
Generate a warm and cute children's education poster
```

**Skill Automatic Processing**:
- Identify: Design poster, requires professional color system
- Call: Design mode (SQLite + YAML fusion)
- Generate: Complete design specifications (colors + borders + decorations + technical parameters)

**Output**:
```
Color scheme: Sky blue palette, primary color light purple-blue (#C7CEEA),
Decorative elements: elements, soft natural window light,
Border style: box_shadow, round corners 20px...
```

### Example 4: Graphic Design (design-master skill)

**User Request**:
```
Generate Apple-style PPT template
```

**Skill Automatic Processing**:
- Identify: Graphic design domain
- Call: design-master skill
- Query: Apple light blue business PPT template (complete system with 12 elements)

**Output**: Complete template system including background, layout, colors, fonts, visual effects

### Example 5: Art Painting (art-master skill)

**User Request**:
```
Generate Chinese ink wash landscape painting
```

**Skill Automatic Processing**:
- Identify: Art painting domain (no characters)
- Call: art-master skill
- Generate: Prompt including brush strokes, negative space, ink splashing techniques

### Example 6: Product Photography (product-master skill)

**User Request**:
```
Generate luxury watch product photography
```

**Skill Automatic Processing**:
- Identify: Product photography domain
- Call: product-master skill
- Generate: Commercial-grade product photography prompt

## 🛠️ Core Functionality

### 1. Element Library System
- **1140+ reusable elements**
- 7 major domain categories
- Reusability scoring (1-10)
- SQLite database storage

### 2. Template System
- Complete design system preservation
- Includes design philosophy and usage guides
- Structured element organization
- Supports PPT, UI, brand VI, etc.

### 3. Intelligent Generation
- Framework-driven (`prompt_framework.yaml`)
- Semantic matching and reasoning
- Consistency checking
- Automatic conflict resolution

### 4. Learning System
- Extract elements from new prompts
- Automatic domain classification
- Reusability scoring
- Continuous knowledge accumulation

## 📊 Database Statistics

### v2.0 (Current Version)
- **Total Elements**: 1246+
- **Portrait Domain**: 502 (portrait-specific)
- **Design Domain**: 155 (graphic design, includes 5 complete templates)
- **Product Domain**: 77 (product photography)
- **Art Domain**: 51 (art styles)
- **Video Domain**: 49 (video generation)
- **Common Domain**: 205 (general techniques)
- **Cross-Domain Available**: 995 (combinatorial use)
- **Design Variables**: 37 color schemes + borders + decorations (200,000+ combinations)
- **Complete Templates**: 5 (Apple, Material Design, Fluent Design, etc.)

### Performance Improvements (v1.0 → v2.0)
- Database Utilization: 40.3% → 79.9% ⬆️ **+98.2%**
- Generation Modes: 1 type → 3 types ⬆️ **+200%**
- Available Combinations: Fixed → 200,000+ ⬆️ **100x+**

## 🔧 Configuration

### prompt_framework.yaml

Defines the complete framework for portrait prompts:
- 7 major categories: subject, facial, styling, expression, lighting, scene, technical
- Field-to-database mapping
- Dependency rules (e.g., era=ancient → makeup=traditional)
- Validation rules

## 📝 Development Guide

### Adding New Elements

```python
from element_db import ElementDatabase

db = ElementDatabase()
db.add_element({
    'element_id': 'portrait_expressions_010',
    'domain_id': 'portrait',
    'category_id': 'expressions',
    'name': 'serene_smile',
    'chinese_name': '宁静微笑',
    'ai_prompt_template': 'serene gentle smile...',
    'keywords': '["serene", "gentle", "peaceful"]',
    'reusability_score': 8.5
})
```

### Creating New Templates

```python
template = {
    'template_id': 'template_xxx',
    'name': 'Template Name',
    'chinese_name': '模板中文名',
    'category': 'ppt_design',
    'element_ids': ['elem1', 'elem2', ...],
    'element_structure': {
        'backgrounds': ['elem1'],
        'layouts': ['elem2']
    },
    'design_philosophy': '设计理念...',
    'usage_scenarios': '使用场景...'
}
```

## 🤝 Contributing

Issues and Pull Requests are welcome!

## 📄 License

MIT License

## 📚 Related Documentation

- **[README_v2.0.md](README_v2.0.md)** - v2.0 quick start guide
- **[UPGRADE_GUIDE_v2.0.md](UPGRADE_GUIDE_v2.0.md)** - Detailed upgrade guide and feature descriptions
- **[prompt_framework.yaml](prompt_framework.yaml)** - Portrait framework configuration file

## 🙏 Acknowledgments

- **Original Author**: [huangserva](https://github.com/huangserva) - Creator of the original Chinese repository
- **Original Repository**: [skill-prompt-generator](https://github.com/huangserva/skill-prompt-generator)
- Based on Claude Code Skills system
- Universal Elements Library architecture
- Framework-driven generation philosophy

---

*This English translation was created using Claude Code to make the project accessible to a wider audience. All intellectual property and credit belong to the original author.*
