|
2 | 2 |
|
3 | 3 | Thanks for your interest in contributing! This guide helps you get started. |
4 | 4 |
|
5 | | -## How to Contribute |
| 5 | +## Start with an Issue |
6 | 6 |
|
7 | | -### 1. Open an Issue First |
| 7 | +The best way to contribute is to [open an issue](https://github.com/runkids/skillshare/issues/new). Issues are where ideas, feature requests, and design discussions happen. This helps us: |
8 | 8 |
|
9 | | -Before writing code, [open an issue](https://github.com/runkids/skillshare/issues/new) to describe what you'd like to change and why. This helps us: |
| 9 | +- Align on whether the change fits the project direction |
| 10 | +- Agree on scope and approach before any code is written |
| 11 | +- Avoid investing time in work that may not be merged |
10 | 12 |
|
11 | | -- Align on the scope and approach |
12 | | -- Avoid duplicate effort |
13 | | -- Discuss alternative solutions early |
| 13 | +**Please open an issue before writing code**, even if you're confident in the approach. Skipping this step is the most common reason contributions can't be accepted. |
14 | 14 |
|
15 | | -Even small changes benefit from a quick issue — it gives context for reviewers and future contributors. |
| 15 | +## Pull Requests |
16 | 16 |
|
17 | | -### 2. Submit a Draft PR |
| 17 | +### What PRs are good for |
18 | 18 |
|
19 | | -If you'd like to propose an implementation, open a [draft pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests) and link it to the issue. Draft PRs let us: |
| 19 | +PRs work best for **small, focused changes**: |
20 | 20 |
|
21 | | -- Collaborate on the approach before investing time in polish |
22 | | -- Catch design mismatches early |
23 | | -- Provide incremental feedback |
| 21 | +- Bug fixes with a clear reproduction |
| 22 | +- Typo and documentation corrections |
| 23 | +- Small improvements (a few files, under ~200 lines of meaningful change) |
24 | 24 |
|
25 | | -> **Note:** Due to the nature of this project, most PRs won't be merged directly — but every contribution is valuable. Your draft PR serves as a concrete reference that shapes the final implementation. |
| 25 | +These can go straight to a PR (still link to an issue if one exists). |
26 | 26 |
|
27 | | -### 3. Include Tests |
| 27 | +### Feature Ideas |
28 | 28 |
|
29 | | -PRs with test coverage are much easier to review and merge. skillshare has both unit and integration tests: |
| 29 | +For new features or large changes: |
30 | 30 |
|
31 | | -- **Unit tests**: alongside source files (`*_test.go`) |
32 | | -- **Integration tests**: `tests/integration/` using `testutil.Sandbox` |
| 31 | +1. **Open an issue** to describe the idea and the problem it solves |
| 32 | +2. **Submit a proposal** — copy [`proposals/TEMPLATE.md`](proposals/TEMPLATE.md), fill it in, and open a PR to `proposals/` |
33 | 33 |
|
34 | | -Run the full check before submitting: |
| 34 | +Approved proposals will be added to the roadmap. Implementation is handled by the maintainer to ensure consistency with the project's architecture and codebase conventions. |
35 | 35 |
|
36 | | -```bash |
37 | | -make check # format + lint + unit + integration tests |
38 | | -``` |
39 | | - |
40 | | -## Development Setup |
| 36 | +> **Note:** Due to the nature of this project, most feature PRs won't be merged directly — but every contribution is valuable. Your PR serves as a concrete reference that shapes the final implementation. |
41 | 37 |
|
42 | | -### Option A: Dev Containers (Recommended) |
| 38 | +### PR Checklist |
43 | 39 |
|
44 | | -Open in [Dev Containers](https://containers.dev/) — Go toolchain, Node.js, pnpm, and demo content are pre-configured. |
| 40 | +- [ ] Linked to an issue (required for features, recommended for bug fixes) |
| 41 | +- [ ] Tests included and passing (`make check`) |
| 42 | +- [ ] No unrelated changes in the diff |
| 43 | +- [ ] Commit messages explain "why", not just "what" |
| 44 | +- [ ] Scope is focused — one concern per PR |
45 | 45 |
|
46 | | -### Option B: Local |
| 46 | +## Development Setup |
47 | 47 |
|
48 | | -Requirements: Go 1.23+ |
| 48 | +All development and testing should be done inside the **devcontainer**. This ensures a consistent environment (Go toolchain, Node.js, pnpm, and demo content are pre-configured). |
49 | 49 |
|
50 | 50 | ```bash |
51 | 51 | git clone https://github.com/runkids/skillshare.git |
52 | 52 | cd skillshare |
53 | | -make build # build binary |
54 | | -make check # format + lint + test |
| 53 | +make devc # start devcontainer + enter shell (one step) |
55 | 54 | ``` |
56 | 55 |
|
57 | | -### Useful Commands |
| 56 | +Once inside the devcontainer: |
58 | 57 |
|
59 | 58 | ```bash |
60 | | -make build # build binary → bin/skillshare |
61 | | -make test # unit + integration tests |
62 | | -make test-unit # unit tests only |
63 | | -make lint # go vet |
64 | | -make fmt # gofmt |
65 | | -make check # fmt + lint + test (must pass before PR) |
66 | | -make ui-dev # Go API server + Vite HMR for Web UI |
| 59 | +make build # build binary → bin/skillshare |
| 60 | +make test # unit + integration tests |
| 61 | +make check # fmt + lint + test (must pass before PR) |
| 62 | +make ui-dev # Go API server + Vite HMR for Web UI |
67 | 63 | ``` |
68 | 64 |
|
69 | | -## PR Checklist |
| 65 | +Other devcontainer commands: |
70 | 66 |
|
71 | | -- [ ] Linked to an issue |
72 | | -- [ ] Tests included and passing (`make check`) |
73 | | -- [ ] No unrelated changes in the diff |
74 | | -- [ ] Commit messages explain "why", not just "what" |
| 67 | +```bash |
| 68 | +make devc-down # stop devcontainer |
| 69 | +make devc-restart # restart devcontainer |
| 70 | +make devc-reset # full reset (remove volumes) |
| 71 | +make devc-status # show devcontainer status |
| 72 | +``` |
75 | 73 |
|
76 | 74 | ## Questions? |
77 | 75 |
|
|
0 commit comments