Skip to content

Commit 5f2fe7d

Browse files
committed
feat: streamline contributing guide
1 parent d64f510 commit 5f2fe7d

File tree

1 file changed

+44
-157
lines changed

1 file changed

+44
-157
lines changed

CONTRIBUTING.md

Lines changed: 44 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -1,186 +1,73 @@
1-
# CONTRIBUTING.md
1+
# Contributing to Lingo.dev
22

3-
Thank you for contributing to Lingo.dev! We're an exciting open source project and we love having you contribute!
3+
Thank you for contributing! We maintain high standards for code quality and design.
44

5-
Here are some resources and guidance to help you get started:
5+
**IMPORTANT: Every requirement below is critical. If any requirement is not met, your issue or PR will be automatically rejected by the bots.**
66

7-
1. [Getting Started](#getting-started)
8-
2. [Issues](#issues)
9-
3. [Pull Requests](#pull-requests)
10-
4. [Release Process](#release-process)
7+
## Before You Start
118

12-
## Getting Started
9+
1. **Find or create an issue** - Search [existing issues](https://github.com/lingodotdev/lingo.dev/issues) first
10+
2. **Wait to be assigned** - Comment on the issue and wait for assignment before starting work
11+
3. **Discuss approach** - Align on implementation details before coding
1312

14-
Here's how to get the project running locally:
13+
## Pull Request Requirements
14+
15+
### Must Have
16+
17+
- **Linked issue** - Reference the issue in your PR (e.g., "Closes #123")
18+
- **Valid title** - Use [Conventional Commits](https://www.conventionalcommits.org/): `feat:`, `fix:`, `chore:`, etc.
19+
- **Tests** - Unit tests for main code paths
20+
- **Changeset** - Run `pnpm new` from repo root
21+
- **Passing checks** - All CI checks must pass
22+
23+
### Standards
24+
25+
- **Surgical PRs** - One clear objective per PR
26+
- **Clean code** - Elegant, well-reasoned implementation
27+
- **No duplicate work** - Check if someone else already opened a PR
28+
29+
## Local Development
1530

1631
### Prerequisites
1732

18-
- **Node.js**: Make sure you have Node.js version 18 or higher installed.
19-
- **pnpm**: You can install using this command `npm install -g pnpm` or by following [this guide](https://pnpm.io/installation)
20-
- **AI API Key**:
21-
Currently, Groq, Google, and Mistral are supported.
22-
- **GROQ API Key**: You can get one by signing up at [Groq](https://console.groq.com/)
23-
- **GOOGLE API Key**: You can get one in the [Google AI Studio](https://aistudio.google.com/apikey)
24-
- **MISTRAL API Key**: You can get one by signing up at [Mistral AI](https://console.mistral.ai)
33+
- Node.js 18+
34+
- pnpm (`npm install -g pnpm`)
35+
- AI API key (Groq, Google, or Mistral) - [setup guide](https://lingo.dev/en/cli/quick-start#step-2-authentication)
2536

2637
### Setup
2738

28-
To set up the project, clone the repository and install the dependencies:
29-
3039
```bash
3140
git clone https://github.com/lingodotdev/lingo.dev
3241
cd lingo.dev
3342
pnpm install
43+
pnpm turbo build
3444
```
3545

36-
Next, configure an AI API key. You can use either a Lingo.dev API key or one of the supported LLM model providers.
37-
38-
Please refer to our docs on how to set this up: https://lingo.dev/en/cli/quick-start#step-2-authentication
39-
40-
_Note:_ When loading LLM API keys (both Lingo.dev and other LLM model providers like Groq or Mistral), the Lingo.dev Compiler checks the following sources in order of priority:
41-
42-
1. Environment variables (via `process.env`)
43-
2. Environment files (`.env`, `.env.local`, `.env.development`)
44-
3. Lingo.dev configuration
45-
46-
Next, you can run the project using the following commands:
46+
### Run Locally
4747

4848
```bash
49-
# start the build process
50-
pnpm turbo build
51-
52-
# in terminal window 1 - watch for CLI code changes
49+
# Terminal 1 - watch CLI changes
5350
cd packages/cli
5451
pnpm run dev
5552

56-
# in terminal window 2 - test the CLI
53+
# Terminal 2 - test CLI
5754
cd packages/cli
58-
pnpm lingo.dev --help # this command will use the current CLI code + demo config from ./packages/cli/i18n.json
55+
pnpm lingo.dev --help
5956
```
6057

61-
Feel free to ask questions on our [Discord server](https://lingo.dev/go/discord)!
62-
63-
## Adding a New LLM Provider
64-
65-
Want to add support for a new LLM provider to Lingo.dev? Here's a checklist to help you get started:
66-
67-
1. **Add Your Dependency**
68-
69-
- Install the relevant SDK/package for your provider in the necessary `package.json` (usually `cli` and/or `compiler`). Lingo.dev uses the [AI SDK](https://ai-sdk.dev) and its [providers](https://ai-sdk.dev/providers/ai-sdk-providers), so check first to make sure the AI SDK supports your provider.
70-
71-
2. **Update the Config Schema**
72-
73-
- Edit [`packages/spec/src/config.ts`](./packages/spec/src/config.ts) and update the list of allowed provider `id` values to include your new provider.
74-
75-
3. **Provider Details**
76-
77-
- Add your provider to [`packages/compiler/src/lib/lcp/api/provider-details.ts`](./packages/compiler/src/lib/lcp/api/provider-details.ts) with name, env var, config key, API docs, and signup link.
78-
79-
4. **API Key Handling**
80-
81-
- Update [`packages/compiler/src/utils/llm-api-key.ts`](./packages/compiler/src/utils/llm-api-key.ts) to add functions for getting the API key from environment/config.
58+
### Run Checks
8259

83-
5. **CLI and Compiler Logic**
84-
85-
- Update the CLI (e.g., [`packages/cli/src/cli/localizer/explicit.ts`](./packages/cli/src/cli/localizer/explicit.ts), [`packages/cli/src/cli/processor/index.ts`](./packages/cli/src/cli/processor/index.ts)) to support your provider.
86-
- Update the compiler's translation logic to instantiate your provider's client (see [`packages/compiler/src/lib/lcp/api/index.ts`](./packages/compiler/src/lib/lcp/api/index.ts)).
87-
88-
6. **Error Handling**
89-
90-
- Ensure user-facing error messages are updated to mention your provider where relevant (API key checks, troubleshooting, etc).
91-
92-
7. **Test and Document**
93-
- Add or update tests to cover your provider.
94-
- Update documentation and this contributing guide as needed.
95-
96-
**Tip:**
97-
Look at how existing providers like "groq", "google", and "mistral" are implemented for reference. Consistency helps us maintain quality and predictability!
98-
99-
## Issues
100-
101-
If you find a bug, please create an Issue and we'll triage it.
102-
103-
- Please search [existing Issues](https://github.com/lingodotdev/lingo.dev/issues) before creating a new one
104-
- Please include a clear description of the problem along with steps to reproduce it. Exact steps with screenshots and URLs really help here
105-
- Before starting work on an issue, please comment on it and wait for it to be assigned to you. This prevents multiple people from working on the same issue simultaneously
106-
- Let's discuss implementation details in the issue comments or Discord before starting work, to ensure alignment between contributors and the Lingo.dev team
107-
108-
## Pull Requests
109-
110-
We love your Pull Requests! However, we maintain extremely high standards for code quality and design. We are looking for elegant, 12/10, beautiful code and deeply weighted system design decisions.
111-
112-
### Our Standards
113-
114-
- **Surgical PRs**: Pull requests must be surgical and extremely single-purposed. One clear objective per PR.
115-
- **Elegant Code**: We expect beautifully crafted, elegant code that demonstrates mastery of the language and patterns.
116-
- **Deep Design Thinking**: System design decisions must be deeply considered and well-reasoned.
117-
- **Comprehensive Testing**: Must include tests that surgically test both positive and negative paths of the code.
118-
- **Uncompromising Quality**: We prefer fewer, higher-quality contributions over numerous mediocre ones.
119-
120-
A couple of things to keep in mind before you submit:
121-
122-
### Before you open a pull request
123-
124-
- GitHub Issue
125-
- Make sure the fix or feature is sufficiently documented and discussed in advance in an existing [GitHub Issue](https://github.com/lingodotdev/lingo.dev/issues)
126-
- If there are no related issues, **we strongly suggest you [create a new Issue](https://github.com/lingodotdev/lingo.dev/issues/new)** and discuss your feature or proposal with the Lingo.dev team
127-
- If there is a Discord thread already, please summarize it in a GitHub Issue. This helps to keep everyone in the loop, including open-source contributors and Lingo.dev team members not part of the original conversation. It also serves as documentation for future decisions.
128-
- README update
129-
- If applicable, please add a section with the CLI commands introduced in your PR (what their purpose is and how to use them)
130-
- It is not necessary to update the README file for every change, oftentimes a comprehensive description in the Issue or PR description is enough
131-
- Tests
132-
- Your changes should include unit tests for the main code paths, to make sure nothing breaks
133-
- Changeset
134-
- Add a [changeset](https://github.com/changesets/changesets) for your feature or fix (run `pnpm new` from the repo root)
135-
- PR checks
136-
- Make sure all checks pass
137-
- You can run the checks locally in repo root:
138-
```sh
139-
pnpm install --frozen-lockfile
140-
pnpm format:check
141-
pnpm turbo build --force
142-
pnpm turbo test --force
143-
pnpm changeset status --since origin/main
144-
```
145-
...or let GitHub run it in the PR for you.
146-
147-
### Opening a pull request
148-
149-
- GitHub Issue
150-
- Make sure to link your PR to the existing Issue(s)
151-
- We may not be able to accept new features without existing Issues
152-
- This does not apply to smaller fixes with sufficient description in the PR
153-
- Existing PRs
154-
- Make sure someone else hasn't already created a PR fixing the same issue.
155-
- PR title
156-
- The title should be [a valid Conventional Commit title](https://github.com/amannn/action-semantic-pull-request?tab=readme-ov-file#action-semantic-pull-request)
157-
- Should start with `feat:`, `fix:`, `chore:`, etc.
158-
- PR description
159-
- Should contain sufficient description of your PR (unless the linked Issue already does)
160-
- _💡 Tip:_ Oftentimes less is more. Try to write in your own words; real humans are reviewing your PR.
161-
- Demo video
162-
- For larger features we would really appreciate a quick screen recording showing it in action
163-
- It helps make the review process faster
164-
- You can use [open-source Cap](https://github.com/CapSoftware/Cap), [QuickTime on Mac](https://support.apple.com/guide/quicktime-player/record-your-screen-qtp97b08e666/mac), or any other software you prefer
165-
166-
### Review Process
167-
168-
- We will always try to accept the first viable PR that resolves the Issue
169-
- Please discuss implementation approach beforehand to avoid having PRs rejected
170-
- Please actively discuss with the Lingo.dev team in the PR and related Issue(s)
171-
172-
#### Automated Code Review
60+
```bash
61+
pnpm install --frozen-lockfile
62+
pnpm format:check
63+
pnpm turbo build --force
64+
pnpm turbo test --force
65+
pnpm changeset status --since origin/main
66+
```
17367

174-
We use Claude Code to provide automated code reviews on all pull requests. This helps ensure:
68+
## Review Process
17569

176-
- Code quality and maintainability
177-
- Security best practices
178-
- Performance considerations
179-
- Proper test coverage
180-
- Documentation completeness
70+
- Automated code review by AI bots provides suggestions
71+
- Human reviewers make final decisions
18172

182-
The automated review will post comments on your PR with suggestions and feedback. While these are helpful guidelines, human reviewers will make the final decisions. If Claude Code identifies critical security issues, please address them promptly.
183-
184-
---
185-
186-
Thank you!
73+
Questions? Join our [Discord](https://lingo.dev/go/discord)!

0 commit comments

Comments
 (0)