bv-property/slug icon
public
Published on 7/22/2025
Project Development Rules

Rules

Build & Development Commands

  • Use npm install or yarn install for dependency installation - Run npm run dev or yarn dev for development server - Use npm run build or yarn build for production builds - Always run npm run lint before committing code - Use npm run format to auto-format code with Prettier - Run npm run type-check for TypeScript projects - Use environment-specific scripts: npm run dev:local, npm run build:prod - Always check package.json scripts section for available commands - Use npm ci in CI/CD environments for faster, reliable builds - Run npm audit regularly to check for security vulnerabilities

Testing Guidelines

  • Write unit tests for all utility functions and business logic - Aim for minimum 80% code coverage on critical paths - Use descriptive test names: should return user data when valid ID provided - Follow AAA pattern: Arrange, Act, Assert - Mock external dependencies and API calls in unit tests - Write integration tests for API endpoints and database interactions - Use npm run test for running all tests - Use npm run test:watch during development - Run npm run test:coverage to check coverage reports - Write end-to-end tests for critical user journeys - Test error handling and edge cases thoroughly - Keep tests isolated and independent of each other

Code Style & Guidelines

  • Follow language-specific style guides (ESLint, Prettier, Black, gofmt) - Use meaningful variable and function names (no single letters except loop counters) - Keep functions small and focused on single responsibility - Use consistent naming conventions: camelCase for JS/TS, snake_case for Python - Add JSDoc/docstrings for public functions and complex logic - Avoid deep nesting (max 3-4 levels) - Use early returns to reduce complexity - Handle errors gracefully with proper error messages - Remove console.logs and debugging statements before committing - Use TypeScript types/interfaces for better code documentation - Follow DRY principle but avoid premature abstraction - Use const over let, let over var in JavaScript

Documentation Guidelines

  • Update README.md for any setup or usage changes - Document all environment variables in README or .env.example - Add inline comments for complex business logic only - Keep comments up-to-date with code changes - Document API endpoints with request/response examples - Use clear commit messages following conventional commits format - Update CHANGELOG.md for significant changes - Document deployment procedures and requirements - Include troubleshooting section in documentation - Add code examples in documentation for complex features - Document breaking changes prominently - Keep documentation in the same repository as code