iDrv5-MyFR8 Agent Prompt Library
This library provides curated prompts to ensure agents follow clean coding, UI standards, and error tracking when working on the iDrv5-MyFR8 logistics platform.
🎯 Purpose
Section titled “🎯 Purpose”This library provides curated prompts to ensure agents follow clean coding, UI standards, and error tracking when working on the iDrv5-MyFR8 logistics platform.
🏗️ Clean Coding Standards
Section titled “🏗️ Clean Coding Standards”Code Structure Prompt
Section titled “Code Structure Prompt”When writing code for iDrv5-MyFR8:1. Follow the module structure: modules/{module_name}/{routes.py, models.py, services.py}2. Use snake_case for Python files and functions3. Use PascalCase for class names4. Organize imports: stdlib → third-party → local5. Include docstrings for all public methods6. Use type hints where possibleError Handling Prompt
Section titled “Error Handling Prompt”For error handling in iDrv5-MyFR8:1. Use the centralized ErrorTracker from utils/error_tracker.py2. Always provide context with errors3. Log errors at appropriate levels (DEBUG, INFO, WARNING, ERROR, CRITICAL)4. Use try-except blocks for database operations5. Return meaningful error messages to users6. Track module-specific errors for analyticsDatabase Operations Prompt
Section titled “Database Operations Prompt”For database operations:1. Use SQLAlchemy ORM consistently2. Handle connection failures gracefully3. Implement proper session management4. Use pagination for large datasets5. Always close database sessions6. Include database health checks🎨 UI Standards
Section titled “🎨 UI Standards”Template Structure Prompt
Section titled “Template Structure Prompt”For HTML templates in iDrv5-MyFR8:1. Extend base templates: layout.html for main pages2. Use Bootstrap 5 classes consistently3. Include CSRF tokens in all forms4. Use semantic HTML5 elements5. Ensure responsive design principles6. Include portal-specific stylingComponent Design Prompt
Section titled “Component Design Prompt”For UI components:1. Create reusable components in templates/components/2. Use consistent color scheme: primary (#007bff), success (#28a745)3. Include loading states for async operations4. Add proper error state displays5. Ensure accessibility standards (ARIA labels)6. Test on mobile and desktop viewportsForm Handling Prompt
Section titled “Form Handling Prompt”For forms in iDrv5-MyFR8:1. Use Flask-WTF for form validation2. Include proper field validation3. Display validation errors clearly4. Use consistent form styling5. Include success/error flash messages6. Implement CSRF protection🔧 Module Development
Section titled “🔧 Module Development”New Module Creation Prompt
Section titled “New Module Creation Prompt”When creating a new module:1. Create directory structure: modules/{module_name}/2. Include __init__.py with version and metadata3. Define clear service interfaces4. Document module dependencies5. Create comprehensive tests6. Update module registry7. Add to config.py MODULE_DETAILSAPI Endpoint Prompt
Section titled “API Endpoint Prompt”For API endpoints:1. Use RESTful conventions2. Include proper HTTP status codes3. Validate input data4. Return consistent JSON structure5. Include error handling6. Add rate limiting where appropriate7. Document with docstringsService Layer Prompt
Section titled “Service Layer Prompt”For service classes:1. Keep business logic in services, not routes2. Use dependency injection patterns3. Include proper error handling4. Return consistent data structures5. Add logging for important operations6. Include unit tests📊 Performance & Monitoring
Section titled “📊 Performance & Monitoring”Performance Optimization Prompt
Section titled “Performance Optimization Prompt”For performance optimization:1. Use database query optimization2. Implement appropriate caching3. Minimize N+1 query problems4. Use pagination for large datasets5. Optimize template rendering6. Monitor database connection poolsMonitoring Integration Prompt
Section titled “Monitoring Integration Prompt”For monitoring and analytics:1. Add metrics collection points2. Track user interactions3. Monitor system health4. Log performance metrics5. Include error rate tracking6. Set up alerting thresholds🔒 Security Standards
Section titled “🔒 Security Standards”Authentication Prompt
Section titled “Authentication Prompt”For authentication features:1. Use Flask-Login consistently2. Hash passwords with Werkzeug3. Implement session management4. Add CSRF protection5. Validate user permissions6. Log authentication eventsData Validation Prompt
Section titled “Data Validation Prompt”For data validation:1. Validate all user inputs2. Sanitize data before database storage3. Use parameterized queries4. Implement rate limiting5. Add input length restrictions6. Validate file uploads properly🧪 Testing Standards
Section titled “🧪 Testing Standards”Unit Testing Prompt
Section titled “Unit Testing Prompt”For unit tests:1. Test all public methods2. Include edge cases3. Mock external dependencies4. Use descriptive test names5. Aim for 80%+ code coverage6. Test error conditionsIntegration Testing Prompt
Section titled “Integration Testing Prompt”For integration tests:1. Test module interactions2. Validate API endpoints3. Test database operations4. Check UI workflows5. Test authentication flows6. Validate error handling📚 Documentation Standards
Section titled “📚 Documentation Standards”Code Documentation Prompt
Section titled “Code Documentation Prompt”For code documentation:1. Include module-level docstrings2. Document all public APIs3. Provide usage examples4. Document configuration options5. Include troubleshooting guides6. Keep documentation up-to-dateAPI Documentation Prompt
Section titled “API Documentation Prompt”For API documentation:1. Document all endpoints2. Include request/response examples3. Document error codes4. Provide authentication details5. Include rate limiting information6. Add usage examples🚀 Deployment Standards
Section titled “🚀 Deployment Standards”Environment Configuration Prompt
Section titled “Environment Configuration Prompt”For environment setup:1. Use environment variables for secrets2. Include configuration validation3. Document required variables4. Provide development defaults5. Include health check endpoints6. Add logging configurationProduction Readiness Prompt
Section titled “Production Readiness Prompt”For production deployment:1. Include proper error pages2. Configure logging levels3. Set up monitoring endpoints4. Include database migrations5. Configure static file serving6. Add security headers🔄 Maintenance Standards
Section titled “🔄 Maintenance Standards”Code Review Prompt
Section titled “Code Review Prompt”For code reviews:1. Check for security vulnerabilities2. Validate error handling3. Review performance implications4. Check code style consistency5. Validate test coverage6. Review documentation updatesRefactoring Prompt
Section titled “Refactoring Prompt”For refactoring:1. Maintain backward compatibility2. Update all related tests3. Document breaking changes4. Update module dependencies5. Validate performance impact6. Update documentation🎯 Usage Guidelines
Section titled “🎯 Usage Guidelines”For New Developers
Section titled “For New Developers”- Review this library before starting work
- Use prompts as checklists for development
- Ask questions when standards are unclear
- Contribute improvements to prompts
For Code Reviews
Section titled “For Code Reviews”- Reference relevant prompts during reviews
- Ensure standards compliance
- Provide constructive feedback
- Update prompts based on review learnings
For Project Maintenance
Section titled “For Project Maintenance”- Regular review and update of prompts
- Incorporate lessons learned
- Add new patterns as they emerge
- Remove outdated practices
Last Updated: $(date) Version: 1.0.0