Skip to main content

Coding Standards

Consistent code style makes the codebase easier to read and maintain. This guide covers our standards for all STELLA components.

Quick Reference

ComponentLanguageStyle GuideFormatter
BackendTypeScriptAirbnbPrettier
AgentsPythonPEP 8Black
FrontendReact/TSReact TS CheatsheetPrettier

Standards by Component

TypeScript (Backend)

NestJS backend code conventions including:

  • Formatting with Prettier
  • Linting with ESLint
  • Naming conventions
  • Service and DTO examples

Python (Agents)

Python agent code conventions including:

  • Formatting with Black
  • Linting with Pylint
  • Type checking with mypy
  • Agent and tool examples

React (Frontend)

React frontend code conventions including:

  • Component structure
  • File organization
  • Custom hooks patterns

Git & Commits

Version control best practices including:

  • Branch naming conventions
  • Conventional commit format
  • Commit message guidelines
  • Git workflow and tips

Testing

Testing standards for all components:

  • Backend testing with Jest
  • Frontend testing
  • Agent testing with pytest

General Principles

  1. Consistency over preference - Follow existing patterns in the codebase
  2. Readability over cleverness - Write code that's easy to understand
  3. Document the why - Comments should explain reasoning, not what
  4. Test what matters - Focus on behavior, not implementation details
  5. Small, focused changes - Each PR should do one thing well