This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Firevector is a wildfire observation and fire behavior calculation tool. It digitizes the NWCG fire behavior observation form, computing derived fields like Effective Wind Speed (EWS), EWS ratios, and projected Rate of Spread (ROS) from field observations.
npm workspaces monorepo with three layers:
packages/schema— Shared TypeScript types for the fire observation data model (FireObservation,WindSlope,RateOfSpread, etc.). No runtime deps, types-only package.packages/engine— Pure calculation functions (calculateTotalEws,calculateEwsRatio,calculateRos,recompute). Depends on@firevector/schema. All functions returnnullwhen inputs are incomplete — no exceptions for missing data.apps/web— Next.js frontend (planned, not yet scaffolded)services/api— Python FastAPI backend (planned, not yet scaffolded). Will useuvfor env management.
Cross-package imports use @firevector/schema and @firevector/engine workspace references.
# Install all workspace dependencies
npm install
# Run engine tests (Vitest)
npm run test:engine
# Run a single engine test file
npx vitest run --workspace=packages/engine src/__tests__/engine.test.ts
# Run API tests (when scaffolded)
npm run test:api # runs: cd services/api && uv run pytest
# Run all tests
npm test # engine + api- TypeScript — ES2022 target, strict mode, bundler module resolution
- Vitest — test runner for TS packages
- Python / FastAPI — planned API service (pytest for testing, uv for package management)
- Open-Meteo — weather data source (see
WeatherResponsetype in schema)
- EWS (Effective Wind Speed) = midflame wind speed + slope contribution
- EWS Ratio = max(observed, predicted) / min(observed, predicted); null if denominator is zero
- ROS (Rate of Spread) — projected from observed ROS and EWS ratio; multiplied if "faster", divided if "slower"
recompute()— the main entrypoint that recalculates all derived fields from raw inputs in a single pass- Null propagation — any calculation with null inputs returns null (no defaults, no exceptions)