Wiki for Vibe Coded Apps

Vibe Coding Wiki

200+ hrs, 70k lines, non-developer PM. Distilled lessons + community insights.
Tags: #vibe-coding #ai #workflow #security


1. Planning


2. Session & Token Management


3. Build Order

Build frontend with mock data → validate AI understood the spec → refine data model → implement backend.

Backend-First (traditional / team projects)

Build the API → frontend just displays what exists. Cleaner business logic, fewer rewrites.

Contract-First (best of both)

Define OpenAPI spec → build both sides against it independently → use Postman to test endpoints before the frontend exists.

Verdict: UI-first works well solo. Backend/contract-first for teams or complex logic.


4. Testing

Rule Why
Test behaviour, not implementation Survives refactors
Name test after the bug/behaviour it catches Self-documenting
Cover failure paths, not just happy path Regressions hide in edge cases
No loose assertions that pass on broken code Tests must actually catch bugs

TDD Flow for Tricky Features

  1. List everything that could go wrong
  2. Ask AI to write a failing test for each
  3. Run it — confirm it fails for the right reason
  4. Ask AI to write the implementation
  5. Confirm test passes

This stops the AI writing code first, then writing tests that rubber-stamp whatever it did.

Key Practices


5. Version Control (Git)


Persistent instruction file the AI reads every session. Without it, the AI repeats the same mistakes across sessions.

Essential rules to include:

- Split components aggressively — one responsibility per component
- No business logic in components — belongs in hooks/services
- Max file size: 300 lines
- Test behaviour, not implementation
- Always cover failure paths
- API keys never reach the browser
- AI-generated content sanitized before rendering

7. Refactoring

⚠️ When refactoring with AI:

Explicitly tell it not to touch existing logic — only port. Models will silently delete things. Always diff carefully after a refactor. Never trust "I didn't change any logic."

Watch for:


8. Code Review & PR Discipline

Review checklist:


9. Security

Honest baseline: AI security reviews pass flawed code regularly. For multi-tenant or sensitive-data apps, get a human security review.

Must-Know Concepts

Practical Checklist

Access Control

API Keys

Output & Headers

Secrets in Code

Linting / Static Analysis

OWASP Top 10 — High-Risk in Vibe Coding

Risk AI Vibe Coding Danger
A01 Broken Access Control High — AI often skips auth checks on individual endpoints
A05 Security Misconfiguration High — CSP, CORS, headers easy to miss
A06 Vulnerable Dependencies High — AI never audits deps
A09 Security Logging Failures High — AI rarely adds audit logging unprompted
A02 Cryptographic Failures Medium — correct libs, but may misconfigure

Why AI Can't Fully Cover Security


10. Multi-Model Strategy

Model Best For
Claude UI/UX, component design, nuanced writing
Codex Complex logic, heavy refactors, token-efficient on large tasks
Gemini Fast large-context codebase evaluation; fresh perspective — analysis only, don't let it build
GPT-4o Cross-checking, planning, reasoning trade-offs

11. Deployment


12. Multi-Agent Workflows

git worktree add ../feature-b-dir feature-b-branch

13. TypeScript


14. Tooling Reference

Category Tool Notes
Version control Git + GitHub/GitLab Day one
Secret scanning Gitleaks CI integration
Linting ESLint / Ruff / clang-tidy Every build
Mutation testing Stryker (JS) Periodic
Error tracking Sentry Set up early
Analytics PostHog Behavioural data
API testing Postman Backend-independent testing
Secret management GCP Secret Manager / AWS Secrets Manager Never hardcode

React Native specific:


15. Beginner Ramp

Tier 1 — Day One

Tier 2 — First Month

Tier 3 — Once Shipping

Where to Learn


Glossary

Term Definition
PRD Written plan for what you're building, before you build it
CLAUDE.md File that tells your AI the rules to follow every session
Context window How much the AI can "remember" in one conversation — finite
Token Unit of AI computation — words, code, instructions all cost tokens
Git worktree Multiple branches checked out simultaneously in separate folders
CSP Content Security Policy — browser rule limiting what your site can load/send
RLS Row-Level Security — DB feature enforcing who can read/write which rows
XSS Cross-Site Scripting — injecting malicious code via user input
Mutation testing Deliberately breaking code to verify tests catch the breakage
Linter Finds code patterns likely to cause bugs before they do
Gitleaks Scans git history for accidentally committed secrets
API contract Formal definition of an endpoint's inputs and outputs
SHA Unique fingerprint for a specific version of your code