# Get started

## Install {#install}


```sh
pnpm add lifecycle-kit
```

Lifecycle Kit is ESM-only and supports the maintained Node.js 22, 24 and 26 lines (`>=22`) plus modern
bundlers. CommonJS applications can load it with dynamic `import()`.


## Use a stage {#use-a-stage}


Subpath imports are the primary interface. They minimize the imported surface
and make dependencies visible at the call site.

```ts
import { compositionColor, deriveBiochemistry, normalise } from "lifecycle-kit/chem";

const { backbone } = deriveBiochemistry({ Si: 30 }, 500);
// backbone: "Si"

const body = normalise({ sugar: 0, protein: 3, lipid: 1, mineral: 0, chitin: 0, keratin: 0 });
compositionColor(body); // "#beb5af"
```

Structured inputs are validated at the exported-function boundary. Invalid
physical quantities throw a named error instead of propagating `NaN` into a
later stage.


## Run the repository examples {#run-the-repository-examples}


The repository includes two examples that execute against the built package
export map in CI:

```sh
pnpm build
pnpm check:examples
```

- [`quick-start.mjs`](https://github.com/jbcom/lifecycle-kit/blob/main/examples/quick-start.mjs)
  demonstrates the smallest useful chemistry-and-metabolism loop.
- [`world-creature.mjs`](https://github.com/jbcom/lifecycle-kit/blob/main/examples/world-creature.mjs)
  carries a world and creature through the full pipeline.

Next, read [How the pipeline stays deterministic](https://jonbogaty.com/lifecycle-kit/determinism/index.md) or browse the
[API reference](https://jonbogaty.com/lifecycle-kit/api-reference/index.md).

To turn a `Path` into an SVG, Pixi Graphics calls, or depth-sorted render data,
continue to [Render a creature](https://jonbogaty.com/lifecycle-kit/rendering/index.md). If an automated coding agent is
integrating the library, use the explicit contract in
[Agentic consumers](https://jonbogaty.com/lifecycle-kit/agentic-consumers/index.md) before it generates an integration.
