Everything from the Vibe Coding series in one reference page. Bookmark this. Come back to it often.
Tool Comparison Matrix
| Feature | Claude Code | Cursor | GitHub Copilot |
|---|---|---|---|
| Interface | Terminal | VS Code fork | IDE extension |
| Best at | Complex tasks, multi-file changes, debugging | UI generation, scaffolding, Composer mode | Inline completions, quick suggestions |
| Agent mode | Yes (primary mode) | Yes (Composer, Background Agents) | Yes (Copilot Workspace) |
| Multi-agent | Yes (Agent Teams) | Limited | Limited |
| Context window | 200K tokens | 200K tokens | 128K tokens |
| Local models | No | Yes (OpenAI-compatible) | No |
| MCP support | Yes (native) | Partial | No |
| CLI support | Yes (primary) | No | Yes (gh copilot) |
| Price | $20/mo (Pro), $100-200/mo (Max) | $20/mo (Pro) | $10/mo (Individual) |
| Best for | Backend, architecture, complex tasks | Frontend, UI, full-stack scaffolding | Quick completions, simple edits |
When to use which:
- Claude Code when the task touches multiple files, requires reasoning, or involves debugging
- Cursor when building UI, scaffolding new projects, or making visual changes
- Copilot when typing code and wanting inline suggestions, or for simple completions
Detailed comparison: Choosing Your AI Coding Stack
The 6-Step Vibe Coding Workflow
From The Vibe Coding Workflow:
1. Specify — Write a clear description of what you want before prompting AI. Include requirements, constraints, tech stack, and expected behavior. For large features, write a PRD.
2. Generate — Send the specification to your AI tool. Let it generate the code. Do not interrupt the generation with follow-up prompts — let it finish.
3. Review — Read every line of generated code. Check for: correct logic, proper error handling, security issues, adherence to project conventions, missing edge cases.
4. Fix — Fix issues found during review. For small fixes, edit manually. For larger issues, re-prompt AI with a specific description of what is wrong.
5. Test — Run existing tests. Ask AI to generate new tests for the new code. Run those too. If tests fail, go back to step 4.
6. Commit — Make a focused commit with a conventional commit message. Add Co-authored-by trailer for AI-assisted code. Push and open a PR.
The CRISP Prompt Framework
From Prompt Engineering for Code:
| Letter | Stands for | Description |
|---|---|---|
| C | Context | What is the project? What already exists? |
| R | Requirements | What exactly should the code do? |
| I | Input/Output | What does the function receive and return? |
| S | Style | What patterns, conventions, or constraints to follow? |
| P | Priority | What matters most? Performance? Readability? Security? |
Example CRISP prompt:
Context: Next.js 15 app with Prisma and PostgreSQL.
The user model already exists.
Requirements: Create a pagination utility that works
with any Prisma model. It should accept page number,
page size, and an optional filter. It should return
the data, total count, total pages, and current page.
Input: { model: PrismaModel, page: number,
pageSize: number, where?: object }
Output: { data: T[], total: number, totalPages: number,
page: number, pageSize: number }
Style: TypeScript with generics. No classes — use
a plain function. Match the existing utility pattern
in lib/utils.ts.
Priority: Type safety first. The return type should
be fully typed based on the Prisma model.
Top 10 Prompt Patterns
From Prompt Engineering for Code:
1. Specification First
Write a specification for [feature]. Do not write code yet.
Include: requirements, API design, data model, edge cases.
2. Incremental Build
Implement only [Step N] from the specification.
Do not change anything from the previous steps.
3. Review and Fix
Review the code you just generated for [specific concern].
Fix any issues you find.
4. Test First
Write tests for [feature] first. Then implement the
code to make the tests pass.
5. Explain Then Implement
Explain how [algorithm/pattern] works. Then implement
it for our use case: [description].
6. Constrained Generation
Implement [feature] using only [specific libraries].
Do not add any new dependencies.
Follow the pattern in [existing file].
7. Error Handling Focus
Add comprehensive error handling to [function/module].
Handle: [list specific error cases].
Each error should have a specific error code and message.
8. Refactor with Safety
Refactor [code] to [goal]. Do not change the external
API or behavior. Show me the changes before applying them.
9. Security Review
Review [file] for security vulnerabilities.
Check for: injection, auth bypass, data exposure,
rate limiting gaps. List each issue with severity.
10. Migration
Migrate [code] from [old pattern] to [new pattern].
Keep backward compatibility. Add deprecation warnings
for old usage. Include a migration guide in comments.
Context File Templates
From Context Engineering:
CLAUDE.md (for Claude Code)
# Project Name
## Overview
Brief description of what this project does.
## Tech Stack
- Language: TypeScript 5.6
- Framework: Next.js 15 (App Router)
- Database: PostgreSQL with Prisma 6.2
- Testing: Vitest + Testing Library
- Styling: Tailwind CSS v4
## Project Structure
- app/ — Next.js pages and layouts
- lib/ — Shared utilities and configurations
- components/ — Reusable UI components
- prisma/ — Database schema and migrations
## Coding Conventions
- Use Server Components by default
- Use Server Actions for mutations
- Zod for all input validation
- Conventional commits with Co-authored-by trailers
- No default exports (except pages)
- Prefer const arrow functions
## Commands
- Dev: npm run dev
- Test: npm test
- Build: npm run build
- Lint: npm run lint
## Important Rules
- Never hardcode secrets — use environment variables
- Always validate user input with Zod
- Always check resource ownership before mutations
- Keep API response shapes consistent
.cursorrules (for Cursor)
You are an expert TypeScript developer working on a
Next.js 15 application.
Rules:
- Use TypeScript strict mode
- Prefer Server Components over Client Components
- Use Tailwind CSS for styling — no CSS modules
- Follow the existing file structure and naming
- Import from @/ path alias
- Use Zod for validation, not manual checks
- Error messages should be user-friendly
- Write tests with Vitest
When writing Compose components:
- Keep components under 100 lines
- Extract reusable logic to custom hooks
- Use Shadcn/ui components from components/ui/
When writing API routes:
- Validate all inputs with Zod schemas
- Return consistent error shapes
- Use proper HTTP status codes
- Always authenticate protected routes
copilot-instructions.md (for GitHub Copilot)
This is a TypeScript project using Next.js 15.
Preferences:
- Prefer arrow functions with explicit return types
- Use const assertions where appropriate
- Import types with the type keyword
- Prefer early returns over nested conditionals
- Use template literals over string concatenation
Testing:
- Use Vitest, not Jest
- Use Testing Library, not Enzyme
- Prefer integration tests over unit tests
- Mock external services, not internal modules
Decision Flowchart: When to Vibe Code
From When NOT to Vibe Code:
Use AI when:
- The task has clear, well-defined requirements
- You can verify the output (tests exist or you can write them)
- The code is not security-critical (or you have time to review thoroughly)
- Similar code exists in the codebase or in public repositories
- You understand the problem domain well enough to review the solution
Do NOT use AI (or use with extreme caution) when:
- Requirements are unclear or ambiguous
- The code handles money, authentication, or sensitive data (use AI, but review every line)
- You are learning a new concept and want to build deep understanding
- The task requires creative problem-solving or novel algorithms
- The codebase has complex, undocumented conventions that AI will not follow
- The task requires understanding business context that is not in the code
Common AI Code Bugs to Watch For
From Debugging AI-Generated Code:
| Bug Type | How to Spot It | Example |
|---|---|---|
| Off-by-one errors | Check loop boundaries and array indexing | for (i = 0; i <= arr.length) |
| Missing error handling | Look for unhandled promise rejections and missing try/catch | await fetch(url) without error handling |
| Hardcoded values | Search for magic numbers and strings | if (role === "admin") instead of using constants |
| Race conditions | Check async operations that modify shared state | Two concurrent updates to the same record |
| Wrong defaults | Verify default values match business logic | isPublic: true when notes should be private by default |
| Incomplete validation | Test with edge cases: empty strings, null, very large values | Missing length check on user input |
| Stale imports | Check that imported functions actually exist in the source | Import from a module that was renamed |
| Type assertions hiding bugs | Search for as casts in TypeScript | user as AdminUser without checking |
| N+1 queries | Check database calls inside loops | Fetching user for each note in a loop |
| Memory leaks | Check for uncleaned event listeners and intervals | setInterval without clearInterval on cleanup |
MCP Quick Setup Reference
From MCP in Practice:
MCP (Model Context Protocol) lets AI tools connect to external services — databases, APIs, file systems, and more.
Common MCP servers:
| Server | What it does | Use case |
|---|---|---|
@modelcontextprotocol/server-filesystem | Read/write files | Project file access |
@modelcontextprotocol/server-postgres | Query PostgreSQL | Database debugging |
@modelcontextprotocol/server-github | GitHub API access | PR management, issue tracking |
@modelcontextprotocol/server-fetch | HTTP requests | API testing, documentation fetching |
Setup in Claude Code (claude_desktop_config.json):
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"@modelcontextprotocol/server-postgres",
"postgresql://user:pass@localhost:5432/mydb"
]
},
"github": {
"command": "npx",
"args": [
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_TOKEN": "ghp_your_token"
}
}
}
}
Git Workflow Quick Reference
From Git Workflows with AI:
Commit after each AI step:
# AI generates code → review → fix → commit
git add [specific files]
git commit -m "feat(scope): description
Co-authored-by: Claude <noreply@anthropic.com>"
Track AI contributions:
# Count AI-assisted commits
git log --grep="Co-authored-by: Claude" --oneline | wc -l
# Compare AI vs human commits
git log --oneline | wc -l # Total
PR template:
## Summary
What and why.
## AI Tools Used
- Claude Code: [what it generated]
- Manual: [what you wrote/fixed]
## Testing
- [ ] Tests pass
- [ ] Manual testing done
Productivity Metrics Quick Reference
From Measuring Your AI Productivity:
What to track:
- Task completion time (AI vs manual)
- Tokens consumed per task type
- Bugs introduced by AI vs caught by AI
- PRs merged per week
- Monthly tool cost vs time saved
ROI formula:
Monthly hours saved x hourly rate = Value
Value - Tool costs = Monthly ROI
Typical results (from 30-day experiment):
- Feature development: 61% faster with AI
- Bug fixing: 26% faster with AI
- Test generation: 71% faster with AI
- Net ROI: 12.8x on tool investment
Series Index
| # | Article | Topic |
|---|---|---|
| 1 | Vibe Coding Fundamentals | Getting started |
| 2 | Choosing Your AI Coding Stack | Tool selection |
| 3 | Your First Vibe Coding Session | Workflow basics |
| 4 | When NOT to Vibe Code | Anti-patterns |
| 5 | Claude Code Mastery | Claude deep dive |
| 6 | Cursor Mastery | Cursor deep dive |
| 7 | GitHub Copilot Mastery | Copilot deep dive |
| 8 | Context Engineering | Context files |
| 9 | Prompt Engineering for Code | Prompt patterns |
| 10 | MCP in Practice | External integrations |
| 11 | AI-Powered Testing | Test generation |
| 12 | AI Code Review Pipeline | Code review |
| 13 | Debugging AI-Generated Code | Debugging |
| 14 | Multi-Agent Workflows | Agent teams |
| 15 | Build: CLI Tool | Python CLI project |
| 16 | Build: REST API | TypeScript API project |
| 17 | Build: Full-Stack Web App | Next.js dashboard |
| 18 | Build: Mobile App | Kotlin + Compose |
| 19 | Build: Browser Extension | Chrome extension |
| 20 | Local AI Models | Ollama setup |
| 21 | AI-First Development | Workflow shift |
| 22 | The Future of Vibe Coding | 2027 predictions |
| 23 | Git Workflows with AI | Git best practices |
| 24 | Measuring Productivity | Metrics and ROI |
| 25 | Vibe Coding Cheat Sheet | This page |
Part 25 of the Vibe Coding series. This is the final article in the series.