Overview
TypeScript/JavaScript
Biome for linting and formatting
Python
Ruff for linting and formatting, mypy for type checking
TypeScript/JavaScript Style
GAIA uses Biome instead of ESLint + Prettier for faster, unified tooling.Configuration
biome.json at repository root:
Running Biome
Key Rules
No Explicit Any
No Explicit Any
Never use
any type - Always provide proper type definitionsNo Inline Imports
No Inline Imports
All imports at the top - No inline or conditional imports
Line Width 80
Line Width 80
Maximum 80 characters per line - Improves readability
Import Type Hints
Import Type Hints
Use type imports - Separate type imports from value imports
Arrow Parentheses
Arrow Parentheses
Always use parentheses - Even for single parameters
Trailing Commas
Trailing Commas
Use trailing commas - Cleaner diffs and fewer merge conflicts
React/Next.js Conventions
Python Style
GAIA uses Ruff for both linting and formatting.Configuration
pyproject.toml in apps/api/:
Running Ruff
Key Rules
Type Hints Required
Type Hints Required
Always provide type annotations - For parameters and return values
No Inline Imports
No Inline Imports
All imports at the top - Grouped by standard, third-party, local
PEP 8 Style
PEP 8 Style
Follow PEP 8 - Standard Python style guide
Docstrings
Docstrings
Google-style docstrings - For classes and public functions
Error Handling
Error Handling
Explicit error handling - Use try-except with specific exceptions
Agent Tool Pattern
General Principles
Self-Documenting Code
Code should be clear without verbose comments. Use meaningful names.
Feature-Based Organization
Group files by feature/domain, not by file type.
Absolute Imports
Use path aliases (
@/ for frontend, app. for backend).Single Responsibility
Each function/component should do one thing well.
IDE Setup
VS Code
Recommended extensions and settings:- Biome (biomejs.biome)
- Ruff (charliermarsh.ruff)
- Python (ms-python.python)
- Mypy (matangover.mypy)
Pre-commit Hooks
Install pre-commit hooks to enforce style:.pre-commit-config.yaml):
- YAML, JSON, TOML validation
- Merge conflict detection
- Large file checks
- Python AST validation
- Secret detection
CI/CD Checks
All code must pass automated checks:Quick Reference
TypeScript Commands
Python Commands
All Projects
Next Steps
Contributing
Learn the contribution workflow
Pull Requests
PR requirements and process
Conventional Commits
Commit message guidelines