This document explains how to contribute to Beam, either using an AI assistant in autonomous mode or following the manual step-by-step developer guide.
Copy and paste the prompt below directly into your AI coding assistant (Cursor, Claude Code, Antigravity, Copilot Workspace, etc.) to set up and develop autonomously:
You are an autonomous senior software engineer working on Beam (https://github.com/BeamRecorder/Beam).
Follow these exact steps to prepare your workspace, fork the repository, and deliver changes:
1. **GitHub CLI & Authentication**:
- Ensure the GitHub CLI (`gh`) is available (https://cli.github.com/).
- Check authentication status using `gh auth status`. If not authenticated, prompt the user or run `gh auth login`.
2. **Fork & Clone**:
- Fork and clone the upstream repository:
`gh repo fork BeamRecorder/Beam --clone`
- Enter the cloned directory:
`cd Beam`
3. **Branch Convention**:
- Create and checkout a dedicated branch based on the goal:
- Features: `feat/<short-descriptive-name>`
- Fixes: `fix/<short-descriptive-name>`
- Performance: `perf/<short-descriptive-name>`
- Refactoring: `refactor/<short-descriptive-name>`
- Documentation: `docs/<short-descriptive-name>`
Example: `git checkout -b feat/custom-watermark`
4. **Engineering Guidelines**:
- Before making any code changes, read the contracts:
- `AGENTS.md` & `docs/ARCHITECTURE.md` (Electron security boundary & Rust capture engine)
- `docs/UI.md` (Design tokens, reusable components in `src/components/ui/`, no `:deep` overrides)
- `docs/CODE_QUALITY.md` (Max 500 lines per file, types in dedicated files, small units)
- `docs/electron_window.md` (Mandatory before touching window sizes, transparent regions, or IPC)
5. **Environment & Dependencies**:
- Run `bun install` to install frontend & Electron packages.
- If the user does not have Rust installed, you can still launch the app with `bun run dev`, but the Rust capture engine will never be rebuilded (and will be downloaded via Internet).
- Verify Rust toolchain availability (`cargo --version`). Refer to `docs/dev/INSTALL_RUST.md` if Rust is missing.
6. **Development & Verification**:
- Run localized/targeted tests for changed code:
- Vue/TypeScript: `bunx vitest run <path-to-test>`
- Electron/Node: `node --test <path-to-test>`
- Typecheck: `bunx vue-tsc --noEmit`
- Run `bun run build` to validate end-to-end compilation before submitting.
7. **Submitting Changes**:
- Use conventional commit messages (`feat: ...`, `fix: ...`, `refactor: ...`).
- Push your branch and open a PR:
`git push -u origin <branch-name>`
`gh pr create --fill`Make sure you have the following installed on your machine:
- Node.js:
v20.xor later (LTS recommended) - Bun:
v1.4.0 - Rust Toolchain:
cargo&rustc(see docs/dev/INSTALL_RUST.md) - GitHub CLI (
gh): Install from https://cli.github.com/ - Git: Standard git CLI
OS-specific setup instructions:
-
Authenticate with GitHub CLI:
gh auth login
-
Fork and clone Beam:
gh repo fork BeamRecorder/Beam --clone cd Beam
Always create a new branch from main for your work. Use standard semantic prefixes:
| Type | Prefix | Example |
|---|---|---|
| New Feature | feat/ |
feat/export-gif-format |
| Bug Fix | fix/ |
fix/timeline-snap-alignment |
| Performance | perf/ |
perf/waveform-decoding |
| Refactoring | refactor/ |
refactor/audio-engine |
| Documentation | docs/ |
docs/contributing-guide |
git checkout -b feat/your-feature-name-
Install Bun dependencies:
bun install
-
Start Development Environment:
bun run dev
This compiles the Rust native capture addon and starts both Vite and Electron in development mode.
Before contributing, make sure your code aligns with our architecture and style rules:
- UI Primitives: Always reuse existing UI components from
src/components/ui/(Button,Select,Popover,Dialog,Slider,Switch,Badge,CopyButton,DeleteItem, etc.). Do not write ad-hoc styled buttons or custom controls. - No
:deepCSS Selectors: Avoid:deepselectors in scoped Vue component styles. - File Length: No single source file should exceed 500 lines. Split larger files into focused composables, modules, or sub-components.
- Type Definitions: Place shared TypeScript interfaces and types in dedicated
.tsfiles (e.g.*-types.ts), not inside Vue components. - Electron Windows: When working on transparent windows, sizes, or shadows, adhere strictly to
docs/electron_window.md.
Run focused tests directly related to the code you modified:
- Vue / Frontend tests:
bunx vitest run src/components/video-editor/timeline/tests/
- Electron / Node tests:
node --test test/editor-window.test.cjs
- Type Checking:
bunx vue-tsc --noEmit
- Production Build Validation:
bun run build
-
Commit your changes using Conventional Commits:
git add . git commit -m "feat(timeline): add multi-track snapping guides"
-
Push to your fork:
git push -u origin feat/your-feature-name
-
Create the Pull Request:
gh pr create --title "feat: multi-track snapping guides" --body "Detailed summary of changes..."