Coding Standards
Consistent code style makes the codebase easier to read and maintain. This guide covers our standards for all STELLA components.
Quick Reference
| Component | Language | Style Guide | Formatter |
|---|---|---|---|
| Backend | TypeScript | Airbnb | Prettier |
| Agents | Python | PEP 8 | Black |
| Frontend | React/TS | React TS Cheatsheet | Prettier |
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
- Consistency over preference - Follow existing patterns in the codebase
- Readability over cleverness - Write code that's easy to understand
- Document the why - Comments should explain reasoning, not what
- Test what matters - Focus on behavior, not implementation details
- Small, focused changes - Each PR should do one thing well