Home

VIBE-CODE-RULES: Universal Coding Agent Standards

These rules apply to all AI-assisted coding work unless explicitly overridden by a project-specific AGENTS.md. Read in full before writing any code.


1. Mindset & Role


2. Project Kickoff Protocol


3. Git & Version Control

Rule Why
Never work directly on main Main is the safety net
Branch naming: feature/, fix/, experiment/ Consistent naming makes branches identifiable
Commit after every working change Small commits mean you can roll back to any working state
Write clear commit messages Format: type: short description
Push to remote after every commit Local-only commits provide no backup or CI trigger
After 3+ failed attempts, run git reset --hard LLMs accumulate bad code layers; resetting is faster
Always start from clean git state Dirty state makes isolation impossible

4. Code Quality Standards


5. Security

Practice Rule
Never commit secrets Use environment variables, ensure .env is in .gitignore
Never log sensitive data No API keys, tokens, passwords, or PII in logs
Validate all user input Both client-side and server-side
Keep dependencies updated Run npm audit regularly
Use HTTPS for all external API calls No HTTP, ever
Store .env.example Document required variables without exposing values
Enable Row-Level Security (RLS) Every table with user data must have RLS policies
Audit routes bypassing RLS Any service role client must manually verify ownership
Never hardcode client-specific content Per-user content belongs in the database

6. Debugging Protocol


7. Testing

Principle Requirement
“It works on my machine” is not tested Tested means: describe the test, input, and expected output
Write at least one integration test per feature Simulate a user clicking through the entire flow
Test the happy path AND the failure path What happens when the API returns an error?
For complex features, test in a standalone project first Build a minimal prototype before integrating
Download reference implementations when available Use them as a baseline to prove the API works

8. UI/UX Standards


9. Copy & Content Standards


10. Performance


11. Documentation

Practice Purpose
Keep project docs updated as you build Outdated docs actively mislead
Store API documentation locally AI can reference them instead of hallucinating
Every project must have a README.md What it does, how to set up, run, and deploy
Document non-obvious decisions One-liner on why you chose X over Y

12. Checkpoints & Refactoring


Summary

Category Key Principle
Mindset Senior engineer discipline, ask when unsure
Planning Plan first, section-by-section execution
Git Small commits, clear messages, push immediately
Code Quality Small files, descriptive names, no duplication
Security Never commit secrets, validate input, use RLS
Debugging Hypothesize first, add logging, reset when stuck
Testing Integration tests, test failures, isolate complexity
UI/UX No emojis, consistent spacing, error states required
Copy No placeholders, every word earns its place
Performance Minimal dependencies, lazy load, debounce
Docs Update as you build, store API docs locally
Refactoring Checkpoint after sections, refactor when working
Tags: AiCodingStandardsWorkflowGit