AI Best Practices
Effective Prompting
Section titled “Effective Prompting”Be Specific
Section titled “Be Specific”# Bad"Fix this code"
# Good"This React component re-renders too often.How can I optimize it using useMemo and useCallback?"Provide Context
Section titled “Provide Context”# Bad"How do I handle errors?"
# Good"In this Express.js API endpoint, how should I handledatabase connection errors and return appropriate HTTP status codes?"Iterate and Refine
Section titled “Iterate and Refine”1. "What's the best way to implement caching?"2. "For a Node.js API with Redis, what strategies work best?"3. "Show me cache invalidation for user data updates"Code Quality
Section titled “Code Quality”Use AI for Reviews
Section titled “Use AI for Reviews”<leader>ar # Before committing# Address suggestions before commitValidate AI Suggestions
Section titled “Validate AI Suggestions”Security Considerations
Section titled “Security Considerations”Review AI-Generated Code
Section titled “Review AI-Generated Code”<leader>ar # AI security review# Check for:# - Input validation# - SQL injection prevention# - Authentication checksDon’t Share Sensitive Data
Section titled “Don’t Share Sensitive Data”# Bad: Paste actual API keys# Good: Use placeholders like "API_KEY"Troubleshooting
Section titled “Troubleshooting”AI Not Responding
Section titled “AI Not Responding”# Check API keysecho $GEMINI_API_KEY
# Test connectivitycurl -I https://generativelanguage.googleapis.comRate Limiting
Section titled “Rate Limiting”- Reduce request frequency
- Use different AI tools alternately
- Consider upgrading API plans
Slow Responses
Section titled “Slow Responses”- Be more specific in prompts
- Reduce context size
- Use shorter code snippets
Productivity Tips
Section titled “Productivity Tips”Keyboard Shortcuts Mastery
Section titled “Keyboard Shortcuts Mastery”<leader>ac # Quick AI chat<leader>aa # AI actions menu<leader>ar # Code review<leader>af # Quick fixesContext Switching
Section titled “Context Switching”- Supermaven: Real-time coding
- CodeCompanion: Complex problems
- Database AI: SQL queries
Learning from AI
Section titled “Learning from AI”"Why did you suggest this approach?""What are the trade-offs?""Are there alternative approaches?"Daily AI Habits
Section titled “Daily AI Habits”- Morning: Plan features with AI
- Coding: Use completion tools
- Review: AI code review
- Evening: Document with AI help