# Contributing This project and everyone participating in it are governed by the Code of Conduct which can be found in the file [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. ## Prerequisites - [mise](https://mise.jdx.dev/): manages tool versions (Node.js, pnpm, [Turbo](https://turbo.build/), Ollama) - [Docker](https://docs.docker.com/get-docker/): runs local service dependencies (PostgreSQL, etc.) ## Getting Started ### Install tooling [mise](https://mise.jdx.dev/) reads `mise.toml` and installs the correct versions of Node.js, pnpm, Turbo, and Ollama. ```sh mise install ``` Use mise-managed tools directly after activation, or through `mise exec` in non-interactive scripts: ```sh mise exec -- pnpm install mise exec -- turbo build ``` ### Start local services ```sh docker compose up -d ``` ### Install dependencies and build ```sh pnpm install turbo build ``` Build a specific package and its dependencies: ```sh turbo build --filter=@shipfox/api... ``` ## Dependency versions Read the [dependency version policy](docs/policies/dependency-versions.md) before adding, updating, or exempting a dependency. It defines catalog range rules, peer compatibility, coordinated Renovate families, and the transitive exception format. ## Local Tooling ### Mise Tasks The repository defines project tasks in `mise.toml`. List them with: ```sh mise tasks ``` Mise tasks are safe to run from the main checkout or from a Conductor worktree. When a task needs the main checkout, it detects `CONDUCTOR_ROOT_PATH` and delegates to `mise -C "$CONDUCTOR_ROOT_PATH" run `. ### Shared Ollama Ollama is installed by mise and is used as a shared local service. It is started from the main checkout, not from each Conductor worktree, because the server is heavy and stateless. Conductor setup runs this automatically for local workspaces: ```sh mise run ollama:up ``` From a worktree, that task delegates to the root checkout and runs the root `ollama:up` task. From the root checkout, it starts `ollama serve`, pulls `smollm2:135m-instruct-q2_K`, and then reports the API as ready. A background warmup request preloads the model with a 24 hour keep-alive, so callers can start using the Ollama HTTP API as soon as the pull completes. Useful commands: ```sh mise run ollama:up # start the shared server and pull smollm2:135m-instruct-q2_K mise run ollama:status # show endpoint, root path, and managed process status mise run ollama:stop # stop the server if this repo started it ``` The helper stores process state and logs under: ```text $CONDUCTOR_ROOT_PATH/.context/shared-ollama/ ``` The default endpoint is `http://127.0.0.1:11434`. Override it only when needed: ```sh SHIPFOX_OLLAMA_BASE_URL=http://127.0.0.1:11500 mise run ollama:up SHIPFOX_OLLAMA_MODEL=other:model mise run ollama:up SHIPFOX_OLLAMA_KEEP_ALIVE=2h mise run ollama:up ``` ### Conductor Worktree Services Conductor workspaces run `dev/worktree-services.mjs up` during setup. This creates per-worktree Docker services, assigns ports from `CONDUCTOR_PORT`, and writes the generated app environment to `.context/local-services/env`, which is loaded by `mise.toml`. Common commands: ```sh mise exec -- node dev/worktree-services.mjs status mise exec -- node dev/worktree-services.mjs stop mise exec -- node dev/worktree-services.mjs destroy ``` `destroy` removes the worktree Docker volumes and generated local-service state. The shared Ollama service is intentionally not stopped during workspace archive. ## Writing Documentation All technical writing (docs pages, package READMEs, guides) follows [WRITING.md](WRITING.md): structure for skimming, sentence and word rules, a strict no-em-dash rule, and language-level targets with a readability script. Docs-app pages additionally follow [apps/docs/WRITING.md](apps/docs/WRITING.md). ## Directory Structure ``` apps/ Application packages (deployable services) dev/ Local environment and Conductor workspace lifecycle e2e/ E2E harness, fixtures, screens, and suites libs/ Library packages (shared code, published or internal) tools/ Internal build, policy, and release tooling ``` Each package follows the same layout: ``` package/ src/ Source code test/ Test factories and helpers dist/ Build output (git-ignored) ``` ## Common Scripts Available in most packages via `pnpm