AGENTS.md — shared-libs
This directory groups shared Rust crates and TypeScript modules. There is no build
or test target for shared-libs/ itself — operate inside the relevant sub-library and
read its own AGENTS.md first. CLAUDE.md is a one-line @AGENTS.md import. See
ARCHITECTURE.md for structure.
Layout
crates/start-core/— Rust backend lib (start-core, lib namestart_core). Has its ownAGENTS.mdandARCHITECTURE.md, plus topic notes (core-rust-patterns.md,i18n-patterns.md,patchdb.md,rpc-toolkit.md,s9pk-structure.md,exver.md,VERSION_BUMP.md).crates/rpc-toolkit/— JSON-RPC handlers, transports, CLI bindings and optional TypeScript method-tree generation.crates/visit-rs/andcrates/visit-rs-derive/— generic value/type reflection and opaque metadata. RPC owns serde normalization and TypeScript policy. Both start-core and StartWRT use the in-workspace runtime crate; rpc-toolkit uses it for its opt-intsfeature.- The other first-party Rust crates have their own scoped guidance.
ts-modules/— shared TypeScript modules; the@start9labs/sharedand@start9labs/marketplaceAngular libraries plus the non-Angular@start9labs/start-core(start-core/— the SDK's core types/ABI/effects/OS bindings, consumed by web and bundled into the SDK; the workspace root is the repo root, whereangular.jsonlives). Has its ownAGENTS.mdandARCHITECTURE.md(structure and data flow).
Contributor workflow
Build and test Rust by package name from the root workspace. make start-core-test
exercises the backend; make rpc-toolkit-test exercises reflection and RPC bindings
in their supported feature configurations, including generated-module checks with
the root pinned TypeScript compiler. The latter installs its Node prerequisites
through the existing workspace make rules.
make start-core-format and make start-core-format-check include every shared
Rust crate. Native Rust builds are Linux-only; CI also verifies the product target
matrix. Platform-specific dependencies and APIs must preserve those targets.
Web (ts-modules/) — runs from the repo root (the Angular workspace root, where
package.json lives; there is no package.json under ts-modules/):
npm ci
npm run build:deps # builds @start9labs/start-core + patch-db client (required before typecheck/build)
npm run check # typechecks all projects
make web-format-check # prettier check across the Angular workspace (make web-format to write)
Gotchas
- No code lives directly in
shared-libs/— only the two sub-dirs. - start-core is one crate in one workspace. Build it by package name
(
-p start-core), not bycd-ing and running a barecargo build. There is a single rootCargo.toml/Cargo.lock. - Cross-platform matters for Rust. Local
cargo checkis linux-only; CI builds an apple-darwin + linux-musl matrix. Changes touchinglibc/platform APIs or deps can break darwin even when linux passes — cfg-gate platform-specific code rather than reimplementing it cross-platform. - The repo root is the Angular workspace for ALL front ends. The product apps
(
projects/start-os/web/{ui,setup-wizard},projects/start-tunnel/web,projects/start-wrt/web,projects/brochure-marketplace) build through this root workspace; theirangular.jsonentries point into the product dirs. Editing a shared lib affects every app — runnpm run check(all projects) after. build:depsis a prerequisite.@start9labs/start-coreresolves toshared-libs/ts-modules/start-core/distandpatch-db-clienttoshared-libs/crates/patch-db/client(from the workspace root); both must be built before typecheck/build will succeed.- patch-db is a first-party crate at repo-root
shared-libs/crates/patch-db/. start-core consumes its Rustcore; web consumes its TSclient. - Web UI work follows the
start9-frontendskill at the repo root (.claude/skills/start9-frontend/) — seets-modules/AGENTS.md. - Do not edit
CLAUDE.mdfiles — they are one-line@AGENTS.mdimports.
Shared Rust formatting
Every crate under crates/ formats through make start-core-format and
make start-core-format-check, using the root pinned-nightly formatter.