Tips & Tricks
Master the art of AI-assisted development with proven strategies and best practices
These tips and tricks will help you work more effectively with AI coding assistants, avoid common pitfalls, and build better applications faster. From debugging strategies to choosing the right tools, these insights come from real-world experience building web applications with AI.
Debugging & Problem Solving
Smart strategies for debugging and overcoming obstacles in AI-assisted development.
1. Revert and Retry (Golden Rule)
When something goes wrong, don't keep asking AI to "fix it" repeatedly. Instead, revert your changes and update your original prompt with additional context about the issue you observed.
2. Investigate Root Causes
When you're stuck, ask the AI to investigate deeply: "Think and investigate where the problem is coming from," "look into all related files," and "don't assume you know the answer."
Anthropic tip: Use words like "think," "think hard," "think harder," or "ultrathink" to increase the token budget for reasoning.
3. Test APIs Separately
When an API or route.ts file isn't working, ask the AI to create a test script. Run the test until it's successful, then use those learnings to fix your actual implementation.
4. Strategic Logging
Ask the AI to add console logs strategically to pinpoint exactly where things are going wrong. This helps identify the root cause of issues quickly.
Effective Communication with AI
Learn how to structure prompts and provide context for better AI assistance.
5. Context Before Task
Structure your prompts with context at the beginning and the task request at the end. Paint a clear picture of the situation before asking for changes. Be descriptive yet concise.
💡 Research insight:
LLMs pay most attention to tokens at the start and end of prompts.
6. Use Reasoning Models for Planning
When uncertain about direction, switch to reasoning models and ask questions: "How would you approach this?" "What's the best way to...?" "What do you need from me to feel confident about building this?"
Research insight: Iterative Q&A reduces hallucinations and produces more precise output.
7. Speak the Language of LLMs
Use markdown files to communicate goals, tasks, and documentation. Store project requirements locally and have AI create product requirement documents and todo lists in markdown format.
Pro tools for converting content to markdown:
GitHub Repos
gitingest.com - Convert GitHub projects to markdown
Web Documentation
r.jina.ai or Firecrawl - Convert web docs to markdown
Production & Security
Ensure your application is secure and production-ready.
8. Context-Aware Security Reviews
Before production, ask AI to review your code for security issues and vulnerabilities. Always share your app's context and target scale.
💡 Context matters:
A fitness app for 1,000 users has different security needs than a financial app for 100,000 users. Be specific about your requirements.
Choosing the Right Tools
Know which models and platforms to use for different types of tasks.
9. Know Every Model's Strengths
Different models excel at different tasks. Test new models as they come out and make mental notes about when to use each one.
Current model examples:
o3
Planning, task breakdowns, debugging
Sonnet 4
Specific, precise execution tasks
10. Choose the Right Starting Platform
Research your project needs first, then pick the optimal starting point based on whether you're starting from scratch or working with existing code.
🔧 Existing Projects
- Cursor, Windsurf, VS Code, Claude Code
🚀 From Scratch
- Next.js projects: V0, Bolt
- Python projects: Replit
- Frontend projects: Lovable
11. Stay Adaptable
Stay open to experimenting with new tools that could make you 10x more efficient, but balance this with mastering your current workflow.
Smart Project Execution
Strategies for breaking down complex projects and executing them effectively.
12. Break Everything into Smaller Chunks
Instead of asking AI to build a complete app, break it down into smallest components. Ask for detailed architecture, component descriptions, and step-by-step task lists in markdown format.
💡 Example:
Don't ask for "a Linktree clone" - ask for component breakdown, architecture docs, and detailed sub-tasks.
13. Examples Beat Fine-tuning
When you know what you want, provide examples or code snippets for guaranteed performance improvement. This works for API docs, component functionality, code style, and response formats.
Research fact: Examples boost performance more than fine-tuning. One example is good, many examples are better.
14. Start with MVP, Then Iterate
Before starting, think about what the first version of your ideal product would look like. Start there and iterate toward the final outcome rather than asking AI to build the complete final product from the beginning.
💬 Giving Better Instructions to AI
You already know AI is powerful — but it needs clear direction. Here's how to get better results:
Best Practices
✅ Do This:
- Break your ideas down into bullet points
- Tag specific files or paths (e.g. `/app/page.tsx`, not "the homepage")
- Ask for comments inside the code and logs (to track what's happening)
- Be honest when something didn't work — say so
- Ask why something is done — not just what was changed
When AI Gets Stuck
If it's repeating mistakes, say:
Use these phrases:
- "Avoid previous assumptions. Study the related files and fix the actual issue."
- "Learn from previous attempts that didn't work and try a different approach."
- "Don't make assumptions about where the problem is. Carefully analyze the error."
Communication Tips
💡 Remember:
Don't assume the AI remembers everything. Be clear, be specific, and ask why something is done — not just what was changed.
🧯 What To Do When Something Breaks
Step-by-Step Debugging
- Copy the error from your browser or terminal
- Paste it into your AI — say: "What's causing this error? Here's the message."
- If it's not obvious where the issue is, tell AI: "Here's what I was doing before this broke."
- Ask it to: "Add console logs so we can see what's happening step-by-step."
- Still stuck? "Revert to last working version and try a different approach."
💡 Bonus tip:
Keep a "Last Working Version"
checkpoint in GitHub so you can always go back if needed.
🔄 Quick Rollback Prompt:
Use CLI to rollback to my last remote version. Revert my local files to match remote.
🚫 What Not To Touch
Sometimes curiosity leads to chaos. Here's what you should leave alone unless AI tells you otherwise:
🚫 Don't:
- Rename folders like
app
,components
, orlib
- Delete random files just to "clean things up"
- Change filenames from
page.tsx
orroute.ts
— that can break your app - Hard-code secret keys — always use
.env
- Move things around without asking where they should go
🤔 When in doubt:
Ask AI: "Is it safe to delete or rename this file?"
Key Takeaways
🔧 When You're Stuck
- Revert and retry with better context
- Ask AI to investigate root causes
- Test components separately
- Use strategic logging
🎯 For Better Results
- Be specific with AI, provide context & ask for explanations
- Provide context before tasks
- Use examples and markdown docs
- Break down complex projects
- Start simple, then iterate
- Always use .env files for secrets/keys & never expose API keys in your code
- Regularly commit to GitHub are your safety net (aka checkpoints)