The State of Vue.js Report 2025 is now available! Case studies, key trends and community insights.

Read now
AI Powered Coding Assistants: Best Practices to Boost Software Development with ai development

AI-Powered Coding Assistants: Best Practices to Boost Software Development

Maciej Korolik

AI-assisted software development tools rapidly transform software development, offering the potential to significantly enhance speed, developer comfort, and overall work quality. Platforms like GitHub Copilot and Cursor lead this revolution, providing sophisticated features for code generation and support throughout the software engineering lifecycle. These AI software development tools aim to bridge the gap between idea and execution, allowing developers to focus on problem-solving and collaboration.

However, integrating AI in programming within the Integrated Development Environment (IDE) presents challenges. Language models, even state-of-the-art ones like GPT-4o and Claude 3.7 Sonnet, can make mistakes. They might generate code that deviates from project standards or "hallucinate," producing non-existent API calls. Without clear context and expectations, AI might suggest misaligned solutions, leading to:

  • Additional rework.

  • Increased risk of errors.

  • A perception that AI is not a valuable asset.

Therefore, understanding how to use these AI programming tools effectively is crucial. This requires a shift from passively accepting AI-generated code to a collaborative approach where human expertise guides and refines the AI's output. Personalizing these tools through custom rules and adopting AI best practices is crucial to maximize benefits and mitigate risks. By tailoring AI assistants to specific project needs and coding standards, development teams can ensure more consistent, reliable, and high-quality code generation, ultimately leading to a more efficient and successful AI application development process.

Maximizing Performance with AI Coding Assistant: Cursor and GitHub Copilot

AI-powered coding assistants like Cursor and GitHub Copilot are becoming integral to many engineers' daily development workflows, including ours at Monterail. These tools offer a multitude of features designed to enhance productivity and streamline the coding process, augmenting, rather than replacing, developer expertise.

Key Capabilities of AI Coding Assistants

Real-time Code Completion and Suggestions

Both tools proactively suggest code snippets, variable names, and function completions as you type, reducing typing effort and time spent on repetitive code.

Image below: Example of Cursor’s code completion

AI coding assistant: Example of Cursor’s code completion

Generating Repetitive Code and Boilerplate

AI assistants automate routine tasks like creating React boilerplate or generating similar code structures. This allows developers to focus on more complex logic and is a massive gain in AI and software development.

Code Generation from Natural Language

By interpreting inline comments written in plain English, these tools can translate them into functional code. This accelerates the AI development process. 

Image below: Example of inline editing in Cursor

AI coding assistant: Example of inline editing in Cursor

Refactoring Existing Code

These tools assist in simplifying complex logic, improving readability, and modernizing legacy code. GitHub Copilot's chat interface allows you to highlight code and request improvements or refactoring suggestions.

Identifying, Debugging, and Correcting Syntax Errors
Real-time feedback and suggestions implicitly help avoid and correct syntax errors.

Explaining and Commenting Code
The chat interface can explain how a selected piece of code works, aiding in understanding unfamiliar sections. They can also generate comments, though well-written code should minimize the need for extensive commenting.

Generating Tests
GitHub Copilot is proficient in writing tests. While not explicitly detailed, Cursor's code generation capabilities likely extend to this domain. This is crucial for maintaining quality in AI in software development.

Chat-Based Assistance
Both GitHub Copilot and Cursor offer chat-based AI assistance, but their approaches to 'agents' differ.

  • GitHub Copilot features specialized agents within its chat, such as the workspace agent for local code and the GitHub agent for repository-related queries. It also allows for creating custom extensions, enabling more tailored functionalities.

  • Cursor features a more active 'agent' designed for direct coding assistance. This agent can not only answer questions but also write code and attempt to verify its correctness by running tests and building commands (in 'YOLO mode'). It can autonomously iterate to fix build errors. It’s possible to give the agent more context and knowledge for complex tasks, such as official documentation from some library. 

Image below: Example use of Agent in Cursor with a documentation link passed as additional context

Example use of Agent in Cursor with a documentation link passed as additional context

