|
1 | | -## Contributing to tambo |
| 1 | +# Contributing to tambo |
2 | 2 |
|
3 | | -Thank you for contributing! This guide outlines our workflow and the quality bar for changes. Please read it end-to-end before opening a PR. |
| 3 | +Thanks for helping! This guide covers workflow expectations only—**all coding standards, architecture rules, and naming conventions live in @AGENTS.md.** |
4 | 4 |
|
5 | | -### Code of Conduct |
| 5 | +## Quick Links |
6 | 6 |
|
7 | | -By participating, you agree to uphold a respectful, inclusive environment. Be kind, constructive, and collaborative. |
| 7 | +- That guide – canonical reference for architecture, naming, coding rules, doc expectations, AI usage, Charlie workflow, etc. |
| 8 | +- `docs/` + `devdocs/` – public docs + internal references (update them with code changes). |
| 9 | +- [RELEASING.md](./RELEASING.md) – API/SDK/Cloud release process. |
8 | 10 |
|
9 | | -### Workflow overview |
| 11 | +## Workflow Overview |
10 | 12 |
|
11 | | -1. Open or pick up an issue. |
12 | | -2. Create a feature branch from `main`. |
13 | | -3. Implement your change with tests and docs. |
14 | | -4. Open a PR with a semantic versioning title and the checklist below. |
15 | | -5. Get at least one approval and a green CI run. |
| 13 | +1. Pick or file an issue. |
| 14 | +2. Branch from `main` (`alecf/<descriptive-name>` when using Conductor). |
| 15 | +3. Build the feature/fix with tests + docs alongside the code. |
| 16 | +4. Run lint, types, and tests locally. |
| 17 | +5. Open a PR with a Conventional Commit title and include the checklist below. |
| 18 | +6. Iterate with reviewers (and Charlie, the AI code reviewer) until CI is green and approvals are in. |
16 | 19 |
|
17 | | -### PR titles and semantic versioning (required) |
| 20 | +## PR Titles and Semantic Versioning |
18 | 21 |
|
19 | | -We infer release impact from PR titles using Conventional Commits semantics. Use one of: |
| 22 | +We infer release impact from PR titles using [Conventional Commits](https://www.conventionalcommits.org/) syntax: |
20 | 23 |
|
21 | | -- `feat(scope): add something` → Minor version bump |
22 | | -- `fix(scope): fix something` → Patch version bump |
23 | | -- `perf(scope): ...`, `refactor(scope): ...`, `docs(scope): ...`, `chore(scope): ...` → Typically patch or no release |
24 | | -- `feat(scope)!: breaking change summary` or include a `BREAKING CHANGE:` footer → Major version bump |
| 24 | +- `feat(scope): ...` → Minor bump |
| 25 | +- `fix(scope): ...`, `perf(scope): ...`, `refactor(scope): ...`, `docs(scope): ...`, `chore(scope): ...` → Patch bump or none |
| 26 | +- Breaking change → `feat(scope)!: ...` or include a `BREAKING CHANGE:` footer |
25 | 27 |
|
26 | | -Examples: |
| 28 | +Scopes reference areas like `api`, `web`, `core`, `cli`, `docs`, `sdk`. Keep titles imperative and concise. Examples: `feat(api): add transcript export endpoint`, `fix(web): prevent duplicate project creation`. |
27 | 29 |
|
28 | | -- `feat(button): add destructive variant` |
29 | | -- `fix(table): restore keyboard navigation` |
30 | | -- `feat(api)!: remove deprecated v1 endpoints` |
| 30 | +## Documentation & Visual Changes |
31 | 31 |
|
32 | | -Scopes are usually package or area names (e.g., `button`, `cli`, `docs`, `sdk`). Keep titles clear and imperative. |
| 32 | +- Every functional change must update the relevant docs (`docs/`, root `.md`, or `devdocs/`). |
| 33 | +- Component work must keep Showcase + CLI registry in sync. |
| 34 | +- UI/DX changes require a ≤90s video demo attached to the PR. |
| 35 | +- Link the doc change (or follow-up issue) in your PR description. |
33 | 36 |
|
34 | | -### TypeScript SDK policy (Stainless-generated) |
| 37 | +## API + SDK Source of Truth |
35 | 38 |
|
36 | | -- The TypeScript SDK is auto-generated by Stainless from the API schema. |
37 | | -- Do not modify the SDK by hand. Instead, land the API change in [the api server](./apps/api/); when deployed, the SDK will be regenerated automatically over the next hour. |
38 | | -- If you need new client behavior, propose it via API changes or helper utilities that wrap the generated client in this repo (not edits to generated files). |
| 39 | +- API lives in `apps/api`. |
| 40 | +- The TypeScript SDK (`@tambo-ai/typescript-sdk`) is generated by Stainless after API deploys. Do **not** edit it manually—let Stainless open the release PR. |
| 41 | +- React SDK updates follow the workflow in [RELEASING.md](./RELEASING.md). |
39 | 42 |
|
40 | | -### Visual changes require a short video demo |
| 43 | +## Required Checks |
41 | 44 |
|
42 | | -Any PR that changes visuals (new component, component behavior/style, or UI in [tambo](https://github.com/tambo-ai/tambo)) must include a brief demo video (≤ 2 minutes). Loom links are fine. Show: |
| 45 | +```bash |
| 46 | +npm run lint |
| 47 | +npm run check-types |
| 48 | +npm test |
| 49 | +``` |
43 | 50 |
|
44 | | -- Where to find the feature |
45 | | -- Before vs after (if applicable) |
46 | | -- Key interactions and edge cases |
| 51 | +Add targeted tests for new behavior and keep migrations in sync with DB changes. When in doubt about placement, follow the guidance in that doc. |
47 | 52 |
|
48 | | -### Documentation is mandatory |
| 53 | +## Charlie (AI Review Agent) |
49 | 54 |
|
50 | | -All changes must update our documentation site. Include: |
| 55 | +- Reply to every comment. |
| 56 | +- Use `@CharlieHelps yes please` to apply a suggestion, `fixed` when you handled it yourself, or explain why you’re declining. |
| 57 | +- Batch the `yes please` comments in a single review when applying multiple fixes. |
51 | 58 |
|
52 | | -- Updated reference pages (props, usage, examples) |
53 | | -- New guides or tutorial steps if introducing concepts |
54 | | -- Migration notes if behavior changes |
| 59 | +## Security & Secrets |
55 | 60 |
|
56 | | -Link the docs PR or commit in your PR description. |
| 61 | +- Never commit credentials. Use the documented env files (`apps/api/.env`, `apps/web/.env.local`, `packages/db/.env`, `docker.env`). |
| 62 | +- Rotate anything leaked immediately. |
57 | 63 |
|
58 | | -### Component library changes must update showcase and CLI |
| 64 | +## PR Checklist |
59 | 65 |
|
60 | | -- Add or update examples in the component showcase so reviewers can validate visually |
61 | | -- Update the CLI so new components can be scaffolded/added by the CLI |
62 | | -- Add a minimal usage example to the docs and CLI help output where applicable |
| 66 | +- [ ] Conventional Commit title (`!` for breaking changes) |
| 67 | +- [ ] Linked issue(s) or context |
| 68 | +- [ ] Docs updated (or follow-up issue linked) |
| 69 | +- [ ] Showcase/CLI updated if components changed |
| 70 | +- [ ] Visual change video attached (if applicable) |
| 71 | +- [ ] Tests added/updated; `npm run lint`, `npm run check-types`, `npm test` all pass |
| 72 | +- [ ] SDK workflow respected (no manual edits to generated clients) |
63 | 73 |
|
64 | | -### AI-generated code policy |
| 74 | +## Need More Guidance? |
65 | 75 |
|
66 | | -- Any AI-generated code must be reviewed by a human and brought up to our readability, testing, and documentation standards. |
67 | | -- Follow our internal AI rules/policy document (link internally). Do not include secrets or customer data in prompts. |
| 76 | +If you’re looking for coding standards, naming rules, CLI/showcase sync details, AI policy, or MCP instructions, that single source of truth has you covered. |
68 | 77 |
|
69 | | -### Quality bar |
| 78 | +## Code of Conduct |
70 | 79 |
|
71 | | -- TypeScript, ESLint, and Prettier must pass: `pnpm -w lint` and `pnpm -w typecheck` |
72 | | -- Tests must pass locally and in CI: `pnpm -w test` |
73 | | -- Add tests for new logic and meaningful changes |
74 | | -- Keep functions small, well-named, and guard edge cases early |
| 80 | +Participate respectfully and keep collaboration constructive. |
75 | 81 |
|
76 | | -### PR checklist (include in description) |
| 82 | +## API and SDK Source of Truth |
77 | 83 |
|
78 | | -- [ ] Semantic PR title using Conventional Commits (`feat`, `fix`, `!` for breaking) |
79 | | -- [ ] Linked issue(s) |
80 | | -- [ ] If SDK needed: confirm it will be regenerated by Stainless (no manual SDK edits) |
81 | | -- [ ] JSDoc updated in code where relevant |
82 | | -- [ ] Docs site updated (pages/examples/CLI help), or a separate doc PR is linked |
83 | | -- [ ] Visual change demo video attached (≤ 2 min) |
84 | | -- [ ] Showcase updated for component changes |
85 | | -- [ ] CLI updated to support new components or options |
86 | | -- [ ] Tests added/updated and all CI checks green |
| 84 | +- API changes live in `apps/api`. |
| 85 | +- The TypeScript SDK (`@tambo-ai/typescript-sdk`) is generated by Stainless from the deployed API spec. Never edit the SDK by hand or publish it manually. |
| 86 | +- Deploy API changes, let Stainless open the SDK release PR, review that PR, then land dependency bumps here as needed. |
87 | 87 |
|
88 | | -### Branching, commits, and reviews |
| 88 | +## Visual Changes Need a Short Video |
89 | 89 |
|
90 | | -- Branch from `main`, rebase as needed to keep history clean |
91 | | -- Use small, focused commits with clear messages (Conventional Commits encouraged, but PR title governs versioning) |
92 | | -- At least one reviewer approval required; request experts for API or design-heavy changes |
| 90 | +UI or DX-affecting PRs (components, dashboard tweaks, CLI UX) must ship with a ≤90s screen recording showing before/after and key flows. Loom links are fine. |
93 | 91 |
|
94 | | -### Releases |
| 92 | +## Documentation Requirements |
95 | 93 |
|
96 | | -- We follow Semantic Versioning (semver). Release type is derived from PR titles and/or maintainer input |
97 | | -- Changelogs are generated by CI (or maintainers) based on merged PRs |
98 | | -- Maintainers may squash and edit titles to reflect the correct semver impact |
| 94 | +Every functional change must update docs in the right place: |
99 | 95 |
|
100 | | -### Links |
| 96 | +- Public docs: `docs/` (Fumadocs) or the relevant MDX page. |
| 97 | +- Developer docs: root `.md` files or `devdocs/`. |
| 98 | +- Link the doc change (or follow-up issue) in your PR. |
101 | 99 |
|
102 | | -- Community Discord: https://discord.gg/dJNvPEHth6 |
| 100 | +If you touch components: |
| 101 | + |
| 102 | +- Update Showcase examples (`showcase/`) so reviewers can interact with the change. |
| 103 | +- Update the CLI registry (`cli/src/registry/`) so scaffolding stays in sync. |
| 104 | +- Mirror any CLI component changes into `docs/` components if they originated there. |
| 105 | + |
| 106 | +## Lint, Types, and Tests (Required) |
| 107 | + |
| 108 | +Before requesting review, all of these must pass: |
| 109 | + |
| 110 | +```bash |
| 111 | +npm run lint |
| 112 | +npm run check-types |
| 113 | +npm test |
| 114 | +``` |
| 115 | + |
| 116 | +Fix lint warnings, keep TypeScript strict, and add focused tests for new logic. Database changes must include matching Drizzle migrations (`npm run db:generate`). |
| 117 | + |
| 118 | +## Coding Standards |
| 119 | + |
| 120 | +- Favor small, functional modules with explicit error handling. |
| 121 | +- Early-return instead of deep nesting; avoid mutation. |
| 122 | +- Keep business logic outside UI components; use `lib/`, `services/`, or `utils/` helpers. |
| 123 | +- Follow React naming conventions (see `devdocs/NAMING_CONVENTIONS.md`) and loading-state rules (`devdocs/LOADING_STATES.md`). |
| 124 | +- Use tRPC inside `apps/web` instead of ad-hoc `/api` routes. |
| 125 | +- Never edit generated SDK files; wrap them if you need helpers. |
| 126 | + |
| 127 | +## AI-Generated Code Policy |
| 128 | + |
| 129 | +AI output must be reviewed and cleaned up by you. Follow the internal AI policies described there and never paste secrets or private data into prompts. |
| 130 | + |
| 131 | +## Working with Charlie (AI Code Reviewer) |
| 132 | + |
| 133 | +Charlie may leave inline suggestions on your PR. Reply to every comment: |
| 134 | + |
| 135 | +- Use `@CharlieHelps yes please` if you want it to apply a fix. |
| 136 | +- Reply with `fixed` (plus context) after resolving manually. |
| 137 | +- Explain if the suggestion is being declined. |
| 138 | + |
| 139 | +Batch multiple `@CharlieHelps yes please` replies in a single review if you want Charlie to apply several fixes together. |
| 140 | + |
| 141 | +## Security and Secrets |
| 142 | + |
| 143 | +Do not commit API keys or credentials. Use the documented env files (`apps/api/.env`, `apps/web/.env.local`, `packages/db/.env`, `docker.env`). Rotate anything leaked immediately. |
| 144 | + |
| 145 | +## PR Checklist (Copy into Description) |
| 146 | + |
| 147 | +Copy the checklist from the **PR Checklist** section above into your PR description. |
| 148 | + |
| 149 | +## Branching, Commits, and Reviews |
| 150 | + |
| 151 | +- Keep branches small and focused; rebase on `main` when needed. |
| 152 | +- Use clear, scoped commits (Conventional Commits encouraged). |
| 153 | +- At least one maintainer approval required. Pull in subject-matter experts for API, DB, or design-heavy changes. |
| 154 | + |
| 155 | +## Releases |
| 156 | + |
| 157 | +- Release-please manages tagging and changelog generation for each package. Maintainers may edit PR titles to ensure correct SemVer impact. |
| 158 | +- See [RELEASING.md](./RELEASING.md) for the full workflow across API, SDKs, and apps. |
| 159 | + |
| 160 | +## Links |
| 161 | + |
| 162 | +- Discord: https://discord.gg/dJNvPEHth6 |
| 163 | +- Docs: https://docs.tambo.co |
103 | 164 |
|
104 | 165 | Thanks for helping improve tambo! |
0 commit comments