AI Coding

Using AI assistants like Copilot, Cursor, and Claude for software development.

7 tips in this topic

Key Tips

All Tips

How should I structure complex coding prompts?

Break complex coding tasks into three parts: context (what exists), goal (what you want), and constraints (requirements and limitations). This structure prevents the AI from making assumptions and produces more accurate code.

moderate Linus Lee Prompt Engineering, AI Coding

How do I use AI to refactor legacy code safely?

Feed the AI your existing tests first, then the code to refactor. Ask it to preserve all test-passing behavior while improving structure. This anchors the refactoring to verified behavior rather than assumptions.

advanced Simon Willison AI Coding

How can I get better code suggestions in Copilot?

Write a detailed comment describing the function before you start typing code. Copilot reads comments as context, so a clear description of inputs, outputs, and edge cases produces dramatically better suggestions.

quick-win Linus Lee AI Coding

What is context stuffing and when should I use it?

Paste relevant documentation, examples, or reference material directly into your prompt before asking questions. AI models work best with explicit context rather than relying on training data that may be outdated or incomplete.

moderate Linus Lee Prompt Engineering, AI Coding

How do I build a simple AI agent with function calling?

Define your tools as JSON schemas, then let the model decide when to call them. Start simple: one tool for search, one for calculation. The model returns a function call instead of text, you execute it, feed results back. Loop until done.

advanced Swyx AI Agents, AI Coding

How do I use AI to debug code faster?

Paste the error message, the relevant code, and what you expected to happen. Ask: "What is causing this error and how do I fix it?" The AI can often spot issues humans miss, like off-by-one errors or incorrect variable scope.

quick-win Simon Willison AI Coding

How do I use Cursor for full-codebase refactoring?

Use Cursor's @codebase mention to give the AI context of your entire project. Then ask for specific refactoring: "Rename all instances of UserService to AuthService and update all imports." Cursor will propose changes across multiple files.

moderate Linus Lee AI Coding