Contributing
Thanks for contributing to Zo Co-browse! This project uses a git-flow-style branching model with a hard verification gate. See Development Setup for the toolchain first.
Branching model
main (protected) ← always the latest working release code; releases cut here
▲
│ PR (CI must be green)
│
dev (protected) ← integration branch; where features merge together
▲
│ PR (CI must be green)
│
feature/* fix/* chore/* ← one branch per unit of work, branched from devRules:
- Branch from
dev, merge back todev. Every feature/fix/chore branch starts atdevand returns todevvia pull request. CI must be green to merge. dev→mainis a PR. Promotion tomainstabilizes it for release. CI must be green;mainis kept strictly up-to-date before merge.- No direct pushes to
mainordev. Both are protected — all changes land via PR. - Releases are deliberate, not automatic. Cut releases from
mainwith avX.Y.Ztag (see Building & Releasing). - Never commit secrets. API tokens live in
chrome.storage.localat runtime, not in the repo.
Merging to
maindoes not publish a release — it only keepsmainreleasable. Thev*tag is the release trigger.
Development setup
bash
git clone https://github.com/CCAgentOrg/zo-cobrowse.git
cd zo-cobrowse
bun install # installs zod + bun-types
bun run setup-hooks # installs the pre-commit verification gate
bun test # all 494 tests should passStart every change from dev:
bash
git checkout dev && git pull
git checkout -b feature/<short-description>Development loop (verify before commit)
The repo practices loop engineering: every change is verified before it is committed, and bun run verify runs all of it:
bash
bun run verify # = tests (bun test) → release checks (lint) → transpile check- The pre-commit hook (from
setup-hooks) runsbun run verifyon every commit and blocks it if anything fails. No husky needed. - Bypass deliberately with
git commit --no-verify. - CI runs the same checks on every branch push and on PRs into
mainanddev.
Code style
- No runtime dependencies beyond zod — the extension loads nothing from npm at runtime.
- Chrome API calls use the callback pattern (MV3 service worker).
- New browser action types must be added to
tests/schemas/actions.ts. - Config defaults live in
extension/lib/config.js. - Chrome mocks live in
tests/helpers/chrome-mock.ts.
Pull request process
- Run
bun run verify— all tests plus release/transpile checks pass. - Update
CHANGELOG.md(andCHECKLIST.md) if the change is user-visible. - Update the ticket completion table in
AGENTS.mdif implementing a tracked feature. - Open a PR against
dev(notmain) — CI runs the sameverifygate. Promotion fromdev→mainis a separate, deliberate PR.
Adding a new action type
- Add the action kind to
ACTION_KINDSintests/schemas/actions.ts - Add the discriminator union member to
ActionSchema - Implement the handler in
extension/background.jsexecuteActions() - Add tests in
tests/actions.test.ts - Add the content-script handler in
extension/content.jsif needed
Editing the docs site
The docs (this site) live in docs/ and are built with VitePress:
bash
cd docs && npm install
npm run docs:dev # live preview
npm run docs:build # verify it buildsDocs deploy automatically to GitHub Pages on merge to main with docs/** changes. See Building & Releasing → Documentation site.
