Compare
1. Code Generation Prompts
CodeVista vs GitHub Copilot
CodeVista:
/explain @function:userAuthentication
/fix @selected_code
/web_search "best practices for authentication"
Copilot:
// Generate a function that [description]
// Write a test for this function
// Fix this error: [error message]
Cursor.so Style
Cursor:
/edit "refactor this to use async/await"
/chat "explain this code"
/generate "create a new API endpoint"
Equivalent CodeVista:
/fix "convert @selected_code to async/await"
/explain @selected_code
/explain "design REST API endpoint for @class:UserController"
2. Advanced Use Cases by Tool
CodeVista Advanced Prompts
1. Architecture Design:
/explain "Suggest microservices architecture for @current_file"
/fix "Apply CQRS pattern to @class:OrderService"
1. Performance Optimization:
/fix "Optimize database queries in @selected_code"
/explain "Suggest caching strategy for @function:getData"
1. Security Enhancement:
/web_search "security best practices for JWT"
/fix "Add input validation to @selected_code"
Claude-Style Prompts (Adaptable to CodeVista)
1. Code Analysis:
"Analyze the time complexity of @function:sortAlgorithm"
"Review @selected_code for potential memory leaks"
1. Architecture Review:
"Review the design patterns used in @class:ServiceLayer"
"Suggest improvements for the current architecture in @current_file"
1. Testing Strategy:
"Generate comprehensive test cases for @class:PaymentProcessor"
"Suggest integration test scenarios for @selected_code"
3. Task-Specific Actions
Code Refactoring
CodeVista:
/fix "Convert to TypeScript: @selected_code"
/explain "Suggest better error handling for @function:processData"
Best Practice:
1. Start with code context upload
2. Use specific function/class references
3. Apply changes incrementally
4. Review in Refactor Preview
Testing Generation
Unit Tests:
/explain "Generate unit tests with Jest for @function:validateUser"
/fix "Add test coverage for edge cases in @selected_code"
Integration Tests:
/explain "Create integration tests for @class:OrderService"
/fix "Add API testing scenarios for @selected_code"
4. Language-Specific Prompts
JavaScript/TypeScript
1. Modern JS Features:
/fix "Convert to ES6+ syntax: @selected_code"
/explain "Implement async/await in @function:fetchData"
1. Type Safety:
/fix "Add TypeScript types to @class:UserService"
/explain "Suggest type improvements for @selected_code"
Python
1. Python Modernization:
/fix "Convert to Python 3.10+ features: @selected_code"
/explain "Implement type hints in @function:process_data"
1. Performance:
/fix "Optimize list comprehension in @selected_code"
/explain "Suggest async implementation for @function:fetch_data"
5. Context-Aware Commands
Project-Wide Analysis
1. Architecture Review:
/explain "Analyze dependency structure in @current_file"
/web_search "microservices best practices for current architecture"
1. Performance Audit:
/fix "Identify performance bottlenecks in @class:DataProcessor"
/explain "Suggest caching strategy for @selected_code"
Security Review
1. Vulnerability Check:
/fix "Check for SQL injection in @selected_code"
/explain "Review security of @class:AuthenticationService"
1. Security Improvements:
/fix "Implement input sanitization in @function:processUserInput"
/explain "Suggest OWASP top 10 mitigations for @selected_code"
6. AI Model-Specific Strengths
GPT-4 Style (Assumed CodeVista Base)
1. Complex Reasoning:
/explain "Analyze trade-offs in current architecture"
/fix "Suggest design patterns for scalability"
1. Detailed Explanations:
/explain "Deep dive into @function:complexAlgorithm"
/web_search "Compare different approaches for implementation"
Claude-Style Adaptations
1. Safety and Validation:
/fix "Add input validation and error handling to @selected_code"
/explain "Suggest defensive programming patterns"
1. Documentation:
/explain "Generate comprehensive documentation for @class:CoreService"
/fix "Add JSDoc comments to @selected_code"
7. Best Practices for Prompting
Structure
1. Be Specific:
❌ "Fix this code"
✅ "Fix the memory leak in @function:processLargeData"
1. Provide Context:
❌ "Optimize this"
✅ "Optimize database queries in @class:UserRepository for high traffic"
Progressive Refinement
1. Start Broad:
/explain "Overview of @class:PaymentService"
1. Drill Down:
/fix "Optimize payment processing in @function:processPayment"
1. Specific Improvements:
/fix "Add retry mechanism for failed transactions"
Combining Tools
1. Analysis:
/web_search "Current best practices"
/explain "Analyze current implementation"
1. Implementation:
/fix "Apply suggested improvements"
/explain "Verify changes and potential impacts"
This comprehensive guide shows how to leverage CodeVista’s capabilities effectively while incorporating best practices from other AI coding assistants. The key is to be specific, provide context, and use the appropriate command for each task.
Sample Prompts
Here are more than 100 sample prompts for CodeVista, categorized into various use cases based on the features and capabilities outlined in the uploaded document. These prompts are designed to help developers maximize their use of CodeVista.
1. Code Explanation Prompts
- Explain the purpose of @function:getUserData.
- What does this code do? @selected_code.
- Explain the logic of the @class:OrderProcessor class.
- Explain the difference between
let
andvar
in JavaScript. - Explain why this SQL query is slow: @selected_code.
- Explain the algorithm used in @function:sortArray.
- What is the time complexity of this function? @selected_code.
- Explain the purpose of @current_file.
- Explain the usage of recursion in @function:calculateFactorial.
- What does this regular expression do?
/[a-z]{3,}/
.
2. Code Fixing Prompts
- Fix this code: @selected_code.
- Fix the syntax error in @function:fetchData.
- Fix the performance bottleneck in @class:DataProcessor.
- Fix the null pointer exception in @selected_code.
- Fix this error: “TypeError: undefined is not a function” in @current_file.
- Fix the security vulnerability in @function:processPayment.
- Fix the memory leak in @function:handleLargeData.
- Fix the deprecated API usage in @selected_code.
- Fix the SQL injection vulnerability in @function:getUserInput.
- Fix the infinite loop in @selected_code.
3. Code Autocompletion Prompts
- Autocomplete this function: @selected_code.
- Suggest a completion for @function:calculateTax.
- Complete this SQL query:
SELECT * FROM users WHERE
. - Complete the React component for a login form.
- Complete the missing logic in @function:processOrder.
- Suggest autocompletion for this Python script: @current_file.
- Complete the function to fetch data from an API.
- Provide a completion for this HTML form:
<form>
. - Autocomplete the CSS for a responsive grid layout.
- Suggest autocompletion for the @class:UserController class.
4. Unit Testing Prompts
- Generate unit tests for @function:validateUserInput.
- Write Jest tests for @class:OrderProcessor.
- Generate test cases for edge scenarios in @function:calculateDiscount.
- Write a unit test for this code: @selected_code.
- Create a test suite for @current_file.
- Generate test cases for input validation in @function:processData.
- Write a test for the @function:fetchUserData function with mock API calls.
- Generate unit tests for @class:PaymentService.
- Write test cases for this function: @selected_code.
- Generate test cases for invalid inputs in @function:calculateFactorial.
5. Refactoring Prompts
- Refactor this code to use async/await: @selected_code.
- Refactor @function:processData to improve readability.
- Refactor @class:UserManager to follow the SOLID principles.
- Refactor this legacy code to use ES6+ syntax: @current_file.
- Refactor @function:fetchOrders to reduce time complexity.
- Refactor the nested if-else blocks in @selected_code.
- Refactor @function:calculateTotal to use a functional programming approach.
- Refactor this code to use dependency injection: @selected_code.
- Refactor @class:OrderService to split responsibilities into smaller classes.
- Refactor this code to improve maintainability: @current_file.
6. Performance Optimization Prompts
- Optimize the performance of @function:fetchData.
- Suggest caching strategies for @function:getUserDetails.
- Optimize this SQL query: @selected_code.
- Improve the performance of @class:DataProcessor.
- Optimize the API response time of @function:getOrders.
- Reduce the time complexity of @function:sortArray.
- Optimize @function:processLargeDataset for memory usage.
- Suggest performance improvements for @class:OrderManager.
- Optimize the database schema in @current_file.
- Improve the load time of this web page: @selected_code.
7. Security Enhancement Prompts
- Add input validation to @function:processUserInput.
- Check for SQL injection vulnerabilities in @selected_code.
- Implement CSRF protection in @current_file.
- Add encryption for sensitive data in @class:UserService.
- Suggest security improvements for @function:loginUser.
- Check for XSS vulnerabilities in @function:renderHTML.
- Add JWT validation to @function:verifyToken.
- Enhance the security of @class:PaymentGateway.
- Add rate limiting to @function:handleRequests.
- Check for potential vulnerabilities in @current_file.
8. Documentation Prompts
- Generate JSDoc comments for @function:processOrder.
- Add docstrings to all functions in @current_file.
- Create API documentation for @class:OrderService.
- Write a README file for this project.
- Generate comments explaining @function:calculateTax.
- Document the parameters and return values of @function:fetchUserData.
- Create a UML diagram for @class:UserManager.
- Write a high-level overview of the system architecture in @current_file.
- Generate inline comments for @selected_code.
- Document the dependencies and setup instructions for this project.
9. Architecture Design Prompts
- Suggest a microservices architecture for this project.
- Design a database schema for an e-commerce platform.
- Create an event-driven architecture for @class:OrderProcessor.
- Suggest design patterns for building a scalable API.
- Propose a CQRS pattern implementation for this system.
- Design a caching strategy for @function:getFrequentlyAccessedData.
- Create a high-level architecture diagram for @current_file.
- Suggest improvements to the current monolithic architecture.
- Propose a message queue system for asynchronous processing.
- Design a multi-tenant database schema for this SaaS platform.
10. Frontend Development Prompts
- Create a responsive navigation bar using Tailwind CSS.
- Generate a React component for a product card.
- Write a function to handle form validation in Vue.js.
- Create a dynamic table component with sorting and filtering.
- Generate a CSS animation for a loading spinner.
- Write a function to toggle dark mode in a React app.
- Create a reusable modal component in Angular.
- Write a function to fetch and display data in a Next.js app.
- Generate a carousel component for displaying images.
- Create a dropdown menu with multi-select functionality.
11. Backend Development Prompts
- Write an Express middleware to log API requests.
- Generate a Flask route to handle file uploads.
- Create a GraphQL resolver for fetching user data.
- Write a function to send emails using Node.js.
- Generate a Django model for a blog post.
- Write a function to handle WebSocket connections.
- Create a REST API endpoint to fetch order details.
- Write a function to process payments using Stripe.
- Generate a Spring Boot service for managing users.
- Write a function to hash passwords using bcrypt.
12. DevOps Prompts
- Write a Dockerfile for this Node.js application.
- Generate a Kubernetes deployment file for this service.
- Create a CI/CD pipeline using GitHub Actions.
- Write a script to automate database backups.
- Generate a Terraform configuration for provisioning AWS resources.
- Write a Helm chart for deploying this application.
- Create a monitoring dashboard using Prometheus.
- Generate a script to clean up unused Docker images.
- Write a function to rotate AWS access keys automatically.
- Create a load testing script using Apache JMeter.
13. Miscellaneous Prompts
- Write a script to automate file renaming.
- Generate a function to calculate the Levenshtein distance between two strings.
- Create a chatbot using Python and Flask.
- Write a script to parse and extract data from a PDF file.
- Generate a function to implement a binary search algorithm.
- Create a script to download files from an FTP server.
- Write a function to convert JSON data to CSV format.
- Generate a script to monitor system resource usage.
- Write a function to compress and decompress files.
- Create a script to schedule tasks using cron jobs.
14. Advanced Prompts
- Generate a function to perform sentiment analysis using Hugging Face.
- Write a script to scrape and analyze stock market data.
- Create a function to cluster data using K-means.
- Generate a script to forecast time series data.
- Write a Python function to clean a dataset.
- Generate a SQL query to analyze sales data.
- Write a function to preprocess text data for NLP tasks.
- Create a script to train a machine learning model using scikit-learn.
- Write a function to visualize data using Matplotlib.
- Generate a function to calculate the correlation matrix of a dataset.
15. Additional Prompts
These include variations of the above prompts tailored for specific programming languages, frameworks, or tools. Examples:
- Refactor this Python script to improve readability.
- Generate a test case for this Java code: @selected_code.
- Write a function to implement OAuth2 authentication in @current_file.
- Create a CI/CD pipeline for deploying a React app.
- Suggest improvements to the GraphQL schema in @current_file.
Let me know if you’d like more prompts in a specific category or tailored for a particular use case!