|
| 1 | +## Contributing to the Matter Handbook |
| 2 | + |
| 3 | +Welcome - thanks for taking the time to improve the Matter Handbook. |
| 4 | + |
| 5 | +> [!NOTE] |
| 6 | +> For questions, clarifications, or early ideas, start a Discussion instead of opening an Issue; |
| 7 | +> Issues are reserved for concrete, actionable work items. |
| 8 | +
|
| 9 | +--- |
| 10 | + |
| 11 | +### Summary |
| 12 | + |
| 13 | +The contribution process is intentionally lightweight and entirely pull‑request (PR) based: |
| 14 | +every change - large or small, including typo fixes - comes in as a PR so it can be reviewed, validated by automation, |
| 15 | +and merged transparently. |
| 16 | + |
| 17 | +Classify the change with the most specific label (`editorial`, `tooling`, or one or more domain labels; |
| 18 | +add `do not merge` only when you deliberately want to block). Every PR requires at least one maintainer approval. |
| 19 | +When a domain label is present, the external `sme-approval` check must also succeed, confirming that the appropriate |
| 20 | +subject‑matter experts have signed off. All mandatory automated checks (including Vale) must be green, |
| 21 | +there must be zero unresolved review threads and no active “changes requested” reviews, |
| 22 | +the PR cannot be in draft state or have merge conflicts, and the blocking `do not merge` label must be absent. |
| 23 | +Once these conditions are satisfied, the merge is performed automatically—no further manual action is needed. |
| 24 | +If you are new to GitHub: a PR is simply a proposed set of changes that others can comment on before it is merged. |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +All changes flow through this PR pipeline (there is no direct push to main, even for small editorial tweaks); |
| 29 | +this ensures consistency, traceability, and required approvals without extra ceremony for contributors |
| 30 | +who are less familiar with GitHub. |
| 31 | + |
| 32 | +### Git Workflow |
| 33 | + |
| 34 | +| Contributor type | Branch location | How to create | After merge | Rationale | |
| 35 | +|------------------|-----------------|---------------|-------------|-----------| |
| 36 | +| Frequent (granted write access) | Branch in this repository | `git switch -c feature-short-description` (from up-to-date `main`) | Auto-deleted by settings / cleanup | Faster feedback, no fork sync overhead | |
| 37 | +| Infrequent / first-time | Fork (user namespace) | Fork on GitHub UI, clone fork, branch there | Branch stays in fork; can be deleted manually | Keeps main repository branch list focused | |
| 38 | + |
| 39 | +Guidelines: |
| 40 | +- Keep branches short-lived and narrowly scoped; open earlier rather than accumulating a large diff. |
| 41 | +- Update your local copy of `main` before branching (fetch and integrate the latest changes) to reduce conflicts. |
| 42 | +- Do not force-push over reviewed commits. |
| 43 | +- Name branches descriptively and succinctly (e.g. `certification-diagram`, `tooling-ci-cache`, `editorial-typos`). |
| 44 | +- One logical change per PR—open multiple PRs instead of a “grab bag”. |
| 45 | +- Frequent contributors should still fork when experimenting in a way that may not merge. |
| 46 | +- Delete local and remote branches after merge (the repository auto-deletes remote branches; you can prune locally with `git fetch --prune`). |
| 47 | + |
| 48 | +If you become a frequent contributor, maintainers may grant write access so you can use the streamlined in-repo branching workflow. This is a trust signal. Maintain clear commit hygiene and respond promptly to review. |
| 49 | + |
| 50 | +### Labels |
| 51 | + |
| 52 | +| If your change… | Use this label | Extra gate | |
| 53 | +|-----------------|---------------|------------| |
| 54 | +| Pure wording / typos / formatting (no meaning change) | `editorial` | Maintainer approval | |
| 55 | +| CI, workflows, devcontainer, build infra | `tooling` | Maintainer approval | |
| 56 | +| Semantic/content change in a domain (e.g. certification) | Domain label (e.g. `certification`) | Maintainer approval + `sme-approval` | |
| 57 | +| Needs a temporary hold | `do not merge` | Blocks merge | |
| 58 | + |
| 59 | +Rules: |
| 60 | +- If a change has any semantic impact, use a domain label (not `editorial`). |
| 61 | +- Multiple domain labels allowed; external check enforces SME coverage. |
| 62 | +- Do not remove a domain label to bypass review. |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +### Merge Conditions |
| 67 | + |
| 68 | +All must be true for auto‑merge: |
| 69 | +- Maintainer approval present. |
| 70 | +- If domain label: `sme-approval` succeeded. |
| 71 | +- Vale success. |
| 72 | +- No unresolved review threads (`#review-threads-unresolved=0`). |
| 73 | +- No “changes requested” reviews. |
| 74 | +- Not draft; no merge conflicts. |
| 75 | +- No `do not merge` label. |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +### Roles |
| 80 | + |
| 81 | +| Role | Responsibility | |
| 82 | +|------|----------------| |
| 83 | +| Author | Correct labels, clear scope, address feedback | |
| 84 | +| Maintainer | Process, risk, coherence | |
| 85 | +| SME (external) | Domain accuracy (per domain label) | |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +### Review Discipline |
| 90 | + |
| 91 | +- Resolve threads only after action or explicit agreement. |
| 92 | +- Keep scope tight; split unrelated chunks. |
| 93 | +- Avoid large force-pushes mid-review (cleanup near the end is fine). |
| 94 | +- Do not game the process by dropping needed labels. |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +### Escalation |
| 99 | + |
| 100 | +If blocked >5 business days: |
| 101 | +- Comment and mention `@project-chip/handbook-maintainers`. |
| 102 | +- Open a Discussion for structural or multi-domain proposals. |
0 commit comments