Custom Instructions/Rules for AI: A crucial feature.

  • GitHub Copilot: Provides "Custom Instructions" that are definable globally, per language, or at the repository level (using a .github/copilot-instructions.md file). These guide the AI on coding styles, library usage, and project-specific guidelines.

  • Cursor: Offers a more granular system with "Rules for AI." These can be defined globally or matched to specific file paths/types, providing fine-grained control over AI behavior in different parts of the codebase. This enables highly context-aware suggestions, ensuring adherence to varying coding standards.

Both tools recognize the importance of personalization for aligning the AI assistant with project requirements and conventions, leading to more effective and reliable AI-assisted software development.

Best Practices for AI-Assisted Coding with Cursor and GitHub Copilot

AI coding assistants like Cursor and GitHub Copilot transform how developers write, debug, and optimize code. These tools offer powerful automation, helping streamline repetitive tasks, generate boilerplate code, and provide insightful debugging suggestions. However, it's crucial to use them strategically to maximize their benefits—understanding their strengths, limitations, and best practices for effective collaboration in AI software development.

In this chapter, I have explored key principles for integrating AI-assisted coding into a workflow. From choosing the right tool to providing sufficient context, reviewing AI-generated code, and enforcing structured workflows, these best practices will help you work smarter, not harder. 

Understand Strengths and Weaknesses

To fully leverage AI coding assistants like Cursor and GitHub Copilot, it's essential to understand their strengths and limitations. These tools excel at tasks such as writing repetitive code, generating boilerplate for React components, or helping debug and correct syntax. They can also be invaluable for explaining and commenting on code and even generating regular expressions. 

For more complex tasks, AI can assist with leveraging AI for complex refactoring tasks and even act as a "pair programmer" for problem-solving by suggesting different approaches. However, it's crucial to remember their limitations. AI might struggle with understanding the broader strategic context or the reasoning behind certain architectural decisions. It's unlikely to generate perfect, bug-free code consistently and might miss necessary edge case handling. Therefore, a balanced perspective is key.

Choose the Right Tool

The landscape of AI-assisted coding tools is constantly evolving, with various options available. It's essential to recognize that these tools are not one-size-fits-all. Each tool has a distinct approach, differing in how they integrate with multiple AI programming languages and technologies and how they fit into your development workflow. The way you interact with one tool might be significantly different from another. Therefore, selecting the right AI assistant is a crucial step. 

Carefully consider your project's specific needs, the technologies you're using, and your personal preferences. The goal is to find a tool that enhances your productivity and complements your skills rather than creating additional frustration or complexity. Experimentation and evaluation are key to determining which AI coding assistant best empowers you and your team.

Provide Sufficient Context

AI in programming thrives on context. Without a clear understanding of the task, project standards, and your expectations, the AI might suggest code that doesn't align with your needs. Before prompting the AI, ensure you've provided enough information. This could include:

  • Clearly stating the problem you're trying to solve.

  • Highlighting relevant code snippets or files within your project.

  • Specifying the programming language, frameworks, and libraries you're using.

  • Outlining specific constraints or requirements, such as performance considerations or adherence to particular design patterns.

For example, instead of simply asking Cursor to "write a function to fetch user data," provide context like "Write a Python function using the Flask framework to fetch user data from the 'users' table in our PostgreSQL database. The function should accept a 'user_id' as input and return a JSON response containing the user's name and email."

Review and Test AI-Generated Code

Never treat AI-generated code as the final product. Thorough human review is essential to catch errors, ensure the code meets your project's quality standards, and that it doesn't introduce security vulnerabilities. Remember, all AI tools can introduce bugs.

Furthermore, testing is paramount. Write unit tests, integration tests, and even manual validation where necessary to ensure the AI-generated code functions correctly and handles various scenarios, including edge cases. As Steve (Builder.io) suggests, for complex tasks, instruct the AI to "write tests first, then the code, then run the tests and update the code until tests pass." This can significantly increase your confidence in the AI's output.

Provide Feedback

