Vibe Coding Workflow
General Coding
- •Write clear, concise, maintainable code
- •Avoid unnecessary abstraction
- •Add JSDoc/docstrings for public APIs and complex logic
- •Handle errors explicitly with user-friendly messages
- •Consider security (SQL injection, XSS, API key exposure)
- •Choose efficient algorithms and data structures
Test-Driven Development
- •Write comprehensive tests first (positive, negative, edge cases)
- •Implement minimum code to pass tests
- •On failure: web search or official docs before each fix attempt
- •Max 3 attempts on same error - ask user for help if stuck
Feature Implementation Workflow
1. Planning
- •Analyze requirements
- •Present implementation plan to user
- •Get approval before proceeding
2. Step-by-Step Implementation
- •Break into logical small units
- •Add logging (console.group/log) for debugging
- •Test each step before proceeding
- •Remove debug logs after stabilization
Context Management
File Documentation (First 100 Lines)
tsx
/** * @file UserProfile.tsx * @description User profile page component * * Main features: * 1. Display user info (name, email, avatar) * 2. Edit profile * 3. Upload profile image * * Core logic: * - Supabase Auth for user authentication * - React Query for data fetching/caching * - React Hook Form for form validation * * @dependencies * - @supabase/ssr * - @tanstack/react-query * - react-hook-form */
Organization
- •Keep files under 500 lines
- •Follow existing directory structure and naming conventions
Refactoring
- •Incremental, small changes
- •Get user approval for large refactors
- •Maintain existing code style
- •Run tests before and after
Error Resolution Loop
code
1. Encounter error 2. WebSearchTool / context7 MCP for solution 3. Apply fix 4. Test 5. If same error after 3 attempts -> ask user for help
Quality Automation
When linter/static analyzer shows errors:
- •Search for solution (web/docs)
- •Apply fix
- •Repeat until clean
- •Max 3 attempts per error type