Everything from the Vibe Coding series in one reference page. Bookmark this. Come back to it often.

Tool Comparison Matrix

FeatureClaude CodeCursorGitHub Copilot
InterfaceTerminalVS Code forkIDE extension
Best atComplex tasks, multi-file changes, debuggingUI generation, scaffolding, Composer modeInline completions, quick suggestions
Agent modeYes (primary mode)Yes (Composer, Background Agents)Yes (Copilot Workspace)
Multi-agentYes (Agent Teams)LimitedLimited
Context window200K tokens200K tokens128K tokens
Local modelsNoYes (OpenAI-compatible)No
MCP supportYes (native)PartialNo
CLI supportYes (primary)NoYes (gh copilot)
Price$20/mo (Pro), $100-200/mo (Max)$20/mo (Pro)$10/mo (Individual)
Best forBackend, architecture, complex tasksFrontend, UI, full-stack scaffoldingQuick 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:

LetterStands forDescription
CContextWhat is the project? What already exists?
RRequirementsWhat exactly should the code do?
IInput/OutputWhat does the function receive and return?
SStyleWhat patterns, conventions, or constraints to follow?
PPriorityWhat 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 TypeHow to Spot ItExample
Off-by-one errorsCheck loop boundaries and array indexingfor (i = 0; i <= arr.length)
Missing error handlingLook for unhandled promise rejections and missing try/catchawait fetch(url) without error handling
Hardcoded valuesSearch for magic numbers and stringsif (role === "admin") instead of using constants
Race conditionsCheck async operations that modify shared stateTwo concurrent updates to the same record
Wrong defaultsVerify default values match business logicisPublic: true when notes should be private by default
Incomplete validationTest with edge cases: empty strings, null, very large valuesMissing length check on user input
Stale importsCheck that imported functions actually exist in the sourceImport from a module that was renamed
Type assertions hiding bugsSearch for as casts in TypeScriptuser as AdminUser without checking
N+1 queriesCheck database calls inside loopsFetching user for each note in a loop
Memory leaksCheck for uncleaned event listeners and intervalssetInterval 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:

ServerWhat it doesUse case
@modelcontextprotocol/server-filesystemRead/write filesProject file access
@modelcontextprotocol/server-postgresQuery PostgreSQLDatabase debugging
@modelcontextprotocol/server-githubGitHub API accessPR management, issue tracking
@modelcontextprotocol/server-fetchHTTP requestsAPI 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

#ArticleTopic
1Vibe Coding FundamentalsGetting started
2Choosing Your AI Coding StackTool selection
3Your First Vibe Coding SessionWorkflow basics
4When NOT to Vibe CodeAnti-patterns
5Claude Code MasteryClaude deep dive
6Cursor MasteryCursor deep dive
7GitHub Copilot MasteryCopilot deep dive
8Context EngineeringContext files
9Prompt Engineering for CodePrompt patterns
10MCP in PracticeExternal integrations
11AI-Powered TestingTest generation
12AI Code Review PipelineCode review
13Debugging AI-Generated CodeDebugging
14Multi-Agent WorkflowsAgent teams
15Build: CLI ToolPython CLI project
16Build: REST APITypeScript API project
17Build: Full-Stack Web AppNext.js dashboard
18Build: Mobile AppKotlin + Compose
19Build: Browser ExtensionChrome extension
20Local AI ModelsOllama setup
21AI-First DevelopmentWorkflow shift
22The Future of Vibe Coding2027 predictions
23Git Workflows with AIGit best practices
24Measuring ProductivityMetrics and ROI
25Vibe Coding Cheat SheetThis page

Part 25 of the Vibe Coding series. This is the final article in the series.