# Contributing

Manim Stateflow is test-first.

Before adding a feature, write the smallest automated test that describes the behavior. If the feature affects visible behavior, also add a small review scene in `examples/` so the motion can be inspected.

## Development Setup

Create an environment, then install the package in editable mode:

```powershell
python -m pip install -e ".[test]"
```

If you want to render examples, install Manim too:

```powershell
python -m pip install -e ".[test,manim]"
```

## Test Commands

Run the fast test suite:

```powershell
pytest -q
```

Render a review scene:

```powershell
manim -ql examples/01_quickstart.py Quickstart
```

Before opening a release PR, also run:

```powershell
python -m build
python -m twine check dist/*
```

## Design Rules

- Manim Stateflow owns dependency tracking, dirty scheduling, and cleanup.
- Manim owns geometry, layout, interpolation, rendering, and user-authored updaters.
- The pure graph should not contain raw Manim `Mobject`s.
- Object relations should be method effects, such as `label.d.next_to(dot, UP)`.
- `.d.apply(...)` is dependency-driven; `.d.on_frame(...)` is frame-driven.
- A feature is incomplete until tests exist and pass.
- Visible behavior should have a review scene.

See `docs/guide.md` for the longer version of the core patterns.