AI coding assistants learn and improve based on the feedback they receive. Make it a habit to provide feedback on the suggestions and code generated by the AI.

  • In GitHub Copilot, use the thumbs up and thumbs down icons to indicate whether a suggestion was helpful.

  • If the AI goes off track in Cursor, don't hesitate to stop it and rephrase your prompt.

  • Clearly articulate what you liked or disliked about the generated code and why.

This feedback loop helps the AI better understand your preferences and project requirements over time, leading to more relevant and helpful suggestions in the future.

Treat Your AI Assistant as a Teammate

Shift your mindset from viewing Cursor (or any AI assistant) as a magic code generator to treating it as a collaborative team member. Just as you wouldn't expect a new human team member to write perfect code without guidance, don't expect the AI to do so.

Engage in a structured collaboration. Start with clear problem statements and requirements, discuss potential designs with the AI, break down implementation into manageable phases, and maintain regular validation against requirements. Force the AI to use the context of previous steps to keep it aligned with your agreed-upon direction.

Enforce an Opinionated Workflow

Establishing a clear and consistent workflow for interacting with your AI coding assistant can significantly improve its effectiveness. Consider adopting a structured approach, such as Skylar Payne's four-phase workflow: Problem Statement & Requirements, Design Documentation, Phased Implementation, and Continuous Testing.

Define clear "rules of engagement" for the AI. For instance, you might instruct it to always generate type hints and docstrings, follow a specific coding style, or use particular testing frameworks. This enforced workflow helps guide the AI's output and ensures greater consistency with your project standards.

Document Everything

Even with the assistance of AI software development tools, thorough documentation remains crucial. Document the requirements, design decisions, and the code, including any AI-generated portions. This ensures that you, your team, and even the AI clearly understand the project's architecture and logic in future interactions.

Encourage the AI to generate comments for complex logic and keep your README files up-to-date. Consider creating structured design documents for more complicated features, possibly even with the AI's assistance.

Leverage Personalization

A key advantage of modern artificial intelligence software development is personalization. AI coding assistants can be tailored to match your specific coding style, project requirements, and workflow preferences. Take the time to configure "Rules for AI" in Cursor or "Custom Instructions" in GitHub Copilot to align the AI's behavior with your project's specific needs and your personal coding preferences. Examples of personalization include:

  • Specifying preferred coding styles (e.g., variable naming conventions, use of specific language features).

  • Defining how tests should be created and which testing frameworks to use.

  • Instructing the AI to use specific libraries or avoid others.

  • Setting guidelines for code commenting.

Image below: An example file with Cursor rules

AI powered software development: An example file with Cursor rules

Use Cursor's YOLO Mode Wisely

Cursor's "YOLO mode" can be a powerful feature for automating specific AI development tasks. However, as the name implies, it should be used with caution and very specific instructions.

Enable YOLO mode when you want Cursor to autonomously execute commands, such as running your build process (e.g., TSC) and automatically fixing any errors until the build passes. You can also instruct it to run tests and iterate on the code until all tests succeed,  making it a useful tool in AI application development.

The key is to provide a clear allow list of commands that Cursor can run and potentially a deny list of commands it should never execute. By setting these boundaries, you can leverage the automation capabilities of YOLO mode while mitigating potential risks in AI and software development.


Image below: YOLO mode settings in Cursor

AI assisted software development: YOLO mode settings in Cursor

Be Mindful of Overfitting and Ethics

When personalizing your AI assistant, consider the risk of overfitting your existing codebase. While guiding the AI to follow your project's style is helpful, blindly replicating existing patterns might perpetuate bad practices or hinder innovation in AI programming.

Additionally, be aware of the ethical considerations surrounding AI in software development. Understand the potential biases in the AI models and programming languages and ensure that these tools align with ethical principles and regulatory compliance. Responsible artificial intelligence programming is key to fairness and transparency in AI-powered solutions.

Experiment and Adapt

The field of AI-assisted software development is rapidly evolving. Don't be afraid to experiment with different prompting techniques, tool features, and workflows. Continuously evaluate what works best for you and your team, and be prepared to adapt your strategies as AI development advances. Share your learnings and best practices with your colleagues to foster a culture of effective AI collaboration.

