# Contributing to Otto

Thanks for wanting to contribute! Otto is a young project and we genuinely appreciate any help.

## Getting Started

1. Fork the repo
2. Clone your fork:
   ```bash
   git clone https://github.com/YOUR_USERNAME/otto.git
   cd otto
   ```
3. Create a branch for your changes:
   ```bash
   git checkout -b my-feature
   ```

## Project Structure

```
otto/
├── extension/          # Chrome extension (JavaScript)
│   ├── manifest.json
│   ├── src/
│   └── ...
└── macos/              # macOS agent (Swift + Python)
    ├── Sources/Otto/
    ├── agent.py
    └── ...
```

## Extension Development

The browser extension is plain JavaScript — no build step required.

1. Make your changes in `extension/`
2. Go to `chrome://extensions`
3. Click the refresh icon on the Otto extension
4. Test your changes

Key files:
- `src/background/` — Service worker, tab management
- `src/content/` — DOM interaction, tools
- `src/sidebar/` — Chat UI
- `src/ai/` — OpenRouter API, prompts

## macOS Agent Development

The macOS agent is written in Swift with a Python orchestration layer.

1. Make your changes in `macos/`
2. Build:
   ```bash
   cd macos
   swift build
   ```
3. Test:
   ```bash
   .build/debug/otto --help
   ```

Key files:
- `Sources/Otto/main.swift` — CLI commands
- `Sources/Otto/AccessibilityService.swift` — UI element detection
- `agent.py` — AI agent loop

## Submitting Changes

1. Commit your changes with a clear message
2. Push to your fork
3. Open a Pull Request

We'll review it as soon as we can. Don't worry about making it perfect — we're happy to help iterate.

## Ideas for Contributions

Not sure where to start? Here are some ideas:

- **Bug fixes** — Found something broken? Fix it!
- **Documentation** — Improve README, add examples
- **New tools** — Add browser automation capabilities
- **UI improvements** — Make the sidebar nicer
- **Error handling** — Better error messages help everyone

## Questions?

Open an issue or reach out. We're friendly.

---

Thanks again for contributing!
