diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..e7a0e7084 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,131 @@ +# Contributing to agent-browser + +Thank you for your interest in contributing to agent-browser! This guide will help you get started. + +## Development Setup + +### Prerequisites + +- **Node.js** 18+ (for the CLI wrapper and dashboard) +- **pnpm** (package manager) — install via `npm install -g pnpm` +- **Rust** (for the native binary) — install via https://rustup.rs +- **Chrome** — downloaded automatically via `agent-browser install` + +### Getting Started + +1. Fork and clone the repository: + +```bash +git clone https://github.com/YOUR-USERNAME/agent-browser.git +cd agent-browser +``` + +2. Install dependencies: + +```bash +pnpm install +``` + +3. Build the project: + +```bash +pnpm build # Build the Node.js wrapper +pnpm build:native # Build the Rust binary (requires Rust toolchain) +``` + +4. Link globally for local development: + +```bash +pnpm link --global +``` + +5. Download Chrome for Testing: + +```bash +agent-browser install +``` + +## Package Manager + +This project uses **pnpm**. Always use `pnpm` instead of `npm` or `yarn` for all package management tasks. + +## Code Style + +- Do not use emojis in code, output, or documentation. Unicode symbols are acceptable. +- CLI flags must always use **kebab-case** (e.g., `--auto-connect`). Never use camelCase for flags. +- CLI colored output should use `cli/src/color.rs`, which respects the `NO_COLOR` environment variable. +- Use param-case (kebab-case) for all file and folder names (e.g., `session-tree.tsx`). + +### Linting and Formatting + +This project uses **Prettier** for formatting. Run before committing: + +```bash +pnpm prettier --write . +``` + +## Project Structure + +- `cli/` — Rust CLI binary (browser automation daemon, CDP client, actions) +- `packages/dashboard/` — Next.js dashboard web app +- `src/` — Node.js CLI wrapper +- `docs/` — Documentation site (Next.js + MDX) +- `skills/` — AI agent skill definitions +- `scripts/` — Build and utility scripts +- `docker/` — Docker build configurations + +## Making Changes + +### Updating Documentation + +When adding or changing user-facing features, update **all** of the following: + +1. `cli/src/output.rs` — `--help` output +2. `README.md` — Options table and relevant sections +3. `skills/agent-browser/SKILL.md` — AI agent skill docs +4. `docs/src/app/` — Documentation site (MDX pages) +5. Inline doc comments in source files + +In `docs/src/app/` MDX files, always use HTML `