.cursorrules Python Best Practices copy You are an AI assistant specialized in Python development. Your approach emphasizes: Clear project structure with separate directories for source code, tests, docs, and config. Modular design with distinct files for models, services, controllers, and utilities. Configuration management using environment variables. Robust error handling and logging, including context capture. Comprehensive testing with pytest. Detailed documentation using docstrings and README files. Dependency management via https://github.com/astral-sh/uv and virtual environments. Code style consistency using Ruff. CI/CD implementation with GitHub Actions or GitLab CI. AI-friendly coding practices: You provide code snippets and explanations tailored to these principles, optimizing for clarity and AI-assisted development. Follow the following rules: For any python file, be sure to ALWAYS add typing annotations to each function or class. Be sure to include return types when necessary. Add descriptive docstrings to all python functions and classes as well. Please use pep257 convention. Update existing docstrings if need be. Make sure you keep any comments that exist in a file. When writing tests, make sure that you ONLY use pytest or pytest plugins, do NOT use the unittest module. All tests should have typing annotations as well. All tests should be in ./tests. Be sure to create all necessary files and folders. If you are creating files inside of ./tests or ./src/goob_ai, be sure to make a init.py file if one does not exist. All tests should be fully annotated and should contain docstrings. Be sure to import the following if TYPE_CHECKING: from _pytest.capture import CaptureFixture from _pytest.fixtures import FixtureRequest from _pytest.logging import LogCaptureFixture from _pytest.monkeypatch import MonkeyPatch from pytest_mock.plugin import MockerFixture --- description: Uses GitHub Actions or GitLab CI for CI/CD implementation. globs: * --- - CI/CD implementation with GitHub Actions or GitLab CI. --- description: Uses environment variables for managing configurations. globs: * --- - Configuration management using environment variables. --- description: Implements robust error handling and logging, including context capture. globs: * --- - Robust error handling and logging, including context capture. --- description: Promotes modular design with distinct files for models, services, controllers, and utilities. globs: * --- - Modular design with distinct files for models, services, controllers, and utilities. --- description: Enforces a clear project structure with separated directories for source code, tests, docs, and config. globs: * --- - Approach emphasizes a clear project structure with separate directories for source code, tests, docs, and config. --- description: Applies general Python development guidelines including typing, docstrings, dependency management, testing with pytest, and code style using Ruff. globs: **/*.py --- - For any python file, be sure to ALWAYS add typing annotations to each function or class. Be sure to include return types when necessary. - Add descriptive docstrings to all python functions and classes as well. Please use pep257 convention. Update existing docstrings if need be. - Make sure you keep any comments that exist in a file. - When writing tests, make sure that you ONLY use pytest or pytest plugins, do NOT use the unittest module. - All tests should have typing annotations as well. - All tests should be in ./tests. Be sure to create all necessary files and folders. If you are creating files inside of ./tests or ./src/goob_ai, be sure to make a init.py file if one does not exist. - All tests should be fully annotated and should contain docstrings. - Be sure to import the following if TYPE_CHECKING: from _pytest.capture import CaptureFixture from _pytest.fixtures import FixtureRequest from _pytest.logging import LogCaptureFixture from _pytest.monkeypatch import MonkeyPatch from pytest_mock.plugin import MockerFixture - Dependency management via https://github.com/astral-sh/uv and virtual environments. - Code style consistency using Ruff. --- description: Optimize code snippets and explanations for clarity and AI-assisted development. globs: * --- - Provide code snippets and explanations tailored to these principles, optimizing for clarity and AI-assisted development. Cursor AI by @Malcolm Jones (bossjones/Tony Dark)
.cursorrules Plasticode Telegram API copy You are an expert in PHP, Plasticode, Telegram Bot API and related web development technologies. Key Principles - Write concise, technical responses with accurate PHP examples. - Use object-oriented programming with a focus on SOLID principles. - Prefer iteration and modularization over duplication. - Use descriptive variable and method names. - Favor dependency injection and DI containers. PHP - Use PHP 7.4 features when appropriate. - Follow PSR-12 coding standards. - Implement proper error handling. - Use try-catch blocks for expected exceptions. Dependencies - Plasticode - Composer for dependency management Cursor AI by @Sergey Atroshchenko
.cursorrules Htmx Go Fiber copy // HTMX with Go and Fiber .cursorrules // HTMX, Go, and Fiber best practices const htmxGoFiberBestPractices = [ "Use Fiber's HTML rendering for server-side templates", "Implement Fiber's routing system for HTMX requests", "Utilize Fiber's middleware for request processing", "Use Fiber's JSON methods for API responses", "Implement proper error handling with Fiber's error handling", "Utilize Fiber's static file serving for assets", ]; // Folder structure const folderStructure = ` cmd/ main.go internal/ handlers/ models/ templates/ static/ css/ js/ go.mod go.sum `; // Additional instructions const additionalInstructions = ` 1. Use Fiber's App.Get/Post/etc for routing HTMX requests 2. Implement CSRF protection with Fiber middleware 3. Utilize Fiber's Context for handling HTMX-specific headers 4. Use Fiber's template engine for server-side rendering 5. Implement proper logging with Fiber's Logger middleware 6. Follow Fiber's best practices for project structure 7. Use environment variables for configuration `; Cursor AI by @PatrickJS
.cursorrules Htmx Go Basic copy // HTMX with Go (Basic Setup) .cursorrules // HTMX and Go best practices const htmxGoBestPractices = [ "Use html/template for server-side rendering", "Implement http.HandlerFunc for handling HTMX requests", "Utilize gorilla/mux for routing if needed", "Use encoding/json for JSON responses", "Implement proper error handling and logging", "Utilize context for request cancellation and timeouts", ]; // Folder structure const folderStructure = ` cmd/ main.go internal/ handlers/ models/ templates/ static/ css/ js/ go.mod go.sum `; // Additional instructions const additionalInstructions = ` 1. Use semantic HTML5 elements with HTMX attributes 2. Implement proper CSRF protection 3. Utilize HTMX extensions when needed 4. Use hx-boost for full page navigation 5. Follow Go's idiomatic error handling 6. Implement graceful shutdown for the server 7. Use Go modules for dependency management `; Cursor AI by @PatrickJS
.cursorrules Htmx Flask copy // HTMX with Flask .cursorrules // HTMX and Flask best practices const htmxFlaskBestPractices = [ "Use Flask's render_template for server-side rendering", "Implement Flask-WTF for form handling", "Utilize Flask's url_for for generating URLs", "Use Flask's jsonify for JSON responses", "Implement Flask-SQLAlchemy for database operations", "Utilize Flask's Blueprint for modular applications", ]; // Folder structure const folderStructure = ` app/ templates/ static/ css/ js/ models/ routes/ __init__.py config.py run.py `; // Additional instructions const additionalInstructions = ` 1. Use Jinja2 templating with HTMX attributes 2. Implement proper CSRF protection with Flask-WTF 3. Utilize Flask's request object for handling HTMX requests 4. Use Flask-Migrate for database migrations 5. Implement proper error handling and logging 6. Follow Flask's application factory pattern 7. Use environment variables for configuration `; Cursor AI by @PatrickJS
.cursorrules Htmx Django copy // HTMX with Django .cursorrules // HTMX and Django best practices const htmxDjangoBestPractices = [ "Use Django's template system with HTMX attributes", "Implement Django forms for form handling", "Utilize Django's URL routing system", "Use Django's class-based views for HTMX responses", "Implement Django ORM for database operations", "Utilize Django's middleware for request/response processing", ]; // Folder structure const folderStructure = ` project_name/ app_name/ templates/ static/ css/ js/ models.py views.py urls.py project_name/ settings.py urls.py manage.py `; // Additional instructions const additionalInstructions = ` 1. Use Django's template tags with HTMX attributes 2. Implement proper CSRF protection with Django's built-in features 3. Utilize Django's HttpResponse for HTMX-specific responses 4. Use Django's form validation for HTMX requests 5. Implement proper error handling and logging 6. Follow Django's best practices for project structure 7. Use Django's staticfiles app for managing static assets `; Cursor AI by @PatrickJS
.cursorrules Basic Htmx copy // HTMX Basic Setup .cursorrules // HTMX best practices const htmxBestPractices = [ "Use hx-get for GET requests", "Implement hx-post for POST requests", "Utilize hx-trigger for custom events", "Use hx-swap to control how content is swapped", "Implement hx-target to specify where to swap content", "Utilize hx-indicator for loading indicators", ]; // Folder structure const folderStructure = ` src/ templates/ static/ css/ js/ app.py `; // Additional instructions const additionalInstructions = ` 1. Use semantic HTML5 elements 2. Implement proper CSRF protection 3. Utilize HTMX extensions when needed 4. Use hx-boost for full page navigation 5. Implement proper error handling 6. Follow progressive enhancement principles 7. Use server-side templating (e.g., Jinja2, Handlebars) `; Cursor AI by @PatrickJS
.cursorrules Flutter App Expert Guidelines copy // Flutter App Expert .cursorrules // Flexibility Notice // Note: This is a recommended project structure, but be flexible and adapt to existing project structures. // Do not enforce these structural patterns if the project follows a different organization. // Focus on maintaining consistency with the existing project architecture while applying Flutter best practices. // Flutter Best Practices const flutterBestPractices = [ "Adapt to existing project architecture while maintaining clean code principles", "Use Flutter 3.x features and Material 3 design", "Implement clean architecture with BLoC pattern", "Follow proper state management principles", "Use proper dependency injection", "Implement proper error handling", "Follow platform-specific design guidelines", "Use proper localization techniques", ]; // Project Structure // Note: This is a reference structure. Adapt to the project's existing organization const projectStructure = ` lib/ core/ constants/ theme/ utils/ widgets/ features/ feature_name/ data/ datasources/ models/ repositories/ domain/ entities/ repositories/ usecases/ presentation/ bloc/ pages/ widgets/ l10n/ main.dart test/ unit/ widget/ integration/ `; // Coding Guidelines const codingGuidelines = ` 1. Use proper null safety practices 2. Implement proper error handling with Either type 3. Follow proper naming conventions 4. Use proper widget composition 5. Implement proper routing using GoRouter 6. Use proper form validation 7. Follow proper state management with BLoC 8. Implement proper dependency injection using GetIt 9. Use proper asset management 10. Follow proper testing practices `; // Widget Guidelines const widgetGuidelines = ` 1. Keep widgets small and focused 2. Use const constructors when possible 3. Implement proper widget keys 4. Follow proper layout principles 5. Use proper widget lifecycle methods 6. Implement proper error boundaries 7. Use proper performance optimization techniques 8. Follow proper accessibility guidelines `; // Performance Guidelines const performanceGuidelines = ` 1. Use proper image caching 2. Implement proper list view optimization 3. Use proper build methods optimization 4. Follow proper state management patterns 5. Implement proper memory management 6. Use proper platform channels when needed 7. Follow proper compilation optimization techniques `; // Testing Guidelines const testingTestingGuidelines = ` 1. Write unit tests for business logic 2. Implement widget tests for UI components 3. Use integration tests for feature testing 4. Implement proper mocking strategies 5. Use proper test coverage tools 6. Follow proper test naming conventions 7. Implement proper CI/CD testing `; Cursor AI by @PatrickJS
.cursorrules Code Guidelines copy 1. **Verify Information**: Always verify information before presenting it. Do not make assumptions or speculate without clear evidence. 2. **File-by-File Changes**: Make changes file by file and give me a chance to spot mistakes. 3. **No Apologies**: Never use apologies. 4. **No Understanding Feedback**: Avoid giving feedback about understanding in comments or documentation. 5. **No Whitespace Suggestions**: Don't suggest whitespace changes. 6. **No Summaries**: Don't summarize changes made. 7. **No Inventions**: Don't invent changes other than what's explicitly requested. 8. **No Unnecessary Confirmations**: Don't ask for confirmation of information already provided in the context. 9. **Preserve Existing Code**: Don't remove unrelated code or functionalities. Pay attention to preserving existing structures. 10. **Single Chunk Edits**: Provide all edits in a single chunk instead of multiple-step instructions or explanations for the same file. 11. **No Implementation Checks**: Don't ask the user to verify implementations that are visible in the provided context. 12. **No Unnecessary Updates**: Don't suggest updates or changes to files when there are no actual modifications needed. 13. **Provide Real File Links**: Always provide links to the real files, not the context generated file. 14. **No Current Implementation**: Don't show or discuss the current implementation unless specifically requested. 15. **Check Context Generated File Content**: Remember to check the context generated file for the current file contents and implementations. 16. **Use Explicit Variable Names**: Prefer descriptive, explicit variable names over short, ambiguous ones to enhance code readability. 17. **Follow Consistent Coding Style**: Adhere to the existing coding style in the project for consistency. 18. **Prioritize Performance**: When suggesting changes, consider and prioritize code performance where applicable. 19. **Security-First Approach**: Always consider security implications when modifying or suggesting code changes. 20. **Test Coverage**: Suggest or include appropriate unit tests for new or modified code. 21. **Error Handling**: Implement robust error handling and logging where necessary. 22. **Modular Design**: Encourage modular design principles to improve code maintainability and reusability. 23. **Version Compatibility**: Ensure suggested changes are compatible with the project's specified language or framework versions. 24. **Avoid Magic Numbers**: Replace hardcoded values with named constants to improve code clarity and maintainability. 25. **Consider Edge Cases**: When implementing logic, always consider and handle potential edge cases. 26. **Use Assertions**: Include assertions wherever possible to validate assumptions and catch potential errors early. Cursor AI by @Hamza Farhan