Common Pitfalls of AI-Generated Code and How to Navigate Them

AI coding assistants can significantly accelerate development, but relying on them without caution can lead to unpleasant surprises. From over-reliance on AI-generated code to issues like lack of context and hidden bugs, these challenges can impact code quality and maintainability. I’ve covered the most common mistakes developers make when using AI- for programming and provided practical strategies for navigating them.

Over-Reliance on AI-Generated Code

A significant pitfall is blindly accepting AI-generated code without proper understanding or review. This can lead to the accumulation of technical debt, the introduction of subtle bugs or security vulnerabilities, and a lack of developers' ownership and understanding of the codebase. Remember, AI software development tools are designed to assist, not to replace, your critical thinking and engineering expertise.

Lack of Context

Failing to provide sufficient and clear context is a common cause of frustration when using AI coding assistants. If the AI doesn't understand the problem you're trying to solve, the existing codebase, or your specific requirements, it's likely to generate irrelevant or incorrect code. Always take the time to provide the necessary background information before prompting the AI. For example, simply asking "write a function" without specifying the language, purpose, or context will likely yield a generic and unhelpful result.

The "70% Problem"

As Addy Osmani highlights, while AI can dramatically accelerate the initial stages of development, often reaching around 70% completion quickly, the remaining 30% – which includes thorough refactoring, comprehensive error handling, robust testing, and detailed documentation – still requires significant engineering effort and expertise. Failing to recognize this "70% problem" can lead to a false sense of progress and result in poorly maintainable and unreliable software.

AI-Introduced Bugs

Despite their sophistication, AI programming languages are not infallible and can introduce bugs, logical errors, or security vulnerabilities into your code. These issues might not be immediately apparent and can be more challenging to track down later. This underscores the critical importance of AI best practices, including rigorous code review and comprehensive testing of all AI-generated code.

Frustration from Misunderstandings

Treating AI coding assistants as perfect, sentient beings rather than as tools with specific strengths and weaknesses can lead to frustration. Misunderstandings can arise from unclear prompting, unrealistic expectations of the AI's capabilities, or a failure to recognize when the AI has gone off track. AI software development tools are not perfect solutions. Remember that effective collaboration with AI requires clear communication, iterative refinement, and a willingness to guide the AI toward the desired outcome.

Strategies for Smarter AI-Assisted Development

Integrating Cursor and GitHub Copilot into your software development workflows requires a strategic mindset that embraces collaboration and critical evaluation. The key AI best practices for empowering your team with these intelligent coding assistants can be summarised as follows:

  • Understand tool strengths and limitations.

  • Provide clear and comprehensive context.

  • Adopt a structured workflow and best practices.

  • Treat AI assistants as collaborators.

  • Critically review and test all AI-generated code.

  • Leverage personalization features.

  • Provide feedback to improve future suggestions.

  • Stay informed about new features and updates.

  • Be aware of and mitigate common pitfalls.

Ultimately, Cursor and GitHub Copilot are powerful aids that augment the expertise of skilled developers. They are not replacements for the critical thinking, problem-solving abilities, and deep contextual understanding experienced engineers bring to software development. 

By encouraging your team to adopt these tools responsibly, continuously refine their prompting and review techniques, and embrace a collaborative approach, you can achieve higher productivity, improved code quality, and a more efficient and potentially more enjoyable AI development experience. The future of artificial intelligence programming increasingly involves a synergistic partnership between human ingenuity and AI, and mastering this collaboration is key to building better software.


Maciej Korolik
Maciej Korolik
Senior Frontend Developer and AI Expert at Monterail
Maciej is a Senior Frontend Developer and AI Expert at Monterail, specializing in React.js and Next.js. Passionate about AI-driven development, he leads AI initiatives by implementing advanced solutions, educating teams, and helping clients integrate AI technologies into their products. With hands-on experience in generative AI tools, Maciej bridges the gap between innovation and practical application in modern software development.