|
| 1 | +# Contributor onboarding |
| 2 | + |
| 3 | +Welcome. This doc is the **fast path** for your first PR. It links the existing guides rather than repeating them — read it once, then bookmark the references below. |
| 4 | + |
| 5 | +## Before you start |
| 6 | + |
| 7 | +| Doc | What it covers | |
| 8 | +|-----|----------------| |
| 9 | +| [CONTRIBUTING.md](../CONTRIBUTING.md) | Dev setup, code style, PR checklist, where to change each layer | |
| 10 | +| [docs/architecture.md](architecture.md) | Data flow, export state machine, dispatch table, frontend layout | |
| 11 | +| [docs/api-reference.md](api-reference.md) | HTTP routes, error codes, field stability | |
| 12 | + |
| 13 | +## Suggested reading order |
| 14 | + |
| 15 | +Work through these in order before touching unfamiliar code: |
| 16 | + |
| 17 | +1. **[docs/architecture.md](architecture.md)** — component diagram, layers, and how JSONL becomes API + UI. |
| 18 | +2. **[utils/jsonl_parser.py](../utils/jsonl_parser.py)** — session parsing entry point; tool results flow through `tool_dispatch`. |
| 19 | +3. **[utils/tool_dispatch.py](../utils/tool_dispatch.py)** — priority-based `_TOOL_RESULT_DISPATCH` table; read the module docstring and [dispatch table notes](architecture.md#dispatch-table). |
| 20 | +4. **Frontend SPA** — [`static/js/app.js`](../static/js/app.js) (routing), [`static/js/sessions.js`](../static/js/sessions.js) (message panel), [`static/js/render/registry.js`](../static/js/render/registry.js) (tool renderers). |
| 21 | + |
| 22 | +For API or export changes, also skim [`api/error_codes.py`](../api/error_codes.py) and [`utils/md_exporter.py`](../utils/md_exporter.py). |
| 23 | + |
| 24 | +## First PR walkthrough |
| 25 | + |
| 26 | +### 1. Fork and clone |
| 27 | + |
| 28 | +```powershell |
| 29 | +# GitHub UI: fork cppalliance/claude-code-chat-browser to your account, then: |
| 30 | +git clone https://github.com/<your-user>/claude-code-chat-browser.git |
| 31 | +cd claude-code-chat-browser |
| 32 | +git remote add upstream https://github.com/cppalliance/claude-code-chat-browser.git |
| 33 | +``` |
| 34 | + |
| 35 | +On macOS/Linux, use the same `git clone` / `git remote add` commands in your shell. |
| 36 | + |
| 37 | +### 2. Create a branch |
| 38 | + |
| 39 | +Branch names follow `feat/<topic>`, `fix/<topic>`, `docs/<topic>`, etc. (see [CONTRIBUTING.md](../CONTRIBUTING.md#branching-and-pull-requests)). |
| 40 | + |
| 41 | +```bash |
| 42 | +git fetch upstream |
| 43 | +git checkout -b docs/my-first-change upstream/master |
| 44 | +``` |
| 45 | + |
| 46 | +### 3. Development setup |
| 47 | + |
| 48 | +Follow **[CONTRIBUTING.md — Development setup](../CONTRIBUTING.md#development-setup)** for your OS (Python 3.12 venv, `pip install -r requirements-dev.txt`, optional Node 20+ for JS). |
| 49 | + |
| 50 | +Smoke-test the dev server: |
| 51 | + |
| 52 | +```bash |
| 53 | +python app.py --port 5000 |
| 54 | +# Open http://127.0.0.1:5000 |
| 55 | +``` |
| 56 | + |
| 57 | +### 4. Make a focused change |
| 58 | + |
| 59 | +- One logical change per PR when possible. |
| 60 | +- Match existing conventions (ruff, import order, `error_response()` for API errors) — see [Code style](../CONTRIBUTING.md#code-style-and-conventions). |
| 61 | +- Add or update tests for behavior changes — see [Tests required](../CONTRIBUTING.md#tests-required-for-common-changes). |
| 62 | + |
| 63 | +### 5. Run the full local gate |
| 64 | + |
| 65 | +CI runs these on Ubuntu, Windows, and macOS. Run them locally before opening a PR: |
| 66 | + |
| 67 | +```bash |
| 68 | +# Lint + format (required) |
| 69 | +ruff check . |
| 70 | +ruff format --check . |
| 71 | + |
| 72 | +# Type check (Ubuntu CI job; run locally before Python-heavy changes) |
| 73 | +mypy -p api -p utils -p models -p scripts |
| 74 | + |
| 75 | +# Security audit (production deps) |
| 76 | +pip-audit -r requirements.txt |
| 77 | + |
| 78 | +# Python tests (full suite) |
| 79 | +pytest -q |
| 80 | + |
| 81 | +# Integration subset (also run in CI) |
| 82 | +pytest tests/test_api_integration.py -v |
| 83 | + |
| 84 | +# Frontend — only if you changed static/js/ |
| 85 | +npm ci |
| 86 | +npm test |
| 87 | +``` |
| 88 | + |
| 89 | +Fix formatting with `ruff format .` when `ruff format --check` fails. |
| 90 | + |
| 91 | +### 6. Push and open a PR |
| 92 | + |
| 93 | +```bash |
| 94 | +git push -u origin docs/my-first-change |
| 95 | +``` |
| 96 | + |
| 97 | +Open a pull request against **`master`** on `cppalliance/claude-code-chat-browser`. Include: |
| 98 | + |
| 99 | +- A short summary of **why** the change is needed. |
| 100 | +- A **Test plan** checklist (what you ran locally). |
| 101 | +- Links to any related issue (`Fixes #NNN` when applicable). |
| 102 | + |
| 103 | +### 7. Review |
| 104 | + |
| 105 | +[`.github/CODEOWNERS`](../.github/CODEOWNERS) auto-requests reviewers on new PRs. **Do not self-merge** — wait for at least one approval. Address review feedback in follow-up commits on the same branch. |
| 106 | + |
| 107 | +## Good first issues |
| 108 | + |
| 109 | +Browse open issues filtered by label: |
| 110 | + |
| 111 | +- [**good first issue**](https://github.com/cppalliance/claude-code-chat-browser/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) — scoped for newcomers |
| 112 | +- [**help wanted**](https://github.com/cppalliance/claude-code-chat-browser/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) — maintainers welcome extra hands |
| 113 | +- [**documentation**](https://github.com/cppalliance/claude-code-chat-browser/issues?q=is%3Aissue+is%3Aopen+label%3Adocumentation) — docs-only patches |
| 114 | + |
| 115 | +Not sure which issue to pick? Comment on an issue or open a draft PR early for CI feedback — see [Getting help](../CONTRIBUTING.md#getting-help). |
| 116 | + |
| 117 | +## Maintainer coverage (bus factor) |
| 118 | + |
| 119 | +Recent commit history is concentrated on a small set of identities. If those maintainers are unavailable, review and release can stall. |
| 120 | + |
| 121 | +**Mitigations in this repo:** |
| 122 | + |
| 123 | +- **[`.github/CODEOWNERS`](../.github/CODEOWNERS)** — routes review requests so PRs do not rely on ad-hoc pings. |
| 124 | +- **This onboarding path** — lowers the ramp for a second reviewer or contributor to run gates and ship safely. |
| 125 | + |
| 126 | +If you are joining as a reviewer, read the [suggested reading order](#suggested-reading-order) and run the [full local gate](#5-run-the-full-local-gate) once on `master` before approving your first PR. |
0 commit comments