Tips for AI-Assisted Development
AI is a powerful tool, but like any tool, you get better results when you know how to use it well. This page collects practical advice from real-world experience with AI-assisted Nette development.
- How to write prompts that get better results
- Making the most of MCP Inspector
- Proven workflows for common tasks
- Mistakes to avoid
Writing Better Prompts
The Art of Being Specific
The single biggest improvement you can make is being specific. Compare these two prompts:
Vague prompt:
Create a form
This gives the AI almost no context. What form? What fields? What validation? The AI has to make assumptions, and those assumptions might not match what you need.
Specific prompt:
Create a ProductForm with:
- name: text field, required, max 100 characters
- price: float field, required, must be positive
- description: textarea, optional
- category: select from CategoryRow entities
Use Bootstrap 5 rendering. The form should work for both creating new products and editing existing ones.
Now the AI knows exactly what you need and can generate code that works on the first try.
Point to Existing Patterns
Your codebase already has patterns. Instead of explaining them, point the AI to examples:
Create an OrderPresenter. Follow the same patterns as ProductPresenter –
same structure, same way of handling forms, same template organization.
The AI will read ProductPresenter and replicate the patterns you're already using.
Let MCP Do the Heavy Lifting
If you have MCP Inspector installed (and you should!), don't explain your application – let the AI discover it:
Instead of:
My product table has columns: id (int), name (varchar), price (decimal),
category_id (int, foreign key to category), created_at (datetime)...
Just say:
Generate an entity for the product table.
The AI will call db_get_columns("product") and see the actual schema. The generated entity will match your real
database, including any columns you might have forgotten to mention.
Give Context About Your Goals
AI can't read your mind. If there's a reason behind your request, share it:
I need to optimize the product listing page. It's currently loading
all products at once, which is slow when there are thousands of items.
The page needs to support filtering by category and sorting by price or name.
This helps the AI suggest an appropriate solution (pagination, lazy loading, caching) rather than just blindly implementing what you asked for.
Working with MCP Inspector
MCP Inspector is most powerful when you use it strategically.
Explore Before You Build
Starting a new feature? Let the AI understand the context first:
I'm going to add order tracking. Before we start:
1. What services do I have related to orders?
2. What does my order table look like?
3. What routes handle order-related pages?
This gives the AI context about your existing code, so the new feature fits naturally.
Debug Smarter
When something goes wrong, don't describe the error – let the AI see it:
Something broke. Check the Tracy log for the last exception
and tell me what went wrong.
The AI will call tracy_get_last_exception(), read the stack trace, and can often identify the problem faster than
you could explain it.
Verify Before You Create
Before adding new routes or links, verify what exists:
What presenter handles /admin/products/edit? I want to make sure
I'm not creating something that conflicts.
Common Workflows
Here are proven approaches for common tasks.
Creating a Complete CRUD
Don't ask for one piece at a time. Give the AI the full picture:
Create a complete CRUD for managing products:
1. ProductPresenter with actions: list, add, edit, delete
2. ProductForm as a component (works for both add and edit)
3. Latte templates for all actions
4. Route suggestions
Use the actual product table schema. Follow the patterns
in CategoryPresenter if it exists.
Adding a New Feature
Break it down into phases that build on each other:
I need to add customer reviews to products.
Phase 1 - Data layer:
- Look at the product table
- Suggest the review table schema
- Create ReviewRow entity
Phase 2 - Business logic:
- Create ReviewService for CRUD operations
- Add methods to get reviews for a product
Phase 3 - UI:
- Add review display to ProductPresenter:detail
- Create ReviewForm for submitting reviews
Refactoring Existing Code
Let the AI understand before it changes:
Analyze the OrderService class. What does each method do?
Are there any code smells or improvements you'd suggest?
Then:
The calculateTotal method is doing too much. Split it into
smaller methods while keeping the same public interface.
Mistakes to Avoid
Not Reviewing Generated Code
AI generates code quickly, but that doesn't mean every line is perfect. Always review:
- Database queries – Are they efficient? Do they need indexes?
- Security – Is input validated? Are there authorization checks?
- Edge cases – What happens with empty data? Null values?
AI is very good, but it's still an assistant. You're the developer responsible for the final code.
Ignoring Validation Feedback
If you're using the Claude Code plugin, it validates your Latte templates and NEON files automatically. When it reports an error, the AI knows about it. Instead of manually fixing the error, just say:
Fix the error you just created.
The AI will read the validation output and correct the mistake.
Forgetting Service Registration
When the AI creates a new service class, it sometimes forgets to register it in the DI container. If you get “Service not found” errors, ask:
What changes do I need in services.neon for the new OrderExportService?
Asking for Too Much at Once
While AI can handle complex tasks, sometimes it helps to break them down:
Too ambitious:
Build me a complete e-commerce system with product catalog,
shopping cart, checkout, payments, order tracking, and admin panel.
Better approach:
Let's build an e-commerce system step by step. Start with the product
catalog – I need to list, view, and admin products.
When AI Excels (and When It Doesn't)
AI is Great For
- Boilerplate code – Presenters, forms, entities, basic templates
- Following patterns – “Do it like X but for Y”
- Understanding code – “What does this method do?”
- Generating tests – Given implementation, create tests
- Refactoring – Improving code structure while keeping behavior
Consider Manual Coding For
- Complex business logic – Domain rules that require careful thinking
- Performance-critical code – Algorithms that need optimization
- Security-sensitive code – Authentication, authorization, encryption
- Novel solutions – Things that don't follow existing patterns
AI is a multiplier, not a replacement. It makes good developers faster, but it still needs a good developer guiding it.
Final Thoughts
The best way to learn AI-assisted development is to practice. Start with simple tasks, pay attention to what works, and gradually take on more complex projects.
And remember: the AI is your assistant. You're still the developer. You make the decisions, you review the code, and you're responsible for the quality of the final product.
Happy coding!