Core Commands

Quick reference for common development tasks across all components.

Frontend (Next.js)

cd prospero/frontend
npm run dev          # Start development server
npm run build        # Build for production
npm run lint         # Run linting (fails on warnings)
npm run lint:fix     # Fix linting issues
npm run format       # Format with prettier
npm run test         # Run Jest tests
npm run test:e2e     # Run Playwright E2E tests
npm run generate-types # Generate TypeScript types

Python (ML/Backend)

cd prospero/python
uv sync                      # Install dependencies
uv run ruff check .          # Run linting
uv run ruff format .         # Format code
uv run mypy .                # Type checking
uv run pytest                # Run all tests
uv run pytest client_tests/  # Integration tests
uv run pytest functional_tests/ # Functional tests

Rust (API/Core)

cd prospero/rust
cargo build          # Build all crates
cargo test           # Run tests
cargo clippy         # Run linter
cargo fmt            # Format code
cargo run --bin api  # Run API server

Utility Scripts

Located in the root directory for cross-component operations:
./scripts/lint.sh             # Lint all components
./scripts/pytests.sh          # Run Python tests
./scripts/client_tests.sh     # Run client integration tests
./scripts/functional_tests.sh # Run functional tests
./scripts/ci_tests.sh         # Run full CI test suite
./scripts/rust_build.sh       # Build Rust components

Development Guidelines

React/Frontend Best Practices

Only use useEffect when truly necessary. See React documentation for alternatives.

Color System

Use the predefined color system from prospero/frontend/app/globals.css:
// Use semantic colors that adapt to theme
<div className="bg-primary text-primary-foreground">
  Primary content
</div>
<div className="bg-error text-error-foreground">
  Error message
</div>
Always pair background colors with their corresponding foreground colors for proper contrast in both light and dark modes.

Rust Development Standards

Code Organization

  • Always place use statements at the top of files
  • Use workspace dependencies in prospero/rust/Cargo.toml
  • Never specify versions in individual crate Cargo.toml files

API Development

When modifying API endpoints:
  1. Update the endpoint implementation
  2. Run golden tests to update OpenAPI spec:
    cargo test golden  # First run fails
    cargo test golden  # Second run passes
    
  3. Update structify.stainless.yml if needed
  4. Commit the updated openapi.json

Formatting

Use the project-specific formatter configuration:
cargo fmt --all -- --config-path /home/dev/src/prospero/rust/.rustfmt.toml

Python Development

Workflow Functions

When using the analytics decorator, ensure helper functions are defined inside:
@analytics_decorator()
def process_data(df: pl.LazyFrame) -> pl.LazyFrame:
    # Helper defined inside ensures cache invalidation
    def normalize_value(x):
        return (x - x.mean()) / x.std()

    return df.with_columns(normalize_value(pl.col("value")))

API/SDK Generation

The SDK generation pipeline:
  1. Source: Rust code with utoipa annotations
  2. Generation: Golden tests create openapi.json
  3. SDK Creation: Stainless uses OpenAPI + config
  4. Distribution: SDKs published to npm/PyPI
Always commit openapi.json changes with API modifications to keep SDKs in sync.

Critical Rules

Code Quality Standards

  • Write self-documenting code that doesn’t need comments
  • Use clear, descriptive variable names
  • Only add comments for genuinely complex logic
  • No docstrings or file headers (they become outdated)
  • No comments when removing code

Git Workflow

  • Keep PRs atomic and under ~200 lines when possible
  • Use branch naming convention: claude/{feature-name}
  • Write clear commit messages focusing on “why”
  • Squash and merge to maintain linear history

Testing Strategy

Test Organization

  • Unit Tests: Jest with React Testing Library
  • Integration: Component interaction tests
  • E2E: Playwright for user workflows
  • Location: __tests__/ directories

Running Tests

# Run all tests
./scripts/ci_tests.sh

# Component-specific
cd prospero/frontend && npm test
cd prospero/python && uv run pytest
cd prospero/rust && cargo test

Environment Setup

Required Tools

1

Install UV for Python

curl -LsSf https://astral.sh/uv/install.sh | sh
2

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
3

Install Node.js

# Using nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18

IDE Configuration

Install recommended extensions:
  • Rust Analyzer
  • Python (Pylance)
  • ESLint
  • Prettier
  • Tailwind CSS IntelliSense

Startup Mindset

This is a fast-moving startup environment. We prioritize:
  • Speed: Ship features in days, not weeks
  • Quality: Maintain high code standards
  • Simplicity: Avoid over-engineering
  • Focus: Build what users need now
Make good architectural choices but optimize for rapid iteration. Perfect is the enemy of shipped.