Getting Started¶
Step-by-step guide to set up a development environment for SynthOrg.
Prerequisites¶
Python 3.14+¶
Download from python.org or use a version manager like pyenv.
uv (package manager)¶
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Git¶
Required for cloning the repository and commit hooks. Install from git-scm.com.
Clone and Install¶
uv sync creates a virtual environment in .venv/ and installs all development dependencies (linters, type checker, test runner, pre-commit, etc.).
Verify Installation¶
Run the smoke tests to confirm everything is working:
You should see all tests passing.
Pre-commit Hooks¶
Install the Git hooks so code quality checks run automatically on each commit:
This installs hooks for pre-commit, commit-msg, and pre-push stages. To run all hooks manually against the entire codebase:
What the hooks do¶
| Hook | Purpose |
|---|---|
| trailing-whitespace | Remove trailing whitespace |
| end-of-file-fixer | Ensure files end with a newline |
| check-yaml / check-toml / check-json | Validate config file syntax |
| check-merge-conflict | Prevent committing merge conflict markers |
| check-added-large-files | Block files > 1 MB |
| no-commit-to-branch | Block direct commits to main |
| ruff (check + format) | Lint and format Python code |
| gitleaks | Detect hardcoded secrets |
| commitizen | Enforce conventional commit message format |
| mypy (pre-push) | Type-check affected modules |
| pytest (pre-push) | Run unit tests for affected modules |
| golangci-lint + go vet (pre-push) | Lint/vet Go CLI code (conditional on cli/**/*.go) |
| eslint-web (pre-push) | Lint web dashboard (conditional on web/src/**) |
Quality Checks¶
Run these before pushing to make sure CI will pass:
# Lint
uv run ruff check src/ tests/
# Format check (no changes, just verify)
uv run ruff format --check src/ tests/
# Type check
uv run mypy src/ tests/
# Tests with coverage
uv run python -m pytest tests/ -n 8 --cov=synthorg --cov-fail-under=80
To auto-fix lint issues and reformat:
Project Layout¶
synthorg/
src/synthorg/ # Main package (src layout)
api/ # Litestar REST + WebSocket routes
budget/ # Cost tracking and spending controls
cli/ # Python CLI module (see top-level cli/ for Go CLI)
communication/ # Inter-agent message bus
config/ # YAML config loading and validation
core/ # Shared domain models
engine/ # Agent execution engine
memory/ # Persistent agent memory
providers/ # LLM provider abstraction
security/ # SecOps, approval gates, sandboxing
templates/ # Pre-built company templates
tools/ # Tool registry, MCP integration
hr/ # HR engine (hiring, firing, performance)
observability/ # Structured logging, correlation tracking
persistence/ # Pluggable persistence backends
settings/ # Runtime-editable settings
backup/ # Backup/restore orchestrator
tests/
unit/ # Fast, isolated tests (no I/O)
integration/ # Tests with I/O, databases, APIs
e2e/ # Full system tests
docs/ # Developer documentation
docker/ # Dockerfiles, Compose, .env.example
web/ # React 19 web dashboard (shadcn/ui + Tailwind CSS)
.github/ # CI workflows, dependabot, actions
pyproject.toml # Project config (deps, tools, linters)
docs/DESIGN_SPEC.md # Pointer to design specification pages
CLAUDE.md # AI assistant quick reference
Web Dashboard Development¶
The React dashboard lives in web/. Prerequisites: Node.js 22+.
npm --prefix web install # install frontend deps
npm --prefix web run dev # dev server at http://localhost:5173
npm --prefix web run lint # ESLint (zero warnings enforced)
npm --prefix web run type-check # TypeScript type checking
npm --prefix web run test # Vitest unit tests
npm --prefix web run build # production build
IDE Setup¶
VS Code / Cursor¶
Recommended extensions:
- Ruff (
charliermarsh.ruff) -- linting and formatting - Pylance (
ms-python.vscode-pylance) -- type checking and IntelliSense
Both Pylance (pyright) and mypy are configured in strict mode. They complement each other: Pylance provides real-time IDE feedback while mypy runs in CI as the authoritative check.
Set the Python interpreter to the project virtual environment:
VS Code should auto-detect the .venv directory. If not, use Python: Select Interpreter from the command palette.
Next Steps¶
- Contributing Guide -- development workflow, testing, and PR process
- CONTRIBUTING.md -- branch, commit, and PR workflow
- CLAUDE.md -- code conventions and quick command reference
- Design Specification -- full high-level design specification