### Start Project from Template and Initialize Git Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Clones a project template from a Git repository and initializes a new local Git repository. It also shows how to remove the original remote and set up a new one, pushing the initial commit to the new remote. This is useful for starting new projects with a predefined structure. ```bash # Clone a template repository git clone https://github.com/username/project-template.git my-new-project cd my-new-project # In Cursor IDE, use the "Start from Repo" feature # File > New Project from Git Repository # Enter: https://github.com/username/project-template.git # Initialize with your own git repository git remote remove origin git remote add origin https://github.com/yourusername/my-new-project.git git push -u origin main ``` -------------------------------- ### Prompt Engineering Examples (Markdown) Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Demonstrates effective prompt engineering techniques with contrasting poor and good examples. It highlights the importance of clarity, specificity, expected outputs, and edge cases in prompts for AI models. Includes examples for complex feature requests and deep thinking prompts. ```markdown # Poor prompt example: "fix the sidebar" # Good prompt example: "Update the Sidebar component in src/components/Sidebar.tsx to: 1. Collapse automatically on mobile screens (< 768px width) 2. Maintain open/closed state in localStorage 3. Add smooth transitions (300ms ease-in-out) 4. Include a toggle button with hamburger icon 5. Handle edge case where localStorage is disabled Expected behavior: - Desktop: Sidebar stays open by default - Mobile: Sidebar is collapsed by default - User preference persists across page reloads - Accessibility: Keyboard navigation (Esc to close, Tab to navigate items)" # Complex feature prompt with deep thinking: "Think deep and analyze the current caching strategy. Then implement a multi-layer caching system with: - In-memory cache for frequently accessed data (< 100KB) - Redis cache for medium-term storage (1-24 hours) - Database queries for cold data Requirements: - Cache invalidation on data updates - Automatic cache warming on app startup - Metrics for cache hit/miss rates - Fallback strategy if Redis is unavailable - Maximum memory usage of 512MB Sample input: getUserById(123) Expected flow: 1. Check in-memory cache -> miss 2. Check Redis -> hit -> return cached user 3. If both miss -> query database -> populate caches 4. Return user object with response time < 50ms" # Document successful prompts # Keep a prompts.md file with effective patterns: ## Effective Prompts Log ### API Endpoint Generation "Create a RESTful endpoint for [resource] with full CRUD operations, input validation using Zod, error handling, and OpenAPI documentation" ### Component Creation "Generate a [ComponentName] React component with TypeScript, props interface, error boundary, loading states, and Storybook stories" ``` -------------------------------- ### Deploy Backend with Railway Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt These commands guide you through deploying a backend application using Railway. It includes installing the CLI, logging in, initializing a project, deploying, and setting environment variables. ```bash npm install -g @railway/cli railway login railway init railway up railway variables set DATABASE_URL="postgresql://..." railway variables set JWT_SECRET="your-secret" ``` -------------------------------- ### Docker Deployment Configuration Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt This Dockerfile specifies how to build a Docker image for a Node.js application. It includes steps for setting the working directory, copying dependencies, installing production packages, copying application code, building the app, exposing a port, and defining the start command. ```dockerfile FROM node:18-alpine WORKDIR /app COPY package*.json ./ RUN npm ci --only=production COPY . . RUN npm run build EXPOSE 3000 CMD ["npm", "start"] ``` -------------------------------- ### Iterative Refinement Workflow Example Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Outlines a multi-iteration process for developing a feature, starting with basic implementation and progressively adding validation, UX improvements, error handling, and polish. ```markdown # Iteration workflow example ## Iteration 1: Basic Implementation Goal: Get core functionality working "Create a basic user registration form with email and password fields" Result: ✅ Form renders, but no validation ## Iteration 2: Add Validation Goal: Validate user inputs "Add validation to the registration form: - Email must be valid format - Password minimum 8 characters - Show error messages below fields" Result: ✅ Validation works, but UX is clunky ## Iteration 3: Improve UX Goal: Better user experience "Improve the validation UX: - Real-time validation on blur - Show strength indicator for password - Disable submit until form is valid - Add loading state during submission" Result: ✅ Better UX, but missing error handling ## Iteration 4: Error Handling Goal: Handle API errors gracefully "Add comprehensive error handling: - Network errors -> show retry button - Duplicate email -> show specific message - Server errors -> show generic error + log details - Rate limiting -> show wait time" Result: ✅ Robust error handling ## Iteration 5: Polish Goal: Final touches "Polish the registration form: - Add smooth transitions - Improve accessibility (ARIA labels) - Add success animation - Optimize bundle size" Result: ✅ Production-ready # Quick iteration commands: "Improve the color scheme to be more modern" "Add loading spinners to all buttons" "Make the layout mobile-responsive" "Optimize this function for better performance" "Add TypeScript types to all function parameters" ``` -------------------------------- ### Managing AI Chat Context (Markdown) Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Explains strategies for organizing AI chat sessions to maintain focus and prevent confusion. It provides examples of chat organization, criteria for starting new chats, and commands for resetting context. This helps ensure accurate and relevant AI responses. ```markdown # Chat Organization Strategy ## Chat 1: Authentication System Topic: Implement user authentication Files: src/auth/, src/middleware/auth.js Status: ✅ Completed ## Chat 2: Product API Topic: Build product management endpoints Files: src/api/products/, src/models/Product.js Status: 🔄 In Progress ## Chat 3: Bug Fix - Payment Processing Topic: Fix Stripe webhook timeout issue Files: src/api/webhooks/stripe.js Status: ✅ Completed ## Chat 4: Frontend Dashboard Topic: Create admin dashboard UI Files: src/pages/dashboard/, src/components/dashboard/ Status: 📋 Pending # When to start a new chat: - Switching to a completely different feature - AI starts providing incorrect file names - Context gets too large (> 50 messages) - AI suggests changes to unrelated files - You encounter repeated hallucinations # Reset context command examples: "Let's start fresh. Here's the current state of the authentication system..." "Ignore previous conversation. Focus only on the payment integration." ``` -------------------------------- ### Deploy Frontend with Vercel Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt This section details the process of deploying a frontend application using Vercel. It covers installation, login, initial deployment, production deployment, and setting environment variables. ```bash npm install -g vercel vercel login vercel vercel --prod vercel env add DATABASE_URL production vercel env add STRIPE_SECRET_KEY production vercel env add JWT_SECRET production ``` -------------------------------- ### Basic Git Initialization and Commit Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Demonstrates the fundamental commands for initializing a Git repository, staging all changes, and making an initial commit with a descriptive message. ```bash # Initialize git repository git init git add . git commit -m "Initial commit: Project setup" ``` -------------------------------- ### Good Git Commit Message Examples Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Provides examples of well-structured Git commit messages following conventional commit guidelines, covering features, fixes, refactoring, documentation, testing, performance, and styling. ```bash # Good commit message examples: git commit -m "feat: Add user profile editing functionality" git commit -m "fix: Resolve race condition in cart updates" git commit -m "refactor: Extract database queries to repository layer" git commit -m "docs: Update API documentation with new endpoints" git commit -m "test: Add unit tests for authentication service" git commit -m "perf: Optimize image loading with lazy loading" git commit -m "style: Update button styles to match design system" ``` -------------------------------- ### Build and Push Docker Image Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt These commands demonstrate how to build a Docker image locally and push it to a container registry. Replace `registry.example.com/myapp:latest` with your actual registry and image name. ```bash docker build -t myapp:latest . docker push registry.example.com/myapp:latest ``` -------------------------------- ### Secure API Keys and Environment Variables Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Demonstrates how to secure API keys and sensitive data by storing them in a `.env` file and adding it to `.gitignore`. It includes examples for creating the `.env` file, adding entries, and loading these variables in Node.js and Python applications. ```bash # Create .env file in project root touch .env # Add to .env DATABASE_URL="postgresql://user:password@localhost:5432/mydb" JWT_SECRET="your-super-secret-jwt-key-here" STRIPE_SECRET_KEY="sk_test_51ABC123..." AWS_ACCESS_KEY_ID="AKIA123456789" AWS_SECRET_ACCESS_KEY="abcdef123456789" OPENAI_API_KEY="sk-proj-abc123..." # Add to .gitignore echo ".env*" >> .gitignore echo "/secrets" >> .gitignore echo ".env.local" >> .gitignore echo ".env.production" >> .gitignore ``` ```javascript # Load environment variables in your application # Node.js example: require('dotenv').config(); const dbUrl = process.env.DATABASE_URL; const jwtSecret = process.env.JWT_SECRET; ``` ```python # Python example: from dotenv import load_dotenv import os load_dotenv() database_url = os.getenv('DATABASE_URL') jwt_secret = os.getenv('JWT_SECRET') ``` -------------------------------- ### CI/CD Pipeline for Production Deployment Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt This GitHub Actions workflow defines a CI/CD pipeline that runs on pushes to the main branch. It checks out the code, sets up Node.js, installs dependencies, runs tests, builds the application, and deploys to Vercel using a provided token. ```yaml name: Deploy to Production on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: '18' - run: npm ci - run: npm test - run: npm run build - name: Deploy to Vercel run: vercel --prod --token=${{ secrets.VERCEL_TOKEN }} ``` -------------------------------- ### Comprehensive Project Plan Structure Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt An example markdown structure for a comprehensive project plan. It outlines key sections like Overview, Technical Stack, Features, Implementation Steps, and Success Criteria, serving as a template for planning AI-assisted development projects. ```markdown # Example plan.md structure ## Project: E-commerce Dashboard ### Overview Building a dashboard for managing products, orders, and customers. ### Technical Stack - Frontend: React + TypeScript + Tailwind CSS - Backend: Node.js + Express - Database: PostgreSQL - Deployment: Vercel (frontend) + Railway (backend) ### Features 1. **User Authentication** - Login/Signup with email - Password reset functionality - JWT-based session management 2. **Product Management** - CRUD operations for products - Image upload with S3 - Category and tag system 3. **Order Processing** - Shopping cart functionality - Checkout workflow - Payment integration with Stripe ### Implementation Steps 1. Set up project structure from template 2. Configure database schema 3. Implement authentication system 4. Build product management API 5. Create frontend components 6. Integrate payment processing 7. Add testing suite 8. Deploy to production ### Success Criteria - All features working without errors - Response time < 200ms for API calls - 90%+ test coverage - Mobile-responsive design ``` -------------------------------- ### Creating and Pushing a GitHub Repository Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Shows how to create a new public GitHub repository using the GitHub CLI, linking it to the current local directory, and pushing the initial commit. ```bash # Create GitHub repository (using gh CLI) gh repo create my-project --public --source=. --remote=origin --push ``` -------------------------------- ### AI-Assisted Git Operations Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Provides examples of natural language commands that can be used with AI tools (like Cursor) to perform Git operations such as staging, committing, branching, and pushing. ```text # Using AI agent to handle commits # In Cursor or similar tools: "Stage all changes and commit with message: 'Add product filtering and sorting'" "Create a new branch feature/notifications and commit current changes" "Review my changes, create an appropriate commit message, and push to GitHub" ``` -------------------------------- ### Testing and Debugging Workflow (Bash, JSON, Markdown) Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Details a comprehensive workflow for local development, testing, and debugging. It includes commands for running development servers, various testing modes (watch, coverage, specific files), and a checklist for ensuring code quality. Also shows how to integrate testing scripts into package.json and use AI for error resolution by providing exact error messages. ```bash # Start development server npm run dev # or yarn dev # Access at http://localhost:3000 # Run tests in watch mode npm test -- --watch # or jest --watch # Run specific test file npm test src/components/UserProfile.test.tsx # Run tests with coverage npm test -- --coverage --watchAll=false # Example test workflow npm run dev & # Start server in background npm test -- --watch # Run tests in watch mode npm run lint # Check for linting errors # Continuous testing script (package.json) { "scripts": { "dev": "next dev", "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage", "test:e2e": "playwright test", "test:all": "npm run test && npm run test:e2e && npm run lint" } } ``` ```markdown # Testing checklist: # ✓ Unit tests pass # ✓ Integration tests pass # ✓ E2E tests pass # ✓ No console errors # ✓ No TypeScript errors # ✓ Linter passes # ✓ Build succeeds # Error debugging workflow ## Step 1: Copy the exact error ``` Error: Cannot find module '@/components/UserProfile' at Object. (/app/src/pages/dashboard.tsx:3:1) at Module._compile (node:internal/modules/cjs/loader:1126:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10) ``` ``` -------------------------------- ### AI Agent Mode Commands for Development Tasks Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Provides examples of natural language commands used with AI Agent modes (like in Cursor IDE) to perform various development tasks. This includes file operations, code generation, refactoring, and terminal commands. ```bash # Example Agent Mode commands in Cursor or similar tools # File operations "Create a new component called UserProfile in src/components with TypeScript" "Refactor the authentication logic from auth.js into separate modules" "Move all utility functions from utils.js to src/utils/ directory" # Code generation "Generate a REST API endpoint for user registration with email validation" "Create unit tests for the ProductService class with 90% coverage" "Add error handling to all database queries in the UserRepository" # Terminal commands "Install dependencies: npm install axios react-query zustand" "Run the development server on port 3000" "Create a new git branch called feature/user-authentication" ``` -------------------------------- ### Common API Error Patterns Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Provides examples of common API errors, including status codes, response bodies, and request payloads, useful for detailed error reporting to an AI. ```text API request to /api/users failed Status: 500 Internal Server Error Response: { error: 'Database connection timeout' } Request payload: { userId: 123 } Expected: User object with id, name, email ``` -------------------------------- ### Common Runtime Error Patterns Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Highlights common runtime errors like TypeErrors (e.g., calling 'map' on undefined) and provides examples of the state information that should be shared with an AI for debugging. ```text Uncaught TypeError: Cannot read property 'map' of undefined at ProductList (ProductList.tsx:23) State at time of error: [state object] ``` -------------------------------- ### Refactor Checkout Process using State Machine Pattern (Conceptual) Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt This example outlines a refactoring strategy for a monolithic checkout component into smaller, manageable parts using a state machine pattern. It details the new components and emphasizes preserving existing functionality while adding error boundaries. No specific programming language code is provided, as this is a conceptual breakdown. -------------------------------- ### Regular Git Commit Workflow Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Illustrates the standard Git workflow for staging changes, committing them with a message, and pushing to the 'main' branch on the remote repository. ```bash # Regular commit workflow git add . git commit -m "feat: Add user authentication system" git push origin main ``` -------------------------------- ### Common Build Error Patterns Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Details common build-time errors, such as module resolution failures and non-zero exit codes, and suggests including full build output when seeking AI help. ```text Build failed with exit code 1 Module not found: Can't resolve 'react-icons/fa' [Full build output] ``` -------------------------------- ### Git Commit Frequency Guidelines Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Offers recommendations on when to commit changes to version control, emphasizing logical units of work, bug fixes, and regular session-ending commits. ```text # Commit frequency guidelines: # ✓ After completing a logical unit of work # ✓ Before switching to a different feature # ✓ After fixing a bug # ✓ At the end of each coding session # ✓ Before potentially breaking changes ``` -------------------------------- ### Git Feature Branch Workflow Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Details the process of creating a new feature branch, making changes, committing them, and pushing the feature branch to the remote repository. ```bash # Feature branch workflow git checkout -b feature/payment-integration # Make changes git add . git commit -m "feat: Integrate Stripe payment processing" git push origin feature/payment-integration ``` -------------------------------- ### View Git Commit History Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt These commands provide different ways to view your Git commit history. The first shows a concise, graphed log, while the second offers a custom, detailed format. ```bash git log --oneline --graph --all git log --pretty=format:"%h - %an, %ar : %s" ``` -------------------------------- ### Common TypeScript Error Patterns Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Illustrates typical TypeScript errors encountered during development, such as type mismatches and undefined values, and provides context for reporting these errors to an AI for assistance. ```text TypeScript error at src/utils/api.ts:45:12 Type 'string | undefined' is not assignable to type 'string' [Full error context and code snippet] ``` -------------------------------- ### Configure Vercel Automatic Deployment Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt This JSON object represents the build settings for a Next.js application on Vercel, enabling automatic deployments from GitHub repositories. Environment variables are configured separately in the Vercel dashboard. ```json { "buildCommand": "npm run build", "outputDirectory": ".next", "framework": "nextjs", "installCommand": "npm install" } ``` -------------------------------- ### Troubleshooting TypeScript Import Errors Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt Demonstrates how to debug TypeScript import errors, particularly with module resolution and export issues in a Next.js project. This involves checking `tsconfig.json` configurations and verifying component exports. ```typescript import { UserProfile } from '@/components/UserProfile' ``` ```json { "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./src/*"] } } } ``` ```text Error: UserProfile is not exported from '@/components/UserProfile' ``` -------------------------------- ### Configure Git Commit History Protection Source: https://context7.com/analyticalrohit/awesome-vibe-coding-guide/llms.txt These commands configure Git to automatically use rebase for pulls and prune remote tracking branches, helping maintain a cleaner and more linear commit history. ```bash git config --global pull.rebase true git config --global fetch.prune true ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.