# Agent Guidelines

## Test-Driven Development

Follow TDD for all code changes:

1. Write or update tests before implementing functionality.
2. Run the test suite (`uv run pytest`) and confirm the new tests fail for the expected reason.
3. Implement the minimum code to make the tests pass.
4. Run the full test suite again to verify nothing is broken.

Do not skip tests for "simple" changes. If you're changing behavior, there should be a test that covers it.

## Documentation

Before committing changes, check whether `src/abreka/docs/user_guide.md` needs to be updated. If your changes add, remove, or modify any of the following, update the guide to match:

- CLI commands, flags, or arguments
- Configuration options in `config.toml`
- Web UI pages or features
- Experiment lifecycle or status transitions
- Metrics protocol
- Agent prompts or template variables
- Project structure or conventions

The user guide is served in the web UI at `/guide` and is the primary reference for users. It must stay accurate.

## Global Install

After every commit, reinstall abreka globally as a uv tool so the `abreka` CLI reflects the latest changes:

```bash
UV_TOOL_BIN_DIR=~/.local/bin UV_TOOL_DIR=~/.local/share/uv/tools uv tool install --force --reinstall /home/generativist/Projects/abreka
```
