From 638abd797033e5802222e42473ca789140871f0d Mon Sep 17 00:00:00 2001 From: davidweb3-ctrl Date: Mon, 23 Mar 2026 23:30:19 +0000 Subject: [PATCH] docs: add CONTRIBUTING.md and CI badge to README - Add comprehensive CONTRIBUTING.md with setup instructions - Add CI status badge and other shields to README - Include coding style guidelines and PR process bounty:8e29b86d-2387-4a5a-bd72-69afaa74c4ad --- CONTRIBUTING.md | 143 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 4 ++ 2 files changed, 147 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..b1e31e59f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,143 @@ +# Contributing to agent-browser + +Thank you for your interest in contributing to agent-browser! This document provides guidelines for contributing to the project. + +## Table of Contents + +- [Development Environment Setup](#development-environment-setup) +- [Coding Style Guidelines](#coding-style-guidelines) +- [Submitting a Pull Request](#submitting-a-pull-request) + +## Development Environment Setup + +### Prerequisites + +- **Node.js** >= 20.x +- **pnpm** >= 9.x (package manager) +- **Rust** >= 1.70 (for native CLI) +- **Git** + +### Installation + +1. Fork the repository on GitHub +2. Clone your fork: + ```bash + git clone https://github.com/YOUR_USERNAME/agent-browser.git + cd agent-browser + ``` + +3. Install dependencies: + ```bash + pnpm install + ``` + +4. Install Playwright browsers: + ```bash + pnpm exec playwright install --with-deps chromium + ``` + +5. Build the TypeScript: + ```bash + pnpm build + ``` + +6. (Optional) Build the Rust CLI: + ```bash + pnpm run build:native + ``` + +### Running Tests + +```bash +# Run all tests +pnpm test + +# Run tests in watch mode +pnpm test:watch + +# Run Rust tests only +cargo test --manifest-path cli/Cargo.toml +``` + +### Running the Development Server + +```bash +pnpm dev +``` + +## Coding Style Guidelines + +### TypeScript/JavaScript + +- Use **TypeScript** for all new code +- Follow the existing code style (enforced by Prettier) +- Run `pnpm format` before committing +- Run `pnpm typecheck` to ensure type safety + +### Rust + +- Follow standard Rust formatting (`cargo fmt`) +- Run `cargo clippy` to catch common mistakes +- Ensure all tests pass: `cargo test` + +### General + +- Write clear, descriptive commit messages +- Add tests for new functionality +- Update documentation as needed +- Keep changes focused and atomic + +## Submitting a Pull Request + +1. **Create a branch** for your changes: + ```bash + git checkout -b feature/your-feature-name + ``` + +2. **Make your changes** following the coding guidelines above + +3. **Test your changes**: + ```bash + pnpm test + pnpm typecheck + pnpm format:check + ``` + +4. **Commit your changes**: + ```bash + git add . + git commit -m "feat: add your feature description" + ``` + +5. **Push to your fork**: + ```bash + git push origin feature/your-feature-name + ``` + +6. **Create a Pull Request** on GitHub: + - Go to the original repository + - Click "New Pull Request" + - Select your branch + - Fill in the PR template with: + - Clear description of changes + - Related issue numbers (if applicable) + - Testing performed + +7. **Wait for review** - maintainers will review your PR and provide feedback + +### PR Checklist + +- [ ] Tests pass (`pnpm test`) +- [ ] TypeScript compiles without errors (`pnpm typecheck`) +- [ ] Code is formatted (`pnpm format`) +- [ ] Commit messages are clear and descriptive +- [ ] Documentation is updated (if needed) + +## Questions? + +Feel free to open an issue for: +- Bug reports +- Feature requests +- Questions about contributing + +Thank you for contributing! diff --git a/README.md b/README.md index 7b0dfba9a..ed486c208 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # agent-browser +[![CI](https://github.com/dextonai/agent-browser/actions/workflows/ci.yml/badge.svg)](https://github.com/dextonai/agent-browser/actions/workflows/ci.yml) +[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![npm version](https://img.shields.io/npm/v/agent-browser.svg)](https://www.npmjs.com/package/agent-browser) + Headless browser automation CLI for AI agents. Fast Rust CLI with Node.js fallback. ## Installation