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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Advanced Prompt System - Dinamik ve Akıllı Dosya Üretimi
|
| 2 |
+
|
| 3 |
+
def get_advanced_context_prompt(project_type, project_idea, tech_details):
|
| 4 |
+
"""
|
| 5 |
+
Proje türüne göre tamamen dinamik context dosyaları oluşturur.
|
| 6 |
+
Dosya isimleri ve içerikleri otomatik belirlenir.
|
| 7 |
+
"""
|
| 8 |
+
return f"""
|
| 9 |
+
Sen bir Senior Context Engineer olarak, aşağıdaki proje için profesyonel bir context yapısı oluşturacaksın.
|
| 10 |
+
|
| 11 |
+
PROJE BİLGİLERİ:
|
| 12 |
+
- Proje Türü: {project_type}
|
| 13 |
+
- Proje Açıklaması: {project_idea}
|
| 14 |
+
- Teknik Detaylar: {tech_details}
|
| 15 |
+
|
| 16 |
+
GÖREV:
|
| 17 |
+
Bu proje için en uygun context dosyalarını belirle ve oluştur. Her dosya şu formatta olmalı:
|
| 18 |
+
# context/[dosya_adı].md
|
| 19 |
+
|
| 20 |
+
KURALLAR:
|
| 21 |
+
1. Dosya isimleri proje mantığına uygun olmalı (01_persona.md gibi sabit isimler KULLANMA)
|
| 22 |
+
2. Her dosyanın amacı net olmalı ve içeriği o amaca hizmet etmeli
|
| 23 |
+
3. Proje türüne özgü best practice'leri takip et
|
| 24 |
+
4. Gerçek dünya senaryolarına uygun, production-ready içerik üret
|
| 25 |
+
5. Her dosya birbirleriyle ilişkili ve tutarlı olmalı
|
| 26 |
+
|
| 27 |
+
ÖRNEK YAKLAŞIMLAR:
|
| 28 |
+
- ML Projesi için: model_architecture.md, data_pipeline.md, experiment_tracking.md
|
| 29 |
+
- Web Projesi için: frontend_architecture.md, api_design.md, state_management.md
|
| 30 |
+
- Mobil için: navigation_flow.md, offline_strategy.md, platform_guidelines.md
|
| 31 |
+
|
| 32 |
+
İÇERİK KALİTESİ:
|
| 33 |
+
- Kod örnekleri gerçek ve çalışabilir olmalı
|
| 34 |
+
- Konfigürasyon dosyaları complete olmalı
|
| 35 |
+
- Güvenlik ve performans konuları detaylı işlenmeli
|
| 36 |
+
- Edge case'ler ve error handling stratejileri dahil edilmeli
|
| 37 |
+
|
| 38 |
+
Şimdi bu proje için en uygun context yapısını oluştur. Dosya sayısı ve isimleri tamamen projenin ihtiyaçlarına göre belirlenmelidir.
|
| 39 |
+
"""
|
| 40 |
+
|
| 41 |
+
def get_advanced_commands_prompt(project_type, project_idea, context_summary):
|
| 42 |
+
"""
|
| 43 |
+
Context'e dayalı olarak akıllı command dosyaları oluşturur.
|
| 44 |
+
"""
|
| 45 |
+
return f"""
|
| 46 |
+
Sen bir DevOps ve Automation uzmanısın. Aşağıdaki proje için command dosyaları oluşturacaksın.
|
| 47 |
+
|
| 48 |
+
PROJE BİLGİLERİ:
|
| 49 |
+
- Proje Türü: {project_type}
|
| 50 |
+
- Proje: {project_idea}
|
| 51 |
+
- Context Özeti: {context_summary}
|
| 52 |
+
|
| 53 |
+
GÖREV:
|
| 54 |
+
Bu projeyi baştan sona yönetmek için gerekli tüm command dosyalarını oluştur.
|
| 55 |
+
|
| 56 |
+
KURALLAR:
|
| 57 |
+
1. Her command dosyası belirli bir görevi otomatize etmeli
|
| 58 |
+
2. Dosya isimleri aksiyonu net tanımlamalı
|
| 59 |
+
3. Her komut şunları içermeli:
|
| 60 |
+
- Detaylı açıklama
|
| 61 |
+
- Prerequisite'ler
|
| 62 |
+
- Step-by-step execution
|
| 63 |
+
- Beklenen çıktılar
|
| 64 |
+
- Troubleshooting rehberi
|
| 65 |
+
- Sonraki adımlar
|
| 66 |
+
|
| 67 |
+
ÖRNEK COMMAND TÜRLERİ:
|
| 68 |
+
- Environment setup & dependency management
|
| 69 |
+
- Data processing pipelines
|
| 70 |
+
- Testing & validation workflows
|
| 71 |
+
- Deployment & rollback procedures
|
| 72 |
+
- Monitoring & alerting setup
|
| 73 |
+
- Performance optimization tasks
|
| 74 |
+
- Security scanning & compliance checks
|
| 75 |
+
|
| 76 |
+
AUTOMATION SEVİYESİ:
|
| 77 |
+
- One-click execution hedeflenmeli
|
| 78 |
+
- Idempotent olmalı (tekrar çalıştırılabilir)
|
| 79 |
+
- Error recovery mekanizmaları içermeli
|
| 80 |
+
- Progress reporting ve logging dahil edilmeli
|
| 81 |
+
|
| 82 |
+
Her command dosyası # commands/[aksiyonel_isim].txt formatında olmalı.
|
| 83 |
+
"""
|
| 84 |
+
|
| 85 |
+
def get_advanced_prompts_prompt(project_type, project_idea, tech_stack):
|
| 86 |
+
"""
|
| 87 |
+
AI-powered development için sofistike prompt template'leri oluşturur.
|
| 88 |
+
"""
|
| 89 |
+
return f"""
|
| 90 |
+
Sen bir AI Engineering uzmanısın. Bu proje için AI asistanlarına verilecek prompt template'lerini oluşturacaksın.
|
| 91 |
+
|
| 92 |
+
PROJE:
|
| 93 |
+
- Tür: {project_type}
|
| 94 |
+
- Açıklama: {project_idea}
|
| 95 |
+
- Teknolojiler: {tech_stack}
|
| 96 |
+
|
| 97 |
+
GÖREV:
|
| 98 |
+
Projenin her aşamasında AI asistanlarını efektif kullanmak için prompt template'leri oluştur.
|
| 99 |
+
|
| 100 |
+
TEMPLATE YAPISI:
|
| 101 |
+
Her template şunları içermeli:
|
| 102 |
+
1. Context injection points
|
| 103 |
+
2. Variable placeholders
|
| 104 |
+
3. Output format specifications
|
| 105 |
+
4. Quality criteria
|
| 106 |
+
5. Example inputs/outputs
|
| 107 |
+
6. Edge case handling instructions
|
| 108 |
+
|
| 109 |
+
PROMPT KATEGORİLERİ:
|
| 110 |
+
- Code generation prompts
|
| 111 |
+
- Architecture decision prompts
|
| 112 |
+
- Bug fixing prompts
|
| 113 |
+
- Performance optimization prompts
|
| 114 |
+
- Documentation generation prompts
|
| 115 |
+
- Code review prompts
|
| 116 |
+
- Testing scenario prompts
|
| 117 |
+
- Refactoring prompts
|
| 118 |
+
|
| 119 |
+
PROMPT KALİTE KRİTERLERİ:
|
| 120 |
+
- Clear and unambiguous instructions
|
| 121 |
+
- Structured output requirements
|
| 122 |
+
- Domain-specific terminology
|
| 123 |
+
- Best practices enforcement
|
| 124 |
+
- Security considerations
|
| 125 |
+
- Performance awareness
|
| 126 |
+
|
| 127 |
+
Her prompt template # prompts/[görev_adı].tpl formatında olmalı.
|
| 128 |
+
"""
|
| 129 |
+
|
| 130 |
+
# Proje analizi için gelişmiş fonksiyonlar
|
| 131 |
+
def analyze_project_requirements(project_type, project_idea):
|
| 132 |
+
"""
|
| 133 |
+
Proje gereksinimlerini analiz eder ve öneriler üretir.
|
| 134 |
+
"""
|
| 135 |
+
analysis_prompt = f"""
|
| 136 |
+
Analyze this project and provide:
|
| 137 |
+
1. Core technical requirements
|
| 138 |
+
2. Suggested architecture patterns
|
| 139 |
+
3. Required integrations
|
| 140 |
+
4. Security considerations
|
| 141 |
+
5. Scalability requirements
|
| 142 |
+
6. Team structure recommendations
|
| 143 |
+
|
| 144 |
+
Project Type: {project_type}
|
| 145 |
+
Project Idea: {project_idea}
|
| 146 |
+
"""
|
| 147 |
+
return analysis_prompt
|
| 148 |
+
|
| 149 |
+
def generate_project_metadata(project_type, project_idea):
|
| 150 |
+
"""
|
| 151 |
+
Proje için metadata ve konfigürasyon önerileri.
|
| 152 |
+
"""
|
| 153 |
+
return {
|
| 154 |
+
"suggested_files": [],
|
| 155 |
+
"tech_stack_recommendations": [],
|
| 156 |
+
"architecture_patterns": [],
|
| 157 |
+
"best_practices": [],
|
| 158 |
+
"common_pitfalls": []
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
# Kalite kontrol fonksiyonları
|
| 162 |
+
def validate_generated_structure(files_dict):
|
| 163 |
+
"""
|
| 164 |
+
Oluşturulan dosya yapısının kalitesini kontrol eder.
|
| 165 |
+
"""
|
| 166 |
+
validations = {
|
| 167 |
+
"has_readme": False,
|
| 168 |
+
"has_architecture": False,
|
| 169 |
+
"has_security": False,
|
| 170 |
+
"has_testing": False,
|
| 171 |
+
"consistency_score": 0,
|
| 172 |
+
"completeness_score": 0
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
# Validation logic here
|
| 176 |
+
return validations
|
| 177 |
+
|
| 178 |
+
# Template özelleştirme sistemi
|
| 179 |
+
INDUSTRY_TEMPLATES = {
|
| 180 |
+
"fintech": {
|
| 181 |
+
"required_contexts": ["compliance.md", "security_audit.md", "data_privacy.md"],
|
| 182 |
+
"required_commands": ["pci_compliance_check.txt", "audit_trail_generator.txt"],
|
| 183 |
+
"special_considerations": ["GDPR", "PCI-DSS", "SOC2"]
|
| 184 |
+
},
|
| 185 |
+
"healthcare": {
|
| 186 |
+
"required_contexts": ["hipaa_compliance.md", "patient_data_handling.md"],
|
| 187 |
+
"required_commands": ["phi_data_scanner.txt", "compliance_reporter.txt"],
|
| 188 |
+
"special_considerations": ["HIPAA", "HL7", "FHIR"]
|
| 189 |
+
},
|
| 190 |
+
"gaming": {
|
| 191 |
+
"required_contexts": ["game_design_document.md", "monetization_strategy.md"],
|
| 192 |
+
"required_commands": ["asset_pipeline.txt", "build_all_platforms.txt"],
|
| 193 |
+
"special_considerations": ["Performance", "Multi-platform", "LiveOps"]
|
| 194 |
+
}
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
# Akıllı dosya adlandırma sistemi
|
| 198 |
+
def generate_smart_filenames(project_context):
|
| 199 |
+
"""
|
| 200 |
+
Proje bağlamına göre anlamlı dosya isimleri üretir.
|
| 201 |
+
"""
|
| 202 |
+
naming_conventions = {
|
| 203 |
+
"context": {
|
| 204 |
+
"prefix": "",
|
| 205 |
+
"suffix": ".md",
|
| 206 |
+
"style": "descriptive" # technical_architecture.md
|
| 207 |
+
},
|
| 208 |
+
"commands": {
|
| 209 |
+
"prefix": "",
|
| 210 |
+
"suffix": ".txt",
|
| 211 |
+
"style": "action_based" # deploy_to_production.txt
|
| 212 |
+
},
|
| 213 |
+
"prompts": {
|
| 214 |
+
"prefix": "",
|
| 215 |
+
"suffix": ".tpl",
|
| 216 |
+
"style": "task_oriented" # generate_unit_tests.tpl
|
| 217 |
+
}
|
| 218 |
+
}
|
| 219 |
+
return naming_conventions
|
| 220 |
+
|
| 221 |
+
# Proje karmaşıklık analizi
|
| 222 |
+
def calculate_project_complexity(project_type, project_idea, features):
|
| 223 |
+
"""
|
| 224 |
+
Proje karmaşıklığını hesaplar ve buna göre dosya sayısını belirler.
|
| 225 |
+
"""
|
| 226 |
+
complexity_factors = {
|
| 227 |
+
"user_management": 2,
|
| 228 |
+
"payment_processing": 3,
|
| 229 |
+
"real_time_features": 3,
|
| 230 |
+
"ai_ml_integration": 4,
|
| 231 |
+
"multi_platform": 3,
|
| 232 |
+
"third_party_integrations": 2,
|
| 233 |
+
"offline_capability": 2,
|
| 234 |
+
"internationalization": 2
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
base_complexity = 5
|
| 238 |
+
total_complexity = base_complexity
|
| 239 |
+
|
| 240 |
+
for feature in features:
|
| 241 |
+
if feature in complexity_factors:
|
| 242 |
+
total_complexity += complexity_factors[feature]
|
| 243 |
+
|
| 244 |
+
# Dosya sayısı önerileri
|
| 245 |
+
recommended_files = {
|
| 246 |
+
"context": min(15, 5 + total_complexity // 2),
|
| 247 |
+
"commands": min(20, 5 + total_complexity // 2),
|
| 248 |
+
"prompts": min(15, 3 + total_complexity // 3)
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
return recommended_files
|
| 252 |
+
|
| 253 |
+
# Sektör-spesifik şablonlar
|
| 254 |
+
def get_industry_specific_requirements(industry):
|
| 255 |
+
"""
|
| 256 |
+
Sektöre özgü gereksinimler ve standartlar.
|
| 257 |
+
"""
|
| 258 |
+
industry_reqs = {
|
| 259 |
+
"finance": ["SOC2", "PCI-DSS", "Audit trails", "Encryption at rest"],
|
| 260 |
+
"healthcare": ["HIPAA", "Patient privacy", "Medical device integration"],
|
| 261 |
+
"education": ["FERPA", "Accessibility", "Multi-tenant architecture"],
|
| 262 |
+
"ecommerce": ["Payment gateways", "Inventory management", "Tax compliance"],
|
| 263 |
+
"social": ["Content moderation", "Privacy controls", "Scale considerations"]
|
| 264 |
+
}
|
| 265 |
+
return industry_reqs.get(industry, [])
|