Over the past several months, I’ve worked extensively with a variety of AI coding assistants — including GitHub Copilot, ChatGPT, Gemini, Grok, and Cursor. While each of these tools has its strengths, this article walks through key concepts and workflows using Cursor as the main example. The ideas discussed — like prompt structuring, automation, and rule-based assistance — are applicable across most AI development tools.
Let’s dive into the practical, from beginner to advanced.
1. Ask Mode — A Conversational Debugging and Learning Tool
Cursor’s Ask mode is more than just a help feature — it’s a powerful way to gain insight into your code without triggering unwanted edits. Instead of auto-generating changes, Ask mode allows you to explore ideas, understand existing logic, and seek suggestions in a conversational format.
For example, I uploaded a utility method involving a sorting algorithm that a teammate had written. I wanted a breakdown of its logic, so I prompted:
“Can you walk me through what this sorting method does step-by-step?”
It’s an excellent learning and debugging tool — ideal when you want insight before implementation.
Cursor also excels in autocompletion and code suggestions. As you type, the AI predicts and suggests code snippets, functions, and variables. These suggestions are context-aware, meaning they consider your project’s structure and dependencies for greater accuracy and speed.
2. Rules — Programming the AI to Match Your Intentions
Cursor’s Rules feature is where the tool really begins to feel like a teammate.
You can define custom rules to shape how Cursor behaves across projects. For example:
- Always use
ILogger<T>
instead ofConsole.WriteLine
- Follow a consistent folder structure
- Use naming conventions like
XyzService
for service classes
These rules are stored and enforced across sessions. It’s like giving Cursor a style guide and expecting it to follow it every time.
Instead of just asking for “clean code,” you’re programming the AI to follow your team’s conventions.
For more inspiration and examples, check out: awesome-cursorrules
3. Starting with aFile – Building Context from the Ground Up
AI tools are only as smart as the context they’re given. Cursor allows you to use .md
files to preload relevant project knowledge. These files serve as long-term context documents for the AI to read before responding to prompts.
Use cases include:
- Explaining architecture
- Listing key domain entities
- Defining coding standards
- Describing APIs and workflows
How Files Help with AI Coding:
- Persistent Context: Project rules, architecture, and goals defined once in a
.md
file are remembered across sessions—so you don’t have to repeat them. - Contextual Anchoring: You can reference sections within the file directly in your prompts: “Refactor this based on the structure in the
Architecture
section." - Reasoning Trail: You can log trade-offs and previous decisions in the file for Cursor to use during future interactions.
.md
files are especially helpful when working on long-term projects or collaborating asynchronously with teammates.
4. Start a New Chat — For Cleaner AI Responses
In Cursor, starting a new chat with a file often gives better results than continuing an older thread. Each new chat begins with a clean context, avoiding the confusion of prior prompt history.
Whenever I noticed responses becoming inconsistent or off-track, starting fresh typically brought clarity and focus.
This habit becomes especially useful when switching between features or troubleshooting multiple bugs.
⚠️ A Note on External Edits
If you’re using Cursor alongside another IDE — like Visual Studio, which I often do — make sure to notify Cursor when files are modified outside the app. Cursor doesn’t automatically detect external changes, and this can lead to incorrect or outdated suggestions if it’s referencing an older file state.
To stay accurate, you can reload or re-open the file within Cursor to sync changes before prompting.
5. Integrating with MCP (Model Context Protocol)
The Model Context Protocol (MCP) is an open standard that allows Cursor to interact with external tools and data sources like databases, Notion, GitHub.
You can configure an MCP server that Cursor queries for:
- Database schema
- Documentation from APIs or tools
- Access to memory systems or CI/CD triggers
Note: This is a more advanced feature. It requires setting up a server that speaks the MCP protocol, so it’s better suited for experienced developers or teams with infrastructure experience.
Example Use Case:
Let’s say you’re building a C# app and want to generate a data model class from a production database’s Users
table.
After setting up an MCP server to expose the schema, you can prompt:
“Generate a C# data model class based on the Users
table in the database."
Cursor might return:
public class User
{
public int Id { get; set; }
public string Username { get; set; }
public string Email { get; set; }
public DateTime CreatedAt { get; set; }
}
⚠️ Security Note:
Connecting Cursor to production data may introduce risks. Instead:
- Expose schema only — not real data
- Use read-only service accounts
- Authenticate and secure your MCP endpoints
MCP is incredibly powerful when used wisely — it brings live project context into the AI’s reach.
6. Generating UI from Uploaded Images
Another exciting feature in Cursor is the ability to generate UI code from images. Whether it’s a wireframe, screenshot, or mockup, you can upload the design and prompt Cursor to create a matching interface.
Example Workflow:
You upload an image of a login form and prompt:
“Generate a responsive login form in HTML and Tailwind based on this image.”
Cursor returns:
<div class="login-form">
<label>Username</label>
<input type="text" />
<label>Password</label>
<input type="password" />
<button type="submit">Login</button>
</div>
You can even prompt further for style changes:
“Make the buttons rounded and use primary theme colors.”
Cursor updates the code accordingly, often reflecting colors, padding, or font styles from the image if they’re clear enough.
This is incredibly useful for prototyping UIs quickly or aligning frontend implementation with designer-provided visuals.
7. Final Thoughts — Maintaining Control While Using AI
AI tools like Cursor can supercharge your productivity — but it’s crucial not to lose control of your codebase.
If you start blindly accepting AI suggestions and merging code without review, you risk building systems you don’t fully understand. When issues arise later, it becomes hard to debug or extend unfamiliar logic.
So here’s a rule I follow:
- Always review the code
- Understand what it’s doing and why
- Commit only when you’re confident it’s correct
If you’re a junior developer or new to certain concepts, make sure you understand the AI-generated code — and ask a senior developer to review it before merging. AI should help you learn and deliver faster, not become a crutch.
Treat AI as an assistant, not a replacement for critical thinking.