"""Create test recipes in the database for testing the UI.""" from src.database.db_manager import DatabaseManager from src.database.models import Recipe, Output def main(): # Initialize database db = DatabaseManager("database/chef.db") db.init_database() # Create test recipes print("Creating test recipes...") recipe1 = Recipe.create( db, name="Python Code Review Prompt", prompt_text="""Please review the following Python code for: 1. Code quality and best practices 2. Potential bugs or issues 3. Performance optimizations 4. Security vulnerabilities Code: [PASTE CODE HERE] Provide detailed feedback with specific suggestions for improvement.""", tags="python,code-review,quality", description="A comprehensive code review prompt for Python code", notes="Works best with Claude Opus. Include full context." ) if recipe1: print(f"✓ Created: {recipe1.name}") # Add a test output for this recipe output1 = Output.create( db, recipe_id=recipe1.id, filename="review_20251208.txt", filepath=f"recipe_{recipe1.id}/review_20251208.txt", file_type=".txt", file_size=2048, execution_notes="Initial review of auth module" ) if output1: print(f" ✓ Added output: {output1.filename}") recipe2 = Recipe.create( db, name="Technical Documentation Writer", prompt_text="""Write clear and comprehensive technical documentation for the following: Topic: [TOPIC] Audience: [TARGET AUDIENCE] Length: [BRIEF/DETAILED] Include: - Overview and purpose - Step-by-step instructions - Code examples (if applicable) - Common issues and troubleshooting - References and further reading Use clear headings, bullet points, and examples.""", tags="documentation,technical-writing,tutorial", description="Generate structured technical documentation", notes="Adjust formality based on audience. Include screenshots where helpful." ) if recipe2: print(f"✓ Created: {recipe2.name}") recipe3 = Recipe.create( db, name="SQL Query Optimizer", prompt_text="""Analyze and optimize the following SQL query: ```sql [PASTE QUERY HERE] ``` Database: [PostgreSQL/MySQL/SQLite] Schema: [DESCRIBE TABLES] Please: 1. Identify performance issues 2. Suggest optimizations (indexes, rewrites, etc.) 3. Explain the improvements 4. Provide the optimized query 5. Estimate performance impact""", tags="sql,database,optimization,performance", description="Optimize SQL queries for better performance" ) if recipe3: print(f"✓ Created: {recipe3.name}") # Verify creation all_recipes = Recipe.get_all(db) print(f"\nTotal recipes in database: {len(all_recipes)}") db.close() print("\n✅ Test recipes created successfully!") if __name__ == "__main__": main()